Getting Width Information from a Postscript font 
Author Message
 Getting Width Information from a Postscript font

Hi,

I dont know a great deal about the fundamentals of PS so sorry if this is a
nonsensical question.

Ive got a project where I need to know how to get exact width information
about each character in a given PS Font. I want to be able to tell, given
the name and size of the font, exactly how much room it will take up on the
page.

Presumably this information is somehow encapsulated into the font? How can I
get at it?

Thanks in advance for any help.

Regards,

--
Roger



Mon, 08 Mar 2004 03:14:59 GMT  
 Getting Width Information from a Postscript font

Quote:

>Hi,

>I dont know a great deal about the fundamentals of PS so sorry if this is a
>nonsensical question.

>Ive got a project where I need to know how to get exact width information
>about each character in a given PS Font. I want to be able to tell, given
>the name and size of the font, exactly how much room it will take up on the
>page.

>Presumably this information is somehow encapsulated into the font? How can I
>get at it?

Do you need to get this information from within a postscript program,
or from outside PostScript, given the font file(s)?
----------------------------------------

Visit http://www.*-*-*.com/ ,
PSAlter, psalters, tea, and small {*filter*} animals. And stuff.  


Mon, 08 Mar 2004 03:50:31 GMT  
 Getting Width Information from a Postscript font

Quote:

> I dont know a great deal about the fundamentals of PS so sorry if this is a
> nonsensical question.

> Ive got a project where I need to know how to get exact width information
> about each character in a given PS Font. I want to be able to tell, given
> the name and size of the font, exactly how much room it will take up on the
> page.

Best advice is to get the character width from the AFM file for
the font in question. An AFM is an Adobe Font Metrics file, a
plain ASCII text file that contains information about font metrics.

--



Mon, 08 Mar 2004 03:58:12 GMT  
 Getting Width Information from a Postscript font


Quote:


> > I dont know a great deal about the fundamentals of PS so sorry if this
is a
> > nonsensical question.

> > Ive got a project where I need to know how to get exact width
information
> > about each character in a given PS Font. I want to be able to tell,
given
> > the name and size of the font, exactly how much room it will take up on
the
> > page.

> Best advice is to get the character width from the AFM file for
> the font in question. An AFM is an Adobe Font Metrics file, a
> plain ASCII text file that contains information about font metrics.

> --

Thanks. Where can I get AFM files from? Does that mean I have to get an AFM
file for EVERY font, because we've got lots. Can you create your own? Is
there a program that can create them for you?
Any advice appreciated.

--
Roger



Tue, 09 Mar 2004 02:53:51 GMT  
 Getting Width Information from a Postscript font

Quote:





> > > I dont know a great deal about the fundamentals of PS so sorry if this
> is a
> > > nonsensical question.

> > > Ive got a project where I need to know how to get exact width
> information
> > > about each character in a given PS Font. I want to be able to tell,
> given
> > > the name and size of the font, exactly how much room it will take up on
> the
> > > page.

> > Best advice is to get the character width from the AFM file for
> > the font in question. An AFM is an Adobe Font Metrics file, a
> > plain ASCII text file that contains information about font metrics.

> > --

> Thanks. Where can I get AFM files from?

The font vendor.

Quote:
> Does that mean I have to get an AFM file for EVERY font,

All the ones you want to use at least.

Quote:
> because we've got lots.

You probably received AFMs when you purchased the fonts. If you're
working on windows, then you must have PFMs for the fonts you use,
and there are PFM->AFM converters. Alternatively, you could consider
getting the metrics from the PFM.

Quote:
> Is there a program that can create them for you?

getafm, which is part of the widely-available psutils. But as the
man page says:

  BUGS
     Kerning information is not generated by getafm; it is best
     to use original AFM files if possible.

--



Tue, 09 Mar 2004 04:08:13 GMT  
 Getting Width Information from a Postscript font
Hi Roger

Loads of font utilities etc etc here:

http://cgm.cs.mcgill.ca/~luc/pssoftware.html

Cheers

Graham



Tue, 09 Mar 2004 04:34:36 GMT  
 Getting Width Information from a Postscript font
GhostScript includes one program that prints the font on a sheet of
paper, including the widths. You might use both, the program and the
output. You could also WWW-search for "PostScript language reference",
and then, in the result search for "width"...

Ulrich

Quote:

> Hi,

> I dont know a great deal about the fundamentals of PS so sorry if this is a
> nonsensical question.

> Ive got a project where I need to know how to get exact width information
> about each character in a given PS Font. I want to be able to tell, given
> the name and size of the font, exactly how much room it will take up on the
> page.

> Presumably this information is somehow encapsulated into the font? How can I
> get at it?

> Thanks in advance for any help.

> Regards,

> --
> Roger



Tue, 16 Mar 2004 20:39:32 GMT  
 Getting Width Information from a Postscript font
Roger

There is a free C library called FreeType
(a type rastersation library) which will
give you access to the metrics of individual
glyphs -- even if you don't have an
AFM or PFM file; i.e., it parses the
PFB (binary) or PFA (text) outline file.
Supports TrueType as well.

It is still in development -- I think
Font Guru Extraordinaire ;--))
Tom Kacvinsky is involved in
this project (I've seen Tom's name
in bugfix reports and the C source).

Tom -- which bit are you coding?

See
www.freetype.org

Even if you don't actually
use the rendering capability
(it has font-hinting as well)
you could still leverage this library
to provide very useful font-support
routines such as exact string width
and height calculations. Indeed, one
of the tutorials covers this.

If you have access to full
AFM metric files, it'll do
kerning for you.
I've barely scratched the surface
of FreeType but, so far, I'm pretty
impressed with it and
hope its development continues
apace.

Regards

Graham



Fri, 19 Mar 2004 22:19:53 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. How to make fixed width fonts with non-fixed width fonts

2. Fixed-width,sans-serif Postscript font?

3. Need a quality fixed width Postscript font

4. Type1 PostScript information to X Logical Font Description

5. Help: Information about PostScript font file format?

6. Getting all font names from your PostScript printer.

7. Getting frame width with Javascript

8. Getting offsetX or width for relativ positioned div

9. Getting Frame Width?

10. Sample code - getting width and height of a GIF in JScript

11. Getting the users screen width and height

12. Getting width and height of a frame?

 

 
Powered by phpBB® Forum Software