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

Unified Diff: include/core/SkTypeface.h

Issue 1027373002: Font variations. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Some clean up. Created 5 years, 8 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: include/core/SkTypeface.h
diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h
index 6a6d7241a2c861a1268ef992b5d87ed7b652d379..e2c97968e5961269260c56bde222e2740b5347ca 100644
--- a/include/core/SkTypeface.h
+++ b/include/core/SkTypeface.h
@@ -16,6 +16,7 @@
#include "SkWeakRefCnt.h"
class SkDescriptor;
+class SkFontData;
class SkFontDescriptor;
class SkScalerContext;
struct SkScalerContextRec;
@@ -281,6 +282,7 @@ public:
* The caller is responsible for deleting the stream.
*/
SkStreamAsset* openStream(int* ttcIndex) const;
+ SkFontData* createFontData() const;
/**
* Return a scalercontext for the given descriptor. If this fails, then
@@ -307,6 +309,8 @@ public:
}
protected:
+ static SkTypeface* CreateFromFontData(SkFontData*);
+
/** uniqueID must be unique and non-zero
*/
SkTypeface(const SkFontStyle& style, SkFontID uniqueID, bool isFixedPitch = false);
@@ -326,6 +330,9 @@ protected:
uint32_t glyphIDsCount) const = 0;
virtual SkStreamAsset* onOpenStream(int* ttcIndex) const = 0;
+ // TODO: make pure virtual.
+ virtual SkFontData* onCreateFontData() const;
+
virtual void onGetFontDescriptor(SkFontDescriptor*, bool* isLocal) const = 0;
virtual int onCharsToGlyphs(const void* chars, Encoding, uint16_t glyphs[],

Powered by Google App Engine
This is Rietveld 408576698