You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I do not know how R handles fonts, but it appears that it only deals with Type1 postscript fonts for which we need a separate font metrics file, fontname.afm.
extrafont relies on ttf2pt1 to extract the afm. But it appears that ttf2pt1 is abandonware. (It certainly gives me a bunch of compiler warnings when built).
Possible options
From the extrafont source in truetype.r we find the comment
Previously, I tried using ttf2afm to do the afm extraction, but the afm files created by ttf2afm didn't work with R. The command for ttf2afm was: ttf2afm Impact.ttf -o Impact.afm
I am assuming that that is ttf2afm from pdftex (source) but I am assuming that that was about the one that comes in common TeX installations.
I did a quick test with ttf2afm from pdftex and on first sight it might work out. At the moment pdf export seems to function properly on linux systems (I tested this also on Mac OS, but I did not install ghostscript).
On a mac, ttf2pt1 installed with Homebrew (using the bottled version compiled by them) works. It is a drop-in replacement for the one in Rttf2pt1 - as in I copied the homebrew binary to the Rttf2pt1/exec/ R library folder, and then all the TTF files in my system were able to be imported (i.e. no segmentation fault and the Font Name was returned) except for a few. (With Rttf2pt1, only about half worked).
I do not know how R handles fonts, but it appears that it only deals with Type1 postscript fonts for which we need a separate font metrics file,
fontname.afm
.extrafont
relies onttf2pt1
to extract the afm. But it appears thatttf2pt1
is abandonware. (It certainly gives me a bunch of compiler warnings when built).Possible options
From the extrafont source in
truetype.r
we find the commentI am assuming that that is
ttf2afm
from pdftex (source) but I am assuming that that was about the one that comes in common TeX installations.There is a Rust crate that uses https://docs.rs/ttf-parser/0.14.0/ttf_parser/index.html I do not know enough about the structure of ttf and or afm to see how to use that to generate an afm from a ttf.
The text was updated successfully, but these errors were encountered: