THotPDF GPOS Kerning and Placement Methods

THotPDF API 참조

 

THotPDF 메서드  자동 shaping  GSUB

HotPDF의 GPOS pair-kerning, contextual kerning, vertical kerning, cursive-anchor, mark-positioning, mark-to-ligature 조회와 텍스트 출력 시 이를 적용하는 ShapingFeatures 플래그를 문서화합니다

 

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;

 

다루는 API

API사용 참고 사항
HasGPOSKerning등록된 Unicode 폰트가 GPOS kerning lookup을 노출하는지 보고합니다
GetGPOSPairAdjustment순서화된 glyph 쌍의 부호 있는 advance 조정을 반환하고, overload를 통해 배치를 반영한 X/Y 오프셋도 반환할 수 있습니다
GetGPOSContextualKernRunglyph run에 걸쳐 GPOS Type 7/8 positioning 규칙을 해석해 glyph별 contextual kern 조정을 반환합니다
HasGPOSVerticalKern등록된 Unicode 폰트가 vertical kerning 또는 vertical proportional adjustment lookup을 노출하는지 보고합니다
GetGPOSVerticalKern순서화된 glyph 쌍에 대해 vkrn/vpal lookup의 부호 있는 세로 YAdvance 조정을 반환합니다
GetGPOSMarkOffsetmark glyph를 base glyph에 붙이기 위한 Mark-to-Base 배치 오프셋을 반환합니다
GetGPOSMarkMarkOffsetmark glyph를 다른 mark glyph 위에 쌓기 위한 Mark-to-Mark 배치 오프셋을 반환합니다
HasGPOSCursive등록된 Unicode 폰트가 GPOS cursive attachment lookup을 노출하는지 보고합니다
GetGPOSCursiveAnchors폰트가 cursive attachment 규칙을 제공할 때 glyph의 진입/이탈 cursive anchor를 반환합니다
GetGPOSMarkToLigatureOffsetmark를 특정 ligature 컴포넌트에 붙이기 위한 Mark-to-Ligature 배치 오프셋을 반환합니다
GetGPOSLigatureComponentCountligature glyph에 기록된 mark-attachment 컴포넌트 수를 반환해 호출자가 ComponentIndex 를 호출하기 전 유효한 GetGPOSMarkToLigatureOffset
ApplyMarkToLigatureShapingligature 컴포넌트 소유권을 기록해 텍스트 출력 중 mark-to-ligature 오프셋을 적용할 수 있게 합니다
sfKerningleft-to-right Unicode 텍스트 출력 중 GPOS pair-kerning 조정을 켭니다
sfMarkPositioningcombining mark에 대한 GPOS Mark-to-Base/Mark-to-Mark 오프셋을 켭니다
sfMarkToLigature개별 ligature 컴포넌트에 붙는 mark에 대한 GPOS Mark-to-Ligature 오프셋을 켭니다
sfCursiveAttachmentUnicode 텍스트 출력 중 GPOS cursive 진입/이탈 anchor 정렬을 켭니다. 다음에 의해 shaping된 right-to-left 아랍어 run을 포함합니다 sfArabicGSUB
sfVerticalKerning세로 텍스트 출력 경로에서 GPOS vkrn과 vpal 세로 advance 조정을 켭니다. 조정된 걸음은 glyph마다 하나의 show 블록을 출력해서 실려 나갑니다

 

사용 참고 사항

Pair kerning은 1000 유닛 em 기준으로 부호 있는 advance·배치 조정을 반환합니다. Contextual kerning은 glyph run에 걸쳐 Type 7/8 lookup을 해석합니다. Mark positioning은 Mark-to-Base, Mark-to-Mark, Mark-to-Ligature anchor를 다룹니다. ApplyMarkToLigatureShaping은 sfMarkToLigature가 쓰는 run 수준 ligature 컴포넌트 데이터를 준비합니다. Cursive attachment는 한 glyph의 이탈 anchor를 다음 glyph의 진입 anchor에 정렬하며, native 아랍어 GSUB shaping이 그 anchor를 지닌 폰트별 contextual glyph ID를 만들어 낸 뒤에 가장 유용합니다. 출력 경로는 대응 shaping 플래그가 켜져 있을 때만 이를 적용합니다

 

참고: ShapingFeatures OpenType GSUB Engine Automatic Shaping Pipeline