History log of /frameworks/minikin/libs/minikin/CmapCoverage.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
bcb024df56c8ae7a5914d6f060ac99a2b5d118d9 18-Feb-2016 Seigo Nonaka <nona@google.com> Merge "Improve Paint.measureText and Paint.hasGlyph for variation sequences." into nyc-dev
6b1c227da6492a435f0341d7fe95d9992669920e 02-Feb-2016 Seigo Nonaka <nona@google.com> Improve Paint.measureText and Paint.hasGlyph for variation sequences.

Before this patch, the font fallback chain iterated all installed font
families if a variation selector was specified.

This CL narrows down the range of iteration.
To decide the font family for the variation sequence, we need to search
for both the variation sequence and its base code point.
The new range of the iteration is a union of them.

With this change, the running time of Paint.hasGlyph for the variation
sequence improves 50% and the running time of Paint.measureText for the
variation sequence improves 40% for the large text case on Nexus 6
userdebug.

Bug: 26784699
Bug: 11750374

Change-Id: Iced1349e3ca750821d8882c551551f65bb569794
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
734f037130e14b3d44bc74026d3d065c025a8280 11-Feb-2016 Raph Levien <raph@google.com> Add error logging on invalid cmap

This patch logs instances of fonts with invalid cmap tables.

Bug: 25645298
Bug: 26413177
Change-Id: I183985e9784a97a2b4307a22e036382b1fc90e5e
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
3034e8b4ab627278b88faae2f4813562f31a7c2b 15-Jan-2016 Raph Levien <raph@google.com> Reject fonts with invalid ranges in cmap
am: ca8ac8acda

* commit 'ca8ac8acdad662230ae37998c6c4091bb39402b6':
Reject fonts with invalid ranges in cmap
ca8ac8acdad662230ae37998c6c4091bb39402b6 06-Jan-2016 Raph Levien <raph@google.com> Reject fonts with invalid ranges in cmap

A corrupt or malicious font may have a negative size in its cmap
range, which in turn could lead to memory corruption. This patch
detects the case and rejects the font, and also includes an assertion
in the sparse bit set implementation if we missed any such case.

External issue:
https://code.google.com/p/android/issues/detail?id=192618

Bug: 26413177
Change-Id: Icc0c80e4ef389abba0964495b89aa0fae3e9f4b2
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
73abbd59344770601991248cc56846cd199812b8 06-Jan-2016 Raph Levien <raph@google.com> Reject fonts with invalid ranges in cmap

A corrupt or malicious font may have a negative size in its cmap
range, which in turn could lead to memory corruption. This patch
detects the case and rejects the font, and also includes an assertion
in the sparse bit set implementation if we missed any such case.

External issue:
https://code.google.com/p/android/issues/detail?id=192618

Bug: 26413177
Change-Id: Icc0c80e4ef389abba0964495b89aa0fae3e9f4b2
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
998293f985dc6c23f90b160f3bc647807c76d3fe 08-Dec-2015 Raph Levien <raph@google.com> Avoid integer overflows in parsing fonts
am: 6299a6ba13

* commit '6299a6ba13906c695f7a4f6748f7bc5856a110e5':
Avoid integer overflows in parsing fonts
6299a6ba13906c695f7a4f6748f7bc5856a110e5 01-Dec-2015 Raph Levien <raph@google.com> Avoid integer overflows in parsing fonts

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 183c9ec2800baa2ce099ee260c6cbc6121cf1274)
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
183c9ec2800baa2ce099ee260c6cbc6121cf1274 01-Dec-2015 Raph Levien <raph@google.com> Avoid integer overflows in parsing fonts

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
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
5f11abd31fa8cfa723f54bd1c98ce4e27e7d3c77 23-Oct-2014 Raph Levien <raph@google.com> Silently ignore invalid rangeOffset values

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
/frameworks/minikin/libs/minikin/CmapCoverage.cpp
9cc9bbe1461f359f0b27c5e7645c17dda001ab1d 24-Apr-2013 Raph Levien <raph@google.com> Initial commit of Minikin library

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
/frameworks/minikin/libs/minikin/CmapCoverage.cpp