[luatex] Loading Type 1 fonts

David Shourabi Porcel david.shourabiporcel at gmail.com
Sat Oct 7 23:00:23 CEST 2017


Hello,

I would like to load Type 1 fonts. AFAICT, that means:

 1)  opening the PFB with fontloader.open
 2)  adding metrics with fontloader.apply_afmfile on the font file handle
 3)  populating a table suitable for TeX (font.define)

However, with a naive implementation of step 3 (almost a copy of the
OpenType loader), I am getting absurd metrics.

On the matter:

 -  a paper from Hans, "Fonts out of ConTeXt", mentions that AFMs are
parsed directly instead of going the (lossy) AFM->TFM route
 -  this loader[1] from Patrick Gundlach has some special handling for
PFBs, which suggests that step 3 indeed requires a dedicated
implementation and not just a coopy of the True/OpenType loader
 -  luaotfload's history shows there was AFM support. It was removed
because it was merged to LuaTeX's fontloader library

However, they don't shed much light on the subject. Could you give me
some clues? Something like the example TrueType loader in the wiki[2]
would be particularly helpful.

Thank you,

David

1: https://gist.github.com/pgundlach/354808/492857e7bd58dcf0a7027fe3d92a57927e212340

2: http://wiki.luatex.org/index.php/Use_a_TrueType_font


More information about the luatex mailing list