1. 30 10月, 2014 1 次提交
    • R
      Move coverage bitmap from FontCollection to FontFamily · 253320d2
      Raph Levien 提交于
      This will significantly reduce memory usage and also speed the creation
      of new font families. In particular, the coverage bitmaps for the fonts
      in the fallback stack will be computed once in the Zygote, rather than
      separately in each app process.
      
      Bug: 17756900
      Change-Id: I66f5706bddd4658d78fe5b709f7251ca9d2ff4f8
      253320d2
  2. 24 10月, 2014 1 次提交
    • R
      Silently ignore invalid rangeOffset values · 5f11abd3
      Raph Levien 提交于
      Some fonts contain a cmap segment for char 0xffff that contains an
      invalid rangeOffset. This was rejected by the existing code, which
      means the font is considered to have empty Unicode coverage. This patch
      just discards the invalid segment (consistent with OpenType Sanitizer),
      making the custom font display.
      
      Bug: 18106256
      Change-Id: Icc8616a3030f80e62db906332be64d434ae72ea2
      5f11abd3
  3. 23 9月, 2014 1 次提交
    • R
      Fine-tune fake-bolding condition · d5804e39
      Raph Levien 提交于
      The old logic for fake bolding results in no fake bolding for a bold
      span on a light weight (300) because the target weight (600 in this
      case) didn't meet the condition. This patch fine-tunes the threshold
      to enable fake bolding for this.
      
      Bug: 17587185
      
      Change-Id: I04abd00a74240cbed79c417f81486aa2158b2806
      d5804e39
  4. 04 9月, 2014 1 次提交
    • R
      Snap advance widths to integers · 6740536e
      Raph Levien 提交于
      Fractional advance widths were causing subtle problems with text
      positioning when the same text was drawn with different spans in the
      hwui renderer. Quantizing the coordinates on layout (as opposed to
      waiting until the renderer draws the glyphs) solves the problem.
      
      This patch also fixes a discrepancy between x position and advance
      widths when letterspacing.
      
      Bug: 17347779
      Change-Id: Ia705944047408c2839d5ad078eefd6bbec446872
      6740536e
  5. 27 8月, 2014 1 次提交
    • R
      Try Unicode decomposition for selecting fallback font · 997c799e
      Raph Levien 提交于
      This patch finds an appropriate fallback font in the case where no font
      directly maps the requested character, but a font does exist for the
      character's canonical decomposition. This yields correct rendering of
      compatibility characters such as U+FA70.
      
      Bug: 15816880
      Bug: 16856221
      Change-Id: Idff8ed6b942fec992a0815a32028b95af091d0ee
      997c799e
  6. 22 8月, 2014 3 次提交
    • B
      Allocate font vector on stack · 56c7fb8c
      Behdad Esfahbod 提交于
      This reduces another allocation (last one?) we were doing when
      fulfilling shaping requests from the cache.
      
      Bug: 17111260
      Change-Id: Ieb8ae1ccfcaacedb257e1e9263777f10623aaf98
      56c7fb8c
    • B
      Fix Layout initialization in the skipCache path · 6da7796c
      Behdad Esfahbod 提交于
      C++ local var initialization always tricks me.  Previously, Layout
      didn't have a constructor, which meant that defining it on the stack
      left mAdvance uninitialized.  This was not an issue when we were doing
      "new Layout()", since that invokes zero-initialization, but was an
      issue for the skipCache path that was allocating layout on stack by
      just "Layout l" instead of "Layout l = Layout()".  To avoid surprises,
      add a constructors that clears everything.
      
      Also adds reset() method to reset the layout for reuse.
      
      Change-Id: I3e02f00da9dd7d360abe13f63c310f6882292d0a
      6da7796c
    • B
      Speed up cache lookup · 288c9159
      Behdad Esfahbod 提交于
      Avoid copying the string for cache lookup.
      
      Bug: 17111260
      Change-Id: Ic220bfc991fc6b3dada197304aabdf72a8941bd7
      288c9159
  7. 09 8月, 2014 1 次提交
    • B
      Choose same font for Emoji keycap and its base character · f952161b
      Behdad Esfahbod 提交于
      The U+20E3 COMBINING KEYCAP is used in our fonts to generate an emoji
      rendering of ASCII numbers and letters through GSUB.  For that to work
      we need to choose the same (Emoji) font for the character coming
      *before* the COMBINING KEYCAP character.
      
      This is a special-case of a broader need to choose fonts per grapheme
      cluster as opposed to per character, but for now, special-case U+20E3.
      
      Bug: 7557244
      Change-Id: I958e5a01068df8495bbb9bc3b9ed871cea1838b6
      f952161b
  8. 31 7月, 2014 1 次提交
  9. 30 7月, 2014 1 次提交
    • B
      Fix examples build · 9802b0dc
      Behdad Esfahbod 提交于
      Was broken after recent CSS removal.
      
      Change-Id: I160fbc73286b21336d6f3943ff92d7d150dff74b
      9802b0dc
  10. 28 7月, 2014 1 次提交
  11. 30 7月, 2014 3 次提交
  12. 24 7月, 2014 1 次提交
  13. 26 7月, 2014 1 次提交
    • B
      Don't get stuck on invalid UTF-16 · b8208bc1
      Behdad Esfahbod 提交于
      Replaces invalid unicode with replacement character U+FFFD and always
      makes forward progress.
      
      Bug: 15849380
      
      Change-Id: Ic59ef6c64b0f5c4450bcae61597adcc269d6e7c5
      b8208bc1
  14. 25 7月, 2014 2 次提交
    • B
      Towards CSS removal · a5bb9119
      Behdad Esfahbod 提交于
      Extract language from FontStyle during shaping.  Don't attach CSS
      to LayoutContext.
      
      Change-Id: Ie621d3415410178d0d15fa7b810eb8e412342ab6
      a5bb9119
    • B
      Remove deprecated API · f0a1e5b2
      Behdad Esfahbod 提交于
      It has been unused outside minikin.
      
      Change-Id: Iaa2237767d81c77f90d0264e633375e601dd72f1
      f0a1e5b2
  15. 23 7月, 2014 1 次提交
  16. 11 7月, 2014 4 次提交
  17. 10 7月, 2014 1 次提交
    • R
      Assign non-coverage font runs to base font · 156acb18
      Raph Levien 提交于
      When a run has no cmap coverage in any font, use the base font. Most of
      the time, this will cause rendering of the .notdef glyph, which is
      preferable to displaying nothing. In some cases, Harfbuzz may be able to
      decompose the characters (not in the cmap) to ones that are, in which
      case we'll render those, as long as they're in the base font.
      
      Bug: 6629748
      Bug: 15816880
      Change-Id: Ibb1b9242c83626e0c7db363ad65ce44a967a005e
      156acb18
  18. 07 7月, 2014 1 次提交
  19. 27 6月, 2014 1 次提交
    • R
      Disable "palt" OpenType feature · 67ea671f
      Raph Levien 提交于
      Proper Japanese layout requires sophisticated rules for spacing
      punctuation, not just turning on the "palt" (proportional alternate)
      feature. Until we can support the whole set, roll back palt.
      
      Change-Id: If2359c529b70b1dd45dddc00e5f4aa1c91f8b0e9
      67ea671f
  20. 26 6月, 2014 1 次提交
    • R
      Add purgeCaches() method · 22e41754
      Raph Levien 提交于
      Expose a method to purge caches used for TextLayout, useful for low
      memory conditions.
      
      Change-Id: I92f41afe987b7be4af5ca0a0c50fb51be35a2758
      22e41754
  21. 20 6月, 2014 2 次提交
    • R
      Implement grapheme cluster breaking · 3d28a3fc
      Raph Levien 提交于
      This patch includes an implementation of grapheme cluster breaking,
      which is especially useful for repositioning the cursor for left and
      right arrow key presses. The implementation is closely based on Unicode
      TR29, and uses the ICU grapheme cluster break property, but is tailored
      to more closely match the existing implementation and expected behavior.
      
      Part of a fix for b/15653110 Improve behavior of arrow keys in EditText
      
      Change-Id: I8eb742f77039c9ab7b2838285018cf8a8fc88343
      3d28a3fc
    • R
      Make font runs less sticky · bb601b67
      Raph Levien 提交于
      Fixes b/15734816 In the text "Wi-Fi", "-Fi" appears bolder than "Wi"
      
      The problem was caused by "stickiness" in choosing fonts, where layout
      would prefer using a font used for preceding characters as long as it
      mapped the following characters in a run, in favor of the "best match"
      rules. This patch adds a whitelist for making the stickiness more
      conservative, only applying it for characters necessary for correct
      shaping (ZWJ and ZWNJ in particular) and basic punctuation, where it is
      desirable to match the style of the preceding text.
      
      Change-Id: I1cf116879f074a5a71c351846707bfdd07b0d320
      bb601b67
  22. 13 6月, 2014 4 次提交
  23. 12 6月, 2014 1 次提交
  24. 13 6月, 2014 1 次提交
    • R
      Tighten requirements for fake bold · 9f9f3b1e
      Raph Levien 提交于
      The simple predicate for fake bold (2 or more grades darker than
      requested) was applying it to thin (100 weight) when normal was
      requested. This patch tightens the predicate to also require that
      the requested weight be in the bold range.
      
      Fix for bug 15588352 "sans-serif-thin doesn't work on lockscreen"
      
      Change-Id: Id9988bd149a9c8a7c943e3b221f7fb4b37fb6ddb
      9f9f3b1e
  25. 12 6月, 2014 3 次提交
    • R
      Fix missing text on nonexistent font file · bd36ec76
      Raph Levien 提交于
      Fix for bug 15570313 "Missing text on nonexistent font file"
      
      This patch makes sure that the lastChar and mInstances arrays are in
      sync with each other even when a FontFamily being added has no valid
      fonts in it. Previously, when they got out of sync, unicode coverage
      calculation would be wrong, resulting in missing text.
      
      Change-Id: I69c727ef69e2c61e2b2d6b81d5a28c806327f865
      bd36ec76
    • R
      Support for fake bold and italics · 15651697
      Raph Levien 提交于
      This patch adds support for computing when fake bold and fake italics
      are needed (because the styles are requested but not provided by the
      matching FontFamily), and providing them as part of the layout result.
      
      Part of the fix for bug 15436379 Fake bold doesn't fully work (Minikin)
      
      Change-Id: I180c034b559837943673b5c272c8e890178dff0d
      15651697
    • R
      Add baseFont method to FontCollection · b1eae5ea
      Raph Levien 提交于
      This patch adds a method to retrieve the base font from a
      FontCollection, which is useful when querying global font metrics.
      
      Part of the fix for bug 15467288 "Inconsistent line heights on
      Minikin builds"
      
      Change-Id: I268ae5128d0852a020d746bc22af81fc1a623228
      b1eae5ea
  26. 11 6月, 2014 1 次提交