1

I've been studying this problem for a couple of days now without success ...

I've configured and deployed Graphite (with carbon and whisper) using the Puppet Graphite module on a CentOS 6.5 server. The webapp will only render text in the graphs if I select Courier as the font face.

I know that Graphite uses cairo to render the PNG graphs, and that relies on freetype or the fontconfig library. All of those are installed.

Other people have solved this problem by installing the "bitmap-fonts" package. The package installed on my server is "bitmaps-fonts-compat" which one would hope is compatible with "bitmap-fonts".

The version of cairo provided in the RedHat repos is 1.8 (a few revisions old).

Mojo
  • 925
  • 1
  • 9
  • 24
  • What messages do you see in the graphite webapp's logs when you try to render a font other than courier? – sciurus Mar 04 '14 at 23:00
  • rendering.log records no errors: just "Rendered PNG in 0.08... seconds" – Mojo Mar 04 '14 at 23:28
  • What's the output of fc-list? – sciurus Mar 04 '14 at 23:43
  • ]$ fc-list MiscFixed:style=Regular Utopia:style=Bold Italic Console:style=Regular LucidaTypewriter:style=Sans Bold Utopia:style=Bold Bitstream Charter:style=Bold Italic Cursor:style=Regular Bitstream Charter:style=Regular Courier 10 Pitch:style=Bold Italic Bitstream Charter:style=Italic MiscFixed:style=SemiCondensed LucidaTypewriter:style=Sans MiscFixed:style=Bold Courier 10 Pitch:style=Italic Utopia:style=Italic Courier 10 Pitch:style=Regular Fangsong ti:style=Regular Courier 10 Pitch:style=Bold MiscFixed:style=Bold SemiCondensed Fixed:style=Regular Utopia:style=Regular Bitstream Charter ... – Mojo Mar 05 '14 at 00:02
  • And all of those are available in Graphite, but only text in Courier is visible? – sciurus Mar 05 '14 at 00:13
  • The Graphite UI offers font faces Sans, Times, and Helvetica, besides Courier. The other three render nothing. – Mojo Mar 05 '14 at 00:40

2 Answers2

3

I had similar issue on Fedora 21 and fixed it by installing dejavu-sans-fonts & dejavu-serif-fonts (without bitmaps-fonts-compat).

Phil
  • 131
  • 3
2

I had the same problem. To workaround this, change fontname from Sans to LucidaTypewriter (or any other from fc-list) in graphite/render/glyph.py on my server the full path is: /usr/lib/python2.6/site-packages/graphite/render/glyph.py

diff:

64c64
<   fontname='LucidaTypewriter',
---
>   fontname='Sans',

and restart wsgi server.

faja
  • 36
  • 1
  • Nice! Now, in the file, it says "This gets overriden by graphTemplates.conf" which on my system is not found in the /opt/graphite tree. (That's where I found glyph.py.) So it looks in theory like I might solve the problem by properly creating a graphTemplates.conf file and override the font name there. That missing conf file might be key. – Mojo Mar 31 '14 at 17:38
  • 1
    My graphite installation is in /opt/graphite. In /opt/graphite/conf there's a graphTemplates.conf.example file, but not graphTemplates.conf. Using puppet I installed a graphTemplates.conf in /opt/graphite/conf replacing "Sans" with "LucidaTypewriter" and got my default fonts back. – Mojo Mar 31 '14 at 22:27