The motivation of this CL is enhance the font fallback score design
to support multiple language font fallback.
This CL contains following changes:
- Break language based font score into two: script-based score and
primary-language-based score.
- The primary-language-based score is 0 if the script-based score is 0.
If the script-based score is not 0 and the primary language is the
as same as the requested one, the font gets an extra score of 1.
- The language score gets a higher multiplier for languages higher in
the locale list.
Bug: 25122318
Bug: 26168983
Change-Id: Ib999997a88e6977e341f4c325e2a1b41a59db2d5
am: 850fcc0b6f -s ours
* commit '850fcc0b6fb848b383ab3123d243faf9c73efda0':
Tailor grapheme boundaries so sequence emoji are one grapheme - DO NOT MERGE
Make it so it's not possible to position the cursor inside an emoji
formed by a sequence including zero-width joiners.
Bug: 25368653
Change-Id: I67ec0874cd1505f3c82ab91492ffc3d39a52fae6
Make it so it's not possible to position the cursor inside an emoji
formed by a sequence including zero-width joiners.
Bug: 25368653
Change-Id: I67ec0874cd1505f3c82ab91492ffc3d39a52fae6
A corrupt or malicious font may have a negative size in its cmap
range, which in turn could lead to memory corruption. This patch
detects the case and rejects the font, and also includes an assertion
in the sparse bit set implementation if we missed any such case.
External issue:
https://code.google.com/p/android/issues/detail?id=192618
Bug: 26413177
Change-Id: Icc0c80e4ef389abba0964495b89aa0fae3e9f4b2
The assertion for the lock state has now activated by
I9c4b1e1f09c6793e387fbdb8bb654cc0a13c65d5.
This CL fixes the assertion failure in the unit tests by acquiring
lock before calling the functions.
Change-Id: I6a6afefb4de01e8610c2abfe6c779afa9442cc67
The caller of FontFamily::hasVariationSelector needs to acquire the
lock before calling it, but FontCollection::hasVariationSelector
didn't acquire the lock. This caused a race condition.
This CL fixes this race condition.
Also, it turned out that assertMinikinLocked didn't assert even on
eng or userdebug device. This CL enables assertion on eng and userdebug
device since this assertion must be treated as bug.
BUG: 26323806
Change-Id: I9c4b1e1f09c6793e387fbdb8bb654cc0a13c65d5
This is 2nd attempt of I8df992a6851021903478972601a9a5c9424b100c.
The main purpose of this CL is expanding FontLanguage to be able to
save full script tag. Previously, FontLangauge kept only limited script
tags. With this CL, FontLanguage keeps all script tags.
This CL contains the following changes:
- FontLanguage changes:
-- Moved to private directory not to be instantiated outside of Minikin.
-- Removed bool(), bits(), FontLanguage(uint32_t) methods which are no
longer used.
-- Change the FontLanguage internal data structure.
-- Introduces script match logic.
- FontLanguages changes:
-- Moved to private directory not to be instantiated outside of Minikin.
-- This is now std::vector<FontLanguage>
- FontLanguageListCache changes:
-- Now FontLanguageListCache::getId through
FontStyle::registerLanguageList is the only way to instantiate the
FontLanguage.
-- Normalize input to be BCP47 compliant identifier by ICU.
Bug: 26168983
Change-Id: I431b3f361a7635497c05b85e8ecbeb48d9aef63e
The main purpose of this CL is expanding FontLanguage to be able to
save full script tag. Previously, FontLangauge kept only limited script
tags. With this CL, FontLanguage keeps all script tags.
This CL contains the following changes:
- FontLanguage changes:
-- Moved to private directory not to be instantiated outside of Minikin.
-- Removed bool(), bits(), FontLanguage(uint32_t) methods which are no
longer used.
-- Change the FontLanguage internal data structure.
-- Introduces script match logic.
- FontLanguages changes:
-- Moved to private directory not to be instantiated outside of Minikin.
-- This is now std::vector<FontLanguage>
- FontLanguageListCache changes:
-- Now FontLanguageListCache::getId through
FontStyle::registerLanguageList is the only way to instantiate the
FontLanguage.
-- Normalize input to be BCP47 compliant identifier by ICU.
Bug: 26168983
Change-Id: I8df992a6851021903478972601a9a5c9424b100c
Previous CL[1] adds module names into LOCAL_ADDITIONAL_DEPENDENCIES, but
it was wrong. LOCAL_ADDITIONAL_DEPENDENCIES only accepts file path.
However, BUILD_PREBUILT doesn't provide a file path of the installed
font. So use custom tool and LOCAL_GENERATED_SOURCES instead.
Confirmed no-op build doesn't built minikin_tests and
continuous_native_tests.zip contains all necessary files.
[1]: I7d83abc077bce4e38fd93c7d607bc7e1f7871e6b
BUG: 26197092
Change-Id: I90e80036248ae72e0e0f9c6144a259f5f96ec9ce
Replaced two instances of negating an unsigned long, which was
resulting in aborts from unsigned integer sanitization with the
equivalent logical not-add 1.
Bug: 25884483
Change-Id: Ic7498e0af638dcd438ce69803021d3cdc3acd4f6
Removing the extra score of 2 for the script matching from the font
fallback score calculation. If the two langauges have different
scripts, we should treat them as different languages.
Change-Id: Ie0d6f27bd1086248895935a7bd01b5d404044ad0
To work native tests with additional font related files, copy
the files into /data/nativetest/minikin_tests/.
This copy only happens when the minikin_tests is built.
It is not an expected to copy the font files into the product image.
Change-Id: I7d83abc077bce4e38fd93c7d607bc7e1f7871e6b
FontLanguageListCache is an intentionally leaky singleton and its
internal cache won't be purged.
BUG: 25122318
Change-Id: I272097e979fe44b83fd86822235350e12eda8f51
If U+FE0E is appended to the emoji code point, the glyph should have a
text presentation.
On the other hand, if U+FE0F is appended to the emoji code point, the
glyph should have an emoji presentation.
Bug: 11256006
Change-Id: I5187d44500b13a138e7ffbcf2c72e2da06374c8c
A malformed TTF can cause size calculations to overflow. This patch
checks the maximum reasonable value so that the total size fits in 32
bits. It also adds some explicit casting to avoid possible technical
undefined behavior when parsing sized unsigned values.
Bug: 25645298
Change-Id: Id4716132041a6f4f1fbb73ec4e445391cf7d9616
(cherry picked from commit 183c9ec2800baa2ce099ee260c6cbc6121cf1274)
A malformed TTF can cause size calculations to overflow. This patch
checks the maximum reasonable value so that the total size fits in 32
bits. It also adds some explicit casting to avoid possible technical
undefined behavior when parsing sized unsigned values.
Bug: 25645298
Change-Id: Id4716132041a6f4f1fbb73ec4e445391cf7d9616