1. 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
  2. 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
  3. 02 6月, 2015 1 次提交
    • R
      Disable hyphenation for unreasonably long words · a0196658
      Raph Levien 提交于
      Very long words cause O(n^2) behavior. These are unlikely to happen in
      real text, but do happen with synthetic strings, so in those cases we
      just disable hyphenation.
      
      Bug: 20790394
      Change-Id: Idf957dd40b24efe1476f619f17093a48b5bc56f7
      a0196658
  4. 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
  5. 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
  6. 16 4月, 2015 2 次提交
    • 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
  7. 31 3月, 2015 3 次提交
  8. 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