[subset] never drop the 'pref' feature.

Never ever drop feature 'pref', even if it's empty. Harfbuzz uses it to choose the shaper for Khmer.
This commit is contained in:
Garret Rieger 2021-04-01 14:32:38 -07:00
parent 092094f705
commit c35d786397
12 changed files with 21 additions and 0 deletions

View File

@ -3728,6 +3728,13 @@ struct GSUBGPOS
for (unsigned i : feature_indices->iter())
{
const Feature& f = get_feature (i);
hb_tag_t tag = get_feature_tag (i);
if (tag == HB_TAG ('p', 'r', 'e', 'f'))
// Note: Never ever drop feature 'pref', even if it's empty.
// HarfBuzz chooses shaper for Khmer based on presence of this
// feature. See thread at:
// http://lists.freedesktop.org/archives/harfbuzz/2012-November/002660.html
continue;
if (f.featureParams.is_null ()
&& !f.intersects_lookup_indexes (lookup_indices)

View File

@ -26,6 +26,7 @@ EXTRA_DIST += \
expected/layout.gsub5 \
expected/layout.gsub6 \
expected/layout.gsub8 \
expected/layout.khmer \
expected/layout.gdef \
expected/layout.context \
expected/layout.gdef-varstore \

View File

@ -25,6 +25,7 @@ TESTS = \
tests/layout.gsub5.tests \
tests/layout.gsub6.tests \
tests/layout.gsub8.tests \
tests/layout.khmer.tests \
tests/layout.notonastaliqurdu.tests \
tests/layout.tests \
tests/sbix.tests \

Binary file not shown.

View File

@ -0,0 +1,11 @@
FONTS:
Khmer.ttf
PROFILES:
keep-layout.txt
keep-layout-retain-gids.txt
SUBSETS:
1
ញុំបានមើ

View File

@ -19,6 +19,7 @@ tests = [
'layout.gsub6',
'layout.gsub8',
'layout.gdef',
'layout.khmer',
'layout.context',
'layout.gdef-varstore',
'layout.gdef-attachlist',