Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #3612

Re: true type font (TTF) to adobe font metric(AFM) -- postscript program needed

Newsgroups comp.lang.postscript
Date 2021-01-17 15:06 -0800
References <33a9326e-90cc-440d-9416-c8f68b2ba866n@googlegroups.com> <62fd572a-07d0-4d3a-88de-de81e438976cn@googlegroups.com>
Message-ID <2bff122d-5d1f-42ac-928c-e829bf256870n@googlegroups.com> (permalink)
Subject Re: true type font (TTF) to adobe font metric(AFM) -- postscript program needed
From "dougLas.L.mc...@maiL.mil" <dougLas.L.mcaLLaster.civ@mail.mil>

Show all headers | View raw


On Sunday, January 17, 2021 at 12:34:40 PM UTC-5, luser droog wrote:
> On Saturday, January 16, 2021 at 6:03:09 AM UTC-6, dougLas.L.mc...@maiL.mil wrote: 
> > 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).
Thx,

I found a ttf2ufm.exe at http://wxcode.sourceforge.net/docs/wxpdfdoc/makefont.html 
It is a stand alone exe for windows and, thus, fully meets my need.
(And it worked on the goggle font for which the ttf2afm.exe failed.)

It does include the source code for folks on linux.
It is an extension of an original program ttf2pt1.exe.

Back to comp.lang.postscript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

true type font (TTF) to adobe font metric(AFM) -- postscript program needed "dougLas.L.mc...@maiL.mil" <dougLas.L.mcaLLaster.civ@mail.mil> - 2021-01-16 04:03 -0800
  Re: true type font (TTF) to adobe font metric(AFM) -- postscript program needed luser droog <luser.droog@gmail.com> - 2021-01-17 09:34 -0800
    Re: true type font (TTF) to adobe font metric(AFM) -- postscript program needed "dougLas.L.mc...@maiL.mil" <dougLas.L.mcaLLaster.civ@mail.mil> - 2021-01-17 15:06 -0800
      Re: true type font (TTF) to adobe font metric(AFM) -- postscript program needed jdh3 <inspironwuxga@gmail.com> - 2021-01-17 16:25 -0800

csiph-web