diff options
author | Raph Levien <raph@google.com> | 2013-05-22 16:14:27 -0700 |
---|---|---|
committer | Raph Levien <raph@google.com> | 2013-06-14 11:22:35 -0700 |
commit | bcc3dc5a2591a95a57e379e27cbad69c18e91e67 (patch) | |
tree | 6ba40e86f2ef0d52b2e0796f1dda0eb6e5ec4377 /include/minikin/FontCollection.h | |
parent | 9cc9bbe1461f359f0b27c5e7645c17dda001ab1d (diff) | |
download | minikin-bcc3dc5a2591a95a57e379e27cbad69c18e91e67.tar.gz |
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
Diffstat (limited to 'include/minikin/FontCollection.h')
-rw-r--r-- | include/minikin/FontCollection.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/include/minikin/FontCollection.h b/include/minikin/FontCollection.h index 3aa2aca..a2a5391 100644 --- a/include/minikin/FontCollection.h +++ b/include/minikin/FontCollection.h @@ -19,12 +19,9 @@ #include <vector> -#include <ft2build.h> -#include FT_FREETYPE_H -#include FT_TRUETYPE_TABLES_H - -#include "SparseBitSet.h" -#include "FontFamily.h" +#include <minikin/MinikinFont.h> +#include <minikin/SparseBitSet.h> +#include <minikin/FontFamily.h> namespace android { @@ -40,19 +37,19 @@ public: // Do copy constructor, assignment, destructor so it can be used in vectors Run() : font(NULL) { } Run(const Run& other): font(other.font), start(other.start), end(other.end) { - if (font) FT_Reference_Face(font); + if (font) font->Ref(); } Run& operator=(const Run& other) { - if (other.font) FT_Reference_Face(other.font); - if (font) FT_Done_Face(font); + if (other.font) other.font->Ref(); + if (font) font->Unref(); font = other.font; start = other.start; end = other.end; return *this; } - ~Run() { if (font) FT_Done_Face(font); } + ~Run() { if (font) font->Unref(); } - FT_Face font; + MinikinFont* font; int start; int end; }; |