PeachDrawing.Text
PeachDrawing.Text.Unicode
Scripts Class
Unicode scripts (UAX #24): the script of a character, and the script each character of a text is treated as belonging to once shared characters have been resolved against their surroundings.
public static class Scripts
Inheritance System.Object → Scripts
Remarks
Scripts are named as the Unicode Script property names them, for example Latin,
Arabic, Han. Punctuation, digits and spaces used by many scripts are Common, and
combining marks that take their base’s script are Inherited.
| Fields | |
|---|---|
| Common | The script of characters used by many scripts, such as punctuation, digits and spaces. |
| Inherited | The script of characters that take the script of the character they combine with. |
| Unknown | The script of a code point the Unicode Character Database does not assign one. |
| Methods | |
|---|---|
| Of(int) | The Script property of a code point, with no resolution against surrounding text. |
| Of(Rune) | The Script property of a character, with no resolution against surrounding text. |
| Resolve(IReadOnlyList<int>) | Gives every code point of a text the script it is to be treated as (UAX #24 section 5.1): a character with a real script keeps it, and one that is Common or Inherited takes the nearest preceding real script, or the nearest following one if the text opens with such characters. A text with no real script at all has nothing to resolve against: its Inherited characters become Common and the others stay as they are. |
| ResolveLooked(IReadOnlyList<string>) | The same resolution as Resolve(IReadOnlyList<int>), for a caller that already looked up each character’s script. |