diff options
| author | eunhhu <[email protected]> | 2026-09-28 11:43:16 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-28 11:43:16 +0100 |
| commit | 482d3c93255277f5251008638bc59bfab0eb4b9e (patch) | |
| tree | 5e230bdcf6c04f50c7a98dfe50f403b502add1e3 /text/text.h | |
| parent | 8ba0615b0fe832a15eb695ccd661674b6946995c (diff) | |
| download | vega-482d3c93255277f5251008638bc59bfab0eb4b9e.tar.gz vega-482d3c93255277f5251008638bc59bfab0eb4b9e.zip | |
Normalize text to NFD and NFC, passing all of Unicode's normalization tests
Diffstat (limited to 'text/text.h')
| -rw-r--r-- | text/text.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/text/text.h b/text/text.h index e4e50ac..40503c0 100644 --- a/text/text.h +++ b/text/text.h @@ -21,6 +21,17 @@ int vega_bracket(uint32_t code, uint32_t *pair); /* The character that mirrors code (Bidi_Mirroring_Glyph), or 0. */ uint32_t vega_mirror(uint32_t code); +/* Canonical_Combining_Class; a code point's full canonical decomposition + * (0 when it has none; Hangul syllables are left to vega_nfd); the primary + * composite of two code points, or 0. */ +uint8_t vega_combining_class(uint32_t code); +size_t vega_decomposition(uint32_t code, const uint32_t **out); +uint32_t vega_composition(uint32_t first, uint32_t second); +/* Normalization forms D and C (UAX #15): out has room for 4 * count code + * points (the most one decomposes into); returns how many it holds. */ +size_t vega_nfd(const uint32_t *in, size_t count, uint32_t *out); +size_t vega_nfc(const uint32_t *in, size_t count, uint32_t *out); + /* The embedding levels of one paragraph by the Unicode Bidirectional * Algorithm (UAX #9, rules P2 to I2), then L1 as for one line: classes are * its characters' Bidi_Class; codes, when given, are the characters, so |
