complex script 및 fine typography 를 제어하기 위한 고차원 api.
fine typography 와 complex script 를 layout 하기 위해서는 간단한 방법으로 되지 않기 때문에 usp10이 필요하다.
complex script의 포지셔닝 및 쉐이핑은 unicode standard를 따른다.
Complex Script란?
- Bidirection Rendering
- Contextual Shaping
캐릭터를 감싸고있는것에 따라 쉐이프를 달리한다. ae, fi, sz 등등 Ligature
- Combining Character
- Specialized Word Break and Justification
태국어의 경우 단어를 자르는 경우 복잡한 룰이 적용된다.
- Filtering for illegal Character Combinations
태국어의 경우 어떤 캐릭터의 조합을 막는 필터가 필요함.
- Font Fallback
ScriptStringAnalyse 함수에 의해 적용됨.
Shaping / Other Processing / Caret / Words and Character Clusters
ScriptGetProperties
ScriptShape
generate glyphs and visual attributes for a unicode run.
어플리케이션들은 ScriptShape 함수로 shaping engine 에 접근할 수 있다. 모든 complex script shaping engine들은 쉐이핑 하기 전에 디바이스 컨테스트 핸들에 표시된 폰트를 유효화한다. Complex script들은 반드시 ScriptItemize 함수에 의해 리턴된 스크립트를 사용해서 shape 된다.
SCRIPT_ANALYSIS의 eScript 멤버에 SCRIPT_UNDEFINED라고 적혀 shape 되면 인쇄상의 품질은 떨어질 수 있지만 other runs는 읽기쉽게 유지된다(? 먼말이지)
ScriptShape는 성공하거나, USP_E_SCRIPT_NOT_IN_FONT( 어플리케이션이 제공하는 폰트가 충분한 글리프나 shaping table를 포함하지 않을 경우) 0을 리턴한다. 폰트가 몇몇 글자를 서포트하지않거나 SCRIPT_UNDEFINED 일경우에도 일단 함수는 0을 리턴. 이 경우에는 missing glyph의 대체를 하기 위해 어플리케이션이 glyph output buffer를 스캔해야 한다. FontFallback에 자세히 나올듯.
Glyph와 GlyphRun이란?
glyph는 폰트에서 캐릭터를 나타내는 물리적 표현이다. A를 나타내더라도 폰트에 따라 다른 모양을 갖는것. 그 모양을 glyph라고 함.
glyph run은 같은 face, size, effect를 갖는 연속된 glyph set. (underline 이나 strike등은 상관없다)
ScriptItemize
Caching
Displaying Text width Uniscribe
Processing Complex Scripts
Using Font Fallback
Using the ScriptString Functions
Displaying the Caret in Bidirectional Strings
Managing Caret Placement and Hit Testing
Translating Mouse Hit X Offset to Caret Position
Using Character Clusters
Using Word Break Points
Working with Relationships Among Caret Positions, Justification Points, and Clusters.
bidi.c에서
BIDI_Recorder 라는 클래스에서 ScriptItemize, ScriptShape, ScriptLayout 등을 이용.
get_char_typeW ->
msed_wctype_table(wtype.c)이용해서 캐릭터의 directory 결정함.
근데 direction도 오른쪽 왼쪽만 있는게 아님.
ON = Other Neutral
L, R = left, right
AN = Arabic Number
EN = European Number
...
'Font' 카테고리의 다른 글
MSDN API (Text 및 Font) (0) | 2017.01.03 |
---|---|
Uniscribe 분석 (1) (0) | 2016.07.06 |