[indic] Allow double-halant in old-spec Devanagari

Fixes https://github.com/harfbuzz/harfbuzz/issues/1071
This commit is contained in:
Behdad Esfahbod 2018-07-31 15:19:32 -07:00
parent fe099a844b
commit 92ba9905ca
3 changed files with 14 additions and 6 deletions

View File

@ -667,10 +667,10 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
* last consonant. * last consonant.
* *
* Reports suggest that in some scripts Uniscribe does this only if there * Reports suggest that in some scripts Uniscribe does this only if there
* is *not* a Halant after last consonant already (eg. Kannada), while it * is *not* a Halant after last consonant already. We know that is the
* does it unconditionally in other scripts (eg. Malayalam, Bengali). We * case for Kannada, while it reorders unconditionally in other scripts,
* don't currently know about other scripts, so we whitelist Malayalam and * eg. Malayalam, Bengali, and Devanagari. We don't currently know about
* Bengali for now. * other scripts, so we whitelist Malayalam, Bengali, and Devanagari.
* *
* Kannada test case: * Kannada test case:
* U+0C9A,U+0CCD,U+0C9A,U+0CCD * U+0C9A,U+0CCD,U+0C9A,U+0CCD
@ -681,15 +681,21 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
* U+0D38,U+0D4D,U+0D31,U+0D4D,U+0D31,U+0D4D * U+0D38,U+0D4D,U+0D31,U+0D4D,U+0D31,U+0D4D
* With lohit-ttf-20121122/Lohit-Malayalam.ttf * With lohit-ttf-20121122/Lohit-Malayalam.ttf
* *
* Bengali test case * Bengali test case:
* U+0998,U+09CD,U+09AF,U+09CD * U+0998,U+09CD,U+09AF,U+09CD
* With Windows XP vrinda.ttf * With Windows XP vrinda.ttf
* https://github.com/harfbuzz/harfbuzz/issues/1073 * https://github.com/harfbuzz/harfbuzz/issues/1073
*
* Devanagari test case:
* U+091F,U+094D,U+0930,U+094D
* With chandas.ttf
* https://github.com/harfbuzz/harfbuzz/issues/1071
*/ */
if (indic_plan->is_old_spec) if (indic_plan->is_old_spec)
{ {
bool disallow_double_halants = buffer->props.script != HB_SCRIPT_MALAYALAM && bool disallow_double_halants = buffer->props.script != HB_SCRIPT_MALAYALAM &&
buffer->props.script != HB_SCRIPT_BENGALI; buffer->props.script != HB_SCRIPT_BENGALI &&
buffer->props.script != HB_SCRIPT_DEVANAGARI;
for (unsigned int i = base + 1; i < end; i++) for (unsigned int i = base + 1; i < end; i++)
if (info[i].indic_category() == OT_H) if (info[i].indic_category() == OT_H)
{ {

View File

@ -1,2 +1,4 @@
../fonts/57a9d9f83020155cbb1d2be1f43d82388cbecc88.ttf::U+0C9A,U+0CCD,U+0C9A,U+0CCD:[U0C9A_U0CCD.haln=0+1066|U0C9A_0CCD.blwf=0+0] ../fonts/57a9d9f83020155cbb1d2be1f43d82388cbecc88.ttf::U+0C9A,U+0CCD,U+0C9A,U+0CCD:[U0C9A_U0CCD.haln=0+1066|U0C9A_0CCD.blwf=0+0]
../fonts/270b89df543a7e48e206a2d830c0e10e5265c630.ttf::U+0D38,U+0D4D,U+0D31,U+0D4D,U+0D31,U+0D4D:[glyph201=0+1183|U0D4D=0+0] ../fonts/270b89df543a7e48e206a2d830c0e10e5265c630.ttf::U+0D38,U+0D4D,U+0D31,U+0D4D,U+0D31,U+0D4D:[glyph201=0+1183|U0D4D=0+0]
../fonts/b722a7d09e60421f3efbc706ad348ab47b88567b.ttf::U+091F,U+094D,U+0930,U+094D,U+0020:[Tra=0+550|virAma=0@-73,-110+0|space=4+500]
../fonts/b722a7d09e60421f3efbc706ad348ab47b88567b.ttf::U+091F,U+094D,U+0930,U+0942:[Tra=0+550|UT=0@42,-150+0]