TrueType FONT in a Rendering Plugin

All,

I am writing a rendering plug-in that works with the unidriver. I want this
driver to handle TrueType Fonts. I am having trouble figuring out how to get
some of the data used in the FONT Header - especially the dimension
parameters. I have a sample of the FONT header that I obtained by printing a
file using the unidrivers DrvTextOut function and then looking at the PCL
output. I have also dumped the .tff using ttfdump. I Can’t figure out how
they are getting the fields like cell height and cell width. Another example
is xHeight. The Font Header value used by the unidrv is 62. When I look in
the PCLT table contained in the (.ttf file) I see a value of 64768. I assume
this is in FUnits but I can’t come up with a conversion (to pixel say) that
will come up with 62. Another conversion that is baffling to me is Pitch.
The unidrv value is 6.25 cpi. The value in PCLT is 1188. Again I can’t
figure out the conversion.

BTW: For this TTF the Units Per EM are 2048. The printer resolution is 600
DPI. The Font height is 10 point.

Here are a couple of specific questions:

  1. In the PCL spec it says that the units used for a scalable font are
    “design units”. What is meant by design units?
  2. What table is the FONT code located in?

BTW: I am familiar with TrueType 1,0 Font File spec.

Kind regards,
Dale

Dale Hill wrote:

I am writing a rendering plug-in that works with the unidriver. I want this
driver to handle TrueType Fonts. I am having trouble figuring out how to get
some of the data used in the FONT Header - especially the dimension
parameters. I have a sample of the FONT header that I obtained by printing a
file using the unidrivers DrvTextOut function and then looking at the PCL
output. I have also dumped the .tff using ttfdump. I Can’t figure out how
they are getting the fields like cell height and cell width. Another example
is xHeight. The Font Header value used by the unidrv is 62. When I look in
the PCLT table contained in the (.ttf file) I see a value of 64768.

Numbers in TrueType font files are big-endian. 64768 in hex is 0xFD00,
so I’m guessing you really have 0x00FD, which is 253. That’s rather
small, if the units-per-em is 2048. Usually, the xHeight is closer to
half of the em box. What font is this?

The xHeight is literally the height of the lower case ‘x’, because most
of the lower case letters (minus ascenders and descenders) are about
that same height.

I assume
this is in FUnits but I can’t come up with a conversion (to pixel say) that
will come up with 62.

The 62 is in units of quarter dots, right? So that’s 15.5 dots. That’s
close to what I get from

253 units/x 600 dots/in
--------------- X 10 pts/em X -------------
2048 units/em 72 pts/in

The difference may be in my assumption that a 10 point font maps to 10
points per em.

Another conversion that is baffling to me is Pitch.
The unidrv value is 6.25 cpi. The value in PCLT is 1188. Again I can’t
figure out the conversion.

Is this a proportional font? If so, the pitch isn’t really that
important. It may have a table that picks the pitch based on the point
size.

Here are a couple of specific questions:

  1. In the PCL spec it says that the units used for a scalable font are
    “design units”. What is meant by design units?

“Design units” are the “units per EM”. They are the dimensionless
internal numbers that are used for all of the coordinates in the glyph
outlines.

  1. What table is the FONT code located in?

What do you mean by “font code”? The PANOSE code is in the OS/2 table.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.