TTObjs unit
Contains objects definitions used in the FreeType (TrueType) library.
The four important objects managed by the library are:
- Face
- The object for a given typeface.
- Instance
- The object for a given pointsize/transform in a typeface.
- Context
- The object for a loading/hinting execution in a typeface.
- Glyph
- The object for a given glyph (outline and metrics).
A Face object is described by a TFace record, and its associated sub-tables. It is created through a call to the 'TT_Open_Face' API.
An Instance object is described by a TInstance record, and sub-tables. It is created for a given face through a call to the 'TT_Open_Instance' API. Several instances can share the same face.
The point size and/or transform of a given instance object can be changed on the fly through a call to the 'TT_Reset_Instance' API.
A Glyph object is used to describe a glyph to the client application It is made of a TGlyph_Record header, with several sub-tables used to store, for example, point coordinates or outline info. It can hold metrics information and other attributes, as well as the glyph's outline. A client application can request any kind of info to the library on a given glyph through the 'TT_Get_Glyph' call.
A Context is described by a TExec_Context record, and sub-tables Execution contexts are created on demand during the following operations:
- Creating a new instance (to read and execute the font program).
- Setting/resetting the point size (to execute the CVT program).
- During glyph loading (when hinting is on).
They are used to run TrueType instructions and load/store glyph data that are not part of the Glyph object ( as they're of no meaning to a client application ).
The library keeps track of all objects related to a given face.
A face's instances are kept in two linked lists: one is the 'active' list, which tracks the face's current opened instances, while the other is the 'idle' list used to collect/recycle instance objects when they become unuseful after a 'TT_Close_Instance' call.
In the same way, a face's execution contexts are kept in two similar lists. Note that, as contexts are created on demand, the active and idle contexts lists should always contain few elements.
Look also for the following files:
- Face manager
- TTFace.pas
- Instance manager
- TTInst.pas
- Context manager
- TTExec.pas
- Glyph manager
- TTGlyph.pas
Classes and records
TCallRecord | record | Defines a call record used to manage function calls. |
TCodeRange | record | Defines a code range. |
TDefRecord | record | Defines a function / instruction definition record. |
TExec_Context | record | FreeType Execution Context Object. |
TFace | record | The FreeType Face object. |
TFont_Input | record | |
TGlyph | record | FreeType Glyph Object. |
TGlyph_Transform | record | |
TGlyph_Zone | record | |
TGraphicsState | record | Graphics State. |
TIns_Metrics | record | |
TInstance | record | FreeType Instance Object. |
TSubglyph_Record | record |
Procedures and functions
Clear_CodeRange | function | Clear a given code range. |
Context_Load | procedure | |
Context_Run | function | |
Context_Save | procedure | |
Done_Context | procedure | |
Get_CodeRange | function | Returns a pointer to a given code range record. |
Goto_CodeRange | function | Go to a specified code range. |
Instance_Init | function | |
Instance_Reset | function | |
New_Context | function | |
Scale_X | function | |
Scale_Y | function | |
Set_CodeRange | function | Sets properties for the given code range. |
TTObjs_Done | procedure | Finalize the object manager. |
TTObjs_Init | function | Initialize the object manager. |
Types
PCallStack | type | |
PCodeRange | type | |
PDefArray | type | |
PDefRecord | type | |
PExec_Context | type | |
PFace | type | |
PFont_Input | type | |
PGlyph | type | |
PGlyph_Transform | type | |
PGlyph_Zone | type | |
PGraphicsState | type | Pointer to a TGraphicsState record type. |
PInstance | type | |
PSubglyph_Record | type | |
PSubglyph_Stack | type | |
TCallStack | type | Defines a simple call stack. |
TCodeRangeTable | type | Defines a code range. |
TDefArray | type | |
TFunc_Get_CVT | procedure type | Reads a CVT value. |
TFunc_Set_CVT | procedure type | Setting or Moving a CVT value. |
TMove_Function | procedure type | Point displacement along the freedom vector routine, as used by the interpreter. |
TProject_Function | procedure type | Distance projection along one of the proj. vectors, as used by the interpreter. |
TRound_Function | procedure type | Rounding function, as used by the interpreter. |
TSubglyph_Stack | type |
Constants
CvtFlag_Both | constant | |
CvtFlag_None | constant | |
CvtFlag_X | constant | |
CvtFlag_Y | constant | |
Default_GraphicsState | constant | |
MaxCodeRanges | constant | Maximum number of code ranges. |
TT_CodeRange_Cvt | constant | |
TT_CodeRange_Font | constant | |
TT_CodeRange_Glyph | constant |
Variables
exec_cache | variable | |
face_cache | variable |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
