This commit is contained in:
Behdad Esfahbod 2012-02-22 16:43:21 -05:00
parent 514b6f8866
commit 634c9e3423
1 changed files with 39 additions and 30 deletions

View File

@ -104,9 +104,28 @@ _hb_unicode_modified_combining_class (hb_unicode_funcs_t *ufuncs,
{ {
int c = hb_unicode_combining_class (ufuncs, unicode); int c = hb_unicode_combining_class (ufuncs, unicode);
/* For Hebrew, we permute the "fixed-position" classes 10-25 into the order if (unlikely (hb_in_range<int> (c, 27, 33)))
* described in the SBL Hebrew manual http://www.sbl-site.org/Fonts/SBLHebrewUserManual1.5x.pdf {
* (as recommended by http://forum.fontlab.com/archive-old-microsoft-volt-group/vista-and-diacritic-ordering-t6751.0.html) /* Modify the combining-class to suit Arabic better. See:
* http://unicode.org/faq/normalization.html#8
* http://unicode.org/faq/normalization.html#9
*/
c = c == 33 ? 27 : c + 1;
}
else if (unlikely (hb_in_range<int> (c, 10, 25)))
{
/* The equivalent fix for Hebrew is more complex.
*
* We permute the "fixed-position" classes 10-25 into the order
* described in the SBL Hebrew manual:
*
* http://www.sbl-site.org/Fonts/SBLHebrewUserManual1.5x.pdf
*
* (as recommended by:
* http://forum.fontlab.com/archive-old-microsoft-volt-group/vista-and-diacritic-ordering-t6751.0.html)
*
* More details here:
* https://bugzilla.mozilla.org/show_bug.cgi?id=662055
*/ */
static const int permuted_hebrew_classes[25 - 10 + 1] = { static const int permuted_hebrew_classes[25 - 10 + 1] = {
/* 10 sheva */ 22, /* 10 sheva */ 22,
@ -126,18 +145,8 @@ _hb_unicode_modified_combining_class (hb_unicode_funcs_t *ufuncs,
/* 24 shin dot */ 10, /* 24 shin dot */ 10,
/* 25 sin dot */ 11, /* 25 sin dot */ 11,
}; };
/* Modify the combining-class to suit Arabic better. See:
* http://unicode.org/faq/normalization.html#8
* http://unicode.org/faq/normalization.html#9
*/
if (unlikely (hb_in_range<int> (c, 27, 33)))
c = c == 33 ? 27 : c + 1;
/* The equivalent fix for Hebrew is more complex,
* see the SBL Hebrew manual.
*/
else if (unlikely (hb_in_range<int> (c, 10, 25)))
c = permuted_hebrew_classes[c - 10]; c = permuted_hebrew_classes[c - 10];
}
return c; return c;
} }