9 Commits

Author SHA1 Message Date
Seigo Nonaka
41e02e9613 Remove FontFamily.addFont and make FontFamily immutable.
This lays the groundwork for making SparseBitSet serializable.
FontFamily.addFont is only used when the FontFamily is constructed.
Thus, instead of calling FontFamily.addFont multiple time, passes
Font list to the constructor. By this change, FontFamily can be
immutable now.

By making FontFamily immutable, We can create FontFamily with
pre-calculated SparseBitSet.

Bug: 34042446
Test: minikin_tests has passed
Change-Id: I2576789fba6cb27687e920e2488e8bedbcf7d36f
2017-01-12 13:27:00 +09:00
Seigo Nonaka
14e2d136aa Always use minikin namespace.
Here is a new policy of the namespace of minikin.
- All components should be in minikin namespace.
- All tests are also in minikin namespace and no anonymous namespace.

Bug: 29233740
Change-Id: I71a8a35049bb8d624f7a78797231e90fed1e2b8c
2016-06-11 00:11:17 +09:00
Aurimas Liutikas
070633ad65 Fix two "unused parameter" warnings in minikin sample.
Removing variables in main function of sample/example.cpp as
they are not used.

Bug: 26936282
Change-Id: I64ae0a455b413df333ddd4810a9e090d52322041
2016-02-12 00:40:29 +00:00
John Reck
8920e81717 Move Bitmap to a different namespace
namespace naming collision. Move minikin's
Bitmap out of android:: and into minikin::

Change-Id: I5ae3925f81b848dc79576429ab55243b96f7fed2
2015-04-27 17:23:29 +00:00
Behdad Esfahbod
9802b0dc8e Fix examples build
Was broken after recent CSS removal.

Change-Id: I160fbc73286b21336d6f3943ff92d7d150dff74b
2014-07-29 16:57:00 -04:00
Behdad Esfahbod
f0a1e5b2da Remove deprecated API
It has been unused outside minikin.

Change-Id: Iaa2237767d81c77f90d0264e633375e601dd72f1
2014-07-24 19:18:14 -04:00
Raph Levien
4d4e6bc811 Caching for layouts and harfbuzz faces
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
2014-05-27 15:39:33 +00:00
Raph Levien
bcc3dc5a25 Introduce MinikinFont abstraction
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
2013-06-14 11:22:35 -07:00
Raph Levien
9cc9bbe146 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
2013-04-25 12:23:57 -07:00