diff options
author | Steve Kondik <steve@cyngn.com> | 2015-12-07 16:53:23 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-12-07 16:53:23 -0800 |
commit | 4055ec7d38073b5cf93864ba25e6f12cb8720917 (patch) | |
tree | 6c0cc09fad685d13b9e7a797842bc6a143626560 /libs/minikin/FontCollection.cpp | |
parent | 9b9883f253c09a6ff1bdc56648cdec524a583cf3 (diff) | |
parent | 86542797761632890092ef89b7fb58c2c2cdfc11 (diff) | |
download | android_frameworks_minikin-4055ec7d38073b5cf93864ba25e6f12cb8720917.tar.gz android_frameworks_minikin-4055ec7d38073b5cf93864ba25e6f12cb8720917.tar.bz2 android_frameworks_minikin-4055ec7d38073b5cf93864ba25e6f12cb8720917.zip |
Merge tag 'android-6.0.1_r3' of https://android.googlesource.com/platform/frameworks/minikin into HEAD
Android 6.0.1 release 3
Diffstat (limited to 'libs/minikin/FontCollection.cpp')
-rw-r--r-- | libs/minikin/FontCollection.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/minikin/FontCollection.cpp b/libs/minikin/FontCollection.cpp index b4bfe31..2bcbc03 100644 --- a/libs/minikin/FontCollection.cpp +++ b/libs/minikin/FontCollection.cpp @@ -167,6 +167,10 @@ static bool isStickyWhitelisted(uint32_t c) { return false; } +static bool isVariationSelector(uint32_t c) { + return (0xFE00 <= c && c <= 0xFE0F) || (0xE0100 <= c && c <= 0xE01EF); +} + void FontCollection::itemize(const uint16_t *string, size_t string_size, FontStyle style, vector<Run>* result) const { FontLanguage lang = style.getLanguage(); @@ -184,9 +188,11 @@ void FontCollection::itemize(const uint16_t *string, size_t string_size, FontSty nShorts = 2; } } - // Continue using existing font as long as it has coverage and is whitelisted + // Continue using existing font as long as it has coverage and is whitelisted; + // also variation sequences continue existing run. if (lastFamily == NULL - || !(isStickyWhitelisted(ch) && lastFamily->getCoverage()->get(ch))) { + || !((isStickyWhitelisted(ch) && lastFamily->getCoverage()->get(ch)) + || isVariationSelector(ch))) { FontFamily* family = getFamilyForChar(ch, lang, variant); if (i == 0 || family != lastFamily) { size_t start = i; |