adobe-type-tools / afdko

Adobe Font Development Kit for OpenType
https://adobe-type-tools.github.io/afdko/
Other
1.06k stars 167 forks source link

How to use makeotf with `.pfb` files? #1672

Closed Firestar-Reimu closed 1 year ago

Firestar-Reimu commented 1 year ago

I want to convert AMSfonts (Type 1) to otf: https://www.ams.org/arc/resources/amsfonts-about.html

but it only contains .pfb and .pfm, no .pfa

If I use makeotf with pfb

it will say:

$ makeotf -f cmb10.pfb 
makeotf [Warning] Could not find default features file. Font will be built without any layout features.
makeotf [Warning] Could not find FontMenuNameDB file. Font will be built with menu names derived from PostScript name.
  ERROR: bad hex string [/home/firestar/Downloads/amsfonts/fonts/type1/public/amsfonts/cm/cmb10.pfb]
Error executing command 'makeotfexe -f /home/firestar/Downloads/amsfonts/fonts/type1/public/amsfonts/cm/cmb10.pfb -o /home/firestar/Downloads/amsfonts/fonts/type1/public/amsfonts/cm/CMB10.otf -shw'
makeotf [Error] Failed to build output font file '/home/firestar/Downloads/amsfonts/fonts/type1/public/amsfonts/cm/CMB10.otf'.

it seems that http://www.lcdf.org/~eddietwo/type/t1ascii.1.html can convert .pfb to .pfa

frankrolf commented 1 year ago

tx -t1 font.pfb > font.pfa

Firestar-Reimu commented 1 year ago

What is tx command? Thanks!


The SHA256SUM of .pfa file from tx -t1 cmb10.pfb > cmb10.pfa and t1ascii cmb10.pfb cmb10.pfa are different.

frankrolf commented 1 year ago

https://adobe-type-tools.github.io/afdko/AFDKO-Overview.html#tx

Firestar-Reimu commented 1 year ago

Will it automatically use the font metrics file .pfm?

frankrolf commented 1 year ago

It won’t – when generating your OTF, you’ll want to have kerning data in a .fea file. This might help: https://fonttools.readthedocs.io/en/latest/afmLib.html