[indic] Handle old-spec Malayalam reordering with final Halant

See comment.

Micro-tests added.
This commit is contained in:
Behdad Esfahbod 2014-07-23 16:48:51 -04:00
parent d6d349d178
commit fc0daafab0
8 changed files with 30 additions and 5 deletions

View File

@ -921,14 +921,32 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
info[start].indic_position() = POS_RA_TO_BECOME_REPH;
/* For old-style Indic script tags, move the first post-base Halant after
* last consonant. Only do this if there is *not* a Halant after last
* consonant. Otherwise it becomes messy. */
if (indic_plan->is_old_spec) {
* last consonant.
*
* Reports suggest that in some scripts Uniscribe does this only if there
* is *not* a Halant after last consonant already (eg. Kannada), while it
* does it unconditionally in other scripts (eg. Malayalam). We don't
* currently know about other scripts, so we single out Malayalam for now.
*
* Kannada test case:
* U+0C9A,U+0CCD,U+0C9A,U+0CCD
* With some versions of Lohit Kannada.
* https://bugs.freedesktop.org/show_bug.cgi?id=59118
*
* Malayalam test case:
* U+0D38,U+0D4D,U+0D31,U+0D4D,U+0D31,U+0D4D
* With lohit-ttf-20121122/Lohit-Malayalam.ttf
*/
if (indic_plan->is_old_spec)
{
bool disallow_double_halants = buffer->props.script != HB_SCRIPT_MALAYALAM;
for (unsigned int i = base + 1; i < end; i++)
if (info[i].indic_category() == OT_H) {
if (info[i].indic_category() == OT_H)
{
unsigned int j;
for (j = end - 1; j > i; j--)
if (is_consonant (info[j]) || info[j].indic_category() == OT_H)
if (is_consonant (info[j]) ||
(disallow_double_halants && info[j].indic_category() == OT_H))
break;
if (info[j].indic_category() != OT_H && j > i) {
/* Move Halant to after last consonant. */

View File

@ -38,6 +38,7 @@ CLEANFILES += \
TESTS = \
tests/arabic-feature-order.tests \
tests/context-matching.tests \
tests/indic-old-spec.tests \
tests/indic-pref-blocking.tests \
tests/mongolian-variation-selector.tests \
$(NULL)

View File

@ -1,6 +1,8 @@
226bc2deab3846f1a682085f70c67d0421014144.ttf
270b89df543a7e48e206a2d830c0e10e5265c630.ttf
37033cc5cf37bb223d7355153016b6ccece93b28.ttf
4cce528e99f600ed9c25a2b69e32eb94a03b4ae8.ttf
57a9d9f83020155cbb1d2be1f43d82388cbecc88.ttf
813c2f8e5512187fd982417a7fb4286728e6f4a8.ttf
8a9fea2a7384f2116e5b84a9b31f83be7850ce21.ttf
a919b33197965846f21074b24e30250d67277bce.ttf

View File

@ -1,4 +1,5 @@
arabic-feature-order.tests
context-matching.tests
indic-old-spec.tests
indic-pref-blocking.tests
mongolian-variation-selector.tests

View File

@ -0,0 +1,2 @@
fonts/sha1sum/57a9d9f83020155cbb1d2be1f43d82388cbecc88.ttf:U+0C9A,U+0CCD,U+0C9A,U+0CCD:[U0C9A_U0CCD.haln=0+1066|U0C9A_0CCD.blwf=0+0]
fonts/sha1sum/270b89df543a7e48e206a2d830c0e10e5265c630.ttf:U+0D38,U+0D4D,U+0D31,U+0D4D,U+0D31,U+0D4D:[glyph201=0+1183|U0D4D=0+0]

View File

@ -62,3 +62,4 @@
ശിം‌
കോം‌
യ‍്യ
സ്റ്റ്