src/hb-ot-shape-private.hh | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-)
New commits: commit 634c9e3423a9c23793400d1f56e98070e00b6056 Author: Behdad Esfahbod <[email protected]> Date: Wed Feb 22 16:43:21 2012 -0500 Minor diff --git a/src/hb-ot-shape-private.hh b/src/hb-ot-shape-private.hh index c716962..87e8ddb 100644 --- a/src/hb-ot-shape-private.hh +++ b/src/hb-ot-shape-private.hh @@ -104,40 +104,49 @@ _hb_unicode_modified_combining_class (hb_unicode_funcs_t *ufuncs, { int c = hb_unicode_combining_class (ufuncs, unicode); - /* For Hebrew, 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) - */ - static const int permuted_hebrew_classes[25 - 10 + 1] = { - /* 10 sheva */ 22, - /* 11 hataf segol */ 15, - /* 12 hataf patah */ 16, - /* 13 hataf qamats */ 17, - /* 14 hiriq */ 23, - /* 15 tsere */ 18, - /* 16 segol */ 19, - /* 17 patah */ 20, - /* 18 qamats */ 21, - /* 19 holam */ 14, - /* 20 qubuts */ 24, - /* 21 dagesh */ 12, - /* 22 meteg */ 25, - /* 23 rafe */ 13, - /* 24 shin dot */ 10, - /* 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))) + { + /* 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; - /* The equivalent fix for Hebrew is more complex, - * see the SBL Hebrew manual. - */ + } 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] = { + /* 10 sheva */ 22, + /* 11 hataf segol */ 15, + /* 12 hataf patah */ 16, + /* 13 hataf qamats */ 17, + /* 14 hiriq */ 23, + /* 15 tsere */ 18, + /* 16 segol */ 19, + /* 17 patah */ 20, + /* 18 qamats */ 21, + /* 19 holam */ 14, + /* 20 qubuts */ 24, + /* 21 dagesh */ 12, + /* 22 meteg */ 25, + /* 23 rafe */ 13, + /* 24 shin dot */ 10, + /* 25 sin dot */ 11, + }; c = permuted_hebrew_classes[c - 10]; + } return c; } commit 514b6f88668da4eab85103c536dabe24b7bc457b Author: Behdad Esfahbod <[email protected]> Date: Wed Feb 22 16:34:37 2012 -0500 Followup: Reorder Hebrew combining classes for better rendering Patch from Jonathan Kew. Bug 662055 - advanced Hebrew diacritics are shown correctly only in particular order. diff --git a/src/hb-ot-shape-private.hh b/src/hb-ot-shape-private.hh index 3e3efde..c716962 100644 --- a/src/hb-ot-shape-private.hh +++ b/src/hb-ot-shape-private.hh @@ -104,20 +104,20 @@ _hb_unicode_modified_combining_class (hb_unicode_funcs_t *ufuncs, { int c = hb_unicode_combining_class (ufuncs, unicode); - /* For Hebrew, we permute the "fixed-position" classes 10-15 into the order + /* For Hebrew, 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) */ static const int permuted_hebrew_classes[25 - 10 + 1] = { - /* 10 sheva */ 15, - /* 11 hataf segol */ 16, - /* 12 hataf patah */ 17, - /* 13 hataf qamats */ 18, - /* 14 hiriq */ 19, - /* 15 tsere */ 20, - /* 16 segol */ 21, - /* 17 patah */ 22, - /* 18 qamats */ 23, + /* 10 sheva */ 22, + /* 11 hataf segol */ 15, + /* 12 hataf patah */ 16, + /* 13 hataf qamats */ 17, + /* 14 hiriq */ 23, + /* 15 tsere */ 18, + /* 16 segol */ 19, + /* 17 patah */ 20, + /* 18 qamats */ 21, /* 19 holam */ 14, /* 20 qubuts */ 24, /* 21 dagesh */ 12, commit 6e78607ea71e3e5306f88f227ddba76133d16ed0 Author: Behdad Esfahbod <[email protected]> Date: Wed Feb 22 16:31:15 2012 -0500 Reorder Hebrew combining classes for better rendering Patch from Jonathan Kew. Bug 662055 - advanced Hebrew diacritics are shown correctly only in particular order diff --git a/src/hb-ot-shape-private.hh b/src/hb-ot-shape-private.hh index c49c2b0..3e3efde 100644 --- a/src/hb-ot-shape-private.hh +++ b/src/hb-ot-shape-private.hh @@ -104,12 +104,40 @@ _hb_unicode_modified_combining_class (hb_unicode_funcs_t *ufuncs, { int c = hb_unicode_combining_class (ufuncs, unicode); + /* For Hebrew, we permute the "fixed-position" classes 10-15 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) + */ + static const int permuted_hebrew_classes[25 - 10 + 1] = { + /* 10 sheva */ 15, + /* 11 hataf segol */ 16, + /* 12 hataf patah */ 17, + /* 13 hataf qamats */ 18, + /* 14 hiriq */ 19, + /* 15 tsere */ 20, + /* 16 segol */ 21, + /* 17 patah */ 22, + /* 18 qamats */ 23, + /* 19 holam */ 14, + /* 20 qubuts */ 24, + /* 21 dagesh */ 12, + /* 22 meteg */ 25, + /* 23 rafe */ 13, + /* 24 shin dot */ 10, + /* 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]; return c; } _______________________________________________ HarfBuzz mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/harfbuzz
