TBLFont
Font.
Definition
Unit: Blend2D
Properties
Name | Description |
---|---|
DesignMetrics | The design metrics of the font. |
Face | The font's associated font face. |
FaceFlags | The flags of the font. |
FaceType | The type of the font's associated font face. |
FeatureSettings | Font feature settings. |
IsEmpty | Tests whether the font is empty, which is the same as not IsValid . |
IsValid | Whether the font is a valid instance. |
Matrix | A 2x2 matrix of the font. |
Metrics | The scaled metrics of the font. |
Size | The size of the font. |
Stretch | The stretch of the font. |
Style | The style of the font. |
UnitsPerEm | The "units per em" (UPEM) of the font's associated font face. |
VariationSettings | Font variation settings. |
Weight | The weight of the font. |
Constructors
Name | Description |
---|---|
Assign | Copy constructor makes a weak copy of the underlying representation of the ASrc font. |
Finalize | Destroys the font. |
Initialize | Creates a default initialized font. |
Operators
Name | Description |
---|---|
Equal(TBLFont, TBLFont) | Returns True if two fonts are equal (have the same contents). |
Equal(TBLFont, Pointer) | Used to compare against nil (null font). |
NotEqual(TBLFont, TBLFont) | Returns True if two fonts are not equal (do not have the same contents). |
NotEqual(TBLFont, Pointer) | Used to compare against nil (null font). |
Methods
Property Descriptions
DesignMetrics
The design metrics of the font.
The returned metrics is compatible with the metrics of TBLFontFace
associated with this font.
property DesignMetrics: PBLFontDesignMetrics read GetDesignMetrics
Type: PBLFontDesignMetrics
See Also
Face
The font's associated font face.
Returns the same font face, which was passed to MakeFromFace
.
property Face: TBLFontFace read GetFace
Type: TBLFontFace
See Also
FaceFlags
The flags of the font.
property FaceFlags: TBLFontFaceFlags read GetFaceFlags
Type: TBLFontFaceFlags
FaceType
The type of the font's associated font face.
property FaceType: TBLFontFaceType read GetFaceType
Type: TBLFontFaceType
FeatureSettings
Font feature settings.
property FeatureSettings: TBLFontFeatureSettings read GetFeatureSettings write SetFeatureSettings
Type: TBLFontFeatureSettings
Exceptions
EBlend2DError
: Raised on failure.
IsEmpty
Tests whether the font is empty, which is the same as not IsValid
.
property IsEmpty: Boolean read GetIsEmpty
Type: Boolean
IsValid
Whether the font is a valid instance.
property IsValid: Boolean read GetIsValid
Type: Boolean
Matrix
A 2x2 matrix of the font.
The returned TBLFontMatrix
is used to scale fonts from design units into user units. The matrix usually has a negative M11
member as fonts use a different coordinate system than Blend2D.
property Matrix: TBLFontMatrix read GetMatrix
Type: TBLFontMatrix
Metrics
The scaled metrics of the font.
The returned metrics is a scale of design metrics that match the font size and its options.
property Metrics: PBLFontMetrics read GetMetrics
Type: PBLFontMetrics
Size
The size of the font.
property Size: Single read GetSize write SetSize
Type: Single
Exceptions
EBlend2DError
: Raised on failure.
Stretch
The stretch of the font.
property Stretch: TBLFontStretch read GetStretch
Type: TBLFontStretch
Style
The style of the font.
property Style: TBLFontStyle read GetStyle
Type: TBLFontStyle
UnitsPerEm
The "units per em" (UPEM) of the font's associated font face.
property UnitsPerEm: Integer read GetUnitsPerEm
Type: Integer
VariationSettings
Font variation settings.
property VariationSettings: TBLFontVariationSettings read GetVariationSettings write SetVariationSettings
Type: TBLFontVariationSettings
Exceptions
EBlend2DError
: Raised on failure.
Weight
The weight of the font.
property Weight: TBLFontWeight read GetWeight
Type: TBLFontWeight
Constructor Descriptions
Assign
Copy constructor makes a weak copy of the underlying representation of the ASrc
font.
constructor Assign(var ADest: TBLFont; const ASrc: TBLFont); inline
Parameters
ADest
: TBLFont
ASrc
: TBLFont
Exceptions
EBlend2DError
: Raised on failure.
Finalize
Destroys the font.
destructor Finalize(var ADest: TBLFont)
Parameters
ADest
: TBLFont
Exceptions
EBlend2DError
: Raised on failure.
Initialize
Creates a default initialized font.
A default initialized font is not a valid font that could be used for rendering. It can be considered an empty or null font, which has no family, no glyphs, no tables, it's essentially empty.
constructor Initialize(out ADest: TBLFont)
Parameters
ADest
: TBLFont
Exceptions
EBlend2DError
: Raised on failure.
Operator Descriptions
Equal(TBLFont, TBLFont)
Returns True if two fonts are equal (have the same contents).
class operator Equal(const ALeft, ARight: TBLFont): Boolean; inline; static
Parameters
ALeft
: TBLFont
ARight
: TBLFont
Returns
Boolean
Equal(TBLFont, Pointer)
Used to compare against nil
(null font).
class operator Equal(const ALeft: TBLFont; const ARight: Pointer): Boolean; inline; static
Parameters
ALeft
: TBLFont
ARight
: Pointer
Returns
Boolean
NotEqual(TBLFont, TBLFont)
Returns True if two fonts are not equal (do not have the same contents).
class operator NotEqual(const ALeft, ARight: TBLFont): Boolean; inline; static
Parameters
ALeft
: TBLFont
ARight
: TBLFont
Returns
Boolean
NotEqual(TBLFont, Pointer)
Used to compare against nil
(null font).
class operator NotEqual(const ALeft: TBLFont; const ARight: Pointer): Boolean; inline; static
Parameters
ALeft
: TBLFont
ARight
: Pointer
Returns
Boolean
Method Descriptions
ApplyGPos(TBLGlyphBuffer, TBLBitArray)
procedure ApplyGPos(const AGB: TBLGlyphBuffer; const ALookups: TBLBitArray); inline
Parameters
AGB
: TBLGlyphBuffer
ALookups
: TBLBitArray
ApplyGSub(TBLGlyphBuffer, TBLBitArray)
procedure ApplyGSub(const AGB: TBLGlyphBuffer; const ALookups: TBLBitArray); inline
Parameters
AGB
: TBLGlyphBuffer
ALookups
: TBLBitArray
ApplyKerning(TBLGlyphBuffer)
procedure ApplyKerning(const AGB: TBLGlyphBuffer); inline
Parameters
AGB
: TBLGlyphBuffer
Equals(TBLFont)
Tests whether this and AOther
fonts are equal.
function Equals(const AOther: TBLFont): Boolean; inline
Parameters
AOther
: TBLFont
Returns
Boolean
GetGlyphAdvances(PUInt32, NativeInt, NativeInt)
function GetGlyphAdvances(const AGlyphData: PUInt32; const AGlyphAdvance, ACount: NativeInt): TArray<TBLGlyphPlacement>; overload; inline
Parameters
AGlyphData
: PUInt32
AGlyphAdvance
: NativeInt
ACount
: NativeInt
Returns
TArray<TBLGlyphPlacement>
GetGlyphAdvances(PUInt32, NativeInt, NativeInt, PBLGlyphPlacement)
procedure GetGlyphAdvances(const AGlyphData: PUInt32; const AGlyphAdvance, ACount: NativeInt; out APlacements: PBLGlyphPlacement); overload; inline
Parameters
AGlyphData
: PUInt32
AGlyphAdvance
: NativeInt
ACount
: NativeInt
APlacements
: PBLGlyphPlacement
GetGlyphBounds(PUInt32, NativeInt, NativeInt)
function GetGlyphBounds(const AGlyphData: PUInt32; const AGlyphAdvance, ACount: NativeInt): TArray<TBLBoxI>; overload; inline
Parameters
AGlyphData
: PUInt32
AGlyphAdvance
: NativeInt
ACount
: NativeInt
Returns
TArray<TBLBoxI>
GetGlyphBounds(PUInt32, NativeInt, NativeInt, PBLBoxI)
procedure GetGlyphBounds(const AGlyphData: PUInt32; const AGlyphAdvance, ACount: NativeInt; out ABounds: PBLBoxI); overload; inline
Parameters
AGlyphData
: PUInt32
AGlyphAdvance
: NativeInt
ACount
: NativeInt
ABounds
: PBLBoxI
GetGlyphOutlines(TBLGlyphId, TBLMatrix2D, TBLPath, TBLPathSinkFunc, Pointer)
Retrieves outlines of a single glyph into the AOut
path transformed by AUsserTransform
.
Optionally, a user can provide a ASink
function with AUserData
, which will be called periodically by the glyph outline decoder. The ASink
can be used to immediately process the outline to prevent accumulating a large path in AOut
.
procedure GetGlyphOutlines(const AGlyphId: TBLGlyphId; const AUserTransform: TBLMatrix2D; const AOut: TBLPath; const ASink: TBLPathSinkFunc = nil; const AUserData: Pointer = nil); overload; inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
AGlyphId
: TBLGlyphId
AUserTransform
: TBLMatrix2D
AOut
: TBLPath
ASink
: TBLPathSinkFunc = nil
AUserData
: Pointer = nil
GetGlyphOutlines(TBLGlyphId, TBLPath, TBLPathSinkFunc, Pointer)
Retrieves outlines of a single glyph into the AOut
path.
Optionally, a user can provide a ASink
function with AUserData
, which will be called periodically by the glyph outline decoder. The ASink
can be used to immediately process the outline to prevent accumulating a large path in AOut
.
procedure GetGlyphOutlines(const AGlyphId: TBLGlyphId; const AOut: TBLPath; const ASink: TBLPathSinkFunc = nil; const AUserData: Pointer = nil); overload; inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
AGlyphId
: TBLGlyphId
AOut
: TBLPath
ASink
: TBLPathSinkFunc = nil
AUserData
: Pointer = nil
GetGlyphRunOutlines(TBLGlyphRun, TBLMatrix2D, TBLPath, TBLPathSinkFunc, Pointer)
Retrieves outlines of a glyph run into the AOut
path transformed by AUserTransform
.
Optionally, a user can provide a ASink
function with AUserData
, which will be called periodically by the glyph outline decoder. The ASink
can be used to immediately process the outline to prevent accumulating a large path in AOut
.
procedure GetGlyphRunOutlines(const AGlyphRun: TBLGlyphRun; const AUserTransform: TBLMatrix2D; const AOut: TBLPath; const ASink: TBLPathSinkFunc = nil; const AUserData: Pointer = nil); overload; inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
AGlyphRun
: TBLGlyphRun
AUserTransform
: TBLMatrix2D
AOut
: TBLPath
ASink
: TBLPathSinkFunc = nil
AUserData
: Pointer = nil
GetGlyphRunOutlines(TBLGlyphRun, TBLPath, TBLPathSinkFunc, Pointer)
Retrieves outlines of a glyph run into the AOut
path.
Optionally, a user can provide a ASink
function with AUserData
, which will be called periodically by the glyph outline decoder. The ASink
can be used to immediately process the outline to prevent accumulating a large path in AOut
.
procedure GetGlyphRunOutlines(const AGlyphRun: TBLGlyphRun; const AOut: TBLPath; const ASink: TBLPathSinkFunc = nil; const AUserData: Pointer = nil); overload; inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
AGlyphRun
: TBLGlyphRun
AOut
: TBLPath
ASink
: TBLPathSinkFunc = nil
AUserData
: Pointer = nil
GetTextMetrics(TBLGlyphBuffer, TBLTextMetrics)
procedure GetTextMetrics(const AGB: TBLGlyphBuffer; out AMetrics: TBLTextMetrics); inline
Parameters
AGB
: TBLGlyphBuffer
AMetrics
: TBLTextMetrics
MakeFromFace(TBLFontFace, Single, TBLFontFeatureSettings, TBLFontVariationSettings)
Creates a new font from the existing font AFace
scaled to the given ASize
.
This is an overloaded function that takes additional arguments, which are used to override font AFeatureSettings
and font AVariationSettings
.
procedure MakeFromFace(const AFace: TBLFontFace; const ASize: Single; const AFeatureSettings: TBLFontFeatureSettings; const AVariationSettings: TBLFontVariationSettings); overload; inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
AFace
: TBLFontFace
ASize
: Single
AFeatureSettings
: TBLFontFeatureSettings
AVariationSettings
: TBLFontVariationSettings
MakeFromFace(TBLFontFace, Single, TBLFontFeatureSettings)
Creates a new font from the existing font AFace
scaled to the given ASize
.
This is an overloaded function that takes additional argument AFeatureSettings
.
procedure MakeFromFace(const AFace: TBLFontFace; const ASize: Single; const AFeatureSettings: TBLFontFeatureSettings); overload; inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
AFace
: TBLFontFace
ASize
: Single
AFeatureSettings
: TBLFontFeatureSettings
MakeFromFace(TBLFontFace, Single)
Creates a new font from the existing font AFace
scaled to the given ASize
.
procedure MakeFromFace(const AFace: TBLFontFace; const ASize: Single); overload; inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
AFace
: TBLFontFace
ASize
: Single
MapTextToGlyphs(TBLGlyphBuffer, TBLGlyphMappingState)
procedure MapTextToGlyphs(const AGB: TBLGlyphBuffer; out AStateOut: TBLGlyphMappingState); overload; inline
Parameters
AGB
: TBLGlyphBuffer
AStateOut
: TBLGlyphMappingState
MapTextToGlyphs(TBLGlyphBuffer)
procedure MapTextToGlyphs(const AGB: TBLGlyphBuffer); overload; inline
Parameters
AGB
: TBLGlyphBuffer
PositionGlyphs(TBLGlyphBuffer)
procedure PositionGlyphs(const AGB: TBLGlyphBuffer); inline
Parameters
AGB
: TBLGlyphBuffer
Reset
Resets the font to a default constructed state.
procedure Reset; inline
ResetFeatureSettings
Resets font feature settings.
procedure ResetFeatureSettings; inline
Exceptions
EBlend2DError
: Raised on failure.
ResetVariationSettings
Resets font variation settings.
procedure ResetVariationSettings; inline
Exceptions
EBlend2DError
: Raised on failure.
Shape(TBLGlyphBuffer)
procedure Shape(const AGB: TBLGlyphBuffer); inline
Parameters
AGB
: TBLGlyphBuffer
Swap(TBLFont)
Swaps the underlying representation of this font with the AOther
font.
procedure Swap(var AOther: TBLFont); inline
Parameters
AOther
: TBLFont