記錄 HotPDF 的 GPOS pair-kerning、contextual kerning、vertical kerning、cursive-anchor、mark-positioning 與 mark-to-ligature queries,以及 text output 期間套用它們的 ShapingFeatures flags

THotPDF API reference

 

THotPDF Methods  Auto Shaping  GSUB

說明 HotPDF 的 GPOS pair-kerning、contextual kerning、vertical kerning、cursive-anchor、mark-positioning 與 mark-to-ligature queries,以及文字輸出期間套用它們的 ShapingFeatures flags

 

Delphi 語法

function HasGPOSKerning: Boolean;

function GetGPOSPairAdjustment(FirstGID, SecondGID: Word): Integer;

function GetGPOSPairAdjustment(FirstGID, SecondGID: Word; out AXPlacement, AYPlacement, AYAdvance: Integer): Integer;

function GetGPOSContextualKernRun(const GIDs: array of Word): TArray<Integer>;

function HasGPOSVerticalKern: Boolean;

function GetGPOSVerticalKern(FirstGID, SecondGID: Word): Integer;

function GetGPOSMarkOffset(BaseGID, MarkGID: Word; out DX, DY: Integer): Boolean;

function GetGPOSMarkMarkOffset(BaseMarkGID, AttachMarkGID: Word; out DX, DY: Integer): Boolean;

function HasGPOSCursive: Boolean;

function GetGPOSCursiveAnchors(GID: Word; out EntryX, EntryY, ExitX, ExitY: Integer; out HasEntry, HasExit: Boolean): Boolean;

function GetGPOSMarkToLigatureOffset(LigGID: Word; ComponentIndex: Integer; MarkGID: Word; out DX, DY: Integer): Boolean;

function GetGPOSLigatureComponentCount(LigGID: Word): Integer;

function ApplyMarkToLigatureShaping(const Wide: UnicodeString): UnicodeString;

 

Covered APIs

API使用注意事項
HasGPOSKerning回報註冊的 Unicode 字型是否提供 GPOS kerning lookup
GetGPOSPairAdjustmentReturns the signed advance adjustment for an ordered glyph pair and can also return placement-aware X/Y offsets through the overload
GetGPOSContextualKernRun解析字形序列上的 GPOS Type 7 與 Type 8 定位規則,傳回逐字形的 contextual kern 調整值
HasGPOSVerticalKern回報註冊的 Unicode 字型是否提供直排 kerning 或直排比例調整 lookup
GetGPOSVerticalKern對有序字形對,從 vkrn 或 vpal lookup 傳回帶正負號的直排 YAdvance 調整值
GetGPOSMarkOffset傳回把標記字形附到基礎字形的 Mark-to-Base 位置偏移
GetGPOSMarkMarkOffset傳回把一個標記字形疊到另一個之上的 Mark-to-Mark 位置偏移
HasGPOSCursive回報註冊的 Unicode 字型是否提供 GPOS cursive attachment lookup
GetGPOSCursiveAnchors字型有提供 cursive attachment 規則時,傳回該字形的進入與離開 cursive 錨點
GetGPOSMarkToLigatureOffset傳回把標記附到指定連字 component 的 Mark-to-Ligature 位置偏移
GetGPOSLigatureComponentCountReturns the number of mark-attachment components recorded for a ligature glyph so callers can choose a valid ComponentIndex before calling GetGPOSMarkToLigatureOffset
ApplyMarkToLigatureShaping記錄連字 component 的歸屬,讓文字輸出時能套用 mark-to-ligature 偏移
sfKerning在由左至右的 Unicode 文字輸出期間啟用 GPOS 成對 kerning 調整
sfMarkPositioning為組合符號啟用 GPOS Mark-to-Base 與 Mark-to-Mark 偏移
sfMarkToLigature為附到個別連字 component 的標記啟用 GPOS Mark-to-Ligature 偏移
sfCursiveAttachmentEnables GPOS cursive entry/exit anchor alignment during Unicode text emission, including right-to-left Arabic runs shaped by sfArabicGSUB
sfVerticalKerning在直排文字輸出路徑啟用 GPOS vkrn 與 vpal 的直排前進量調整

 

使用注意事項

Pair kerning 會以 1000-unit em 傳回 signed advance 與 placement adjustments。Contextual kerning 會跨 glyph run 解析 Type 7 與 Type 8 lookups。Mark positioning 涵蓋 Mark-to-Base、Mark-to-Mark 與 Mark-to-Ligature anchors。ApplyMarkToLigatureShaping 會準備 sfMarkToLigature 使用的 run-level ligature component data。Cursive attachment 會將一個 glyph 的 exit anchor 對齊到下一個 glyph 的 entry anchor,這在 native Arabic GSUB shaping 已產生帶有這些 anchors 的 font-specific contextual glyph IDs 後最有用。emit path 只會在相符 shaping flag 啟用時套用這些項目

 

請參閱: ShapingFeatures OpenType GSUB Engine Automatic Shaping Pipeline