Ticket #256 (closed defect: for support check mailinglist)
rrdtool not honoring fonts passed via --font
| Reported by: | human | Owned by: | oetiker |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | rrd_graph | Version: | 1.3.9 |
| Keywords: | Cc: |
Description
I found this: https://lists.oetiker.ch/pipermail/rrd-users/2008-June/014147.html
And did the same test on my system running rrdtool 1.3.8 It is not honoring the font calls when I pass in the path to the font. It's only opening the default font. I discovered this via cacti, when I tried to change fonts that cacti is using to generate specific parts of the graph.
Here's a really nasty command line:
strace -fFv -s 1000 /usr/bin/rrdtool graph /tmp/test.png --imgformat=PNG --start=-86400 --end=-300 --title="nosgoth domain0 - UPS Load Capacity - cyberpower" --rigid --base=1000 --height=120 --width=500 --upper-limit=100 --lower-limit=0 --vertical-label="percent" --slope-mode --font TITLE:12:/usr/local/share/fonts/ProggySquare.ttf --font AXIS:8:/usr/local/share/fonts/victor-pixel.ttf --font LEGEND:6:/usr/local/share/fonts/Fleftex_M.ttf --font UNIT:6:/usr/local/share/fonts/HILOGI18.ttf DEF:a="/usr/share/www/cacti-0.8.7e/rra/4/51.rrd":batteryCharge:AVERAGE DEF:b="/usr/share/www/cacti-0.8.7e/rra/4/51.rrd":upsLoad:AVERAGE AREA:a#74C366FF:"Battery Charge" GPRINT:a:LAST:"Current\:%8.2lf %s" GPRINT:a:MIN:"Minimum\:%8.2lf %s" GPRINT:a:MAX:"Maximum\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\:%8.2lf %s\n" AREA:b#862F2FFF:"Output Load" GPRINT:b:LAST:" Current\:%8.2lf %s" GPRINT:b:MIN:"Minimum\:%8.2lf %s" GPRINT:b:MAX:"Maximum\:%8.2lf %s" GPRINT:b:AVERAGE:"Average\:%8.2lf %s\n" 2>&1 | grep -i ttf | grep open
open("/usr/share/fonts/TTF/Vera.ttf", O_RDONLY) = 3 open("/usr/share/fonts/TTF/VeraMono.ttf", O_RDONLY) = 3
As you can see, it's not opening any fonts.
The fonts are globally readable: ls -lh /usr/local/share/fonts total 208K -rw-rw-r-- 1 root root 17K Mar 8 12:35 Fleftex_M.ttf -rw-rw-r-- 1 root root 9.5K Mar 8 12:35 HILOGI00.ttf -rw-rw-r-- 1 root root 9.6K Mar 8 12:35 HILOGI18.ttf -rw-rw-r-- 1 root root 28K Mar 8 12:35 HILOGI71.ttf -rw-rw-r-- 1 root root 4.4K Mar 8 12:35 ProggySquare?.fon -rw-rw-r-- 1 root root 41K Mar 8 12:35 ProggySquare?.ttf -rw-rw-r-- 1 root root 4.4K Mar 8 12:35 ProggySquareConsole?.fon -rw-rw-r-- 1 root root 4.4K Mar 8 12:35 ProggySquareSZ.fon -rw-rw-r-- 1 root root 41K Mar 8 12:35 ProggySquareSZ.ttf -rw-rw-r-- 1 root root 23K Mar 8 12:35 victor-pixel.ttf
if I export RRD_DEFAULT_FONT: export RRD_DEFAULT_FONT=/usr/local/share/fonts/ProggySquare.ttf And rerun the commands I still don't see any opening of the font.
I tried to apply the patch mentioned in the follow up email to the thread, but it doesn't apply.
Thanks, David Kowis dkowis@…



David,
note that rrdtool 1.3.x and newer user pango and thus fontconfig to render its fonts. Fonts you pass via the --font option must be known by fontconfig. type fc-list to see a list of fonts on your system.
cheers tobi