diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp index ce4d4ac..ef86144 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp +++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp @@ -538,8 +538,20 @@ void HB_HeuristicSetGlyphAttributes(HB_ShaperItem *item) #ifndef NO_OPENTYPE static const HB_OpenTypeFeature basic_features[] = { { HB_MAKE_TAG('c', 'c', 'm', 'p'), CcmpProperty }, - { HB_MAKE_TAG('l', 'i', 'g', 'a'), CcmpProperty }, - { HB_MAKE_TAG('c', 'l', 'i', 'g'), CcmpProperty }, + { HB_MAKE_TAG('l', 'i', 'g', 'a'), LigaProperty }, + { HB_MAKE_TAG('c', 'l', 'i', 'g'), CligProperty }, + {0, 0} +}; + +static const HB_OpenTypeFeature disabled_features[] = { + { HB_MAKE_TAG('c', 'p', 'c', 't'), PositioningProperties }, + { HB_MAKE_TAG('h', 'a', 'l', 't'), PositioningProperties }, + // TODO: we need to add certain HB_ShaperFlag for vertical + // writing mode to enable these vertical writing features: + { HB_MAKE_TAG('v', 'a', 'l', 't'), PositioningProperties }, + { HB_MAKE_TAG('v', 'h', 'a', 'l'), PositioningProperties }, + { HB_MAKE_TAG('v', 'k', 'r', 'n'), PositioningProperties }, + { HB_MAKE_TAG('v', 'p', 'a', 'l'), PositioningProperties }, {0, 0} }; #endif @@ -1110,12 +1122,29 @@ HB_Bool HB_SelectScript(HB_ShaperItem *shaper_item, const HB_OpenTypeFeature *fe HB_UInt *feature_tag_list = feature_tag_list_buffer; while (*feature_tag_list) { HB_UShort feature_index; + bool skip = false; if (*feature_tag_list == HB_MAKE_TAG('k', 'e', 'r', 'n')) { - if (face->current_flags & HB_ShaperFlag_NoKerning) { - ++feature_tag_list; - continue; + if (face->current_flags & HB_ShaperFlag_NoKerning) + skip = true; + else + face->has_opentype_kerning = true; + } + features = disabled_features; + while (features->tag) { + if (*feature_tag_list == features->tag) { + skip = true; + break; } - face->has_opentype_kerning = true; + ++features; + } + // 'palt' should be turned off by default unless 'kern' is on + if (!face->has_opentype_kerning && + *feature_tag_list == HB_MAKE_TAG('p', 'a', 'l', 't')) + skip = true; + + if (skip) { + ++feature_tag_list; + continue; } error = HB_GPOS_Select_Feature(face->gpos, *feature_tag_list, script_index, 0xffff, &feature_index); if (!error) |