THotPDF GSUB Lookup Methods

THotPDF API başvurusu

 

THotPDF Methods  Auto Shaping  GSUB

Single, multiple, alternate, ligature, contextual, chained contextual, reverse chained, contextual-feature ve localized-form yerine koymaları için capability düzeyindeki GSUB lookup API'lerini belgeler

 

Delphi sözdizimi

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;

 

Kapsanan API’ler

APIKullanım notları
GetSingleSubstituteGlyphGSUB LookupType 1 single substitution'ı sorgular; eşleşme yoksa girdi GID'ini döndürür
GetMultipleSubstituteGlyphsGSUB LookupType 2 multiple substitution'ı sorgular ve yerine geçen glyph dizisini döndürür
GetAlternateGlyphCountKapsanan bir girdi glyph'i için GSUB LookupType 3 alternate glyph'lerini sayar
GetAlternateGlyphSıfır tabanlı alternate indeksiyle seçilen alternate glyph'i döndürür
ApplyLigatureSubstitutionBelirli bir indeksten başlayan glyph run'ı için GSUB LookupType 4 ligature substitution'ı sorgular
ApplyContextualSubstBir kuralın run segment'ini değiştirebildiği GSUB contextual veya chained contextual substitution'ı uygular
ApplyReverseChainedContextualSubstSağdan sola uyumlu shaping kuralları için GSUB reverse chained contextual single substitution'ı sorgular
ApplyGSUBContextualFeaturerclt veya calt gibi adlandırılmış bir GSUB contextual feature'ını bir Unicode run'ına uygular ve substitution'ları güvenli biçimde eşler
ApplyLocalizedFormsMetin çıkarma eşlemelerini koruyarak etkin script ve dil altında GSUB locl substitution'larını uygular
MarkUnicodeGlyphUsedDöndürülen yerine geçen GID'i gömülü font subset closure'ına ekler
sfContextualAlternatesGerekli contextual alternates'i rclt uyumlu GSUB contextual lookup yolu üzerinden uygular
sfLocalizedFormsEtkin script ve dil altında GSUB locl localized-form substitution'larını uygular

 

Kullanım notları

Bu metodlar, fontun GSUB tablosunun ne yapacağını yanıtlar. ApplyGSUBContextualFeature, rclt ve calt gibi contextual feature'lar için ortak yoldur; ApplyLocalizedForms ise locl'u etkin GSUB script'i ve dili altında uygular. Çağıran, döndürülen yerine geçen GID'leri elle yazıyorsa, MarkUnicodeGlyphUsed veya bir synthetic-codepoint eşlemesi bu glyph'leri gömülü subset ve ToUnicode map içinde tutmalıdır. Çözümlenmiş lookup'ları tek tek uygulayan karmaşık-script pipeline'ları, her lookup'ı uygun glyph konumlarıyla sınırlamak için glyph-başına bir feature mask'ini paylaşılan TGSUBLookupArray run'ına bir PGSUBLookupArray pointer'ı üzerinden geçirir

 

Ayrıca bkz: OpenType GSUB Engine GSUB script and language methods ShapingFeatures Subset and mapping methods