1. 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
  2. 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
  3. 31 7月, 2014 1 次提交
  4. 30 7月, 2014 2 次提交
  5. 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
  6. 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
  7. 23 7月, 2014 1 次提交
  8. 11 7月, 2014 1 次提交
  9. 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
  10. 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
  11. 12 6月, 2014 1 次提交
    • 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
  12. 11 6月, 2014 1 次提交
    • R
      Support for fake bold and italics · 9a5f713a
      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
      9a5f713a
  13. 07 6月, 2014 1 次提交
    • R
      Provisionally enable "palt" OpenType feature · 4043f6f6
      Raph Levien 提交于
      We want to test configurations where the Noto Japanese font will have
      its "palt" feature (to select tighter spacing in kana) will be enabled
      for framework but not WebView or Chrome rendering of Japanese text. This
      patch simply hardcodes this feature on.
      
      This is also a first step towards more general setting of OpenType
      features. The hardcoded feature list will grow into one set by
      parameters which will eventually be plumbed up to Java.
      
      Change-Id: Ie284e0487a1434155c8ac1cb68ddc4fc4b3c018a
      4043f6f6
  14. 06 6月, 2014 2 次提交
    • R
      Support for context in API · 3f1ea5da
      Raph Levien 提交于
      This patch completes support for adding context for complex script
      layout, for example when a string with joins straddles two spans.
      
      Part of the fix for 15431028: "Properly support context for joining
      scripts (Minikin)"
      
      Change-Id: I65b0833be92eb477aa531bbef0ac6eddeb3a962a
      3f1ea5da
    • R
      Make paint flags consistently uint32_t · 3164d1a7
      Raph Levien 提交于
      Change internal plumbing of paint flags (including CssParse) to uint32_t
      consistently, to match the type used in the client. This will probably
      prevent compiler warnings. Also renames "float" to "double" to avoid
      confusion about precision.
      
      Change-Id: I80374712c4067ca9e7711cc2d4ec33c440ab9c7c
      3164d1a7
  15. 05 6月, 2014 1 次提交
    • R
      Fix unmatching type · 89339973
      Raph Levien 提交于
      Missed a slightly mismatched type (int vs int32_t) from a previous code
      review.
      
      Change-Id: Ib56775a3a1a6ec3763da7f7432186954251cc048
      89339973
  16. 04 6月, 2014 1 次提交
    • R
      Support for scaleX and skewX · 448b0fd7
      Raph Levien 提交于
      Adds pseudo-css properties for scaleX and skewX, as well as paint flags,
      and plumb them through to the MinikinPaint abstraction and to Harfbuzz,
      to support nontrivial scale and stretch of text.
      
      This is the Minikin part of the fix for bug 15186705 "Usability of the
      suggestion strip in recent OTA's is severely reduced"
      
      Change-Id: Ifa60355e086e4691ff92c5d50d84eb7cea0fea95
      448b0fd7
  17. 30 5月, 2014 2 次提交
    • R
      Language and variant selection · 7b221d97
      Raph Levien 提交于
      This patch adds a "lang" pseudo-CSS property and uses it both to select
      an appropriate font and control the "locl" OpenType feature to get the
      most appropriate rendering for the langauge and script.  In addition,
      the "-minikin-variant" property selects between "compact" and "elegant"
      variants of a font, as the former is needed for vertically cramped
      spaces.
      
      This is part of the fix for bug 15179652 "Japanese font isn't shown on
      LMP".
      
      Change-Id: I7fab23c12d4c797a6d339a16e497b79a3afe9df1
      7b221d97
    • R
      Fix for Minikin native crash · 0297ee98
      Raph Levien 提交于
      The context start offset wasn't being taken into account for
      accumulating the advance values, leading in some cases to array index
      overflow.
      
      This is a fix for bug 15327918 "SIGSEGV in
      android::MinikinFontSkia::GetSkTypeface()"
      
      Change-Id: I9b646785724c9b72d862b822cd84661c106fbe52
      0297ee98
  18. 27 5月, 2014 3 次提交
    • R
      Fix for bug 15252902 native crash in Minikin · 7c382381
      Raph Levien 提交于
      This is a fix for bug 15252902 "Crash observed on keep launch or
      existing youtube app after playing video". It was doing the test for a
      null font after trying to resolve the font in a cache, which caused a
      crash when there was no font for the run. This patch just tests before
      cache lookup.
      
      Change-Id: Iee41f7ce6b69cb09438462b6aaa916f242da7b77
      7c382381
    • R
      Caching for layouts and harfbuzz faces · 4d4e6bc8
      Raph Levien 提交于
      This patch adds caching for both layouts and for HarfBuzz face objects.
      The granularity of the cache for layouts is words, so it splits the
      input string at word boundaries (using a heuristic). There are is also
      some refactoring to reduce the amount of allocation and copying, and
      movement towards properly supporting contexts.
      
      The size of the caches is a fixed number of entries; thus, it is
      possible to consume a large amount of memory by filling the cache with
      lots of large strings. This should be refined towards a scheme that
      bounds the total memory used by the cache.
      
      This patch fixes bug 15237293 "Regression: Measure performance is
      significantly slower with minikin".
      
      Change-Id: Ie8176857e2d78656ce5479a7c04969819ef2718d
      4d4e6bc8
    • R
      Do BiDi algorithm for text layout · 86fa46c5
      Raph Levien 提交于
      This is a fix for bug 15130102 "Language name for Hebrew displayed the
      wrong way around on keyboard".
      
      This patch extends the previous BiDi support (when the direction for the
      entire string was given by the caller) to run the BiDi algorithm
      (provided by ICU) over the string to break it into BiDi runs. Thus, it
      handles mixed LTR and RTL strings in a single layout, and also respects
      heuristics for inferring the paragraph direction from the string.
      
      Change-Id: Ia4b869de3c139c5a7d16b8ce7766870b98a815ea
      (cherry picked from commit 4b3a9411)
      86fa46c5
  19. 23 5月, 2014 1 次提交
    • R
      Caching for layouts and harfbuzz faces · cf6d68c3
      Raph Levien 提交于
      This patch adds caching for both layouts and for HarfBuzz face objects.
      The granularity of the cache for layouts is words, so it splits the
      input string at word boundaries (using a heuristic). There are is also
      some refactoring to reduce the amount of allocation and copying, and
      movement towards properly supporting contexts.
      
      The size of the caches is a fixed number of entries; thus, it is
      possible to consume a large amount of memory by filling the cache with
      lots of large strings. This should be refined towards a scheme that
      bounds the total memory used by the cache.
      
      Change-Id: Ie8176857e2d78656ce5479a7c04969819ef2718d
      cf6d68c3
  20. 20 5月, 2014 3 次提交
    • R
      Fix incomplete refcounting and locking · 55f3653a
      Raph Levien 提交于
      These changes were supposed to be committed in the previous patch
      "Better refcounting and locking" but seem to have gotten lost in a
      rebase. It fixes a memory leak and some possible race conditions.
      
      Change-Id: I54ca1e37500ec49756fe317cc6d6d03da9911501
      55f3653a
    • R
      Do BiDi algorithm for text layout · 4b3a9411
      Raph Levien 提交于
      This patch extends the previous BiDi support (when the direction for the
      entire string was given by the caller) to run the BiDi algorithm
      (provided by ICU) over the string to break it into BiDi runs. Thus, it
      handles mixed LTR and RTL strings in a single layout, and also respects
      heuristics for inferring the paragraph direction from the string.
      
      Change-Id: Ia4b869de3c139c5a7d16b8ce7766870b98a815ea
      4b3a9411
    • R
      Fix incomplete refcounting and locking · c31e3883
      Raph Levien 提交于
      These changes were supposed to be committed in the previous patch
      "Better refcounting and locking" but seem to have gotten lost in a
      rebase. It fixes a memory leak and some possible race conditions.
      
      Change-Id: I54ca1e37500ec49756fe317cc6d6d03da9911501
      c31e3883
  21. 15 5月, 2014 2 次提交
    • R
      Initial BiDi support · d231a4b0
      Raph Levien 提交于
      This patch contains a very basic implementation of BiDi. It respects the
      BiDi flags passed in as an explicit parameter (through the
      "-minikin-bidi" pseudo-CSS property), but doesn't yet do its own BiDi
      run detection. It also takes some shortcuts (marked as TODO) that are
      based on reasonable assumptions of the current font stack, but not
      universally valid.
      
      Even with these shortcomings, it seems to display RTL text from TextView
      correctly.
      
      Change-Id: I223433923c4eb06f90c0327e86bfbe0aff71d4f5
      d231a4b0
    • R
      Fix 64-bit cleanliness problem · 0a689bb9
      Raph Levien 提交于
      This patch fixes a problem where int and ssize_t were being conflated.
      
      Change-Id: I642a4ee1d59d81723034fdfe33bd8ca29a5dc322
      0a689bb9
  22. 13 5月, 2014 2 次提交
    • R
      Better refcounting and locking · b80c1f19
      Raph Levien 提交于
      All major externally accessible objects (especially FontFamily and
      FontCollection) are now reference counted. In addition, there is a
      global lock intended to make operations thread-safe.
      
      WIP notice: in this version of the patch, not all external API entry
      points are protected by the lock. That should be fixed.
      
      Change-Id: I14106196e99eb101e8bf1bcb4b81359759d2086c
      b80c1f19
    • R
      A basket of features: itemization, bounds, refcount · ecc2d34a
      Raph Levien 提交于
      This patch improves script run itemization and also exposes metrics
      and bounds for layouts. In addition, there is a fair amount of internal
      cleanup, including ref counting, and making the MinikinFont abstraction
      strong enough to support both FreeType and Skia implementations. There
      is also a sample implementation using Skia, in the sample directory.
      
      As part of its functionality, his patch measures the bounds of the
      layout and gives access through Layout::GetBounds().  The corresponding
      method is not implemented in the FreeType-only implementation of
      MinikinFont, so that will probably have to be fixed.
      
      Change-Id: Ib1a3fe9d7c90519ac651fb4aa957848e4bb758ec
      ecc2d34a
  23. 15 6月, 2013 1 次提交
    • R
      Introduce MinikinFont abstraction · bcc3dc5a
      Raph Levien 提交于
      This commit removes the direct dependency on FreeType and replaces it
      with a MinikinFont abstraction, which is designed to support both
      FreeType and Skia fonts (and possibly others in the future).
      
      Also adds a "total advance" to the Layout, with an API for retrieving
      it.
      
      Change-Id: If20f92db9a43fd15b0fe9794b761ba00fb21338c
      bcc3dc5a
  24. 26 4月, 2013 1 次提交
    • R
      Initial commit of Minikin library · 9cc9bbe1
      Raph Levien 提交于
      This is the initial draft of Minikin, a library intended to perform text
      layout functions. This version does basic weight selection and font runs
      for scripts, and also has a simple renderer for drawing into bitmaps,
      but is lacking measurement, line breaking, and a number of other
      important features. It also lacks caching and other performance
      refinements.
      
      Change-Id: I789a2e47d11d71202dc84b4751b51a5e2cd9c451
      9cc9bbe1