Skip to content
Prev 870 / 919 Next

evince not showing "greek" and "math" in *.pdf plots

Martin, I wouldn't rule out an R issue yet. Fonts are... tricky. So I'm
cc'ing Paul Murrell here.

I tried several viewers here and I see the following: Chrome, Firefox and
Libreoffice Draw show the symbols; however, evince, okular and xournal++
agree on **not** showing the symbols. **If** there is a bug, the bug would
be in fontconfig, because these ones AFAIK properly delegate on fontconfig,
which is the system-wide component that decides what font substitution
should be made for any given font. However, I see:

$ fc-match Helvetica
NimbusSans-Regular.otf: "Nimbus Sans" "Regular"

which is the right choice. And okular confirms this by showing in a
properties dialog that it is substituting Helvetica with URW's Nimbus Sans
Regular. So why aren't the symbols displayed? My best guess is that this
has something to do with how R encodes such symbols. Paul introduced some
changes to fix similar issues for Cairo devices when Fedora dropped support
for Type 1 fonts, see [1]. Now, I'm no font expert, but it seems to me that
the pdf device may require similar fixes. (And why do xpdf or Firefox show
the glyphs... I have no idea. I guess they do their thing without asking
fontconfig).

[1]
https://blog.r-project.org/2020/04/17/changes-to-symbol-fonts-for-cairo-graphics-devices/

Peter, as an aside, note that cairo_pdf embeds the fonts by default.

Best,
I?aki
On Mon, 11 Mar 2024 at 15:31, <pstils at gmail.com> wrote: