int T1_WriteAFMFallbackFile( int FontID)
FontID
. This is done
executing the following steps:
.afm
.
Ascender
, Descender
,
XHeight
, CapHeight
and EncodingScheme
. Their
discussion is deferred to later in this section.
As seen above, the current encoding takes influence on the order the characters appear in the AFM file. One should thus not produce AFM files from reencoded fonts, although this is possible. This yields non-standard AFM files and gives no performance gain, even not when used with t1lib.
The entry EncodingScheme
is not always contained in the fontfile
itself. It is generated by comparison between encodings. t1lib has only one
builtin encoding, AdobeStandardEncoding
, which
is recognized. Every further encoding, defined
by the font itself or applied by a user, is always marked as
FontSpecific
.
The entries CapHeight
, XHeight
Ascender
and
Descender
are not fully determined by a Type 1 font file
although they are existent with high probability. As rough definitions
can be considered:
CapHeight
: The height a capital `H' reaches to.
XHeight
: The height a lower case `x' reaches to.
Ascender
: The height a lower case `d' reaches to.
Descender
: The depth a lower case `p' reaches down.
In the Type 1 notion these dimensions are referred to as top alignment
and bottom alignment values respectively. The corresponding alignment
``zone'', i.e., an interval, is defined by the alignment height and a
corresponding overshoot position. The alignment zones are specified in
the BlueValues array for top alignment zones and the OtherBlues
array for bottom alignment zones. A Type 1 font may define up to 7 top
alignment zones and 5 bottom alignment zones. It is unfortunately not
defined which of these alignment zones refer to CapHeight
,
XHeight
, Ascender
and Descender
.
t1lib tries to get out of this dilemma by making a best guess:
Descender
, this
time examining the OtherBlues array.
T1_WriteAFMFallBackFile()
can indicate a number of error
conditions by returning appropriate values. These are:
0
: No error occurred, AFM file was successfully written.
-1
: The AFM data for the font in question has been
generated by reading an AFM file, there is no need to generate a new
one. If you really want to force an AFM file to be written, take
care that t1lib does not find an AFM file when loading the
font.
-2
: The font in question is not loaded.
-3
: The font in question is loaded but AFM data has not
been generated. This definitely is an error condition because it
indicates not all characters of the font could be rastered, either
because the font file is damaged or because there were
insufficient system resources. In any case the application should
generate a logfile and this file should be examined.
-4
: The AFM file could not be opened. This could be a
permission problem or something else. The file is always opened in
the current working directory.
-5
: The file has successfully been opened but there was
an error writing to the file.
-6
: A memory allocation error occurred. This should not
happen because it indicates there are no system resources.