1. 30 9月, 2015 1 次提交
  2. 11 9月, 2015 1 次提交
    • S
      Resolve glyph ID by HarfBuzz function. · 2a79f59e
      Seigo Nonaka 提交于
      Currently codepoint to glyph ID resolution is done through MinikinFont
      interface. To support variation selector, use HarfBuzz API instead of
      calling this interface since one of its implementation Skia doesn't
      support variation selector.
      
      On the other hand, we don't want to get glyph horizontal advance values
      by HarfBuzz since HarfBuzz doesn't return correct values when the hinting
      is active.
      
      Thus, use ot_font as a parent font and override
      glyph_h_advance/glyph_h_origin functions as is.
      
      With this change, MinikinFont::GetGlyph is no longer necessary but not
      removing in this CL for easy reverting since removing interface requires
      multi-repository commit.
      
      This is a base work of b/11256006 and this patch doesn't provide any
      user visible changes.
      
      Bug: 11256006
      Change-Id: I061172c0b674bb649ce8bc013ffecf38708bdc41
      2a79f59e
  3. 29 8月, 2015 1 次提交
    • S
      Update word breaker to be aware tone mark and variation selector. · 4e3adc6f
      Seigo Nonaka 提交于
      This CL does:
      1. Move the getNextWordBreak/getPrevWordBreak function to a separate source file.
      2. Adding "ForCache" suffix for function name for making clear these function is
         for layout cache.
      3. Introduce unit tests for them.
      
      Bug: 11256006
      Change-Id: I4138751a4570915f1a0d6c8921f89700f8ec7f35
      4e3adc6f
  4. 20 8月, 2015 1 次提交
    • R
      Add basic unit tests for Minikin · d8dd94b8
      Raph Levien 提交于
      Initial unit tests for Minikin functionality. Also fixes an incorrect
      Hangul case (uncovered in testing), and improves handling of broken
      UTF-16.
      
      Change-Id: I69b441d8e3b19ed06abcc56f13271abadf3d1010
      d8dd94b8
  5. 12 8月, 2015 1 次提交
  6. 08 8月, 2015 1 次提交
  7. 07 8月, 2015 1 次提交
    • R
      Gold plate grapheme cluster breaks. · c02138bf
      Roozbeh Pournader 提交于
      This tailors Unicode's Grapheme_Cluster_Break property to better
      classify characters currently with the Control property value.
      
      Also adds support for rule GB9b of UAX #29, needed since there are
      now characters we are tailoring to be Prepend. The rule was
      previously ommited in our implementation because there was no
      characters in the Prepend class.
      
      Bug: 15653110
      Change-Id: If10da88df0980f7d676c8c0b950eda5fb8dbe741
      c02138bf
  8. 30 7月, 2015 1 次提交
    • R
      Improve fallback where explicit variant is not given · 90a09c3f
      Raph Levien 提交于
      In computing scores for which fallback font to choose, a match of a
      variant given explicitly in the xml config file scores higher than a
      family with no explicit variant. One consequence is that U+2010
      HYPHEN is chosen from the Naskh Arabic font in the fallback case.
      
      This patch scores families with no variants as a match (effectively
      the same as if the xml file specified both variants). Thus, it will
      choose the first matching font (Roboto), which is a better choice.
      
      This patch also revises the list of "sticky" characters to include
      various hyphens, so Arabic (and potentially other scripts) text that
      includes hyphens can access the script-specific variants matched to
      the underlying text.
      
      Bug: 22824219
      Change-Id: I6ec1043037f89cad50ca99ac24c473395546bcdf
      90a09c3f
  9. 22 7月, 2015 2 次提交
  10. 21 7月, 2015 1 次提交
    • R
      Consistently apply break opportunities in text spans · e9ec9a1d
      Raph Levien 提交于
      It's essential not to apply a break opportunity within a replacement
      span, otherwise things can happen such as displaying the span twice.
      The old code tested this case based on zero-width characters.
      However, this test was both imprecise, and also in some cases read
      uninitialized values from the mCharWidths array, which in turn led
      to inconsistent line breaking of the same text.
      
      This patch applies all line break opportunities (as identified by
      ICU) within text (as opposed to replacement spans), and also applies
      break opportunities at the beginning and end of replacement spans,
      but avoids breaks within a replacement span.
      
      Bug: 20138621
      Change-Id: I36baeb44d6808356649e1bb69ca57f093fc8c723
      e9ec9a1d
  11. 16 7月, 2015 2 次提交
    • R
      Use ICU to lowercase words to hyphenate. · cdd19dad
      Roozbeh Pournader 提交于
      Previously, the standard C tolower() function was used, which
      didn't support any characters beyond the basic ASCII letters.
      
      Bug: 22506121
      Change-Id: Ibb81121caa29be44fbb59aa98891e9faafc57592
      cdd19dad
    • R
      Add missing hyphen-like characters. · daf62d0e
      Roozbeh Pournader 提交于
      This adds various hyphen-like characters missed in the previous
      patch, that should disallow automatic hyphenation of words containing
      them.
      
      Bug: 22484266
      Change-Id: Ie972cb50384dbe0aa1ab5ec50286b75f9877953a
      daf62d0e
  12. 15 7月, 2015 1 次提交
    • R
      Avoid re-hyphenating already-hyphenated phrases. · baf6d0a4
      Roozbeh Pournader 提交于
      Previously, automatic hyphenation blindly took almost every line
      breaking opportunity as a word break, so words like "low-budget" were
      treated as two separate words, "low-", and "budget", each
      automatically hyphenated.
      
      This patch makes sure the subwords in already-hyphenated phrases are
      not passed to the automatic hyphenator, while keeping the possibility
      of a potential line break where a hyphen already exists.
      
      Bug: 22484266
      Bug: 22287425
      Change-Id: Ie46dbdd70e993d64a9b9cf44b4ae93b21459dbc2
      baf6d0a4
  13. 10 7月, 2015 1 次提交
    • R
      Add HyphenEdit to layout cache · 6c4d167b
      Raph Levien 提交于
      We bypass the word layout cache for "complex" cases, which includes
      things like OpenType features. We were counting a hyphen edit as such
      a case, but the problem is that we measure a _lot_ of these when
      doing layout with hyphenation.
      
      This patch adds plumbing for hyphen edits to the layout cache, so
      that word fragments with hyphens can be cached as well.
      
      Bug: 22378829
      
      Change-Id: Idba4df4faa14f48a5faccc8a7a7955a36c19ef27
      6c4d167b
  14. 01 7月, 2015 1 次提交
    • R
      Allow clusters to start with zero-width characters · 3e0fc64d
      Raph Levien 提交于
      The logic in getRunAdvance() assumed that any zero-width character was
      part of the preceding cluster, which is valid most of the time. However,
      characters such as ZWNBSP (U+FEFF) renders as a zero width glyph
      and is also a grapheme cluster boundary. This patch adds a clause to
      handle that case.
      
      Bug: 22121742
      Change-Id: Iad79a7d988bded1ef05f0fd7905d20669ea22051
      3e0fc64d
  15. 30 6月, 2015 1 次提交
    • R
      Fix logspam and incorrect cluster offset · 91425f05
      Raph Levien 提交于
      An incorrect cluster offset calculation was causing a lot of log
      messages to appear. Separately, a confusion between #if and #ifdef was
      causing unintended logging of line breaks. This patch fixes both.
      
      Bug: 22178333
      Change-Id: I2b3673ed66c784f5082fd127a8dc10bd3df6ed79
      91425f05
  16. 27 6月, 2015 1 次提交
    • R
      Disable letterspacing for connected scripts · e8721b2d
      Raph Levien 提交于
      The appearance of letterspacing with scripts with cursive connections
      is poor, so we simply disable letterspacing for those scripts. There
      may be some cases where some form of letterspacing is desirable, but
      this gives the highest likelihood that the final result will be good
      without requiring additional work from clients.
      
      Bug: 21935803
      Change-Id: Ie25266249ac3a2605aa89ef5132e8edbe3a06d35
      e8721b2d
  17. 25 6月, 2015 1 次提交
    • R
      Separate additional penalty for last line with hyphen · a6f8bf6f
      Raph Levien 提交于
      A recent change added a penalty for a hyphen at the last line break,
      which is visually undesirable. However, the penalty was assessed to
      "widthScore", which broke the assumption (used for another
      optimization) that widthScore increases monotonically. This patch
      separates the penalty into a different parameter, restoring the
      validity of the monotonicity assumption.
      
      Bug: 22066119
      Change-Id: I6a47a350ef3ceee2f00ee430d6954d0c307227f0
      a6f8bf6f
  18. 13 6月, 2015 3 次提交
  19. 10 6月, 2015 1 次提交
    • K
      Fix: getOffsetForAdvance can return worng offset. · 4ea1cc82
      Keisuke Kuroyanagi 提交于
      searchStart was passed to getRunAdvance, but it can be
      different from the start that has been used to initialize
      Layout object. As a result, wrong index could be used in
      getRunAdvance.
      
      Bug: 21744454
      Change-Id: Ibe83cc50ed6f0da2a1532318bc224502be350699
      4ea1cc82
  20. 09 6月, 2015 1 次提交
    • R
      Increase hyphenation penalty for short last line · abae97a3
      Raph Levien 提交于
      Tuning for hyphenation parameters. We discourage hyphenation on the
      last line, but offset this penalty by also applying a penalty for
      each line, which optimizes for minimizing the number of lines. Thus,
      when hyphenation can reduce the number of lines, it increases the
      chance they're used.
      
      There's probably more tuning and refinement that can be done, but
      testing suggests that the tunable parameters are appropriate.
      
      Bug: 20883322
      
      Change-Id: Ida7eaf8aced109e426694f5a386924a842d29c4b
      abae97a3
  21. 02 6月, 2015 3 次提交
  22. 13 5月, 2015 1 次提交
    • R
      Support hyphenation frequency in Minikin. · 0dc07c0b
      Roozbeh Pournader 提交于
      Three hyphenation frequencies are now supported:
      
      kHyphenationFrequency_None, which turns off both automatic
      hyphenation and soft hyphens.
      
      kHyphenationFrequency_Normal, which has aconservative amount of
      hyphenation useful as a conservative default.
      
      kHyphenationFrequency_Full, which has a typographic-quality amount of
      hyphenation useful for running text and tight screens.
      
      Bug: 21038249
      Change-Id: I2800f718c887c9389a1a059d7ec07d7fa2ca1dee
      0dc07c0b
  23. 28 4月, 2015 1 次提交
    • J
      Move Bitmap to a different namespace · 8920e817
      John Reck 提交于
      namespace naming collision. Move minikin's
      Bitmap out of android:: and into minikin::
      
      Change-Id: I5ae3925f81b848dc79576429ab55243b96f7fed2
      8920e817
  24. 23 4月, 2015 1 次提交
    • R
      Don't include trailing newline in width for line breaking · 68ae337a
      Raph Levien 提交于
      In a paragraph with a trailing newline, the width of the newline
      character was included in the line width for breaking purposes,
      basically as if it were a non-breaking space. This caused a
      discrepancy, where Layout.getDesiredWidth() suggested that the text
      would fit in a single line, but StaticLayout would break it because of
      the added width of the newline character.
      
      The proposed fix is simply to consider newline to be a space that
      disappears at the end of a line.
      
      Bug: 20152308
      Change-Id: I539574c5b8ea892c8ed6aca6c59e90ccdf74a680
      68ae337a
  25. 16 4月, 2015 3 次提交
    • R
      Add functions for measuring cursor positioning · 40beb774
      Raph Levien 提交于
      New functions for computing the correspondence between cursor
      position and advance, respecting grapheme boundaries.
      
      Change-Id: I620378d5f64cd74300cd43db522adeb555825dff
      40beb774
    • R
      Rename "margins" to "indents" · bb86b433
      Raph Levien 提交于
      The name "margin" conflicts with another meaning, so we're making the
      name in the public api "idents" and the code consistent in naming.
      
      Change-Id: I9170116b4d972e4b25f0f319e78376310288eb41
      bb86b433
    • R
      Add margins array to line widths object · dc7bc6e3
      Raph Levien 提交于
      In order to support layout in non-rectangular regions, the LineWidths
      object needs to accept an arbitrary array of margins. This is
      implemented in addition to the existing firstWidthLineCount/restWidth
      mechanism for convenience, though using only arrays would have the
      same expressive power.
      
      Bug: 20182243
      Change-Id: Iea96bca1a92012314ac27e617c67f306c1f1b2f2
      dc7bc6e3
  26. 31 3月, 2015 3 次提交
  27. 27 3月, 2015 1 次提交
    • R
      Add LineBreaker to Minikin · 01f52661
      Raph Levien 提交于
      This patch adds a LineBreaker class to Minikin, which will be used for
      computing line breaks in StaticLayout. The version in this patch
      contains basically the same functionality that existed before, but
      hopefully better performance and an interface that's suitable for more
      sophisticated paragraph layout.
      
      Note that this version contains a high quality strategy, which mostly
      works but doesn't respect varying line width.
      
      Change-Id: I02485d58b1e52856296a72cdd4efd963bc572933
      01f52661
  28. 13 3月, 2015 1 次提交
    • R
      HyphenEdit in support of hyphenation · d692d6a9
      Raph Levien 提交于
      Adds a "HyphenEdit" field to the Minikin Paint object, which represents
      an edit to the text to add a hyphen (and, in the future, other edits to
      support nonstandard hyphenation).
      
      Change-Id: Ib4ee690b0fe2137e1d1e2c9251e5526b274ec3a7
      d692d6a9
  29. 26 2月, 2015 1 次提交
    • R
      Disable HarfBuzz's fallback to compatibility decompositions · 0bbff3a9
      Roozbeh Pournader 提交于
      Previously, HarfBuzz's default fallback to compatibility
      decompositions resulted in Mathematical Alphanumeric Symbols getting
      rendered as normal letters and digits when there was no font
      available to render them. This patch disables that fallback, to
      ensure they are displayed as tofus.
      
      Based on a patch by Behdad Esfahbod.
      
      Bug: 19202569
      Change-Id: I357f172302448d4ab0b24efc86119f1977b5996b
      0bbff3a9
  30. 06 1月, 2015 1 次提交