Created attachment 1422686 [details]
screenshot of grafana/graphite font rendering issue
Description of problem:
pcp-webapp-* web interfaces that use pre-rendered graphs (graphite, grafana using default-png.json) print garbage characters instead of readable labels.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. `yum install -y pcp pcp-collector pcp-doc pcp-webapi pcp-webjs`
2. `systemctl start pmwebd`
3. browse to `host:44323` and select either "graphite", or "graphana png" demo dashboards.
Graphs draw lines/axis correctly, but text elements are not printed in a readable font. Screenshots attached.
Correct font rendering.
I have attempted to install various font packages (such as liberation-fonts), and in the case of graphite attempted changing the graph parameters to different font faces. Doing so did not change the results. I was unable to find upstream bugs possibly relating to this. I suspect missing fonts, but I'm not sure *what* fonts exactly. If this is indeed correct, a simple fix is to add the font as a package dependency.
If it's easy, it would be handy to get an "strace -f" of the pmwebd process after a fresh startup, during its rendering of one such png. Here on f27, one can see a bunch of font-related configuration and data files being probed. The last ones, probably the ones most relevant to pmwebd are:
which come from dejavu-sans-fonts rpm. After the above test, would you be able to install just that RPM, restart pmwebd, and see if that fixes it? Thanks!
I don't see references to that font on my strace, only `/usr/share/fonts/lyx/msam10.ttf` - incidentally, this is the font someone mentioned in Freenode ##linux when I asked if anyone recognized this failure mode.
Fortunately, installing dejavu-sans-fonts fixed it!
I'm not 100% on the logic of what font it selects, but it seems if it's expecting a particular font, it should be included as a package dependency. Else, something suitable should be elected as a dependency? Deja-Vu is a pretty nice and very glyph-inclusive font, and doesn't seem to have any undue dependencies - it would make a great suggestion for that.
Thank you, Frank!
(I can upload the strace output if you like)
The code is not expecting a particular font, just anything that matches "sans" as far as Cairo is concerned. (No need for the strace report.)
We recently added a dep on 'liberation-sans-fonts' to resolve a similar issue in pmchart (which is part of the pcp-gui package). Might be worth checking if those fonts resolve the pmwebd issue too, in the interests of avoiding pulling in another font package when chances are pcp-gui may already be installed too, along with the liberation-sans-fonts package.
(In reply to Mark Goodwin from comment #5)
> Might be worth checking if those fonts resolve the pmwebd issue too
I can confirm that liberation-sans-fonts does indeed also remedy this issue. (removed dejavu-*, installed liberation-sans-fonts, restarted pmwebd and confirmed legible text is rendered)
(In reply to Frank Ch. Eigler from comment #4)
> The code is not expecting a particular font, just anything that matches
> "sans" as far as Cairo is concerned. (No need for the strace report.)
Should a default font (or set of fonts) be depended on by the cairo libraries, rather than by those packages utilizing Cairo? I realize drawing text is only a subset of Cairo's functionality, but it doesn't hurt to raise the question, I hope.
> Should a default font (or set of fonts) be depended on by the cairo libraries
Yeah, or freetype, which is a common solib of pmwebd and pmchart.
Fixed by rebase in 7.7.
*** This bug has been marked as a duplicate of bug 1647308 ***