[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The design units of fontinst



While trying to pinpoint a bug in fontinst the other day, I noticed
something very strange. In every (V)PL file fontinst generates, it sets
DESIGNUNITS to the same numeric value as DESIGNSIZE.

(For those of you who don't remember what the DESIGNUNITS property does (I
didn't), here's a quote from VPtoVF.web:
> DESIGNUNITS (numeric value, default is 1). The value
> should be a positive real number; it says how many units equals the design
> size (or the eventual `at' size, if the font is being scaled). For
> example, suppose you have a font that has been digitized with 600 pixels per
> em, and the design size is one em; then you could say `(DESIGNUNITS R 600)'
> if you wanted to give all of your measurements in units of pixels.
)

As far as I understand it, using the same numerical value for DESIGNSIZE
and DESIGNUNITS simply means that the unit used for all other dimensions in
the (V)PL file will be the typographical point, since this is the unit used
to specify the design size. This is a rather strange setup, since fontinst
internally uses AFM units for dimensions, and AFM units are relative to the
design size. This setup requires that all dimensions are converted from AFM
units to points before being written, and this involves quite a lot of work.

What seems to me to be a much simpler setup is to use the default value of
1 for  DESIGNUNITS, as this makes 1 (V)PL unit = 1000 AFM units. Some kind
of conversion is still necessary, but it can be made a bit simpler and,
more importantly, it can be made without any rounding errors. (Having 1
(V)PL unit = 1 AFM unit is even simpler, but then one couldn't make
anything larger than 2048 AFM units, and I think that is far too
restrictive.) An extra plus is that this would mean that fontinst will be
able to correctly interpret the PL files it generates (the bug I mensioned
above turned out to be that the PL-to-MTX converter assumes that the design
unit is the design size, as it is in the Computer Modern fonts).

However, the reason I bring this matter public is that I think the current
construction is a bit too inconvenient (for the programmer) to become the
one used just by mere chance. I therefore ask the fontinst community:

   Is there a reason for using points as the (V)PL units?

Lars Hellström