This section contains the basic data types
defined by FreeType 2, ranging from simple scalar
types to bitmap descriptors. More font-specific
structures are defined in a different section.
This is equivalent to the ANSI C `size_t' type,
i.e. the largest _unsigned_ integer type used to
express a file size or position, or a memory
block size.
The type FT_Pos is a 32-bit integer used to store
vectorial coordinates. Depending on the context,
these can represent distances in integer font
units, or 26.6 fixed float pixel coordinates.
Client applications often need to associate their
own data to a variety of FreeType core objects.
For example, a text layout API might want to
associate a glyph cache to a given size object.
Most FreeType object contains a `generic' field,
of type FT_Generic, which usage is left to client
applications and font servers.
It can be used to store a pointer to
client-specific data, as well as the address of a
`finalizer' function, which will be called by
FreeType when the object is destroyed (for
example, the previous client example would put
the address of the glyph cache destructor in the
`finalizer' field).
fields
data
A typeless pointer to any client-specified data.
This field is completely ignored by the FreeType
library.
finalizer
A pointer to a `generic finalizer' function,
which will be called when the object is
destroyed. If this field is set to NULL, no code
will be called.
typedef struct FT_Bitmap_
{
int rows;
int width;
int pitch;
unsigned char* buffer;
short num_grays;
char pixel_mode;
char palette_mode;
void* palette;
} FT_Bitmap;
A structure used to describe a bitmap or pixmap
to the raster. Note that we now manage pixmaps of
various depths through the `pixel_mode' field.
fields
rows
The number of bitmap rows.
width
The number of pixels in bitmap row.
pitch
The pitch's absolute value is the number of bytes
taken by one bitmap row, including padding.
However, the pitch is positive when the bitmap
has a `down' flow, and negative when it has an
`up' flow. In all cases, the pitch is an offset
to add to a bitmap pointer in order to go down
one row.
buffer
A typeless pointer to the bitmap buffer. This
value should be aligned on 32-bit boundaries in
most cases.
num_grays
This field is only used with
`ft_pixel_mode_grays'; it gives the number of
gray levels used in the bitmap.
pixel_mode
The pixel_mode, i.e., how pixel bits are stored.
palette_mode
This field is only used with paletted pixel
modes; it indicates how the palette is stored.
palette
A typeless pointer to the bitmap palette; only
used for paletted pixel modes.
note
For now, the only pixel mode supported by
FreeType are mono and grays. However, drivers
might be added in the future to support more
`colorful' options.
When using pixel modes pal2, pal4 and pal8 with a
void `palette' field, a gray pixmap with
respectively 4, 16, and 256 levels of gray is
assumed. This, in order to be compatible with
some embedded bitmap formats defined in the
TrueType specification.
Note that no font was found presenting such
embedded bitmaps, so this is currently completely
unhandled by the library.
An enumeration type used to describe the format
of a given glyph image. Note that this version of
FreeType only supports two image formats, even
though future font drivers will be able to
register their own format.
fields
ft_glyph_format_composite
The glyph image is a composite of several other
images. This glyph format is _only_ used with the
FT_LOAD_FLAG_NO_RECURSE flag (XXX: Which is
currently unimplemented).
ft_glyph_format_bitmap
The glyph image is a bitmap, and can be described
as a FT_Bitmap.
ft_glyph_format_outline
The glyph image is a vectorial image made of
bezier control points, and can be described as a
FT_Outline.
ft_glyph_format_plotter
The glyph image is a vectorial image made of
plotter lines (some T1 fonts like Hershey contain
glyph in this format).