THotPDF Font Fallback Methods
Configures ordered fallback faces and exposes coverage and vertical-metric diagnostics
Declarations
procedure SetFontFallbackChain(Script: THPDFFontScript;
const FontNames: array of AnsiString);
procedure ClearFontFallbackChain(Script: THPDFFontScript);
procedure ClearAllFontFallbackChains;
function FontFallbackCount(Script: THPDFFontScript): Integer;
function FontFallbackName(Script: THPDFFontScript;
Index: Integer): AnsiString;
function FontScriptForCodePoint(CodePoint: Cardinal): THPDFFontScript;
function ResolveFontForCodePoint(CodePoint: Cardinal;
const PrimaryFontName: AnsiString;
out ResolvedFontName: AnsiString): boolean; overload;
function ResolveFontForCodePoint(CodePoint: Cardinal;
const PrimaryFontName: AnsiString; const FontStyle: TFontStyles;
out ResolvedFontName: AnsiString): boolean; overload;
function AnalyzeUnresolvedGlyphs(const Text: WideString;
const PrimaryFontName: AnsiString): THPDFUnresolvedGlyphInfoArray; overload;
function AnalyzeUnresolvedGlyphs(const Text: WideString;
const PrimaryFontName: AnsiString; const FontStyle: TFontStyles):
THPDFUnresolvedGlyphInfoArray; overload;
function GetUnresolvedGlyphs: THPDFUnresolvedGlyphInfoArray;
procedure ClearUnresolvedGlyphs;
function GetVerticalGlyphMetrics(CodePoint: Cardinal;
out AdvanceY, OriginY: Integer): boolean;
procedure SetVerticalDefaultMetrics(AdvanceY, OriginY: Integer);
Types
THPDFFontScript = (hfsCommon, hfsLatin, hfsGreek, hfsCyrillic,
hfsHebrew, hfsArabic, hfsIndic, hfsSoutheastAsian, hfsCJK,
hfsKana, hfsHangul, hfsEmoji, hfsOther);
THPDFUnresolvedGlyphInfo = record
CodePoint: Cardinal;
FontName: AnsiString;
Script: THPDFFontScript;
SuggestedFonts: AnsiString;
end;
THPDFUnresolvedGlyphInfoArray = array of THPDFUnresolvedGlyphInfo;
Member topics
- SetFontFallbackChain
- ClearFontFallbackChain
- ClearAllFontFallbackChains
- FontFallbackCount
- FontFallbackName
- FontScriptForCodePoint
- ResolveFontForCodePoint
- AnalyzeUnresolvedGlyphs
- GetUnresolvedGlyphs
- ClearUnresolvedGlyphs
- GetVerticalGlyphMetrics
- SetVerticalDefaultMetrics
- VerticalDefaultAdvanceY
- VerticalDefaultOriginY
Behavior
ResolveFontForCodePointchecks the primary face first, then the matching script chain, thenhfsCommon- The result is true only when an installed face resolves the scalar without GDI face substitution
- Repeated family, face-style, and scalar probes use a bounded 1024-entry cache that is invalidated after private font registration
- Explicit-style overloads inspect the selected bold and italic face; original overloads retain regular-face behavior
AnalyzeUnresolvedGlyphsdeduplicates repeated unresolved scalar and primary-face pairsGetVerticalGlyphMetricsreturns registered OpenType vertical metrics when available and exposes the configured defaults otherwiseSetVerticalDefaultMetricsrequires a positive advance in 1000-unit glyph space