summaryrefslogtreecommitdiff
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-10 11:59:29 -0700
commit9a5f713add8cfb91ac2c9ed5c917309053201ab6 (patch)
tree7d6be261f3a7d30b0d7f14a66b2ff5e290e1bc4f /include/minikin/FontCollection.h
parent89566f0ada1cafe673efa064cde38467990235d4 (diff)
downloadminikin-9a5f713add8cfb91ac2c9ed5c917309053201ab6.tar.gz
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;