summaryrefslogtreecommitdiffstats
path: root/include/minikin/FontCollection.h
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2014-06-06 17:56:41 -0700
committerRaph Levien <raph@google.com>2014-06-11 12:42:44 -0700
commit1565169734dbed6d59cc10f2a7de01f8601533e0 (patch)
tree7d6be261f3a7d30b0d7f14a66b2ff5e290e1bc4f /include/minikin/FontCollection.h
parentb1eae5ea1f0f1303d155ee550f9aa94acd0127c5 (diff)
downloadandroid_frameworks_minikin-1565169734dbed6d59cc10f2a7de01f8601533e0.tar.gz
android_frameworks_minikin-1565169734dbed6d59cc10f2a7de01f8601533e0.tar.bz2
android_frameworks_minikin-1565169734dbed6d59cc10f2a7de01f8601533e0.zip
Support for fake bold and italics
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
Diffstat (limited to 'include/minikin/FontCollection.h')
-rw-r--r--include/minikin/FontCollection.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/include/minikin/FontCollection.h b/include/minikin/FontCollection.h
index 508a129..12700c6 100644
--- a/include/minikin/FontCollection.h
+++ b/include/minikin/FontCollection.h
@@ -32,24 +32,8 @@ public:
~FontCollection();
- class Run {
- 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) font->RefLocked();
- }
- Run& operator=(const Run& other) {
- if (other.font) other.font->RefLocked();
- if (font) font->UnrefLocked();
- font = other.font;
- start = other.start;
- end = other.end;
- return *this;
- }
- ~Run() { if (font) font->UnrefLocked(); }
-
- MinikinFont* font;
+ struct Run {
+ FakedFont fakedFont;
int start;
int end;
};
@@ -60,6 +44,9 @@ public:
// Get the base font for the given style, useful for font-wide metrics.
MinikinFont* baseFont(FontStyle style);
+ // Get base font with fakery information (fake bold could affect metrics)
+ FakedFont baseFontFaked(FontStyle style);
+
uint32_t getId() const;
private:
static const int kLogCharsPerPage = 8;