[rrd-users] Default font is not used

Victor Engmark victor.engmark at gmail.com
Tue Mar 1 10:58:47 CET 2011


On Mon, Feb 28, 2011 at 5:36 PM, Victor Engmark
<victor.engmark at gmail.com> wrote:
> I've tried to compile rrdtool (with pangocairo + fontconfig etc.) with
> lots of different options, but I can't figure out how to make it use
> the font I've provided. Whenever I run `rrdtool graph` it complains:
>
> (process:18744): Pango-WARNING **: failed to choose a font, expect
> ugly output. engine-type='PangoRenderFc', script='common'
>
> The resulting PNG file contains rectangles instead of characters.
> Apropos, specifying .svg instead of .png still results in PNG file
> contents...
>
> I've compiled using
> --with-freetype-config=/usr/opt/rrdtool/share/fonts/VeraMono.ttf, and
> I've verified that that path exists and is readable after
> installation. Please note that this is a custom minimal Linux
> platform, so standard packaging systems (apt-get, emerge, yum) do
> *not* apply.
>
> Possible issues:
> * Do I *have* to have a fontconfig configuration file for this font?
> `/usr/opt/cairopango/bin/fc-cache -fv /usr/opt/rrdtool/share/fonts/`
> says "
> /usr/opt/rrdtool/share/fonts: caching, new cache contents: 1 fonts, 0
> dirs", but I still get the same message afterwards.

Update: An strace of the fc-cache command above shows that it's using
the previously compiled binaries, and the resulting .cache-3 file
contains the specified directory. No mention of VeraMono.ttf, but then
I'm not sure if that's how fontconfig configuration cache files work.
fc-list doesn't show anything, which is odd but could be because
fc-list only lists configured fonts (the man page is not clear about
this). `man fc-cache` says "[files generated by fc-cache] are  read
by  the  fontconfig library at application startup to locate
appropriate fonts," which doesn't seem to be the case here.

An strace of `rrdtool graph` shows that it's aware of the font
configuration files, but doesn't mention the cache (see below). Does
rrdtool use the currently cached fonts or parse the font configuration
to figure out which font to use?

...
open("/usr/opt/cairopango/lib/libfontconfig.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0A\0\0004\0\0\0<"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=430102, ...}) = 0
mmap2(NULL, 186308, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0xb7b26000
mmap2(0xb7b52000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2b) = 0xb7b52000
close(3)                                = 0
...
access("/usr/opt/cairopango/etc/fonts/fonts.conf", R_OK) = 0
stat64("/usr/opt/cairopango/etc/fonts/fonts.conf",
{st_mode=S_IFREG|0644, st_size=5237, ...}) = 0
open("/usr/opt/cairopango/etc/fonts/fonts.conf", O_RDONLY) = 3
read(3, "<?xml version=\"1.0\"?>\n<!DOCTYPE f"..., 8192) = 5237
access("/usr/opt/cairopango/etc/fonts/conf.d", R_OK) = 0
stat64("/usr/opt/cairopango/etc/fonts/conf.d", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
open("/usr/opt/cairopango/etc/fonts/conf.d",
O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 4
fstat64(4, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
getdents64(4, /* 3 entries */, 4096)    = 80
getdents64(4, /* 0 entries */, 4096)    = 0
close(4)                                = 0
read(3, ""..., 8192)                    = 0
close(3)                                = 0
stat64("/usr/opt/cairopango/lib/pango/1.6.0/modules/pango-basic-fc.so",
{st_mode=S_IFREG|0755, st_size=27485, ...}) = 0
open("/usr/opt/cairopango/lib/pango/1.6.0/modules/pango-basic-fc.so",
O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\f\0\0004\0\0\0T"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=27485, ...}) = 0
mmap2(NULL, 9688, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0xb8095000
mmap2(0xb8097000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb8097000
close(3)                                = 0
getpid()                                = 23931
write(2, "\n(process:23931): Pango-WARNING *"..., 126
(process:23931): Pango-WARNING **: failed to choose a font, expect
ugly output. engine-type='PangoRenderFc', script='common'
) = 126
getpid()                                = 23931
write(2, "\n(process:23931): Pango-WARNING *"..., 125
(process:23931): Pango-WARNING **: failed to choose a font, expect
ugly output. engine-type='PangoRenderFc', script='latin'
) = 125

-- 
Victor Engmark



More information about the rrd-users mailing list