aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-28 14:48:00 +0100
committereunhhu <[email protected]>2026-09-28 14:48:00 +0100
commitc23b79f1cb599ee7766002ad23756643e72113e5 (patch)
tree259fce8b301f8cf7a0d353d0115db8e2ba8c9a04
parentb540ccf0cc7a7ccd9b44b2664400bb5e05179d14 (diff)
downloadvega-c23b79f1cb599ee7766002ad23756643e72113e5.tar.gz
vega-c23b79f1cb599ee7766002ad23756643e72113e5.zip
Give Telugu's length marks classes 4 and 5, as HarfBuzz 10.2 does
HarfBuzz reorders marks by a modified combining class; for U+0C55 and U+0C56 (canonical classes 84 and 91) it is 4 and 5, so they sort before the virama. Vega had 0, which rustybuzz 0.20 uses; HarfBuzz 10.2's hb-unicode.hh says otherwise, and Unifont's Telugu showed it.
-rw-r--r--text/shape.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/text/shape.c b/text/shape.c
index 0016fa0..0813bae 100644
--- a/text/shape.c
+++ b/text/shape.c
@@ -568,7 +568,8 @@ static bool default_ignorable(uint32_t ch) {
static bool variation_selector(uint32_t ch) { return (ch >= 0xFE00 && ch <= 0xFE0F) || (ch >= 0xE0100 && ch <= 0xE01EF); }
/* Canonical_Combining_Class as HarfBuzz reorders by: Hebrew's fixed
- * positions in the SBL order, Arabic's shadda before the other marks. */
+ * positions in the SBL order, Arabic's shadda before the other marks,
+ * Telugu's length marks before the virama (hb-unicode.hh). */
static unsigned modified_combining_class(uint32_t u) {
if (u == 0x1A60 || u == 0x0FC6) return 254;
if (u == 0x0F39) return 127;
@@ -577,7 +578,8 @@ static unsigned modified_combining_class(uint32_t u) {
unsigned c = vega_combining_class(u);
if (c >= 10 && c <= 36) return hebrew_arabic[c - 10];
switch (c) {
- case 84: case 91: return 0;
+ case 84: return 4;
+ case 91: return 5;
case 103: return 3;
case 130: return 132;
case 132: return 131;