The memory amount required by the size-dependent data of size
and font FontID
is freed by calling the function
int T1_DeleteSize( int FontID, float size)
As described in section , the data structures containing
size-dependent information of a particular font are organized as a
linked list.
T1_DeleteSize()
takes care that a properly linked
list is left after deleting the data.
If the combination of size
and FontID
does not exist, -1
is returned. If the operation was successful, the return value is 0.
For the purpose of removing all size-dependent data for a particular font, there is the function
int T1_DeleteAllSizes( int FontID)
FontID
. This may be appropriate if a user knows some font not
to be needed any longer. This function is also to be used, if one intends to
reencode a font for
which size dependent data has already been generated. In addition,
font transformations
such as slanting and extending
require a font having no size-specific data.
T1_DeleteAllSizes()
recursively calls T1_DeleteSize()
to
do its job.
It returns the number of sizes removed (including 0 if no sizes were
existent) or -1 if an error occurred.
It is also possible to remove the entire data associated with a particular font from memory using
int T1_DeleteFont( int FontID)
T1_DeleteFont()
goes one step beyond the above functions and
removes all the data associated with the font FontID
. This
includes:
FONTPRIVATE
(see
Whether it is useful or not, a font that has been removed using
T1_DeleteFont()
may also be loaded again, explicitly or
implicitly.
There is a restriction, which has not yet been mentioned: A font may only be
removed if it is a physical font (to be explained later) to which no logical
fonts refer or if it is a logical font.10 A reference counter is maintained in each
physical font to check for this. If the font to be removed is a logical font,
the FONTPRIVATE
area is reset and the reference counter of the
referenced physical font is decremented. Of course, size dependent data is
removed in every case.
T1_DeleteFont()
returns 0 if the font has been removed correctly or if
the font was not loaded. () is returned if
the font was physical and was referenced by logical fonts. A
return value -1 indicates an invalid FontID
.
The function
int T1_FreeGlyph( GLYPH *glyph)
T1_CopyGlyph()
back to the system. This function should not be
applied to the pointer to a glyph returned by one of the rastering
functions. As said earlier, these functions manage the memory areas by
themselves.
Similarly, the function
int T1_FreeCompCharData( T1_COMP_CHAR_INFO *cci)
T1_GetCompCharData()
or
T1_GetCompCharDataByIndex()
(see
Section In order to close the library and return all memory to the system,
int T1_CloseLib( void)