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

Unified Diff: include/ports/SkFontMgr.h

Issue 1027373002: Font variations. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 5 years, 7 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
« no previous file with comments | « include/core/SkTypeface.h ('k') | resources/android_fonts/v22/fonts.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/ports/SkFontMgr.h
diff --git a/include/ports/SkFontMgr.h b/include/ports/SkFontMgr.h
index 4dde920085cb7da8dba2e860dba7d45550aab230..48a0494a7a9d3d574ddc6f287e9a15272c46cbad 100644
--- a/include/ports/SkFontMgr.h
+++ b/include/ports/SkFontMgr.h
@@ -12,6 +12,7 @@
#include "SkFontStyle.h"
class SkData;
+class SkFontData;
class SkStreamAsset;
class SkString;
class SkTypeface;
@@ -95,6 +96,14 @@ public:
SkTypeface* createFromStream(SkStreamAsset*, int ttcIndex = 0) const;
/**
+ * Create a typeface from the specified font data.
+ * Takes ownership of the font data, so the caller should not reference it again.
+ * Will return NULL if the typeface could not be created.
+ * The caller must call unref() on the returned object if it is not null.
+ */
+ SkTypeface* createFromFontData(SkFontData*) const;
+
+ /**
* Create a typeface for the specified fileName and TTC index
* (pass 0 for none) or NULL if the file is not found, or its contents are
* not recognized. The caller must call unref() on the returned object
@@ -129,6 +138,8 @@ protected:
virtual SkTypeface* onCreateFromData(SkData*, int ttcIndex) const = 0;
virtual SkTypeface* onCreateFromStream(SkStreamAsset*, int ttcIndex) const = 0;
+ // TODO: make pure virtual.
+ virtual SkTypeface* onCreateFromFontData(SkFontData*) const;
virtual SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const = 0;
virtual SkTypeface* onLegacyCreateTypeface(const char familyName[],
« no previous file with comments | « include/core/SkTypeface.h ('k') | resources/android_fonts/v22/fonts.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698