Folks,
I use a document system (Lout) which requires an AFM.
(Lout is a wonderful program for generating postscript.)
I found a ttf2afm.exe, as part of the TexLive distribution.
It works for most TTFs; however, it does not work for some google TTFs.
(And TexLive is a very heavy footprint!)
Thus, I need a postscript program which takes a fontname
and outputs the AFM file for that font (or at least puts the requisite info to the postscript log).
I am a total neophyte on this postscript, so please be gentle.
On Saturday, January 16, 2021 at 6:03:09 AM UTC-6, dougLas.L.mc...@maiL.mil wrote:Thx,
Folks,
I use a document system (Lout) which requires an AFM.
(Lout is a wonderful program for generating postscript.)
I found a ttf2afm.exe, as part of the TexLive distribution.
It works for most TTFs; however, it does not work for some google TTFs. (And TexLive is a very heavy footprint!)
Thus, I need a postscript program which takes a fontname
and outputs the AFM file for that font (or at least puts the requisite info to the postscript log).
I am a total neophyte on this postscript, so please be gentle.I think this is going to be nearly impossible to do from within a PostScript program. If you search the group for my thread "Interrogating a font" it goes into the kind of font information you can gather from PostScript.
You can get a good guess for certain metrics like baseline and cap height, but others will be harder. I was trying to generate a PDF font descriptor
and stuff like 'isItalic' (boolean) was really hard to determine just by analyzing
the glyphs (at least for me).
So, probably a better course would be a language that has bindings
for fontconfig and freetype libraries. Fontconfig helps you search the operating system for fonts using a standardized query facility, and
freetype lets you pick apart the font for any info you might need.
This may involve some hackery to heuristically convert a PostScript
font name into the format that fontconfig wants. If needed I can dig up
some C code from xpost that does this (or at least attempts it).
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 91:30:27 |
Calls: | 6,658 |
Files: | 12,203 |
Messages: | 5,334,161 |