... | ... | @@ -4,6 +4,7 @@ Table of Contents |
|
|
|
|
|
- [Overview](#overview)
|
|
|
- [APIs for Text Processing](#apis-for-text-processing)
|
|
|
* [Changes of Character and Glyph APIs](#changes-of-character-and-glyph-apis)
|
|
|
* [New APIs Conforming to Unicode 12.0](#new-apis-conforming-to-unicode-120)
|
|
|
* [Processing Text in Standard Scripts](#processing-text-in-standard-scripts)
|
|
|
* [Processing Text in Complex Scripts](#processing-text-in-complex-scripts)
|
... | ... | @@ -17,14 +18,14 @@ in order to support complex or mixed scripts, we tuned and enhanced |
|
|
MiniGUI's font interfaces in version 4.0.0.
|
|
|
|
|
|
But this is only a small part of the whole story. To show a text paragraph in
|
|
|
complex/mixed scripts, we must implement the complete APIs which conforming
|
|
|
complex/mixed scripts, we must implement the complete APIs which conform
|
|
|
to Unicode standards and specifications, including the Unicode
|
|
|
Bidirectional Algorithm (UAX#9), Unicode Line Breaking Algorithm
|
|
|
(UAX#14), Unicode Normalization Forms (UAX#15), Unicode Script Property
|
|
|
(UAX#24), Unicode Text Segmentation (UAX#29), Unicode Vertical
|
|
|
Text Layout (UAX#50), and so on.
|
|
|
|
|
|
On the basis of full support for Unicode, we provides APIs for laying out,
|
|
|
On the basis of full support for Unicode, we provide APIs for laying out,
|
|
|
shaping, and rendering the text in complex or mixed scripts. This document
|
|
|
describes how to use these APIs.
|
|
|
|
... | ... | @@ -43,7 +44,7 @@ The common languages, such as English and modern Chinese, are |
|
|
`standard scripts`. In these scripts, there is a one-to-one relationship
|
|
|
between an encoded character (e.g. 0x4E2D in UTF-8) and the glyph (中)
|
|
|
that represents it. And we write the characters in standard scripts
|
|
|
always from left to right horizontally then from top to bottom vertically.
|
|
|
often from left to right horizontally then from top to bottom vertically.
|
|
|
|
|
|
A `glyph` is a set of data which represents a specific character in a
|
|
|
visual or printable form. In computer, a glyph may be a bitmap or a
|
... | ... | @@ -75,12 +76,55 @@ rendering text in these scripts. Additional glyph processing to render |
|
|
appropriately sophisticated typography may be desirable beyond the minimum
|
|
|
required to make the text readable.
|
|
|
|
|
|
The situation becomes more complicated when we process a text in
|
|
|
The situation becomes more complicated when we process text in
|
|
|
`mixed scripts`. That is, the text contains characters from different
|
|
|
scripts, for example, Latin, Arabic, and Chinese.
|
|
|
scripts, for example, Latin, Arabic, and Han.
|
|
|
|
|
|
## APIs for Text Processing
|
|
|
|
|
|
### Changes of Character and Glyph APIs
|
|
|
|
|
|
In early versions, we did not significantly distinguish between
|
|
|
characters and glyphs. This will lead to some confusion. Therefore,
|
|
|
we introduce a new type called `Achar32`, which is the character's
|
|
|
index value under a certain charset/encoding. While the type `Glyph32`
|
|
|
is the index value of a glyph in a font.
|
|
|
|
|
|
In order to reflect the correct character and glyph concepts,
|
|
|
the following functions are removed:
|
|
|
|
|
|
* GetGlyphType, use GetACharType instead.
|
|
|
* GetGlyphShape, use GetShapedAChar instead.
|
|
|
* GetGlyphBIDIType, use GetACharBidiType
|
|
|
|
|
|
The names of the following functions are changed:
|
|
|
|
|
|
* BIDIGetTextLogicalGlyphs -> BIDIGetTextLogicalAChars
|
|
|
* BIDIGetTextVisualGlyphs -> BIDIGetTextVisualAChars
|
|
|
* BIDILogAChars2VisGlyphs -> BIDILogAChars2VisAChars
|
|
|
* BIDILogAChars2VisGlyphsEx -> BIDILogAChars2VisACharsEx
|
|
|
|
|
|
But the following functions are deprecated, you should use
|
|
|
the new Unicode version instead:
|
|
|
|
|
|
* BIDIGetTextLogicalAChars
|
|
|
* BIDIGetTextVisualAChars
|
|
|
* BIDILogAChars2VisAChars
|
|
|
* BIDILogAChars2VisACharsEx
|
|
|
* BIDIGetTextRangesLog2Vis
|
|
|
* BIDIGetLogicalEmbedLevelsEx
|
|
|
|
|
|
The following functions are deprecated:
|
|
|
|
|
|
* GetGlyphBitmap, use GetGlyphInfo instead.
|
|
|
|
|
|
The fields `height` and `descent` have been removed from GLYPHINFO structure.
|
|
|
You should get the font metrics information by calling `GetFontMetrics` function
|
|
|
if you want to get the height and descent data of one font.
|
|
|
|
|
|
The the basic glyph type and break type have been removed from GLYPHINFO
|
|
|
structure. You should use `GetACharType` instead.
|
|
|
|
|
|
### New APIs Conforming to Unicode 12.0
|
|
|
|
|
|
- New types:
|
... | ... | |