Next: Writing AFM Files
Up: Missing or Invalid AFM
Previous: Remarks on AFM Files
Contents
Index
Generation of AFM Information
Next lets consider how to generate the AFM information. It is a series of
entirely independent steps:
- When we generate AFM information, we want to do this once and forever
when the font is loaded. Consequently all characters, have to be examined,
not only those that are currently encoded.
We start by fetching all character names the font defines. This done with
T1_GetAllCharNames()
(see
). This
yields a list of possibly more than 256 character names.
- Each of the character addressed by the names above is now rastered at
size 1000 bp. By rastering at 1000 bp we match exactly the charspace
coordinate system which the character outline descriptions are
based on. Width and bounding box are easily examined and saved at
appropriate places.
- The kerning pair area and ligatures are explicitly set to zero.
At the end of this procedure, there is a data area identical to what would
have been built when reading an AFM file without kerning-section and ligature
specifications.
The decision of building AFM data is done on the fly without any user
interaction. Here is what happens on the metrics-area when loading a font:
- t1lib tries to open an AFM file reading metrics and kerning pair
information.
- If this does not succeed, it tries to rescan the AFM file in a sloppy way, only requesting metrics information.
- If this fails too, metrics information is generated on the fly as
described above.
It should be noted that generating metric information the way described above
takes significant amount of time since every character has to be rastered at
1000 bp.
If the T1_NO_AFM
flag is passed to T1_InitLib()
,
t1lib will neither attempt to open AFM files nor generate AFM
information. This is useful to speed up applications which do not
need the metrics data. However, this slows down access to certain features,
mostly related to the string processing functions, and completely disables the
features that only are contained in AFM files (like kerning and ligatures).
Obivously, the t1lib functions that use
the AFM data will not work correctly in this case and should not be
used.
Next: Writing AFM Files
Up: Missing or Invalid AFM
Previous: Remarks on AFM Files
Contents
Index
2004-10-04