1999-12-17 00:11:37 +01:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* freetype.h */
|
|
|
|
/* */
|
|
|
|
/* FreeType high-level API and common types (specification only). */
|
|
|
|
/* */
|
2000-05-17 01:22:21 +02:00
|
|
|
/* Copyright 1996-2000 by */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* This file is part of the FreeType project, and may only be used, */
|
|
|
|
/* modified, and distributed under the terms of the FreeType project */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
|
|
|
/* this file you indicate that you have read the license and */
|
|
|
|
/* understand and accept it fully. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
#ifndef FREETYPE_H
|
|
|
|
#define FREETYPE_H
|
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* The `raster' component duplicates some of the declarations in */
|
|
|
|
/* freetype.h for stand-alone use if _FREETYPE_ isn't defined. */
|
|
|
|
/* */
|
|
|
|
#define _FREETYPE_
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* The FREETYPE_MAJOR and FREETYPE_MINOR macros are used to version the */
|
|
|
|
/* new FreeType design, which is able to host several kinds of font */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* drivers. It starts at 2.0. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
#define FREETYPE_MAJOR 2
|
|
|
|
#define FREETYPE_MINOR 0
|
|
|
|
|
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
#include <freetype/config/ftconfig.h> /* read configuration information */
|
2000-05-11 20:23:52 +02:00
|
|
|
#include <freetype/fterrors.h>
|
2000-05-16 21:51:49 +02:00
|
|
|
#include <freetype/fttypes.h>
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* B A S I C T Y P E S */
|
|
|
|
/* */
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FT_Glyph_Metrics */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure used to model the metrics of a single glyph. Note */
|
|
|
|
/* that values are expressed in 26.6 fractional pixel format or in */
|
|
|
|
/* font units, depending on context. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* width :: The glyph's width. */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* height :: The glyph's height. */
|
|
|
|
/* */
|
|
|
|
/* horiBearingX :: Horizontal left side bearing. */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* horiBearingY :: Horizontal top side bearing. */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* horiAdvance :: Horizontal advance width. */
|
|
|
|
/* */
|
|
|
|
/* vertBearingX :: Vertical left side bearing. */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* vertBearingY :: Vertical top side bearing. */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* vertAdvance :: Vertical advance height. */
|
|
|
|
/* */
|
|
|
|
typedef struct FT_Glyph_Metrics_
|
|
|
|
{
|
|
|
|
FT_Pos width; /* glyph width */
|
|
|
|
FT_Pos height; /* glyph height */
|
|
|
|
|
|
|
|
FT_Pos horiBearingX; /* left side bearing in horizontal layouts */
|
|
|
|
FT_Pos horiBearingY; /* top side bearing in horizontal layouts */
|
|
|
|
FT_Pos horiAdvance; /* advance width for horizontal layout */
|
|
|
|
|
|
|
|
FT_Pos vertBearingX; /* left side bearing in vertical layouts */
|
|
|
|
FT_Pos vertBearingY; /* top side bearing in vertical layouts */
|
|
|
|
FT_Pos vertAdvance; /* advance height for vertical layout */
|
|
|
|
|
|
|
|
} FT_Glyph_Metrics;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <FuncType> */
|
|
|
|
/* FT_Generic_Finalizer */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Describes a function used to destroy the `client' data of any */
|
|
|
|
/* FreeType object. See the description of the FT_Generic type for */
|
|
|
|
/* details of usage. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* The address of the FreeType object which is under finalization. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* Its client data is accessed through its `generic' field. */
|
|
|
|
/* */
|
|
|
|
typedef void (*FT_Generic_Finalizer)(void* object);
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FT_Generic */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* 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_Generic_
|
|
|
|
{
|
|
|
|
void* data;
|
|
|
|
FT_Generic_Finalizer finalizer;
|
|
|
|
|
|
|
|
} FT_Generic;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FT_Bitmap_Size */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* An extremely simple structure used to model the size of a bitmap */
|
|
|
|
/* strike (i.e., a bitmap instance of the font for a given */
|
|
|
|
/* resolution) in a fixed-size font face. This is used for the */
|
|
|
|
/* `available_sizes' field of the FT_Face_Properties structure. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* height :: The character height in pixels. */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* width :: The character width in pixels. */
|
|
|
|
/* */
|
|
|
|
typedef struct FT_Bitmap_Size_
|
|
|
|
{
|
|
|
|
FT_Short height;
|
|
|
|
FT_Short width;
|
|
|
|
|
|
|
|
} FT_Bitmap_Size;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* O B J E C T C L A S S E S */
|
|
|
|
/* */
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FT_Library */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A handle to a FreeType library instance. Each `library' is */
|
|
|
|
/* completely independent from the others; it is the `root' of a set */
|
|
|
|
/* of objects like fonts, faces, sizes, etc. */
|
|
|
|
/* */
|
|
|
|
/* It also embeds a system object (see FT_System), as well as a */
|
|
|
|
/* scan-line converter object (see FT_Raster). */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* Library objects are created through FT_Init_FreeType(). */
|
|
|
|
/* */
|
|
|
|
typedef struct FT_LibraryRec_ *FT_Library;
|
|
|
|
|
|
|
|
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FT_Module */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* A handle to a given FreeType module object. Each module can be a */
|
|
|
|
/* font driver, a renderer, or anything else that provides services */
|
|
|
|
/* to the formers. */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
|
|
|
typedef struct FT_ModuleRec_* FT_Module;
|
|
|
|
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FT_Driver */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A handle to a given FreeType font driver object. Each font driver */
|
|
|
|
/* is able to create faces, sizes, glyph slots, and charmaps from the */
|
|
|
|
/* resources whose format it supports. */
|
|
|
|
/* */
|
|
|
|
/* A driver can support either bitmap, graymap, or scalable font */
|
|
|
|
/* formats. */
|
|
|
|
/* */
|
|
|
|
typedef struct FT_DriverRec_* FT_Driver;
|
|
|
|
|
|
|
|
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FT_Renderer */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* A handle to a given FreeType renderer. A renderer is in charge of */
|
|
|
|
/* converting a glyph image to a bitmap, when necessary. Each */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* supports a given glyph image format, and one or more target */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* surface depths. */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
|
|
|
typedef struct FT_RendererRec_* FT_Renderer;
|
|
|
|
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FT_Face */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A handle to a given driver face object. A face object contains */
|
|
|
|
/* all the instance and glyph independent data of a font file */
|
|
|
|
/* typeface. */
|
|
|
|
/* */
|
|
|
|
/* A face object is created from a resource object through the */
|
|
|
|
/* new_face() method of a given driver. */
|
|
|
|
/* */
|
|
|
|
typedef struct FT_FaceRec_* FT_Face;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FT_Size */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A handle to a given driver size object. Such an object models the */
|
|
|
|
/* _resolution_ AND _size_ dependent state of a given driver face */
|
|
|
|
/* size. */
|
|
|
|
/* */
|
|
|
|
/* A size object is always created from a given face object. It is */
|
|
|
|
/* discarded automatically by its parent face. */
|
|
|
|
/* */
|
|
|
|
typedef struct FT_SizeRec_* FT_Size;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FT_GlyphSlot */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A handle to a given `glyph slot'. A slot is a container where it */
|
|
|
|
/* is possible to load any of the glyphs contained within its parent */
|
|
|
|
/* face. */
|
|
|
|
/* */
|
|
|
|
/* A glyph slot is created from a given face object. It is discarded */
|
|
|
|
/* automatically by its parent face. */
|
|
|
|
/* */
|
|
|
|
typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Type> */
|
|
|
|
/* FT_CharMap */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A handle to a given character map. A charmap is used to translate */
|
|
|
|
/* character codes in a given encoding into glyph indexes for its */
|
|
|
|
/* parent's face. Some font formats may provide several charmaps per */
|
|
|
|
/* font. */
|
|
|
|
/* */
|
|
|
|
/* A charmap is created from a given face object. It is discarded */
|
|
|
|
/* automatically by its parent face. */
|
|
|
|
/* */
|
|
|
|
typedef struct FT_CharMapRec_* FT_CharMap;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Enum> */
|
|
|
|
/* FT_Encoding */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* An enumeration used to specify encodings supported by charmaps. */
|
|
|
|
/* Used in the FT_Select_CharMap() API function. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */
|
|
|
|
/* all character codes must be expressed as FT_Longs. */
|
|
|
|
/* */
|
2000-08-27 09:12:40 +02:00
|
|
|
/* Other encodings might be defined in the future. */
|
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
typedef enum FT_Encoding_
|
|
|
|
{
|
|
|
|
ft_encoding_none = 0,
|
2000-07-09 21:15:30 +02:00
|
|
|
ft_encoding_symbol = FT_MAKE_TAG( 's', 'y', 'm', 'b' ),
|
|
|
|
ft_encoding_unicode = FT_MAKE_TAG( 'u', 'n', 'i', 'c' ),
|
|
|
|
ft_encoding_latin_2 = FT_MAKE_TAG( 'l', 'a', 't', '2' ),
|
|
|
|
ft_encoding_sjis = FT_MAKE_TAG( 's', 'j', 'i', 's' ),
|
|
|
|
ft_encoding_gb2312 = FT_MAKE_TAG( 'g', 'b', ' ', ' ' ),
|
|
|
|
ft_encoding_big5 = FT_MAKE_TAG( 'b', 'i', 'g', '5' ),
|
|
|
|
ft_encoding_wansung = FT_MAKE_TAG( 'w', 'a', 'n', 's' ),
|
|
|
|
ft_encoding_johab = FT_MAKE_TAG( 'j', 'o', 'h', 'a' ),
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
ft_encoding_adobe_standard = FT_MAKE_TAG( 'A', 'D', 'O', 'B' ),
|
|
|
|
ft_encoding_adobe_expert = FT_MAKE_TAG( 'A', 'D', 'B', 'E' ),
|
|
|
|
ft_encoding_adobe_custom = FT_MAKE_TAG( 'A', 'D', 'B', 'C' ),
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
ft_encoding_apple_roman = FT_MAKE_TAG( 'a', 'r', 'm', 'n' )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
} FT_Encoding;
|
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FT_CharMapRec */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* The base charmap class. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* face :: A handle to the parent face object. */
|
|
|
|
/* */
|
2000-10-13 23:00:36 +02:00
|
|
|
/* encoding :: A tag which identifies the charmap. Use this with */
|
|
|
|
/* FT_Select_Charmap(). */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* platform_id :: An ID number describing the platform for the */
|
|
|
|
/* following encoding ID. This comes directly from */
|
|
|
|
/* the TrueType specification and should be emulated */
|
|
|
|
/* for other formats. */
|
|
|
|
/* */
|
|
|
|
/* encoding_id :: A platform specific encoding number. This also */
|
|
|
|
/* comes from the TrueType specification and should be */
|
|
|
|
/* emulated similarly. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* We STRONGLY recommmend emulating a Unicode charmap for drivers */
|
|
|
|
/* that do not support TrueType or OpenType. */
|
|
|
|
/* */
|
|
|
|
typedef struct FT_CharMapRec_
|
|
|
|
{
|
|
|
|
FT_Face face;
|
|
|
|
FT_Encoding encoding;
|
|
|
|
FT_UShort platform_id;
|
|
|
|
FT_UShort encoding_id;
|
|
|
|
|
|
|
|
} FT_CharMapRec;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* B A S E O B J E C T C L A S S E S */
|
|
|
|
/* */
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* FreeType base face class */
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FT_FaceRec */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* FreeType root face class structure. A face object models the */
|
|
|
|
/* resolution and point-size independent data found in a font file. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* num_faces :: In the case where the face is located in a */
|
|
|
|
/* collection (i.e., a resource which embeds */
|
|
|
|
/* several faces), this is the total number of */
|
|
|
|
/* faces found in the resource. 1 by default. */
|
|
|
|
/* */
|
|
|
|
/* face_index :: The index of the face in its resource. */
|
|
|
|
/* Usually, this is 0 for all normal font */
|
|
|
|
/* formats. It can be more in the case of */
|
|
|
|
/* collections (which embed several fonts in a */
|
|
|
|
/* single resource/file). */
|
|
|
|
/* */
|
|
|
|
/* face_flags :: A set of bit flags that give important */
|
|
|
|
/* information about the face; see the */
|
|
|
|
/* FT_FACE_FLAG_XXX macros for details. */
|
|
|
|
/* */
|
|
|
|
/* style_flags :: A set of bit flags indicating the style of */
|
|
|
|
/* the face (i.e., italic, bold, underline, */
|
|
|
|
/* etc). */
|
|
|
|
/* */
|
|
|
|
/* num_glyphs :: The total number of glyphs in the face. */
|
|
|
|
/* */
|
|
|
|
/* family_name :: The face's family name. This is an ASCII */
|
|
|
|
/* string, usually in English, which describes */
|
|
|
|
/* the typeface's family (like `Times New */
|
|
|
|
/* Roman', `Bodoni', `Garamond', etc). This */
|
|
|
|
/* is a least common denominator used to list */
|
|
|
|
/* fonts. Some formats (TrueType & OpenType) */
|
|
|
|
/* provide localized and Unicode versions of */
|
|
|
|
/* this string. Applications should use the */
|
|
|
|
/* format specific interface to access them. */
|
|
|
|
/* */
|
|
|
|
/* style_name :: The face's style name. This is an ASCII */
|
|
|
|
/* string, usually in English, which describes */
|
|
|
|
/* the typeface's style (like `Italic', */
|
|
|
|
/* `Bold', `Condensed', etc). Not all font */
|
|
|
|
/* formats provide a style name, so this field */
|
|
|
|
/* is optional, and can be set to NULL. As */
|
|
|
|
/* for `family_name', some formats provide */
|
|
|
|
/* localized/Unicode versions of this string. */
|
|
|
|
/* Applications should use the format specific */
|
|
|
|
/* interface to access them. */
|
|
|
|
/* */
|
|
|
|
/* num_fixed_sizes :: The number of fixed sizes available in this */
|
|
|
|
/* face. This should be set to 0 for scalable */
|
|
|
|
/* fonts, unless its resource includes a */
|
|
|
|
/* complete set of glyphs (called a `strike') */
|
|
|
|
/* for the specified size. */
|
|
|
|
/* */
|
|
|
|
/* available_sizes :: An array of sizes specifying the available */
|
|
|
|
/* bitmap/graymap sizes that are contained in */
|
|
|
|
/* in the font resource. Should be set to */
|
|
|
|
/* NULL if the field `num_fixed_sizes' is set */
|
|
|
|
/* to 0. */
|
|
|
|
/* */
|
2000-03-28 13:22:31 +02:00
|
|
|
/* num_charmaps :: The total number of character maps in the */
|
|
|
|
/* face. */
|
|
|
|
/* */
|
|
|
|
/* charmaps :: A table of pointers to the face's charmaps */
|
|
|
|
/* Used to scan the list of available charmaps */
|
|
|
|
/* this table might change after a call to */
|
|
|
|
/* FT_Attach_File/Stream (e.g. when it used */
|
|
|
|
/* to hook and additional encoding/CMap to */
|
|
|
|
/* the face object). */
|
|
|
|
/* */
|
|
|
|
/* generic :: A field reserved for client uses. See the */
|
|
|
|
/* FT_Generic type description. */
|
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* bbox :: The font bounding box. Coordinates are */
|
|
|
|
/* expressed in font units (see units_per_EM). */
|
|
|
|
/* The box is large enough to contain any */
|
|
|
|
/* glyph from the font. Thus, bbox.yMax can */
|
|
|
|
/* be seen as the `maximal ascender', */
|
|
|
|
/* bbox.yMin as the `minimal descender', and */
|
2000-05-29 22:46:12 +02:00
|
|
|
/* the maximal glyph width is given by */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* `bbox.xMax-bbox.xMin' (not to be confused */
|
2000-05-29 22:46:12 +02:00
|
|
|
/* with the maximal _advance_width_). Only */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* relevant for scalable formats. */
|
|
|
|
/* */
|
|
|
|
/* units_per_EM :: The number of font units per EM square for */
|
|
|
|
/* this face. This is typically 2048 for */
|
|
|
|
/* TrueType fonts, 1000 for Type1 fonts, and */
|
|
|
|
/* should be set to the (unrealistic) value 1 */
|
|
|
|
/* for fixed-sizes fonts. Only relevant for */
|
|
|
|
/* scalable formats. */
|
|
|
|
/* */
|
|
|
|
/* ascender :: The face's ascender is the vertical */
|
|
|
|
/* distance from the baseline to the topmost */
|
|
|
|
/* point of any glyph in the face. This */
|
|
|
|
/* field's value is positive, expressed in */
|
|
|
|
/* font units. Some font designs use a value */
|
|
|
|
/* different from `bbox.yMax'. Only relevant */
|
|
|
|
/* for scalable formats. */
|
|
|
|
/* */
|
|
|
|
/* descender :: The face's descender is the vertical */
|
|
|
|
/* distance from the baseline to the */
|
|
|
|
/* bottommost point of any glyph in the face. */
|
|
|
|
/* This field's value is positive, expressed */
|
|
|
|
/* in font units. Some font designs use a */
|
|
|
|
/* value different from `-bbox.yMin'. Only */
|
|
|
|
/* relevant for scalable formats. */
|
|
|
|
/* */
|
|
|
|
/* height :: The face's height is the vertical distance */
|
|
|
|
/* from one baseline to the next when writing */
|
|
|
|
/* several lines of text. Its value is always */
|
|
|
|
/* positive, expressed in font units. The */
|
|
|
|
/* value can be computed as */
|
|
|
|
/* `ascender+descender+line_gap' where the */
|
|
|
|
/* value of `line_gap' is also called */
|
|
|
|
/* `external leading'. Only relevant for */
|
|
|
|
/* scalable formats. */
|
|
|
|
/* */
|
2000-05-29 22:46:12 +02:00
|
|
|
/* max_advance_width :: The maximal advance width, in font units, */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* for all glyphs in this face. This can be */
|
|
|
|
/* used to make word wrapping computations */
|
|
|
|
/* faster. Only relevant for scalable */
|
|
|
|
/* formats. */
|
|
|
|
/* */
|
2000-05-29 22:46:12 +02:00
|
|
|
/* max_advance_height :: The maximal advance height, in font units, */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* for all glyphs in this face. This is only */
|
|
|
|
/* relevant for vertical layouts, and should */
|
|
|
|
/* be set to the `height' for fonts that do */
|
|
|
|
/* not provide vertical metrics. Only */
|
|
|
|
/* relevant for scalable formats. */
|
|
|
|
/* */
|
|
|
|
/* underline_position :: The position, in font units, of the */
|
|
|
|
/* underline line for this face. It's the */
|
|
|
|
/* center of the underlining stem. Only */
|
|
|
|
/* relevant for scalable formats. */
|
|
|
|
/* */
|
|
|
|
/* underline_thickness :: The thickness, in font units, of the */
|
|
|
|
/* underline for this face. Only relevant for */
|
|
|
|
/* scalable formats. */
|
|
|
|
/* */
|
2000-03-28 13:22:31 +02:00
|
|
|
/* driver :: A handle to the face's parent driver */
|
|
|
|
/* object. */
|
|
|
|
/* */
|
|
|
|
/* memory :: A handle to the face's parent memory */
|
|
|
|
/* object. Used for the allocation of */
|
|
|
|
/* subsequent objects. */
|
|
|
|
/* */
|
|
|
|
/* stream :: A handle to the face's stream. */
|
|
|
|
/* */
|
|
|
|
/* glyph :: The face's associated glyph slot(s). This */
|
|
|
|
/* object is created automatically with a new */
|
|
|
|
/* face object. However, certain kinds of */
|
|
|
|
/* applications (mainly tools like converters) */
|
|
|
|
/* can need more than one slot to ease their */
|
|
|
|
/* task. */
|
|
|
|
/* */
|
|
|
|
/* sizes_list :: The list of child sizes for this face. */
|
|
|
|
/* */
|
2000-05-29 22:46:12 +02:00
|
|
|
/* max_points :: The maximal number of points used to store */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* the vectorial outline of any glyph in this */
|
|
|
|
/* face. If this value cannot be known in */
|
|
|
|
/* advance, or if the face isn't scalable, */
|
|
|
|
/* this should be set to 0. Only relevant for */
|
|
|
|
/* scalable formats. */
|
|
|
|
/* */
|
2000-05-29 22:46:12 +02:00
|
|
|
/* max_contours :: The maximal number of contours used to */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* store the vectorial outline of any glyph in */
|
|
|
|
/* this face. If this value cannot be known */
|
|
|
|
/* in advance, or if the face isn't scalable, */
|
|
|
|
/* this should be set to 0. Only relevant for */
|
|
|
|
/* scalable formats. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* transform_matrix :: A 2x2 matrix of 16.16 coefficients used */
|
|
|
|
/* to transform glyph outlines after they are */
|
|
|
|
/* loaded from the font. Only used by the */
|
2000-03-28 13:22:31 +02:00
|
|
|
/* convenience functions. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* transform_delta :: A translation vector used to transform */
|
|
|
|
/* glyph outlines after they are loaded from */
|
|
|
|
/* the font. Only used by the convenience */
|
2000-03-28 13:22:31 +02:00
|
|
|
/* functions. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* transform_flags :: Some flags used to classify the transform. */
|
2000-03-28 13:22:31 +02:00
|
|
|
/* Only used by the convenience functions. */
|
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
typedef struct FT_FaceRec_
|
|
|
|
{
|
|
|
|
FT_Long num_faces;
|
|
|
|
FT_Long face_index;
|
|
|
|
|
|
|
|
FT_Long face_flags;
|
|
|
|
FT_Long style_flags;
|
|
|
|
|
|
|
|
FT_Long num_glyphs;
|
|
|
|
|
|
|
|
FT_String* family_name;
|
|
|
|
FT_String* style_name;
|
|
|
|
|
|
|
|
FT_Int num_fixed_sizes;
|
|
|
|
FT_Bitmap_Size* available_sizes;
|
|
|
|
|
2000-03-28 13:22:31 +02:00
|
|
|
FT_Int num_charmaps;
|
|
|
|
FT_CharMap* charmaps;
|
|
|
|
|
|
|
|
FT_Generic generic;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-10-23 20:33:30 +02:00
|
|
|
/*# the following are only relevant for scalable outlines */
|
1999-12-17 00:11:37 +01:00
|
|
|
FT_BBox bbox;
|
|
|
|
|
|
|
|
FT_UShort units_per_EM;
|
|
|
|
FT_Short ascender;
|
|
|
|
FT_Short descender;
|
|
|
|
FT_Short height;
|
|
|
|
|
|
|
|
FT_Short max_advance_width;
|
|
|
|
FT_Short max_advance_height;
|
|
|
|
|
|
|
|
FT_Short underline_position;
|
|
|
|
FT_Short underline_thickness;
|
|
|
|
|
2000-06-07 22:22:44 +02:00
|
|
|
FT_GlyphSlot glyph;
|
|
|
|
FT_Size size;
|
|
|
|
|
2000-10-23 20:33:30 +02:00
|
|
|
/*@private begin */
|
2000-03-28 13:22:31 +02:00
|
|
|
|
|
|
|
FT_Driver driver;
|
|
|
|
FT_Memory memory;
|
|
|
|
FT_Stream stream;
|
|
|
|
|
|
|
|
FT_CharMap charmap;
|
|
|
|
FT_ListRec sizes_list;
|
|
|
|
|
2000-06-30 03:31:22 +02:00
|
|
|
FT_Generic autohint;
|
2000-03-28 13:22:31 +02:00
|
|
|
void* extensions;
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
FT_UShort max_points;
|
|
|
|
FT_Short max_contours;
|
|
|
|
|
2000-03-28 13:22:31 +02:00
|
|
|
FT_Matrix transform_matrix;
|
|
|
|
FT_Vector transform_delta;
|
|
|
|
FT_Int transform_flags;
|
|
|
|
|
2000-10-23 20:33:30 +02:00
|
|
|
/*@private end */
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
} FT_FaceRec;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_FACE_FLAG_SCALABLE */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used to indicate that a given face provides */
|
|
|
|
/* vectorial outlines (i.e., TrueType or Type1). This doesn't */
|
|
|
|
/* prevent embedding of bitmap strikes though, i.e., a given face can */
|
|
|
|
/* have both this bit set, and a `num_fixed_sizes' property > 0. */
|
|
|
|
/* */
|
|
|
|
#define FT_FACE_FLAG_SCALABLE 1
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FT_FACE_FLAG_FIXED_SIZES */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used to indicate that a given face contains */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* `fixed sizes', i.e., bitmap strikes for some given pixel sizes. */
|
|
|
|
/* See the `num_fixed_sizes' and `available_sizes' face properties */
|
|
|
|
/* for more information. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
#define FT_FACE_FLAG_FIXED_SIZES 2
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_FACE_FLAG_FIXED_WIDTH */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used to indicate that a given face contains */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* fixed-width characters (like Courier, Lucida, MonoType, etc.). */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
#define FT_FACE_FLAG_FIXED_WIDTH 4
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_FACE_FLAG_SFNT */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used to indicate that a given face uses the */
|
|
|
|
/* `sfnt' storage fomat. For now, this means TrueType or OpenType. */
|
|
|
|
/* */
|
|
|
|
#define FT_FACE_FLAG_SFNT 8
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_FACE_FLAG_HORIZONTAL */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used to indicate that a given face contains */
|
|
|
|
/* horizontal glyph metrics. This should be set for all common */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* formats, but who knows. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
#define FT_FACE_FLAG_HORIZONTAL 0x10
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_FACE_FLAG_VERTICAL */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used to indicate that a given face contains */
|
|
|
|
/* vertical glyph metrics. If not set, the glyph loader will */
|
|
|
|
/* synthetize vertical metrics itself to help display vertical text */
|
|
|
|
/* correctly. */
|
|
|
|
/* */
|
|
|
|
#define FT_FACE_FLAG_VERTICAL 0x20
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_FACE_FLAG_KERNING */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used to indicate that a given face contains */
|
|
|
|
/* kerning information. When set, this information can be retrieved */
|
|
|
|
/* through the function FT_Get_Kerning(). Note that when unset, this */
|
|
|
|
/* function will always return the kerning vector (0,0). */
|
|
|
|
/* */
|
|
|
|
#define FT_FACE_FLAG_KERNING 0x40
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_FACE_FLAG_FAST_GLYPHS */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used to indicate that the glyphs in a given */
|
|
|
|
/* font can be retrieved very quickly, and that a glyph cache is thus */
|
|
|
|
/* not necessary for any of its child size objects. */
|
|
|
|
/* */
|
|
|
|
/* This flag should really be set for fixed-size formats like FNT, */
|
|
|
|
/* where each glyph bitmap is available directly in binary form */
|
|
|
|
/* without any kind of compression. */
|
|
|
|
/* */
|
|
|
|
#define FT_FACE_FLAG_FAST_GLYPHS 0x80
|
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
|
2000-05-26 19:13:23 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_FACE_FLAG_MULTIPLE_MASTERS */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used to indicate that the font contains */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* multiple masters and is capable of interpolating between them. */
|
2000-05-26 19:13:23 +02:00
|
|
|
/* */
|
|
|
|
#define FT_FACE_FLAG_MULTIPLE_MASTERS 0x100
|
|
|
|
|
2000-07-20 08:57:41 +02:00
|
|
|
|
2000-07-19 19:13:03 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_FACE_FLAG_GLYPH_NAMES */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used to indicate that the font contains */
|
2000-07-20 08:57:41 +02:00
|
|
|
/* glyph names that can be retrieved through FT_Get_Glyph_Name(). */
|
2000-07-19 19:13:03 +02:00
|
|
|
/* */
|
|
|
|
#define FT_FACE_FLAG_GLYPH_NAMES 0x200
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-07-20 08:57:41 +02:00
|
|
|
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_FACE_FLAG_EXTERNAL_STREAM */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* This bit field is used internally by FreeType to indicate that */
|
|
|
|
/* a face's stream was provided by the client application and should */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* not be destroyed by FT_Done_Face(). */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
|
|
|
#define FT_FACE_FLAG_EXTERNAL_STREAM 0x4000
|
|
|
|
|
2000-10-23 20:33:30 +02:00
|
|
|
/* */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
#define FT_HAS_HORIZONTAL( face ) \
|
|
|
|
( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
|
2000-10-23 20:33:30 +02:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
#define FT_HAS_VERTICAL( face ) \
|
|
|
|
( face->face_flags & FT_FACE_FLAG_VERTICAL )
|
2000-10-23 20:33:30 +02:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
#define FT_HAS_KERNING( face ) \
|
|
|
|
( face->face_flags & FT_FACE_FLAG_KERNING )
|
2000-10-23 20:33:30 +02:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
#define FT_IS_SCALABLE( face ) \
|
|
|
|
( face->face_flags & FT_FACE_FLAG_SCALABLE )
|
2000-10-23 20:33:30 +02:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
#define FT_IS_SFNT( face ) \
|
|
|
|
( face->face_flags & FT_FACE_FLAG_SFNT )
|
2000-10-23 20:33:30 +02:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
#define FT_IS_FIXED_WIDTH( face ) \
|
|
|
|
( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
|
2000-10-23 20:33:30 +02:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
#define FT_HAS_FIXED_SIZES( face ) \
|
|
|
|
( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
|
2000-10-23 20:33:30 +02:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
#define FT_HAS_FAST_GLYPHS( face ) \
|
|
|
|
( face->face_flags & FT_FACE_FLAG_FAST_GLYPHS )
|
2000-10-23 20:33:30 +02:00
|
|
|
|
2000-07-19 19:13:03 +02:00
|
|
|
#define FT_HAS_GLYPH_NAMES( face ) \
|
|
|
|
( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
|
2000-07-09 21:15:30 +02:00
|
|
|
|
|
|
|
#define FT_HAS_MULTIPLE_MASTERS( face ) \
|
|
|
|
( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_STYLE_FLAG_ITALIC */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used to indicate that a given face is */
|
|
|
|
/* italicized. */
|
|
|
|
/* */
|
|
|
|
#define FT_STYLE_FLAG_ITALIC 1
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_STYLE_FLAG_BOLD */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used to indicate that a given face is */
|
|
|
|
/* emboldened. */
|
|
|
|
/* */
|
|
|
|
#define FT_STYLE_FLAG_BOLD 2
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* FreeType base size metrics */
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FT_Size_Metrics */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* The size metrics structure returned scaled important distances for */
|
|
|
|
/* a given size object. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* x_ppem :: The character width, expressed in integer pixels. */
|
|
|
|
/* This is the width of the EM square expressed in */
|
|
|
|
/* pixels, hence the term `ppem' (pixels per EM). */
|
|
|
|
/* */
|
|
|
|
/* y_ppem :: The character height, expressed in integer pixels. */
|
|
|
|
/* This is the height of the EM square expressed in */
|
|
|
|
/* pixels, hence the term `ppem' (pixels per EM). */
|
|
|
|
/* */
|
|
|
|
/* x_scale :: A simple 16.16 fixed point format coefficient used */
|
|
|
|
/* to scale horizontal distances expressed in font */
|
|
|
|
/* units to fractional (26.6) pixel coordinates. */
|
|
|
|
/* */
|
|
|
|
/* y_scale :: A simple 16.16 fixed point format coefficient used */
|
|
|
|
/* to scale vertical distances expressed in font */
|
|
|
|
/* units to fractional (26.6) pixel coordinates. */
|
|
|
|
/* */
|
|
|
|
/* x_resolution :: The horizontal device resolution for this size */
|
|
|
|
/* object, expressed in integer dots per inches */
|
|
|
|
/* (dpi). As a convention, fixed font formats set */
|
|
|
|
/* this value to 72. */
|
|
|
|
/* */
|
|
|
|
/* y_resolution :: The vertical device resolution for this size */
|
|
|
|
/* object, expressed in integer dots per inches */
|
|
|
|
/* (dpi). As a convention, fixed font formats set */
|
|
|
|
/* this value to 72. */
|
|
|
|
/* */
|
|
|
|
/* ascender :: The ascender, expressed in 26.6 fixed point */
|
|
|
|
/* pixels. Always positive. */
|
|
|
|
/* */
|
|
|
|
/* descender :: The descender, expressed in 26.6 fixed point */
|
|
|
|
/* pixels. Always positive. */
|
|
|
|
/* */
|
|
|
|
/* height :: The text height, expressed in 26.6 fixed point */
|
|
|
|
/* pixels. Always positive. */
|
|
|
|
/* */
|
|
|
|
/* max_advance :: Maximum horizontal advance, expressed in 26.6 */
|
|
|
|
/* fixed point pixels. Always positive. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* The values of `ascender', `descender', and `height' are only the */
|
|
|
|
/* scaled versions of `face->ascender', `face->descender', and */
|
|
|
|
/* `face->height'. */
|
2000-06-01 08:01:59 +02:00
|
|
|
/* */
|
|
|
|
/* Unfortunately, due to glyph hinting, these values might not be */
|
|
|
|
/* exact for certain fonts, they thus must be treated as unreliable */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* with an error margin of at least one pixel! */
|
2000-06-01 08:01:59 +02:00
|
|
|
/* */
|
|
|
|
/* Indeed, the only way to get the exact pixel ascender and descender */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* is to render _all_ glyphs. As this would be a definite */
|
|
|
|
/* performance hit, it is up to client applications to perform such */
|
|
|
|
/* computations. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
typedef struct FT_Size_Metrics_
|
|
|
|
{
|
|
|
|
FT_UShort x_ppem; /* horizontal pixels per EM */
|
|
|
|
FT_UShort y_ppem; /* vertical pixels per EM */
|
|
|
|
|
|
|
|
FT_Fixed x_scale; /* two scales used to convert font units */
|
|
|
|
FT_Fixed y_scale; /* to 26.6 frac. pixel coordinates.. */
|
|
|
|
|
|
|
|
FT_Pos ascender; /* ascender in 26.6 frac. pixels */
|
|
|
|
FT_Pos descender; /* descender in 26.6 frac. pixels */
|
|
|
|
FT_Pos height; /* text height in 26.6 frac. pixels */
|
|
|
|
FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */
|
|
|
|
|
|
|
|
} FT_Size_Metrics;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* FreeType base size class */
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FT_SizeRec */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* FreeType root size class structure. A size object models the */
|
|
|
|
/* resolution and pointsize dependent data of a given face. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* face :: Handle to the parent face object. */
|
|
|
|
/* */
|
|
|
|
/* generic :: A typeless pointer, which is unused by the FreeType */
|
|
|
|
/* library or any of its drivers. It can be used by */
|
|
|
|
/* client applications to link their own data to each size */
|
|
|
|
/* object. */
|
|
|
|
/* */
|
|
|
|
/* metrics :: Metrics for this size object. This field is read-only. */
|
|
|
|
/* */
|
|
|
|
typedef struct FT_SizeRec_
|
|
|
|
{
|
|
|
|
FT_Face face; /* parent face object */
|
|
|
|
FT_Generic generic; /* generic pointer for client uses */
|
|
|
|
FT_Size_Metrics metrics; /* size metrics */
|
|
|
|
|
|
|
|
} FT_SizeRec;
|
|
|
|
|
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FT_SubGlyph */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* The subglyph structure is an internal object used to describe */
|
|
|
|
/* subglyphs (for example, in the case of composites). */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* The subglyph implementation is not part of the high-level API, */
|
|
|
|
/* hence the forward structure declaration. */
|
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
typedef struct FT_SubGlyph_ FT_SubGlyph;
|
2000-04-04 18:46:12 +02:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FT_GlyphLoader */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* The glyph loader is an internal object used to load several glyphs */
|
|
|
|
/* together (for example, in the case of composites). */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* The glyph loader implementation is not part of the high-level API, */
|
|
|
|
/* hence the forward structure declaration. */
|
|
|
|
/* */
|
|
|
|
typedef struct FT_GlyphLoader_ FT_GlyphLoader;
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
|
2000-07-10 16:24:26 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* FreeType Glyph Slot base class */
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FT_GlyphSlotRec */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FreeType root glyph slot class structure. A glyph slot is a */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* container where individual glyphs can be loaded, be they */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* vectorial or bitmap/graymaps. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* library :: A handle to the FreeType library instance */
|
|
|
|
/* this slot belongs to. */
|
2000-07-01 01:12:55 +02:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* face :: A handle to the parent face object. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* next :: In some cases (like some font tools), several */
|
|
|
|
/* glyph slots per face object can be a good */
|
|
|
|
/* thing. As this is rare, the glyph slots are */
|
|
|
|
/* listed through a direct, single-linked list */
|
|
|
|
/* using its `next' field. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* generic :: A typeless pointer which is unused by the */
|
|
|
|
/* FreeType library or any of its drivers. It */
|
|
|
|
/* can be used by client applications to link */
|
|
|
|
/* their own data to each size object. */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* metrics :: The metrics of the last loaded glyph in the */
|
|
|
|
/* slot. The returned values depend on the last */
|
|
|
|
/* load flags (see the FT_Load_Glyph() API */
|
|
|
|
/* function) and can be expressed either in 26.6 */
|
|
|
|
/* fractional pixels or font units. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Note that even when the glyph image is */
|
|
|
|
/* transformed, the metrics are not. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* linearHoriAdvance :: For scalable formats only, this field holds */
|
|
|
|
/* the linearly scaled horizontal advance width */
|
|
|
|
/* for the glyph (i.e. the scaled and unhinted */
|
2000-10-07 17:51:50 +02:00
|
|
|
/* value of the hori advance). This can be */
|
|
|
|
/* important to perform correct WYSIWYG layout. */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
|
|
|
/* Note that this value is expressed by default */
|
|
|
|
/* in 16.16 pixels. However, when the glyph is */
|
2000-10-07 17:51:50 +02:00
|
|
|
/* loaded with the FT_LOAD_LINEAR_DESIGN flag, */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* this field contains simply the value of the */
|
|
|
|
/* advance in original font units. */
|
|
|
|
/* */
|
|
|
|
/* linearVertAdvance :: For scalable formats only, this field holds */
|
|
|
|
/* the linearly scaled vertical advance height */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* for the glyph. See linearHoriAdvance for */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* comments. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* advance :: This is the transformed advance width for the */
|
|
|
|
/* glyph. */
|
|
|
|
/* */
|
|
|
|
/* format :: This field indicates the format of the image */
|
|
|
|
/* contained in the glyph slot. Typically */
|
|
|
|
/* ft_glyph_format_bitmap, */
|
|
|
|
/* ft_glyph_format_outline, and */
|
|
|
|
/* ft_glyph_format_composite, but others are */
|
|
|
|
/* possible. */
|
|
|
|
/* */
|
|
|
|
/* bitmap :: This field is used as a bitmap descriptor */
|
|
|
|
/* when the slot format is */
|
|
|
|
/* ft_glyph_format_bitmap. Note that the */
|
|
|
|
/* address and content of the bitmap buffer can */
|
|
|
|
/* change between calls of FT_Load_Glyph() and a */
|
|
|
|
/* few other functions. */
|
|
|
|
/* */
|
|
|
|
/* bitmap_left :: This is the bitmap's left bearing expressed */
|
|
|
|
/* in integer pixels. Of course, this is only */
|
|
|
|
/* valid if the format is */
|
|
|
|
/* ft_glyph_format_bitmap. */
|
|
|
|
/* */
|
|
|
|
/* bitmap_top :: This is the bitmap's top bearing expressed in */
|
|
|
|
/* integer pixels. Remember that this is the */
|
|
|
|
/* distance from the baseline to the top-most */
|
|
|
|
/* glyph scanline, upwards y-coordinates being */
|
|
|
|
/* *positive*. */
|
|
|
|
/* */
|
|
|
|
/* outline :: The outline descriptor for the current glyph */
|
|
|
|
/* image if its format is */
|
|
|
|
/* ft_glyph_bitmap_outline. */
|
|
|
|
/* */
|
|
|
|
/* num_subglyphs :: The number of subglyphs in a composite glyph. */
|
|
|
|
/* This format is only valid for the composite */
|
|
|
|
/* glyph format, that should normally only be */
|
|
|
|
/* loaded with the FT_LOAD_NO_RECURSE flag. */
|
|
|
|
/* */
|
|
|
|
/* subglyphs :: An array of subglyph descriptors for */
|
|
|
|
/* composite glyphs. There are `num_subglyphs' */
|
|
|
|
/* elements in there. */
|
|
|
|
/* */
|
|
|
|
/* control_data :: Certain font drivers can also return the */
|
|
|
|
/* control data for a given glyph image (e.g. */
|
|
|
|
/* TrueType bytecode, Type 1 charstrings, etc.). */
|
|
|
|
/* This field is a pointer to such data. */
|
|
|
|
/* */
|
|
|
|
/* control_len :: This is the length in bytes of the control */
|
|
|
|
/* data. */
|
|
|
|
/* */
|
|
|
|
/* other :: Really wicked formats can use this pointer to */
|
|
|
|
/* present their own glyph image to client apps. */
|
|
|
|
/* Note that the app will need to know about the */
|
|
|
|
/* image format. */
|
|
|
|
/* */
|
|
|
|
/* loader :: This is a private object for the glyph slot. */
|
|
|
|
/* Do not touch this. */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* If FT_Load_Glyph() is called with default flags (FT_LOAD_DEFAULT), */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* the glyph image is loaded in the glyph slot in its native format */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* (e.g. a vectorial outline for TrueType and Type 1 formats). */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
|
|
|
/* This image can later be converted into a bitmap by calling */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FT_Render_Glyph(). This function finds the current renderer for */
|
|
|
|
/* the native image's format then invokes it. */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
|
|
|
/* The renderer is in charge of transforming the native image through */
|
|
|
|
/* the slot's face transformation fields, then convert it into a */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* bitmap that is returned in `slot->bitmap'. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */
|
|
|
|
/* to specify the position of the bitmap relative to the current pen */
|
|
|
|
/* position (e.g. coordinates [0,0] on the baseline). Of course, */
|
|
|
|
/* `slot->format' is also changed to `ft_glyph_format_bitmap' . */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
typedef struct FT_GlyphSlotRec_
|
|
|
|
{
|
2000-07-01 01:12:55 +02:00
|
|
|
FT_Library library;
|
1999-12-17 00:11:37 +01:00
|
|
|
FT_Face face;
|
|
|
|
FT_GlyphSlot next;
|
2000-05-12 17:26:58 +02:00
|
|
|
FT_UInt flags;
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
FT_Generic generic;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
FT_Glyph_Metrics metrics;
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
FT_Fixed linearHoriAdvance;
|
|
|
|
FT_Fixed linearVertAdvance;
|
|
|
|
FT_Vector advance;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-03-28 13:22:31 +02:00
|
|
|
FT_Glyph_Format format;
|
2000-07-10 16:24:26 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
FT_Bitmap bitmap;
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
FT_Int bitmap_left;
|
|
|
|
FT_Int bitmap_top;
|
2000-07-10 16:24:26 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
FT_Outline outline;
|
2000-04-04 18:46:12 +02:00
|
|
|
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
FT_UInt num_subglyphs;
|
1999-12-17 00:11:37 +01:00
|
|
|
FT_SubGlyph* subglyphs;
|
|
|
|
|
|
|
|
void* control_data;
|
2000-04-25 18:08:33 +02:00
|
|
|
long control_len;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
void* other;
|
|
|
|
|
2000-10-24 07:44:59 +02:00
|
|
|
/*@private begin */
|
|
|
|
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
FT_GlyphLoader* loader;
|
2000-10-24 07:44:59 +02:00
|
|
|
|
|
|
|
/*@private end */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
} FT_GlyphSlotRec;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* F U N C T I O N S */
|
|
|
|
/* */
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Init_FreeType */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Initializes a new FreeType library object. The set of drivers */
|
|
|
|
/* that are registered by this function is determined at build time. */
|
|
|
|
/* */
|
|
|
|
/* <Output> */
|
|
|
|
/* library :: A handle to a new library object. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Init_FreeType( FT_Library* library );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Done_FreeType */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Destroys a given FreeType library object and all of its childs, */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* including resources, drivers, faces, sizes, etc. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* library :: A handle to the target library object. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Done_FreeType( FT_Library library );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
2000-03-28 13:22:31 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* <Enum> */
|
2000-05-12 12:19:41 +02:00
|
|
|
/* FT_Open_Flags */
|
2000-03-28 13:22:31 +02:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* An enumeration used to list the bit flags used within */
|
|
|
|
/* FT_Open_Args(). */
|
2000-03-28 13:22:31 +02:00
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* ft_open_memory :: This is a memory-based stream. */
|
2000-03-28 13:22:31 +02:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* ft_open_stream :: Copy the stream from the `stream' field. */
|
|
|
|
/* */
|
|
|
|
/* ft_open_pathname :: Create a new input stream from a C pathname. */
|
|
|
|
/* */
|
|
|
|
/* ft_open_driver :: Use the `driver' field. */
|
|
|
|
/* */
|
|
|
|
/* ft_open_params :: Use the `num_params' & `params' field. */
|
|
|
|
/* */
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
ft_open_memory = 1,
|
|
|
|
ft_open_stream = 2,
|
|
|
|
ft_open_pathname = 4,
|
|
|
|
ft_open_driver = 8,
|
|
|
|
ft_open_params = 16
|
2000-04-04 18:46:12 +02:00
|
|
|
|
2000-05-12 12:19:41 +02:00
|
|
|
} FT_Open_Flags;
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* <Struct> */
|
2000-05-12 12:19:41 +02:00
|
|
|
/* FT_Parameter */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A simple structure used to pass more or less generic parameters */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* to FT_Open_Face(). */
|
2000-05-12 12:19:41 +02:00
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* tag :: A 4-byte identification tag. */
|
|
|
|
/* */
|
|
|
|
/* data :: A pointer to the parameter data. */
|
2000-05-12 12:19:41 +02:00
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* The id and function of parameters are driver-specific. */
|
2000-05-12 12:19:41 +02:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
typedef struct FT_Parameter_
|
2000-05-12 12:19:41 +02:00
|
|
|
{
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_ULong tag;
|
|
|
|
FT_Pointer data;
|
2000-05-12 12:19:41 +02:00
|
|
|
|
|
|
|
} FT_Parameter;
|
2000-03-28 13:22:31 +02:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Struct> */
|
|
|
|
/* FT_Open_Args */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A structure used to indicate how to open a new font file/stream. */
|
|
|
|
/* A pointer to such a structure can be used as a parameter for the */
|
|
|
|
/* functions FT_Open_Face() & FT_Attach_Stream(). */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* flags :: A set of bit flags indicating how to use the */
|
|
|
|
/* structure. */
|
|
|
|
/* */
|
|
|
|
/* memory_base :: The first byte of the file in memory. */
|
|
|
|
/* */
|
|
|
|
/* memory_size :: The size in bytes of the file in memory. */
|
|
|
|
/* */
|
|
|
|
/* pathname :: A pointer to an 8-bit file pathname. */
|
|
|
|
/* */
|
|
|
|
/* stream :: A handle to a source stream object. */
|
|
|
|
/* */
|
|
|
|
/* driver :: This field is exclusively used by FT_Open_Face(); */
|
|
|
|
/* it simply specifies the font driver to use to open */
|
|
|
|
/* the face. If set to 0, FreeType will try to load */
|
|
|
|
/* the face with each one of the drivers in its list. */
|
|
|
|
/* */
|
|
|
|
/* num_params :: The number of extra parameters. */
|
|
|
|
/* */
|
|
|
|
/* params :: Extra parameters passed to the font driver when */
|
|
|
|
/* opening a new face. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* `stream_type' determines which fields are used to create a new */
|
|
|
|
/* input stream. */
|
|
|
|
/* */
|
|
|
|
/* If it is `ft_stream_memory', a new memory-based stream will be */
|
|
|
|
/* created using the memory block specified by `memory_base' and */
|
|
|
|
/* `memory_size'. */
|
|
|
|
/* */
|
|
|
|
/* If it is `ft_stream_pathname', a new stream will be created with */
|
|
|
|
/* the `pathname' field, calling the system-specific FT_New_Stream() */
|
|
|
|
/* function. */
|
|
|
|
/* */
|
|
|
|
/* If is is `ft_stream_copy', then the content of `stream' will be */
|
|
|
|
/* copied to a new input stream object. The object will be closed */
|
|
|
|
/* and destroyed when the face is destroyed itself. Note that this */
|
|
|
|
/* means that you should not close the stream before the library */
|
|
|
|
/* does! */
|
|
|
|
/* */
|
|
|
|
typedef struct FT_Open_Args_
|
2000-02-10 18:03:11 +01:00
|
|
|
{
|
2000-05-12 12:19:41 +02:00
|
|
|
FT_Open_Flags flags;
|
|
|
|
FT_Byte* memory_base;
|
|
|
|
FT_Long memory_size;
|
|
|
|
FT_String* pathname;
|
|
|
|
FT_Stream stream;
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
FT_Module driver;
|
2000-05-12 12:19:41 +02:00
|
|
|
FT_Int num_params;
|
|
|
|
FT_Parameter* params;
|
2000-02-13 14:35:21 +01:00
|
|
|
|
2000-02-10 18:03:11 +01:00
|
|
|
} FT_Open_Args;
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* FT_New_Face */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Creates a new face object from a given resource and typeface index */
|
|
|
|
/* using a pathname to the font file. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* <InOut> */
|
|
|
|
/* library :: A handle to the library resource. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* <Input> */
|
|
|
|
/* pathname :: A path to the font file. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* face_index :: The index of the face within the resource. The */
|
|
|
|
/* first face has index 0. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* <Output> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* aface :: A handle to a new face object. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Unlike FreeType 1.x, this function automatically creates a glyph */
|
|
|
|
/* slot for the face object which can be accessed directly through */
|
|
|
|
/* `face->glyph'. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Note that additional slots can be added to each face with the */
|
|
|
|
/* FT_New_GlyphSlot() API function. Slots are linked in a single */
|
|
|
|
/* list through their `next' field. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FT_New_Face() can be used to determine and/or check the font */
|
|
|
|
/* format of a given font resource. If the `face_index' field is */
|
|
|
|
/* negative, the function will _not_ return any face handle in */
|
|
|
|
/* `*face'. Its return value should be 0 if the resource is */
|
|
|
|
/* recognized, or non-zero if not. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_New_Face( FT_Library library,
|
|
|
|
const char* filepathname,
|
|
|
|
FT_Long face_index,
|
|
|
|
FT_Face* face );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
2000-05-12 12:19:41 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_New_Memory_Face */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Creates a new face object from a given resource and typeface index */
|
|
|
|
/* using a font file already loaded into memory. */
|
|
|
|
/* */
|
|
|
|
/* <InOut> */
|
|
|
|
/* library :: A handle to the library resource. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* file_base :: A pointer to the beginning of the font data. */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* */
|
2000-05-12 12:19:41 +02:00
|
|
|
/* file_size :: The size of the memory chunk used by the font data. */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* */
|
2000-05-12 12:19:41 +02:00
|
|
|
/* face_index :: The index of the face within the resource. The */
|
|
|
|
/* first face has index 0. */
|
|
|
|
/* <Output> */
|
|
|
|
/* face :: A handle to a new face object. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* Unlike FreeType 1.x, this function automatically creates a glyph */
|
|
|
|
/* slot for the face object which can be accessed directly through */
|
|
|
|
/* `face->glyph'. */
|
|
|
|
/* */
|
|
|
|
/* Note that additional slots can be added to each face with the */
|
|
|
|
/* FT_New_GlyphSlot() API function. Slots are linked in a single */
|
|
|
|
/* list through their `next' field. */
|
|
|
|
/* */
|
|
|
|
/* FT_New_Memory_Face() can be used to determine and/or check the */
|
|
|
|
/* font format of a given font resource. If the `face_index' field */
|
|
|
|
/* is negative, the function will _not_ return any face handle in */
|
|
|
|
/* `*face'. Its return value should be 0 if the resource is */
|
|
|
|
/* recognized, or non-zero if not. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_New_Memory_Face( FT_Library library,
|
|
|
|
FT_Byte* file_base,
|
|
|
|
FT_Long file_size,
|
|
|
|
FT_Long face_index,
|
|
|
|
FT_Face* face );
|
2000-05-12 12:19:41 +02:00
|
|
|
|
|
|
|
|
2000-02-10 18:03:11 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Open_Face */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Opens a face object from a given resource and typeface index using */
|
|
|
|
/* an `FT_Open_Args' structure. If the face object doesn't exist, it */
|
|
|
|
/* will be created. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* <InOut> */
|
|
|
|
/* library :: A handle to the library resource. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* <Input> */
|
|
|
|
/* args :: A pointer to an `FT_Open_Args' structure which must */
|
|
|
|
/* be filled by the caller. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* face_index :: The index of the face within the resource. The */
|
|
|
|
/* first face has index 0. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* <Output> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* aface :: A handle to a new face object. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Unlike FreeType 1.x, this function automatically creates a glyph */
|
|
|
|
/* slot for the face object which can be accessed directly through */
|
|
|
|
/* `face->glyph'. */
|
|
|
|
/* */
|
|
|
|
/* Note that additional slots can be added to each face with the */
|
|
|
|
/* FT_New_GlyphSlot() API function. Slots are linked in a single */
|
|
|
|
/* list through their `next' field. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FT_Open_Face() can be used to determine and/or check the font */
|
|
|
|
/* format of a given font resource. If the `face_index' field is */
|
|
|
|
/* negative, the function will _not_ return any face handle in */
|
|
|
|
/* `*face'. Its return value should be 0 if the resource is */
|
|
|
|
/* recognized, or non-zero if not. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Open_Face( FT_Library library,
|
|
|
|
FT_Open_Args* args,
|
|
|
|
FT_Long face_index,
|
|
|
|
FT_Face* face );
|
2000-02-10 18:03:11 +01:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-02-10 18:03:11 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Attach_File */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* `Attaches' a given font file to an existing face. This is usually */
|
|
|
|
/* to read additional information for a single face object. For */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* example, it is used to read the AFM files that come with Type 1 */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* fonts in order to add kerning data and other metrics. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* <InOut> */
|
|
|
|
/* face :: The target face object. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* <Input> */
|
|
|
|
/* filepathname :: An 8-bit pathname naming the `metrics' file. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* If your font file is in memory, or if you want to provide your */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* own input stream object, use FT_Attach_Stream(). */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* The meaning of the `attach' action (i.e., what really happens when */
|
|
|
|
/* the new file is read) is not fixed by FreeType itself. It really */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* depends on the font format (and thus the font driver). */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Client applications are expected to know what they are doing */
|
|
|
|
/* when invoking this function. Most drivers simply do not implement */
|
|
|
|
/* file attachments. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Attach_File( FT_Face face,
|
|
|
|
const char* filepathname );
|
|
|
|
|
2000-04-04 18:46:12 +02:00
|
|
|
|
2000-02-10 18:03:11 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Attach_Stream */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* This function is similar to FT_Attach_File() with the exception */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* that it reads the attachment from an arbitrary stream. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* face :: The target face object. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* parameters :: A pointer to an FT_Open_Args structure used to */
|
|
|
|
/* describe the input stream to FreeType. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* <Return> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* <Note> */
|
|
|
|
/* The meaning of the `attach' (i.e. what really happens when the */
|
|
|
|
/* new file is read) is not fixed by FreeType itself. It really */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* depends on the font format (and thus the font driver). */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Client applications are expected to know what they are doing */
|
|
|
|
/* when invoking this function. Most drivers simply do not implement */
|
|
|
|
/* file attachments. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Attach_Stream( FT_Face face,
|
|
|
|
FT_Open_Args* parameters );
|
2000-02-10 18:03:11 +01:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Done_Face */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Discards a given face object, as well as all of its child slots */
|
|
|
|
/* and sizes. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* face :: A handle to a target face object. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Done_Face( FT_Face face );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Set_Char_Size */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Sets the character dimensions of a given face object. The */
|
|
|
|
/* `char_width' and `char_height' values are used for the width and */
|
|
|
|
/* height, respectively, expressed in 26.6 fractional points. */
|
|
|
|
/* */
|
|
|
|
/* If the horizontal or vertical resolution values are zero, a */
|
|
|
|
/* default value of 72dpi is used. Similarly, if one of the */
|
|
|
|
/* character dimensions is zero, its value is set equal to the other. */
|
|
|
|
/* */
|
|
|
|
/* <InOut> */
|
|
|
|
/* size :: A handle to a target size object. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* char_width :: The character width, in 26.6 fractional points. */
|
|
|
|
/* */
|
|
|
|
/* char_height :: The character height, in 26.6 fractional */
|
|
|
|
/* points. */
|
|
|
|
/* */
|
|
|
|
/* horz_resolution :: The horizontal resolution. */
|
|
|
|
/* */
|
|
|
|
/* vert_resolution :: The vertical resolution. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* When dealing with fixed-size faces (i.e., non-scalable formats), */
|
|
|
|
/* use the function FT_Set_Pixel_Sizes(). */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Set_Char_Size( FT_Face face,
|
|
|
|
FT_F26Dot6 char_width,
|
|
|
|
FT_F26Dot6 char_height,
|
|
|
|
FT_UInt horz_resolution,
|
|
|
|
FT_UInt vert_resolution );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Set_Pixel_Sizes */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Sets the character dimensions of a given face object. The width */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* and height are expressed in integer pixels. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* If one of the character dimensions is zero, its value is set equal */
|
|
|
|
/* to the other. */
|
|
|
|
/* */
|
|
|
|
/* <InOut> */
|
|
|
|
/* face :: A handle to the target face object. */
|
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* <Input> */
|
|
|
|
/* pixel_width :: The character width, in integer pixels. */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* pixel_height :: The character height, in integer pixels. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Set_Pixel_Sizes( FT_Face face,
|
|
|
|
FT_UInt pixel_width,
|
|
|
|
FT_UInt pixel_height );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Load_Glyph */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A function used to load a single glyph within a given glyph slot, */
|
|
|
|
/* for a given size. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* face :: A handle to the target face object where the glyph */
|
|
|
|
/* will be loaded. */
|
|
|
|
/* */
|
|
|
|
/* glyph_index :: The index of the glyph in the font file. */
|
|
|
|
/* */
|
|
|
|
/* load_flags :: A flag indicating what to load for this glyph. The */
|
|
|
|
/* FT_LOAD_XXX constants can be used to control the */
|
|
|
|
/* glyph loading process (e.g., whether the outline */
|
|
|
|
/* should be scaled, whether to load bitmaps or not, */
|
|
|
|
/* whether to hint the outline, etc). */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* <Note> */
|
|
|
|
/* If the glyph image is not a bitmap, and if the bit flag */
|
|
|
|
/* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image will be */
|
|
|
|
/* transformed with the information passed to a previous call to */
|
|
|
|
/* FT_Set_Transform. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Note that this also transforms the `face.glyph.advance' field, but */
|
|
|
|
/* *not* the values in `face.glyph.metrics'. */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Load_Glyph( FT_Face face,
|
|
|
|
FT_UInt glyph_index,
|
|
|
|
FT_Int load_flags );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Load_Char */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A function used to load a single glyph within a given glyph slot, */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* for a given size, according to its character code. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* face :: A handle to a target face object where the glyph */
|
|
|
|
/* will be loaded. */
|
|
|
|
/* */
|
|
|
|
/* char_code :: The glyph's character code, according to the */
|
|
|
|
/* current charmap used in the face. */
|
|
|
|
/* */
|
|
|
|
/* load_flags :: A flag indicating what to load for this glyph. The */
|
|
|
|
/* FT_LOAD_XXX constants can be used to control the */
|
|
|
|
/* glyph loading process (e.g., whether the outline */
|
|
|
|
/* should be scaled, whether to load bitmaps or not, */
|
|
|
|
/* whether to hint the outline, etc). */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* If the face has no current charmap, or if the character code */
|
|
|
|
/* is not defined in the charmap, this function will return an */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* error. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* If the glyph image is not a bitmap, and if the bit flag */
|
|
|
|
/* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image will be */
|
|
|
|
/* transformed with the information passed to a previous call to */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FT_Set_Transform(). */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Note that this also transforms the `face.glyph.advance' field, but */
|
|
|
|
/* *not* the values in `face.glyph.metrics'. */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Load_Char( FT_Face face,
|
|
|
|
FT_ULong char_code,
|
|
|
|
FT_Int load_flags );
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_LOAD_NO_SCALE */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit field constant, used with FT_Load_Glyph() to indicate that */
|
|
|
|
/* the vector outline being loaded should not be scaled to 26.6 */
|
|
|
|
/* fractional pixels, but kept in notional units. */
|
|
|
|
/* */
|
|
|
|
#define FT_LOAD_NO_SCALE 1
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_LOAD_NO_HINTING */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used with FT_Load_Glyph() to indicate that */
|
|
|
|
/* the vector outline being loaded should not be fitted to the pixel */
|
|
|
|
/* grid but simply scaled to 26.6 fractional pixels. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* This flag is ignored if FT_LOAD_NO_SCALE is set. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
#define FT_LOAD_NO_HINTING 2
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* FT_LOAD_RENDER */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used with FT_Load_Glyph() to indicate that */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* the function should load the glyph and immediately convert it into */
|
|
|
|
/* a bitmap, if necessary, by calling FT_Render_Glyph(). */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Note that by default, FT_Load_Glyph() loads the glyph image in its */
|
|
|
|
/* native format. */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
#define FT_LOAD_RENDER 4
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_LOAD_NO_BITMAP */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used with FT_Load_Glyph() to indicate that */
|
|
|
|
/* the function should not load the bitmap or pixmap of a given */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* glyph. This is useful when you do not want to load the embedded */
|
|
|
|
/* bitmaps of scalable formats, as the native glyph image will be */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* loaded, and can then be rendered through FT_Render_Glyph(). */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
#define FT_LOAD_NO_BITMAP 8
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* FT_LOAD_VERTICAL_LAYOUT */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used with FT_Load_Glyph() to indicate that */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* the glyph image should be prepared for vertical layout. This */
|
|
|
|
/* basically means that `face.glyph.advance' will correspond to the */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* vertical advance height (instead of the default horizontal */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* advance width), and that the glyph image will translated to match */
|
|
|
|
/* the vertical bearings positions. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
#define FT_LOAD_VERTICAL_LAYOUT 16
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
|
2000-04-25 18:08:33 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_LOAD_FORCE_AUTOHINT */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used with FT_Load_Glyph() to indicate that */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* the function should try to auto-hint the glyphs, even if a driver */
|
|
|
|
/* specific hinter is available. */
|
2000-04-25 18:08:33 +02:00
|
|
|
/* */
|
|
|
|
#define FT_LOAD_FORCE_AUTOHINT 32
|
1999-12-17 00:11:37 +01:00
|
|
|
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
2000-05-18 01:35:37 +02:00
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_LOAD_CROP_BITMAP */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used with FT_Load_Glyph() to indicate that */
|
|
|
|
/* the font driver should try to crop the bitmap (i.e. remove all */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* space around its black bits) when loading it. For now, this */
|
|
|
|
/* really only works with embedded bitmaps in TrueType fonts. */
|
2000-05-18 01:35:37 +02:00
|
|
|
/* */
|
|
|
|
#define FT_LOAD_CROP_BITMAP 64
|
|
|
|
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
|
2000-05-18 01:35:37 +02:00
|
|
|
/*************************************************************************/
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_LOAD_PEDANTIC */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used with FT_Load_Glyph() to indicate that */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* the glyph loader should perform a pedantic bytecode */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* interpretation. Many popular fonts come with broken glyph */
|
|
|
|
/* programs. When this flag is set, loading them will return an */
|
|
|
|
/* error. Otherwise, errors are ignored by the loader, sometimes */
|
|
|
|
/* resulting in ugly glyphs. */
|
|
|
|
/* */
|
|
|
|
#define FT_LOAD_PEDANTIC 128
|
|
|
|
|
|
|
|
|
2000-02-10 18:03:11 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used with FT_Load_Glyph() to indicate that */
|
|
|
|
/* the glyph loader should ignore the global advance width defined */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* in the font. As far as we know, this is only used by the */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* X-TrueType font server, in order to deal correctly with the */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* incorrect metrics contained in DynaLab's TrueType CJK fonts. */
|
2000-02-10 18:03:11 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH 512
|
2000-02-10 18:03:11 +01:00
|
|
|
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_LOAD_NO_RECURSE */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used with FT_Load_Glyph() to indicate that */
|
|
|
|
/* the glyph loader should not load composite glyph recursively. */
|
|
|
|
/* Rather, when a composite glyph is encountered, it should set */
|
|
|
|
/* the values of `num_subglyphs' and `subglyphs', as well as set */
|
|
|
|
/* `face->glyph.format' to ft_glyph_format_composite. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* This is for use by the auto-hinter and possibly other tools. */
|
2000-03-28 13:22:31 +02:00
|
|
|
/* For nearly all applications, this flags should be left unset */
|
|
|
|
/* when invoking FT_Load_Glyph(). */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Note that the flag forces the load of unscaled glyphs. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
#define FT_LOAD_NO_RECURSE 1024
|
1999-12-17 00:11:37 +01:00
|
|
|
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_LOAD_IGNORE_TRANSFORM */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used with FT_Load_Glyph() to indicate that */
|
|
|
|
/* the glyph loader should not try to transform the loaded glyph */
|
|
|
|
/* image. */
|
|
|
|
/* */
|
|
|
|
#define FT_LOAD_IGNORE_TRANSFORM 2048
|
|
|
|
|
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_LOAD_MONOCHROME */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Only used with FT_LOAD_RENDER set, it indicates that the returned */
|
|
|
|
/* glyph image should be 1-bit monochrome. This really tells the */
|
|
|
|
/* glyph loader to use `ft_render_mode_mono' when calling */
|
|
|
|
/* FT_Render_Glyph(). */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
2000-07-01 01:38:23 +02:00
|
|
|
#define FT_LOAD_MONOCHROME 4096
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_LOAD_LINEAR_DESIGN */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used with FT_Load_Glyph() to indicate that */
|
|
|
|
/* the function should return the linearly scaled metrics expressed */
|
|
|
|
/* in original font units, instead of the default 16.16 pixel values. */
|
|
|
|
/* */
|
|
|
|
#define FT_LOAD_LINEAR_DESIGN 8192
|
|
|
|
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Constant> */
|
|
|
|
/* FT_LOAD_DEFAULT */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A bit-field constant, used with FT_Load_Glyph() to indicate that */
|
|
|
|
/* the function should try to load the glyph normally, i.e., */
|
|
|
|
/* embedded bitmaps are favored over outlines, vectors are always */
|
|
|
|
/* scaled and grid-fitted. */
|
|
|
|
/* */
|
|
|
|
#define FT_LOAD_DEFAULT 0
|
|
|
|
|
|
|
|
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Set_Transform */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A function used to set the transformation that is applied to glyph */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* images just before they are converted to bitmaps in a glyph slot */
|
|
|
|
/* when FT_Render_Glyph() is called. */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
|
|
|
/* <InOut> */
|
|
|
|
/* face :: A handle to the source face object. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* matrix :: A pointer to the transformation's 2x2 matrix. Use 0 for */
|
|
|
|
/* the identity matrix. */
|
|
|
|
/* delta :: A pointer to the translation vector. Use 0 for the null */
|
|
|
|
/* vector. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* The transformation is only applied to scalable image formats after */
|
|
|
|
/* the glyph has been loaded. It means that hinting is unaltered by */
|
|
|
|
/* the transformation and is performed on the character size given in */
|
|
|
|
/* the last call to FT_Set_Char_Sizes() or FT_Set_Pixel_Sizes(). */
|
2000-07-01 01:12:55 +02:00
|
|
|
/* */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
FT_EXPORT_DEF( void ) FT_Set_Transform( FT_Face face,
|
|
|
|
FT_Matrix* matrix,
|
|
|
|
FT_Vector* delta );
|
|
|
|
|
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Enum> */
|
|
|
|
/* FT_Render_Mode */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* An enumeration type that lists the render modes supported by the */
|
|
|
|
/* FreeType 2 renderer(s). A renderer is in charge of converting a */
|
|
|
|
/* glyph image into a bitmap. */
|
|
|
|
/* */
|
|
|
|
/* <Fields> */
|
|
|
|
/* ft_render_mode_normal :: This is the default render mode; it */
|
|
|
|
/* corresponds to 8-bit anti-aliased */
|
|
|
|
/* bitmaps, using 256 levels of gray. */
|
|
|
|
/* */
|
|
|
|
/* ft_render_mode_mono :: This render mode is used to produce 1-bit */
|
|
|
|
/* monochrome bitmaps. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* There is no render mode to produce 8-bit `monochrome' bitmaps -- */
|
|
|
|
/* you have to make the conversion yourself if you need such things */
|
|
|
|
/* (besides, FreeType is not a graphics library). */
|
|
|
|
/* */
|
|
|
|
/* More modes might appear later for specific display modes (e.g. TV, */
|
|
|
|
/* LCDs, etc.). They will be supported through the simple addition */
|
|
|
|
/* of a renderer module, with no changes to the rest of the engine. */
|
|
|
|
/* */
|
|
|
|
typedef enum FT_Render_Mode_
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
|
|
|
ft_render_mode_normal = 0,
|
|
|
|
ft_render_mode_mono = 1
|
2000-07-10 16:24:26 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
} FT_Render_Mode;
|
|
|
|
|
2000-07-10 16:24:26 +02:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Render_Glyph */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Converts a given glyph image to a bitmap. It does so by */
|
|
|
|
/* inspecting the glyph image format, find the relevant renderer, and */
|
|
|
|
/* invoke it. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* slot :: A handle to the glyph slot containing the image to */
|
|
|
|
/* convert. */
|
|
|
|
/* */
|
|
|
|
/* render_mode :: This is the render mode used to render the glyph */
|
|
|
|
/* image into a bitmap. See FT_Render_Mode for a list */
|
|
|
|
/* of possible values. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Render_Glyph( FT_GlyphSlot slot,
|
|
|
|
FT_UInt render_mode );
|
2000-07-01 01:12:55 +02:00
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Enum> */
|
|
|
|
/* FT_Kerning_Mode */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* An enumeration used to specify which kerning values to return in */
|
|
|
|
/* FT_Get_Kerning(). */
|
|
|
|
/* */
|
2000-07-10 02:06:22 +02:00
|
|
|
/* <Fields> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* ft_kerning_default :: Return scaled and grid-fitted kerning */
|
|
|
|
/* distances (value is 0). */
|
|
|
|
/* */
|
|
|
|
/* ft_kerning_unfitted :: Return scaled but un-grid-fitted kerning */
|
|
|
|
/* distances. */
|
|
|
|
/* */
|
|
|
|
/* ft_kerning_unscaled :: Return the kerning vector in original font */
|
|
|
|
/* units. */
|
|
|
|
/* */
|
|
|
|
typedef enum FT_Kerning_Mode_
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
|
|
|
ft_kerning_default = 0,
|
|
|
|
ft_kerning_unfitted,
|
|
|
|
ft_kerning_unscaled
|
2000-07-10 16:24:26 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
} FT_Kerning_Mode;
|
|
|
|
|
2000-07-09 21:15:30 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Get_Kerning */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Returns the kerning vector between two glyphs of a same face. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* face :: A handle to a source face object. */
|
|
|
|
/* */
|
|
|
|
/* left_glyph :: The index of the left glyph in the kern pair. */
|
|
|
|
/* */
|
|
|
|
/* right_glyph :: The index of the right glyph in the kern pair. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* kern_mode :: See FT_Kerning_Mode() for more information. */
|
|
|
|
/* Determines the scale/dimension of the returned */
|
|
|
|
/* kerning vector. */
|
2000-07-01 01:12:55 +02:00
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* <Output> */
|
|
|
|
/* kerning :: The kerning vector. This is in font units for */
|
|
|
|
/* scalable formats, and in pixels for fixed-sizes */
|
|
|
|
/* formats. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* Only horizontal layouts (left-to-right & right-to-left) are */
|
|
|
|
/* supported by this method. Other layouts, or more sophisticated */
|
|
|
|
/* kernings, are out of the scope of this API function -- they can be */
|
|
|
|
/* implemented through format-specific interfaces. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Get_Kerning( FT_Face face,
|
|
|
|
FT_UInt left_glyph,
|
|
|
|
FT_UInt right_glyph,
|
|
|
|
FT_UInt kern_mode,
|
|
|
|
FT_Vector* kerning );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
2000-07-19 19:13:03 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Get_Glyph_Name */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-20 08:57:41 +02:00
|
|
|
/* Retrieves the ASCII name of a given glyph in a face. This only */
|
|
|
|
/* works for those faces where FT_HAS_GLYPH_NAME(face) returns true. */
|
2000-07-19 19:13:03 +02:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* face :: A handle to a source face object. */
|
|
|
|
/* */
|
2000-07-20 08:57:41 +02:00
|
|
|
/* glyph_index :: The glyph index. */
|
|
|
|
/* */
|
|
|
|
/* buffer :: A pointer to a target buffer where the name will be */
|
|
|
|
/* copied to. */
|
2000-07-19 19:13:03 +02:00
|
|
|
/* */
|
2000-07-20 08:57:41 +02:00
|
|
|
/* buffer_max :: The maximal number of bytes available in the */
|
|
|
|
/* buffer. */
|
2000-07-19 19:13:03 +02:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* FreeType error code. 0 means success. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2000-07-20 08:57:41 +02:00
|
|
|
/* An error is returned if the face doesn't provide glyph names or if */
|
|
|
|
/* the glyph index is invalid. In all cases of failure, the first */
|
|
|
|
/* byte of `buffer' will be set to 0 to indicate an empty name. */
|
2000-07-19 19:13:03 +02:00
|
|
|
/* */
|
2000-07-20 08:57:41 +02:00
|
|
|
/* The glyph name is truncated to fit within the buffer if it is too */
|
|
|
|
/* long. The returned string is always zero-terminated. */
|
2000-07-19 19:13:03 +02:00
|
|
|
/* */
|
|
|
|
/* This function is not compiled within the library if the config */
|
|
|
|
/* macro FT_CONFIG_OPTION_NO_GLYPH_NAMES is defined in */
|
2000-07-20 08:57:41 +02:00
|
|
|
/* `include/freetype/config/ftoptions.h' */
|
2000-07-19 19:13:03 +02:00
|
|
|
/* */
|
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Get_Glyph_Name( FT_Face face,
|
|
|
|
FT_UInt glyph_index,
|
|
|
|
FT_Pointer buffer,
|
|
|
|
FT_UInt buffer_max );
|
|
|
|
|
|
|
|
|
2000-05-12 19:09:38 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Select_Charmap */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* Selects a given charmap by its encoding tag (as listed in */
|
|
|
|
/* `freetype.h'). */
|
2000-05-12 19:09:38 +02:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* face :: A handle to the source face object. */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* */
|
|
|
|
/* encoding :: A handle to the selected charmap. */
|
2000-05-12 19:09:38 +02:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
2000-05-12 19:09:38 +02:00
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* This function will return an error if no charmap in the face */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* corresponds to the encoding queried here. */
|
2000-05-12 19:09:38 +02:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Select_Charmap( FT_Face face,
|
|
|
|
FT_Encoding encoding );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
2000-05-12 19:09:38 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Set_Charmap */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Selects a given charmap for character code to glyph index */
|
|
|
|
/* decoding. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* face :: A handle to the source face object. */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* charmap :: A handle to the selected charmap. */
|
2000-05-12 19:09:38 +02:00
|
|
|
/* */
|
|
|
|
/* <Return> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* FreeType error code. 0 means success. */
|
2000-05-12 19:09:38 +02:00
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* This function will return an error if the charmap is not part of */
|
|
|
|
/* the face (i.e., if it is not listed in the face->charmaps[] */
|
2000-05-12 19:09:38 +02:00
|
|
|
/* table). */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error ) FT_Set_Charmap( FT_Face face,
|
|
|
|
FT_CharMap charmap );
|
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Get_Char_Index */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Returns the glyph index of a given character code. This function */
|
|
|
|
/* uses a charmap object to do the translation. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* face :: A handle to the source face object. */
|
|
|
|
/* */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* charcode :: The character code. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* The glyph index. 0 means `undefined character code'. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_UInt ) FT_Get_Char_Index( FT_Face face,
|
|
|
|
FT_ULong charcode );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_MulDiv */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* A very simple function used to perform the computation `(a*b)/c' */
|
2000-05-29 22:46:12 +02:00
|
|
|
/* with maximal accuracy (it uses a 64-bit intermediate integer */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* whenever necessary). */
|
|
|
|
/* */
|
|
|
|
/* This function isn't necessarily as fast as some processor specific */
|
|
|
|
/* operations, but is at least completely portable. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* a :: The first multiplier. */
|
|
|
|
/* b :: The second multiplier. */
|
|
|
|
/* c :: The divisor. */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* The result of `(a*b)/c'. This function never traps when trying to */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* on the signs of `a' and `b'. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Long ) FT_MulDiv( FT_Long a,
|
|
|
|
FT_Long b,
|
|
|
|
FT_Long c );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_MulFix */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A very simple function used to perform the computation */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* `(a*b)/0x10000' with maximal accuracy. Most of the time this is */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* used to multiply a given value by a 16.16 fixed float factor. */
|
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* a :: The first multiplier. */
|
|
|
|
/* b :: The second multiplier. Use a 16.16 factor here whenever */
|
|
|
|
/* possible (see note below). */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* The result of `(a*b)/0x10000'. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
|
|
|
/* This function has been optimized for the case where the absolute */
|
|
|
|
/* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
|
|
|
|
/* As this happens mainly when scaling from notional units to */
|
|
|
|
/* fractional pixels in FreeType, it resulted in noticeable speed */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* improvements between versions 2.x and 1.x. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* As a conclusion, always try to place a 16.16 factor as the */
|
|
|
|
/* _second_ argument of this function; this can make a great */
|
|
|
|
/* difference. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Long ) FT_MulFix( FT_Long a,
|
|
|
|
FT_Long b );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_DivFix */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* A very simple function used to perform the computation */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* `(a*0x10000)/b' with maximal accuracy. Most of the time, this is */
|
|
|
|
/* used to divide a given value by a 16.16 fixed float factor. */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* a :: The first multiplier. */
|
|
|
|
/* b :: The second multiplier. Use a 16.16 factor here whenever */
|
|
|
|
/* possible (see note below). */
|
|
|
|
/* */
|
|
|
|
/* <Return> */
|
|
|
|
/* The result of `(a*0x10000)/b'. */
|
|
|
|
/* */
|
|
|
|
/* <Note> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* The optimization for FT_DivFix() is simple: If (a << 16) fits in */
|
|
|
|
/* 32 bits, then the division is computed directly. Otherwise, we */
|
|
|
|
/* use a specialized version of the old FT_MulDiv64(). */
|
1999-12-17 00:11:37 +01:00
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
FT_EXPORT_DEF( FT_Long ) FT_DivFix( FT_Long a,
|
|
|
|
FT_Long b );
|
1999-12-17 00:11:37 +01:00
|
|
|
|
|
|
|
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Function> */
|
|
|
|
/* FT_Vector_Transform */
|
|
|
|
/* */
|
|
|
|
/* <Description> */
|
|
|
|
/* Transforms a single vector through a 2x2 matrix. */
|
|
|
|
/* */
|
|
|
|
/* <InOut> */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* vector :: The target vector to transform. */
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
/* */
|
|
|
|
/* <Input> */
|
|
|
|
/* matrix :: A pointer to the source 2x2 matrix. */
|
|
|
|
/* */
|
|
|
|
/* <MT-Note> */
|
|
|
|
/* Yes. */
|
|
|
|
/* */
|
2000-07-09 21:15:30 +02:00
|
|
|
/* <Note> */
|
|
|
|
/* The result is undefined if either `vector' or `matrix' is invalid. */
|
|
|
|
/* */
|
|
|
|
FT_EXPORT_DEF( void ) FT_Vector_Transform( FT_Vector* vec,
|
|
|
|
FT_Matrix* matrix );
|
- MAJOR INTERNAL REDESIGN:
A lot of internal modifications have been performed lately on the
source in order to provide the following enhancements:
- more generic module support:
The FT_Module type is now defined to represent a handle to a given
module. The file <freetype/ftmodule.h> contains the FT_Module_Class
definition, as well as the module-loading public API
The FT_Driver type is still defined, and still represents a pointer
to a font driver. Note that FT_Add_Driver is replaced by FT_Add_Module,
FT_Get_Driver by FT_Get_Module, etc..
- support for generic glyph image types:
The FT_Renderer type is a pointer to a module used to perform various
operations on glyph image.
Each renderer is capable of handling images in a single format
(e.g. ft_glyph_format_outline). Its functions are used to:
- transform an glyph image
- render a glyph image into a bitmap
- return the control box (dimensions) of a given glyph image
The scan converters "ftraster.c" and "ftgrays.c" have been moved
to the new directory "src/renderer", and are used to provide two
default renderer modules.
One corresponds to the "standard" scan-converter, the other to the
"smooth" one.
The current renderer can be set through the new function
FT_Set_Renderer.
The old raster-related function FT_Set_Raster, FT_Get_Raster and
FT_Set_Raster_Mode have now disappeared, in favor of the new:
FT_Get_Renderer
FT_Set_Renderer
see the file <freetype/ftrender.h> for more details..
These changes were necessary to properly support different scalable
formats in the future, like bi-color glyphs, etc..
- glyph loader object:
A new internal object, called a 'glyph loader' has been introduced
in the base layer. It is used by all scalable format font drivers
to load glyphs and composites.
This object has been created to reduce the code size of each driver,
as each one of them basically re-implemented its functionality.
See <freetype/internal/ftobjs.h> and the FT_GlyphLoader type for
more information..
- FT_GlyphSlot had new fields:
In order to support extended features (see below), the FT_GlyphSlot
structure has a few new fields:
linearHoriAdvance: this field gives the linearly scaled (i.e.
scaled but unhinted) advance width for the glyph,
expressed as a 16.16 fixed pixel value. This
is useful to perform WYSIWYG text.
linearVertAdvance: this field gives the linearly scaled advance
height for the glyph (relevant in vertical glyph
layouts only). This is useful to perform
WYSIWYG text.
Note that the two above field replace the removed "metrics2" field
in the glyph slot.
advance: this field is a vector that gives the transformed
advance for the glyph. By default, it corresponds
to the advance width, unless FT_LOAD_VERTICAL_LAYOUT
was specified when calling FT_Load_Glyph or FT_Load_Char
bitmap_left: this field gives the distance in integer pixels from
the current pen position to the left-most pixel of
a glyph image WHEN IT IS A BITMAP. It is only valid
when the "format" field is set to
"ft_glyph_format_bitmap", for example, after calling
the new function FT_Render_Glyph.
bitmap_top: this field gives the distance in integer pixels from
the current pen position (located on the baseline) to
the top-most pixel of the glyph image WHEN IT IS A
BITMAP. Positive values correspond to upwards Y.
loader: this is a new private field for the glyph slot. Client
applications should not touch it..
- support for transforms and direct rendering in FT_Load_Glyph:
Most of the functionality found in <freetype/ftglyph.h> has been
moved to the core library. Hence, the following:
- a transform can be specified for a face through FT_Set_Transform.
this transform is applied by FT_Load_Glyph to scalable glyph images
(i.e. NOT TO BITMAPS) before the function returns, unless the
bit flag FT_LOAD_IGNORE_TRANSFORM was set in the load flags..
- once a glyph image has been loaded, it can be directly converted to
a bitmap by using the new FT_Render_Glyph function. Note that this
function takes the glyph image from the glyph slot, and converts
it to a bitmap whose properties are returned in "face.glyph.bitmap",
"face.glyph.bitmap_left" and "face.glyph.bitmap_top". The original
native image might be lost after the conversion.
- when using the new bit flag FT_LOAD_RENDER, the FT_Load_Glyph
and FT_Load_Char functions will call FT_Render_Glyph automatically
when needed.
2000-06-22 02:17:42 +02:00
|
|
|
|
2000-10-23 20:33:30 +02:00
|
|
|
/* */
|
2000-05-02 12:55:33 +02:00
|
|
|
|
1999-12-17 00:11:37 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* FREETYPE_H */
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|