diff options
author | Seigo Nonaka <nona@google.com> | 2015-12-11 17:58:03 -0800 |
---|---|---|
committer | Seigo Nonaka <nona@google.com> | 2016-01-15 14:35:14 +0900 |
commit | 6f9966ea7c1910fd780cf7779cc59701c9b98a2b (patch) | |
tree | 5256e93fed4811d282a9481dc7c2804471ad3317 /include | |
parent | a69ca2e172e9c46284619dd1475b89a294e940fd (diff) | |
download | android_frameworks_minikin-6f9966ea7c1910fd780cf7779cc59701c9b98a2b.tar.gz android_frameworks_minikin-6f9966ea7c1910fd780cf7779cc59701c9b98a2b.tar.bz2 android_frameworks_minikin-6f9966ea7c1910fd780cf7779cc59701c9b98a2b.zip |
Introduce multiple language based font fallback.
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
Diffstat (limited to 'include')
-rw-r--r-- | include/minikin/FontCollection.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/minikin/FontCollection.h b/include/minikin/FontCollection.h index cd14261..294692f 100644 --- a/include/minikin/FontCollection.h +++ b/include/minikin/FontCollection.h @@ -67,6 +67,16 @@ private: FontFamily* getFamilyForChar(uint32_t ch, uint32_t vs, uint32_t langListId, int variant) const; + uint32_t calcFamilyScore(uint32_t ch, uint32_t vs, int variant, uint32_t langListId, + FontFamily* fontFamily) const; + + uint32_t calcCoverageScore(uint32_t ch, uint32_t vs, FontFamily* fontFamily) const; + + static uint32_t calcLanguageMatchingScore(uint32_t userLangListId, + const FontFamily& fontFamily); + + static uint32_t calcVariantMatchingScore(int variant, const FontFamily& fontFamily); + // static for allocating unique id's static uint32_t sNextId; |