Font Metrics

CharlieB cdbiem at nospam.net
Tue Oct 12 05:28:59 PDT 2004


Helge Blischke wrote:
> CharlieB wrote:
> >
> > CharlieB wrote:
> > > Helge Blischke wrote:
> > > > CharlieB wrote:
> > > > >
> > > > > In the ppd_file_t structure there is a list of availiable fonts. 35 in my case. How do I get the font metrics (or at least the char widths) for these fonts so I can generate the PostScript file?
> > > > >
> > > > > I am running Linux.
> > > > >
> > > > > Thanks in advance,
> > > > > Charlie
> > > >
> > > > As long as you don't use kerning, you don't need special font
> > > > metrics information. Everything you need is accessible to the
> > > > PostScript interpreter.
> > > >
> > > > What is your problem?
> > > >
> > > I want to know the widths of the chars so I can do line wrapping, etc. Is there a way to get the font metrics?
> >
> > Oh, I need underline positioning also.
> > >
> > > Thanks,
> > > Charlie
>
> Ok, if you won't let the PostScript interpreter do all the fancy
> calculations for you,
> you'd get the .afm files for your 35 fonts (afm means "Adobe Font
> Metrics"). They
> contain the complete metric information (including kerning tables, if
> applicable).
> But your program composing the text to be rendered must keep track of
> what is done
> with the fonts in question (encoding changes, scaling etc.).
>
> And, if you are going to rely on the built-in fonts of a printer, you
> *cannot* be sure
> that am metrics file you get reflects the exact mitrics of the font.
>
> Helge
Is there an easy way to get the correct afm file for the font loaded with say:

/Times findfont

when using cups?

Thanks again.
Charlie




More information about the cups mailing list