12 Commits

Author SHA1 Message Date
Leon Scroggins III
521c14790b Remove references to SkFloatToScalar.
The macro has been deprecated, now that SkScalar is never fixed point.

Fixes minikin build.

Change-Id: I02838a7fa167c5cf58ad225f3f2f52659495492c
2014-05-15 10:52:56 -04:00
Raph Levien
686d245a0f Initial BiDi support
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
2014-05-14 15:56:05 -07:00
Raph Levien
df405e1da1 Fix 64-bit cleanliness problem
This patch fixes a problem where int and ssize_t were being conflated.

Change-Id: I642a4ee1d59d81723034fdfe33bd8ca29a5dc322
2014-05-14 12:33:09 -07:00
Raph Levien
7b250767bc Fix build breakage in sample code
This updates the Skia sample implementation to implement GetBounds,
but the FreeType implementation is NYI (to be fixed in future commit).

Change-Id: I24eda14d5fb11c2a1e81394ad8c779de3292dd79
2014-05-14 11:01:32 -07:00
Raph Levien
02b919bc17 Better refcounting and locking
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
2014-05-12 10:28:15 -07:00
Raph Levien
eee04fd1e5 A basket of features: itemization, bounds, refcount
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
2014-05-12 09:08:15 -07:00
Kenny Root
014dae7e78 Use canonical UniquePtr.h file
Change-Id: I00953971034a7d00ca165accdab528d2b8ff27a7
2013-09-11 23:24:24 -07:00
Kenny Root
0ab6d024ff Use canonical UniquePtr.h header
Change-Id: Id50e9d6fe2f08d3121b168b45791a8e8fb045d7f
2013-09-11 15:02:30 -07:00
Victoria Lease
79497ccc90 Use shared ft2 lib, deal with libpng/zlib deps
Bug: 9603326
Change-Id: I7df1f68fa3a44b37b1b279387f4ddfe942928bb0
2013-06-27 15:43:55 -07:00
Raph Levien
c905bdf4be Fix build breakage
The MinikinFont class was missing a destructor. The build error was
not caught because incremental builds didn't see fit to relink after
I deleted one of the source files (that contained the impl of this
destructor).

Change-Id: Ic72d56fe28316cd2b2f808910e34ca6f177a1220
2013-06-14 14:12:07 -07:00
Raph Levien
8d9541c5fb 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
c1a6032ce6 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