[Indic] Another try to unbreak Sinhala split matras
Just read the comments...
This commit is contained in:
parent
977f1740ac
commit
43b6531500
|
@ -1317,15 +1317,42 @@ decompose_indic (const hb_ot_shape_normalize_context_t *c,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (indic_options ().uniscribe_bug_compatible)
|
if ((ab == 0x0DDA || hb_in_range<hb_codepoint_t> (ab, 0x0DDC, 0x0DDE)))
|
||||||
switch (ab)
|
|
||||||
{
|
{
|
||||||
/* These Sinhala ones have Unicode decompositions, but Uniscribe
|
/*
|
||||||
* decomposes them "Khmer-style". */
|
* Sinhala split matras... Let the fun begin.
|
||||||
case 0x0DDA : *a = 0x0DD9; *b= 0x0DDA; return true;
|
*
|
||||||
case 0x0DDC : *a = 0x0DD9; *b= 0x0DDC; return true;
|
* These four characters have Unicode decompositions. However, Uniscribe
|
||||||
case 0x0DDD : *a = 0x0DD9; *b= 0x0DDD; return true;
|
* decomposes them "Khmer-style", that is, it uses the character itself to
|
||||||
case 0x0DDE : *a = 0x0DD9; *b= 0x0DDE; return true;
|
* get the second half. The first half of all four decompositions is always
|
||||||
|
* U+0DD9.
|
||||||
|
*
|
||||||
|
* Now, there are buggy fonts, namely, the widely used lklug.ttf, that are
|
||||||
|
* broken with Uniscribe. But we need to support them. As such, we only
|
||||||
|
* do the Uniscribe-style decomposition if the character is transformed into
|
||||||
|
* its "sec.half" form by the 'pstf' feature. Otherwise, we fall back to
|
||||||
|
* Unicode decomposition.
|
||||||
|
*
|
||||||
|
* Note that we can't unconditionally use Unicode decomposition. That would
|
||||||
|
* break some other fonts, that are designed to work with Uniscribe, and
|
||||||
|
* don't have positioning features for the Unicode-style decomposition.
|
||||||
|
*
|
||||||
|
* Argh...
|
||||||
|
*/
|
||||||
|
|
||||||
|
const indic_shape_plan_t *indic_plan = (const indic_shape_plan_t *) c->plan->data;
|
||||||
|
|
||||||
|
hb_codepoint_t glyph;
|
||||||
|
|
||||||
|
if (indic_options ().uniscribe_bug_compatible ||
|
||||||
|
(c->font->get_glyph (ab, 0, &glyph) &&
|
||||||
|
indic_plan->pstf.would_substitute (&glyph, 1, true, c->font->face)))
|
||||||
|
{
|
||||||
|
/* Ok, safe to use Uniscribe-style decomposition. */
|
||||||
|
*a = 0x0DD9;
|
||||||
|
*b = ab;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return c->unicode->decompose (ab, a, b);
|
return c->unicode->decompose (ab, a, b);
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
extensive.txt
|
extensive.txt
|
||||||
misc.txt
|
misc.txt
|
||||||
reph.txt
|
reph.txt
|
||||||
|
split-matras.txt
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
කේ
|
||||||
|
කො
|
||||||
|
කෝ
|
||||||
|
කෞ
|
Loading…
Reference in New Issue