THotPDF.ShapingFeatures Property

THotPDF API 參考

 

THotPDF Methods  Auto Shaping  GSUB

控制 HotPDF 的 opt-in producer-side shaping、positioning、localized-form 與 script-preprocess pipeline。預設空集合會保持 output byte-stable;每個 flag 會在 Unicode font 與 text run 需要時啟用特定 GSUB、GPOS 或 script-level path

 

Delphi 語法

property ShapingFeatures: THPDFShapingFeatures read FShapingFeatures write FShapingFeatures;

type THPDFShapingFeature = (sfArabicGSUB, sfStandardLigatures, sfContextualLigatures, sfStylisticAlternates, sfIndicShaping, sfContextualAlternates, sfKerning, sfMarkPositioning, sfTibetanShaping, sfMongolianShaping, sfIndicGSUB, sfLocalizedForms, sfVerticalKerning, sfThaiLaoReorder, sfHebrewReorder, sfJavaneseShaping, sfMarkToLigature, sfCursiveAttachment, sfDiscretionaryLigatures, sfHistoricalLigatures, sfSmallCaps, sfCapsToSmallCaps, sfOldstyleFigures, sfLiningFigures, sfSuperscripts, sfSubscripts, sfOrdinals, sfFractions, sfTaiVietReorder, sfMeeteiMayekShaping, sfDistancePositioning, sfKhmerShaping, sfMyanmarShaping, sfVerticalAlternates, sfCaseSensitiveForms, sfSlashedZero, sfProportionalFigures, sfTabularFigures, sfScientificInferiors, sfNumerators, sfDenominators);

 

涵蓋的 API

API使用注意事項
sfArabicGSUB啟用原生 Arabic GSUB contextual shaping:套用已註冊字型的 init、medi、fina、isol、rlig、calt 與 rclt lookups,必要時透過 synthetic codepoints 發出所得的 glyph IDs
sfStandardLigatures字型提供 liga feature 時,套用 fi、fl、ffi、ffl 等標準 Latin ligature 替換
sfContextualLigatures在標準 ligature 處理之後,透過 clig 加入 contextual ligature 替換
sfStylisticAlternates保留給由呼叫端控制、會明確查詢 alternate glyphs 的 stylistic alternate workflow
sfIndicShaping在文字輸出前執行保守的 Indic syllable reorder 路徑,不強制套用完整 GSUB feature
sfContextualAlternates透過支援 rclt 的 GSUB contextual lookup 路徑套用必要的 contextual alternate
sfKerning在由左至右的 Unicode 文字輸出期間啟用 GPOS pair-kerning 調整
sfMarkPositioning為 combining marks 啟用 GPOS Mark-to-Base 與 Mark-to-Mark 偏移
sfTibetanShaping啟用 Tibetan GSUB shaping,並為 shaping 後的 Tibetan glyph IDs 發出 synthetic codepoints
sfMongolianShaping透過 joining 分析與字型 GSUB lookups 啟用 Mongolian positional-form shaping
sfIndicGSUB執行 Indic reorder 與 GSUB feature 鏈,然後透過 synthetic codepoints 發出 shaping 後的 glyph IDs
sfLocalizedForms在目前的 script 與語言下套用 GSUB locl localized-form 替換
sfVerticalKerning在直排文字輸出路徑中啟用 GPOS vkrn 與 vpal 的垂直 advance 調整
sfThaiLaoReorder在 cmap-to-GID mapping 之前啟用 Thai/Lao SARA AM 分解與 tone-mark 排序
sfHebrewReorder在 RTL 輸出與 mark placement 之前,依 canonical combining class 排序 Hebrew niqqud 與 points
sfJavaneseShaping在 glyph mapping 之前啟用 Javanese pre-base vowel-sign reorder
sfMarkToLigature為附加在 ligature 元件上的 combining marks 啟用 GPOS Mark-to-Ligature placement
sfCursiveAttachment為經字型原生 Arabic GSUB lookups shaping 的 glyph runs 啟用 GPOS cursive entry/exit anchor 對齊
sfDiscretionaryLigatures透過 OpenType dlig feature 套用 discretionary ligature 替換
sfHistoricalLigatures透過 OpenType hlig feature 套用 historical ligature 替換
sfSmallCaps透過 OpenType smcp feature 套用小寫轉 small-cap 的替換
sfCapsToSmallCaps透過 OpenType c2sc feature 套用大寫轉 small-cap 的替換
sfOldstyleFigures透過 OpenType onum feature 套用 oldstyle 數字替換
sfLiningFigures透過 OpenType lnum feature 套用 lining 數字替換
sfSuperscripts透過 OpenType sups feature 套用上標 glyph 替換
sfSubscripts透過 OpenType subs feature 套用下標 glyph 替換
sfOrdinals透過 OpenType ordn feature 套用序數 glyph 替換
sfFractions透過 OpenType frac feature 套用 numerator、fraction slash 與 denominator 替換
sfTaiVietReorder在 cmap-to-GID mapping 之前啟用 Tai Viet visual-order-left vowel 與 mark ordering
sfMeeteiMayekShaping在 cmap-to-GID mapping 之前啟用 Meetei Mayek Brahmic-style syllable reorder
sfDistancePositioning針對超出單純 kerning 的 complex-script spacing lookups,套用 GPOS distance positioning
sfKhmerShaping在 cmap-to-GID mapping 之前啟用 Khmer pre-base vowel 與 cluster reorder
sfMyanmarShaping在 cmap-to-GID mapping 之前啟用 Myanmar kinzi、pre-base vowel、medial 與 mark reorder
sfVerticalAlternates透過 OpenType vert 與 vrt2 features 套用 vertical alternate 替換
sfCaseSensitiveForms透過 OpenType case feature 套用 case-sensitive 標點與符號替換
sfSlashedZero透過 OpenType zero feature 套用斜線零數字替換
sfProportionalFigures透過 OpenType pnum feature 套用比例數字寬度替換
sfTabularFigures透過 OpenType tnum feature 套用等寬數字寬度替換
sfScientificInferiors透過 OpenType sinf feature 套用科學下標 glyph 替換
sfNumerators透過 OpenType numr feature 套用分子 glyph 替換
sfDenominators透過 OpenType dnom feature 套用分母 glyph 替換

 

使用注意事項

請在 RegisterUnicodeTTF 後、寫入文字前使用此 property。locl substitutions 請選 sfLocalizedForms;typographic alternates 與 figure styles 請選 feature-family flags;GPOS advance adjustment 請選 sfKerning、sfVerticalKerning 與 sfDistancePositioning;mark 或 cursive attachment 請選 sfMarkPositioning、sfMarkToLigature 與 sfCursiveAttachment;完整 Indic GSUB shaping 請選 sfIndicGSUB;Thai/Lao、Khmer、Myanmar、Tai Viet、Meetei Mayek、Hebrew 與 Javanese text 請選 script-specific preprocess flags

 

請參閱: Automatic Shaping Pipeline GPOS methods Indic shaping methods Script shaping preprocess methods