1. 04 2月, 2016 1 次提交
    • S
      Improve Paint.hasGlyph performance by caching hb_font_t · 89e80237
      Seigo Nonaka 提交于
      It turned out that hb_font_t creation is not a lightweight operation.
      Especially, Paint.hasGlyph creates hb_font_t for all existing fonts
      every time. To improve the performance, cache hb_font_t instead
      of hb_face_t.
      
      Note that to calculate horizontal advance, MinikinPaint needs to be
      associated with hb_font_t by calling hb_font_set_funcs. With this patch,
      hb_font_set_funcs may be called multiple times for the same hb_font_t
      object. However this is not an issue since MinikinPaint is unique
      during layout.
      
      Bug: 26784699
      
      Change-Id: I516498ae9f0127d700fc9829327e9789845a1416
      89e80237
  2. 26 1月, 2016 1 次提交
  3. 21 1月, 2016 1 次提交
  4. 15 1月, 2016 1 次提交
    • S
      Introduce multiple language based font fallback. · 6f9966ea
      Seigo Nonaka 提交于
      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
      6f9966ea
  5. 14 1月, 2016 2 次提交
  6. 08 1月, 2016 2 次提交
  7. 07 1月, 2016 3 次提交
  8. 06 1月, 2016 2 次提交
    • S
      Fix race condition in Paint.hasGlyph() · a6f5c468
      Seigo Nonaka 提交于
      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
      a6f5c468
    • D
      Enable integer sanitization in libminikin. · 9c13a3dc
      Dan Austin 提交于
      Enable signed and unsigned integer sanitization in libminikin.
      
      Bug: 25884483
      Change-Id: I53abf6affea8e2bb3a5abd381a9f19003a306b36
      9c13a3dc
  9. 05 1月, 2016 2 次提交
    • S
      Replace Qaae script with Zsye · d3376522
      Seigo Nonaka 提交于
      The emoji variant script "Zsye" is registered in ISO 15924.
      
      Bug: 26226285
      Change-Id: Ibc2bc740d57c48f99b6f66b1ad7595bfa8c3cff4
      d3376522
    • S
      Save all kind of script tags into FontLanguage. · 198b46f1
      Seigo Nonaka 提交于
      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
      198b46f1
  10. 22 12月, 2015 2 次提交
    • B
      Revert "Save all kind of script tags into FontLanguage." · 6c4c098c
      Bart Sears 提交于
      This reverts commit 5e995fb8.
      
      Change-Id: I761e0e41906742fbe3d3ac34170af3101e18042a
      6c4c098c
    • S
      Save all kind of script tags into FontLanguage. · 5e995fb8
      Seigo Nonaka 提交于
      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
      5e995fb8
  11. 12 12月, 2015 1 次提交
    • D
      Refactored unsigned long negations · 1bbe03d2
      Dan Austin 提交于
      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
      1bbe03d2
  12. 11 12月, 2015 1 次提交
  13. 09 12月, 2015 1 次提交
    • S
      Introduce FontLanguageListCache. · 6d9dcd2c
      Seigo Nonaka 提交于
      FontLanguageListCache is an intentionally leaky singleton and its
      internal cache won't be purged.
      
      BUG: 25122318
      
      Change-Id: I272097e979fe44b83fd86822235350e12eda8f51
      6d9dcd2c
  14. 08 12月, 2015 2 次提交
    • S
      Select emoji font based on variation selectors. · 369d2d44
      Seigo Nonaka 提交于
      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
      369d2d44
    • R
      Avoid integer overflows in parsing fonts · 6299a6ba
      Raph Levien 提交于
      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 183c9ec2)
      6299a6ba
  15. 01 12月, 2015 1 次提交
    • R
      Avoid integer overflows in parsing fonts · 183c9ec2
      Raph Levien 提交于
      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
      183c9ec2
  16. 19 11月, 2015 4 次提交
    • S
      Search all families instead of using mRanges for variation sequence. · fc119c68
      Seigo Nonaka 提交于
      To optimize the font family search, mRanges is used for narrowing down
      the search range. However, mRanges is constructed from format 4 or
      format 12 entries. So, if the font supports a variation sequence but doesn't
      support the base character of the sequence, the font may not be listed in
      mRanges.
      
      The proper way to fix this issue is using format 14 subtable information
      for mRanges construction. However, this is not a trivial work since currently
      we rely on HarfBuzz for variation sequence lookup and it doesn't provide any
      API for retrieving coverage information.
      
      Thus, as the quick fix, iterate all font families in font fallback chain if
      the variation sequence is specified.
      
      Change-Id: I278da84be8fb8f553590e2e42ed450b7e4a34eca
      fc119c68
    • S
      Introduce FontCollection::hasVariationSelector method. · 80d113bc
      Seigo Nonaka 提交于
      To implement Paint.hasGlyph(), we need a new method to ask the
      FontCollection if it has a glyph for the code point and variation
      selector pair.
      
      Bug: 11256006
      Change-Id: Ie4185c91bcaa4d01aee6beb97784b1f9d2a88f12
      80d113bc
    • R
      Suppress linebreaks in emoji ZWJ sequences - DO NOT MERGE · 30fca219
      Raph Levien 提交于
      Due to the way emoji ZWJ sequences are defined, the ICU line breaking
      algorithm determines that there are valid line breaks inside the
      sequence. This patch suppresses these line breaks.
      
      Bug: 25433289
      Change-Id: I225ebebc0f4186e4b8f48fee399c4a62b3f0218a
      30fca219
    • R
      Accept variation selector in emoji sequences - DO NOT MERGE · 35e4ebec
      Raph Levien 提交于
      This patch basically ignores variation selectors for the purpose of
      itemization into font runs. This allows GSUB to be applied when input
      sequences contain variation selectors.
      
      Bug: 25368653
      Change-Id: I9c1d325ae0cd322c21b7e850d0ec4d73551b2372
      35e4ebec
  17. 13 11月, 2015 1 次提交
    • S
      Fix invalid decrement range of KEYCAP handling in itemize. · 3dd8757f
      Seigo Nonaka 提交于
      This issue was introduced by I22ce0e9eadc941f84e3a9b23462f194e51dd7180.
      Need to decrement the two utf16 chars in KEYCAP handling.
      
      To add unit tests, this CL also addresses the Bug: 24184208 by
      introducing self built fonts since there is no good example in system
      installed fonts.
      
      Bug: 24184208
      Change-Id: I23fa008adbaced78a3cb96442a6bc8892ab84ce8
      3dd8757f
  18. 03 11月, 2015 1 次提交
    • R
      Suppress linebreaks in emoji ZWJ sequences - DO NOT MERGE · c65e6f1e
      Raph Levien 提交于
      Due to the way emoji ZWJ sequences are defined, the ICU line breaking
      algorithm determines that there are valid line breaks inside the
      sequence. This patch suppresses these line breaks.
      
      Bug: 25433289
      Change-Id: I225ebebc0f4186e4b8f48fee399c4a62b3f0218a
      c65e6f1e
  19. 30 10月, 2015 1 次提交
    • R
      Accept variation selector in emoji sequences - DO NOT MERGE · adaf42f0
      Raph Levien 提交于
      This patch basically ignores variation selectors for the purpose of
      itemization into font runs. This allows GSUB to be applied when input
      sequences contain variation selectors.
      
      Bug: 25368653
      Change-Id: I9c1d325ae0cd322c21b7e850d0ec4d73551b2372
      adaf42f0
  20. 28 10月, 2015 2 次提交
    • S
      Add -Werror -Wall -Wextra to compiler option. · bae34768
      Seigo Nonaka 提交于
      This is 2nd trial of I30a0914a4633bd93eb60957cdf378770f04d8428
      
      - To suppress noisy unused parameter warnings, comment out unused
        arguments.
      - Add -Werror for suppressing further warning.
      - Add -Wall -Wextra for safety.
      - Use "z" prefix for format string of size_t.
      
      Verified that compile succeeded on all arm,arm64,mips,x86,x86_64.
      
      Change-Id: I7ad208464486b8a35da53929cb1cfe541ed0052f
      bae34768
    • B
      Revert "Add -Werror -Wall -Wextra to compiler option." · b4c79918
      Bart Sears 提交于
      This reverts commit 63635cff.
      
      Change-Id: I2b4b10e8afedc85dbe2d07f3e47315652b65cd14
      b4c79918
  21. 27 10月, 2015 1 次提交
    • S
      Add -Werror -Wall -Wextra to compiler option. · 63635cff
      Seigo Nonaka 提交于
      - To suppress noisy unused parameter warnings, comment out unused
        arguments.
      - Add -Werror for suppressing further warning.
      - Add -Wall -Wextra for safety.
      
      Change-Id: I30a0914a4633bd93eb60957cdf378770f04d8428
      63635cff
  22. 23 10月, 2015 1 次提交
  23. 20 10月, 2015 1 次提交
    • S
      Support Variation Selector in font selection. · bbdd73ec
      Seigo Nonaka 提交于
      This CL contains the following changes:
      - Add a variation selector argument into getFamilyForChar to be able to
        select fonts which support variation selector.
      - In case no fonts support the codepoint and variation selector pair,
        add a fallback rule which selects font family with ignoring variation
        selector.
      - Change FontCollection::itemize to not change the font family
        immediately preceding a variation selector.
      - Introduce unit tests for variation selectors.
      
      With this CL, TextView can render the variation selectors correctly.
      
      Bug: 11256006
      Change-Id: I22ce0e9eadc941f84e3a9b23462f194e51dd7180
      bbdd73ec
  24. 15 10月, 2015 3 次提交
    • S
      Remove MinikinFont::GetGlyph interface. · 210dfa01
      Seigo Nonaka 提交于
      MinikinFont:GetGlyph is no longer used.
      No behavior chnages are expected with this CL.
      
      Change-Id: I13398503841ac06f930b04815017d4b33338efa1
      210dfa01
    • R
      Complete half-done cherry-picking of Android.mk. DO NOT MERGE · e8264e06
      Roozbeh Pournader 提交于
      The previous commit, 6e2cccdc, was
      incompletely cherry-picked. This adds the missing parts.
      
      Bug: 24570591
      Change-Id: I1097c60587fb8a88cfe6b8ffed5b1689d9bdd429
      e8264e06
    • R
      Binary format for hyphenation patterns · 6e2cccdc
      Raph Levien 提交于
      In the current state, hyphenation in all languages than Sanskrit seems
      to work (case-folding edge cases). Thus, we just disable Sanskrit.
      Packed tries are implemented, but not the finite state machine
      (space/speed tradeoff).
      
      This commit contains a throw-away test app, which runs on the host.
      I think I want to replace it with unit tests, but I'm including it in
      the CL because it's useful during development.
      
      Bug: 21562869
      Bug: 21826930
      Bug: 23317038
      Bug: 23317904
      Bug: 24570591
      Change-Id: I7479a565a4a062fa319651c2c14c0fa18c5ceaea
      (cherry picked from commit f0be43de)
      6e2cccdc
  25. 12 10月, 2015 1 次提交
    • S
      Introduce FontFamily::hasVariationSelector · 0f2a025d
      Seigo Nonaka 提交于
      This CL introduces new method hasVariationSelector into FontFamily but it
      is not used in production code. So no behavior changes are expected.
      
      This CL contains the following changes:
      - Introduce hasVariationSelector which returns true if the corresponding
        font has a glyph for a code point and variation selector pair.
      - Introduce purgeHbFontCache since hb_face_t won't be released by
        keeping hb_font_t.
      - Introduce unit tests with self-built font.
      
      Change-Id: I659a6d03d9ec446b409e1fba2758452abb9f44fa
      0f2a025d
  26. 01 10月, 2015 1 次提交
    • R
      Binary format for hyphenation patterns · f0be43de
      Raph Levien 提交于
      In the current state, hyphenation in all languages than Sanskrit seems
      to work (case-folding edge cases). Thus, we just disable Sanskrit.
      Packed tries are implemented, but not the finite state machine
      (space/speed tradeoff).
      
      This commit contains a throw-away test app, which runs on the host.
      I think I want to replace it with unit tests, but I'm including it in
      the CL because it's useful during development.
      
      Bug: 21562869
      Bug: 21826930
      Bug: 23317038
      Bug: 23317904
      
      Change-Id: I7479a565a4a062fa319651c2c14c0fa18c5ceaea
      f0be43de