Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: src/core/SkFontDescriptor.h

Issue 1027373002: Font variations. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkFontDescriptor.h
diff --git a/src/core/SkFontDescriptor.h b/src/core/SkFontDescriptor.h
index 13f9cb7257d8abdc023685face5dac6f4ed0004d..b297df6d7752e2a39e76304cd1909f5f13226352 100644
--- a/src/core/SkFontDescriptor.h
+++ b/src/core/SkFontDescriptor.h
@@ -12,6 +12,13 @@
#include "SkString.h"
#include "SkTypeface.h"
+class SkFontParameters {
bungeman-skia 2015/03/23 21:59:05 So this class is pragmatic, but also represents th
+public:
+ SkFontParameters() : fIndex(0) { }
+ int fIndex;
+ SkAutoSTArray<4, SkFixed> fAxis;
+};
+
class SkFontDescriptor {
public:
SkFontDescriptor(SkTypeface::Style = SkTypeface::kNormal);
@@ -30,7 +37,7 @@ public:
bool hasFontData() const { return fFontData.get() != NULL; }
// Transfers ownership to the caller.
SkStreamAsset* transferFontData() { return fFontData.detach(); }
- int getFontIndex() const { return fFontIndex; }
+ SkFontParameters& getFontParameters() { return fFontParameters; }
void setFamilyName(const char* name) { fFamilyName.set(name); }
void setFullName(const char* name) { fFullName.set(name); }
@@ -40,7 +47,6 @@ public:
* This method takes ownership of the stream (both reference and cursor).
*/
void setFontData(SkStreamAsset* stream) { fFontData.reset(stream); }
- void setFontIndex(int index) { fFontIndex = index; }
private:
SkString fFamilyName;
@@ -48,7 +54,7 @@ private:
SkString fPostscriptName;
SkString fFontFileName;
SkAutoTDelete<SkStreamAsset> fFontData;
- int fFontIndex;
+ SkFontParameters fFontParameters;
SkTypeface::Style fStyle;
};

Powered by Google App Engine
This is Rietveld 408576698