Sign in Join
FPDoc Onlineexperiment

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

TCallRecordrecordDefines a call record used to manage function calls.
TCodeRangerecordDefines a code range.
TDefRecordrecordDefines a function / instruction definition record.
TExec_ContextrecordFreeType Execution Context Object.
TFacerecordThe FreeType Face object.
TFont_Inputrecord
TGlyphrecordFreeType Glyph Object.
TGlyph_Transformrecord
TGlyph_Zonerecord
TGraphicsStaterecordGraphics State.
TIns_Metricsrecord
TInstancerecordFreeType Instance Object.
TSubglyph_Recordrecord

Procedures and functions

Clear_CodeRangefunctionClear a given code range.
Context_Loadprocedure
Context_Runfunction
Context_Saveprocedure
Done_Contextprocedure
Get_CodeRangefunctionReturns a pointer to a given code range record.
Goto_CodeRangefunctionGo to a specified code range.
Instance_Initfunction
Instance_Resetfunction
New_Contextfunction
Scale_Xfunction
Scale_Yfunction
Set_CodeRangefunctionSets properties for the given code range.
TTObjs_DoneprocedureFinalize the object manager.
TTObjs_InitfunctionInitialize the object manager.

Types

PCallStacktype
PCodeRangetype
PDefArraytype
PDefRecordtype
PExec_Contexttype
PFacetype
PFont_Inputtype
PGlyphtype
PGlyph_Transformtype
PGlyph_Zonetype
PGraphicsStatetypePointer to a TGraphicsState record type.
PInstancetype
PSubglyph_Recordtype
PSubglyph_Stacktype
TCallStacktypeDefines a simple call stack.
TCodeRangeTabletypeDefines a code range.
TDefArraytype
TFunc_Get_CVTprocedure typeReads a CVT value.
TFunc_Set_CVTprocedure typeSetting or Moving a CVT value.
TMove_Functionprocedure typePoint displacement along the freedom vector routine, as used by the interpreter.
TProject_Functionprocedure typeDistance projection along one of the proj. vectors, as used by the interpreter.
TRound_Functionprocedure typeRounding function, as used by the interpreter.
TSubglyph_Stacktype

Constants

CvtFlag_Bothconstant
CvtFlag_Noneconstant
CvtFlag_Xconstant
CvtFlag_Yconstant
Default_GraphicsStateconstant
MaxCodeRangesconstantMaximum number of code ranges.
TT_CodeRange_Cvtconstant
TT_CodeRange_Fontconstant
TT_CodeRange_Glyphconstant

Variables

exec_cachevariable
face_cachevariable

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.