THotPDF GSUB Lookup Methods

THotPDF API-referentie

 

THotPDF Methods  Auto Shaping  GSUB

Documenteert de GSUB-lookup-API's op capability-niveau voor single-, multiple-, alternate-, ligature-, contextual-, chained contextual-, reverse chained-, contextual-feature- en gelokaliseerde-vormvervangingen

 

Delphi-syntaxis

function GetSingleSubstituteGlyph(InputGID: Word; const FeatureTag: AnsiString): Word;

function GetMultipleSubstituteGlyphs(InputGID: Word; const FeatureTag: AnsiString; var OutGIDs: TGSUBLookupArray): Boolean;

function GetAlternateGlyphCount(InputGID: Word; const FeatureTag: AnsiString): Integer;

function GetAlternateGlyph(InputGID: Word; const FeatureTag: AnsiString; AlternateIndex: Integer): Word;

function ApplyLigatureSubstitution(const InputGIDs: array of Word; StartIndex: Integer; const FeatureTag: AnsiString; out OutGID: Word; out ConsumedCount: Integer): Boolean;

function ApplyContextualSubst(const InputGIDs: array of Word; StartIndex: Integer; const FeatureTag: AnsiString; var OutGIDs: TGSUBLookupArray; out ConsumedLen: Integer): Boolean;

function ApplyReverseChainedContextualSubst(const InputGIDs: array of Word; StartIndex: Integer; const FeatureTag: AnsiString; out OutGID: Word): Boolean;

function ApplyGSUBContextualFeature(const Wide: UnicodeString; const AFeatureTag: AnsiString): UnicodeString;

function ApplyLocalizedForms(const Wide: UnicodeString): UnicodeString;

 

Gedekte API’s

APIGebruiksaantekeningen
GetSingleSubstituteGlyphBevraagt GSUB LookupType 1 (single substitution) en geeft de invoer-GID terug als er geen match is
GetMultipleSubstituteGlyphsBevraagt GSUB LookupType 2 (multiple substitution) en geeft de vervangende glyphreeks terug
GetAlternateGlyphCountTelt de GSUB LookupType 3-alternatieve glyphs voor een gedekte invoerglyph
GetAlternateGlyphGeeft een geselecteerde alternatieve glyph terug op basis van een op nul gebaseerde alternatiefindex
ApplyLigatureSubstitutionBevraagt GSUB LookupType 4 (ligature substitution) voor een glyphreeks die op een bepaalde index begint
ApplyContextualSubstPast GSUB contextual of chained contextual substitution toe waarbij een regel een segment van de reeks kan vervangen
ApplyReverseChainedContextualSubstBevraagt de GSUB reverse chained contextual single substitution voor vormingsregels die geschikt zijn voor rechts-naar-links
ApplyGSUBContextualFeaturePast een benoemde GSUB contextual feature zoals rclt of calt toe op een Unicode-reeks en wijst de vervangingen veilig toe
ApplyLocalizedFormsPast GSUB locl-vervangingen toe onder het actieve script en de actieve taal en behoudt de mappings voor tekstextractie
MarkUnicodeGlyphUsedVoegt een geretourneerde vervangende GID toe aan de closure van de ingesloten fontsubset
sfContextualAlternatesPast vereiste contextual alternates toe via het rclt-geschikte GSUB contextual-lookuppad
sfLocalizedFormsPast GSUB locl-vervangingen voor gelokaliseerde vormen toe onder het actieve script en de actieve taal

 

Gebruiksaantekeningen

Deze methoden geven aan welke lookup's de GSUB-tabel van het font zou toepassen. ApplyGSUBContextualFeature is het gedeelde pad voor contextual features zoals rclt en calt; ApplyLocalizedForms past locl toe onder het actieve GSUB-script en de actieve taal. Als je de geretourneerde vervangende GID's zelf uitschrijft, moeten MarkUnicodeGlyphUsed of een synthetic-codepoint-mapping ervoor zorgen dat die glyphs in de ingesloten subset en in de ToUnicode-map blijven. Complex-script-pipelines die opgeloste lookups één voor één toepassen, begrenzen elke lookup tot geschikte glyphposities door een per-glyph feature-mask via een PGSUBLookupArray-pointer in de gedeelde TGSUBLookupArray-run te rijgen

 

Zie ook: OpenType GSUB Engine GSUB-script- en taalmethoden ShapingFeatures Subset and mapping methods