\0
-terminated strings that are read
from the configuration file. They are referenced internally by the global
symbols
PFAB_ptr
, AFM_ptr
, ENC_ptr
and FDB_ptr
respectively. All these are declared as unsigned char *
. These
strings are used by t1lib to locate the respective file types. If no
configuration file exists or some path declaration is missing, the
corresponding searchpath is set to ``.
'', causing t1lib to only
search the current working directory.
no_fonts_ini
: This value is assigned after examining the
fontdatabase file. It is meant to store the number of fonts initially
declared in the fontdatabase file. In other words, it is assigned the
integer number located on the first line of the fontdatabase file.
no_fonts
: The number of actually allocated fonts. Initially, this
quantity is identical to no_fonts_ini
. But if one creates a new
logical font by calling T1_CopyFont()
this counter is incremented to
keep track of allocated fonts. no_fonts
thus represents most large
FontID
minus 1 that makes sense to specify to any function of
t1lib.
no_fonts_limit
: The number of fonts for which memory is currently
allocated. This also is initially set to no_fonts_ini
and is
automatically enlarged to a multiple of the initial value if a call to
T1_CopyFont()
requires additional memory for logical fonts (see
bitmap_pad
: This variable contains the number of bits to which
scanlines of bitmaps and antialiased bitmaps are padded. It is set during
initialization, either to a default value or to the value the application
specified before starting initialization using
T1_SetBimapPad()
. Allowed values are currently `8', `16' and `32'.
endian
: During initialization the hardware is checked for
representation of data in memory. If Big Endian is used, endian
is
set to 1
and otherwise it is set to 0
. endian
is needed
at several times when an application or t1lib itself must know the
byte order of words and long words.
pFontArray
: This a pointer to an array of structures whose type
is referred to as
FONTPRIVATE
in t1lib. The contents of these
structures will be described below. After t1lib has been
initialized, memory is allocated for exactly no_fonts_ini
structures. This memory pool may be enlarged later if the one wants to make
use of logical fonts, for example. The data in these structures initially is
not specified. It is written with meaningful values when a font is loaded
into memory. The index to access this array-elements is the well known font
identification number (FontID
).
pFontFileNameIDArray
: A pointer to a memory area where the
font file names corresponding to the FontID
s are stored. During
initialization, t1lib looks for font files with extension .pfa
and .pfb
. The basename of the file found is stored in this area and
if the font is to be loaded later, its font file name is looked up here.
FONTPRIVATE
. The term FONTPRIVATE
indicates that every font
needs its own structure area. As mentioned earlier, this area is initialized
when the corresponding font is loaded.
pAFMData
: A pointer to a memory area where Adobe Font Metric data
of the font is stored. The memory area itself is build by the
parse_afm
-package which is supplied by Adobe System and included in
t1lib. This happens while a font is loaded. In case there is no AFM file
for the font in question, this pointer is given the value NULL
.
pType1Data
: A pointer to the data area where the Type 1
information is stored. The known PostScript Type 1 objects
Charstrings-dictionary, Subroutines, Othersubroutines and
Fontinfo-dictionary are located here. The memory is filled with data during
parsing the font file when the font is loaded.
pFontEnc
: A pointer to an optional external encoding
vector. During initialization, this pointer is set to NULL
, thus
indicating that by default the font's internal encoding should be used.
If a font is reencoded using a previously loaded encoding vector from an
encoding file, this pointer simply is assigned the address of a valid
encoding array somewhere in memory.
vm_base
: The base address of the virtual memory required by the
font. Unlike the original rasterizer, which allocated virtual memory in
chunks of a fixed size, t1lib uses another principle. Since it is à
priori not obvious how many virtual memory a font consumes, t1lib tries
to load a font repeatedly and increases the amount of virtual memory during
every trial. In order not to waste memory, the memory is reallocated to the
needed size when the font is completely loaded. Finally, the starting
address of the virtual memory is needed when a font is to be unloaded and
the memory it consumes is to be given back to system.
pFontSizeDeps
: A pointer to the area where the size dependent
data is to be stored. This data essentially consists of generated glyphs
plus some administrative item (see FontMatrix
: A matrix of four double
-values specifying the
font matrix. If the FontInfo-dictionary of the font file defines a
FontMatrix, it is copied to this location. If not, a default matrix is
used which does no transformation and scales to bp.
FontTransform
: A matrix that will be concatenated with the
FontMatrix to produce the final transformation of the characters. It is this
matrix that is modified if a font is to be slanted or extended.
slant
: A slant factor for the current font. Note that this
value is initially 0, even for italic font. Only artificially slanting a
font leads to values different from 0.
extend
: The horizontal extension factor for the current font. Its
default value is 1 and the font is thus rendered at its natural width.
physical
: This is a switch that marks a font either being
``physical'' or ``logical''. A physical font by definition is a font for
which a Type 1 font file is available and for which thus Level 1
(size-independent) data is present (see Fig. 5.1). In contrast, the term
``logical font'' refers to a structure of type FONTPRIVATE
whose
entry pType1Data
points to Level 1 data of another (physical)
font. This FONTPRIVATE
-structure is created by calling
T1_CopyFont()
with the identification number of an existing physical
font as argument (see refcount
: This counter keeps track on how much logical fonts
refer to the physical font that is represented by the current structure of
type FONTPRIVATE
. In this since, refcount
is only meaningful for
physical fonts. It is necessary to keep track of the reference of logical
fonts because if this font would be removed from memory by calling
T1_DeleteFont()
, the Level 1 font data memory area would be given back
to the system but the logical fonts referring to that font would still
expect to find Type 1 or Font Metric data at this address. By checking
refcount
, T1_DeleteFont()
can check for logical fonts referring
to the font in question and prevent from removing this font from memory.
In structures describing logical fonts, refcount
is used to
store the information which physical font this logical font is
referring to. This information is also needed by
T1_DeleteFont()
since when removing logical fonts, the
reference counter of the corresponding physical font has to be
decremented.
space_position
: This variable stores the encoding index of the
``space''-character of the current font. If the space character does not
appear in the current font's encoding, space_position
is assigned
-1. It follows that space_position
is assigned when (1) a font loaded and (2) every time a
font is reencoded. Why is it convenient to store the position of the space
character in the encoding vector? The properties of the space character are
set apart from the other characters' properties not only by the fact that it
does not produce any colored pixels but also by that it may shrink and
stretch in t1lib. As a consequence a space character is treated by simply
inserting a horizontal escapement of the width of the space
character--corrected by the quantity space_off
that a user may
specify (see strcmp()
. This overhead
is avoided if the position of space is stored.