|
THotPDF.AssignSyntheticCodepointForGID / GetSyntheticCodepointForGID THotPDF PUA synthetic codepoint allocator (v2.119.68)
|
GSUB Engine Auto Shaping Pipeline Arabic Shaping |
|
Font의 cmap을 통해 도달할 수 있는 natural Unicode codepoint가 없는 OpenType GSUB substitute GID를 위해 Private Use Area(U+E000 - U+F8FF) synthetic codepoint를 allocate하고 query합니다. v2.119.43-66 GSUB query 및 refinement API가 남긴 producer-side GID-level emission gap을 닫습니다
Delphi 구문: function AssignSyntheticCodepointForGID(GID: Word; out SyntheticCP: Word): Boolean; function GetSyntheticCodepointForGID(GID: Word): Word;
Why the API exists v2.119.32-67 producer-side automatic shaping pipeline(Arabic / Latin / Devanagari)은 GSUB engine이 반환한 substitute GID가 Unicode codepoint를 통해 도달 가능해야 합니다. 기존 hex-encoded text pipeline은 GID가 아니라 codepoint를 emit하고, consumer reader는 embedded
하지만 font-internal GID에 위치하는 font-specific substitute, 즉 대부분의 Devanagari cluster shape, font designer가 numbered GID로만 제공하는 stylistic alternate, CJK ideographic variation sequence(IVS), 대응하는 Presentation Form이 없는 discretionary ligature는 font cmap에 codepoint가 전혀 없습니다. v2.119.68 이전에는 이러한 GID에 producer-side hex pipeline으로 도달할 수 없었습니다. v2.119.68은 호출자가 모든 GID에 대해 Private Use Area의 synthetic codepoint를 allocate할 수 있게 하여 이 gap을 닫습니다
AssignSyntheticCodepointForGID semantics 제공된 GID에 대해 다음 사용 가능한 PUA codepoint(U+E000부터 시작)를 allocate하고, 기존 producer-side hex pipeline + consumer-reader resolution chain이 의존하는 모든 cache에 해당 assignment를 mirror합니다
1. 2. 3.
성공하면
GetSyntheticCodepointForGID semantics 기존 assignment에 대한 pure-functional query입니다. 이전에
Allocator state lifecycle
Typical workflow (Devanagari cluster shape)
PDF.RegisterUnicodeTTF('NotoDeva', 'NotoSansDevanagari-Regular.ttf'); PDF.ShapingFeatures := [sfIndicShaping]; PDF.SetGSUBScript('deva');
// Get a font-internal cluster GID through the GSUB engine ClusterGID := PDF.GetSingleSubstituteGlyph(BaseGID, 'nukt'); if ClusterGID <> BaseGID then begin // Check if cmap reaches the substitute - usually no for Indic // clusters, since cluster GIDs are font-internal // Allocate a synthetic codepoint that the producer-side // hex pipeline can emit if PDF.AssignSyntheticCodepointForGID(ClusterGID, SyntheticCP) then begin // SyntheticCP is now in the U+E000-F8FF range; emit it // through UnicodeTextOut just like a normal codepoint PDF.CurrentPage.UnicodeTextOut(X, Y, 0, UnicodeChar(SyntheticCP)); PDF.MarkUnicodeGlyphUsed(ClusterGID); end; end;
Idempotency example
PDF.AssignSyntheticCodepointForGID(150, CP1); // CP1 = $E000 PDF.AssignSyntheticCodepointForGID(151, CP2); // CP2 = $E001 PDF.AssignSyntheticCodepointForGID(150, CP3); // CP3 = $E000 (idempotent) CP4 := PDF.GetSyntheticCodepointForGID(150); // CP4 = $E000 CP5 := PDF.GetSyntheticCodepointForGID(999); // CP5 = 0 (no assignment)
Consumer-reader behavior Consumer reader는 text-showing operator 안의 PUA codepoint를 보고 document-embedded
Copy / paste behavior:
Phase 8 roadmap closure v2.119.68 / Phase 8c.6은 Phase 8 GSUB engine roadmap을 닫습니다. 모든 LookupType 1-8 query API(Phase 1-6), Script / LangSys selection API(Phase 7), TTF subsetter closure entry point(Phase 9), static post-pass ligature folding(v2.119.32 / 58 / 60 / 62), opt-in automatic pipeline(v2.119.59), Arabic rlig + Latin liga / clig + rclt automatic emission(Phase 8b / 8c.2 / 8b / GSUB 'rclt'), ToUnicode reverse-mapping(v2.119.61 / 62 / 65), advance query(v2.119.64), Devanagari Indic reorder pre-pass(v2.119.67), 그리고 이제 PUA synthetic codepoint GID-level emit(v2.119.68)이 모두 OpenType font가 만들 수 있는 모든 종류의 substitute glyph를 처리하는 하나의 producer-side shaping surface로 통합됩니다
참조: OpenType GSUB Substitution Engine, Automatic Shaping Pipeline (Phase 8), Arabic / Persian / Urdu Shaping Support, Syriac / Mongolian / Devanagari Shaping, THotPDF.BeginTaggedContent |