Fix Mongolian Variation Selectors for fonts without GDEF

Originally we fixed those in 79d1007a50.
However, fonts like MongolianWhite don't have GDEF, but have IgnoreMarks
in their LigatureSubstitute init/etc features.  We were synthesizing a
GDEF class of mark for Mongolian Variation Selectors and as such the
ligature lookups where not matching.  Uniscribe doesn't do that.

I tried with more sophisticated fixes, like, if there is no GDEF and
a lookup-flag mismatch happens, instead of rejecting a match, try
skipping that glyph.  That surely produces some interesting behavior,
but since we don't want to support fonts missing GDEF more than we have
to, I went for this simpler fix which is to always mark
default-ignorables as base when synthesizing GDEF.

Micro-test added.

Fixes rest of https://bugs.freedesktop.org/show_bug.cgi?id=65258
This commit is contained in:
Behdad Esfahbod 2014-07-16 13:22:05 -04:00
parent 878a25375b
commit 3b861421a7
5 changed files with 14 additions and 2 deletions

View File

@ -395,8 +395,17 @@ hb_synthesize_glyph_classes (hb_ot_shape_context_t *c)
{
hb_ot_layout_glyph_class_mask_t klass;
klass = _hb_glyph_info_get_general_category (&info[i]) !=
HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK ?
/* Never mark default-ignorables as marks.
* They won't get in the way of lookups anyway,
* but having them as mark will cause them to be skipped
* over if the lookup-flag says so, but at least for the
* Mongolian variation selectors, looks like Uniscribe
* marks them as non-mark. Some Mongolian fonts without
* GDEF rely on this. Another notable character that
* this applies to is COMBINING GRAPHEME JOINER. */
klass = (_hb_glyph_info_get_general_category (&info[i]) !=
HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK ||
_hb_glyph_info_is_default_ignorable (&info[i])) ?
HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH :
HB_OT_LAYOUT_GLYPH_PROPS_MARK;
_hb_glyph_info_set_glyph_props (&info[i], klass);

View File

@ -1,4 +1,5 @@
226bc2deab3846f1a682085f70c67d0421014144.ttf
37033cc5cf37bb223d7355153016b6ccece93b28.ttf
4cce528e99f600ed9c25a2b69e32eb94a03b4ae8.ttf
d629e7fedc0b350222d7987345fe61613fa3929a.ttf
e207635780b42f898d58654b65098763e340f5c7.ttf

View File

@ -1,2 +1,3 @@
context-matching.tests
indic-pref-blocking.tests
mongolian-variation-selector.tests

View File

@ -0,0 +1 @@
fonts/sha1sum/37033cc5cf37bb223d7355153016b6ccece93b28.ttf:U+1826,U+180B,U+1826:[uni1826.E85E_ue.init1=0+599|uni1826.E856_ue.fina=2+750]