Index: include/ports/SkFontConfigInterface.h |
diff --git a/include/ports/SkFontConfigInterface.h b/include/ports/SkFontConfigInterface.h |
index fd5e812a5b49319be5c2be11a2ae0d434e55bbe0..cf2a55bc4f3676bdf0a18c175d12b528cef14b31 100644 |
--- a/include/ports/SkFontConfigInterface.h |
+++ b/include/ports/SkFontConfigInterface.h |
@@ -95,6 +95,16 @@ public: |
virtual SkStreamAsset* openStream(const FontIdentity&) = 0; |
/** |
+ * Return an SkTypeface for the given FontIdentity. |
+ * |
+ * The default implementation simply returns a new typeface built using data obtained from |
+ * openStream(), but derived classes may implement more complex caching schemes. |
+ */ |
+ virtual SkTypeface* getTypeface(const FontIdentity& identity) { |
reed1
2015/11/20 15:30:14
We usually use get... to return a non-ownership-tr
f(malita)
2015/11/20 15:43:00
Done.
(renamed to createTypeface)
|
+ return SkTypeface::CreateFromStream(this->openStream(identity), identity.fTTCIndex); |
+ } |
+ |
+ /** |
* Return a singleton instance of a direct subclass that calls into |
* libfontconfig. This does not affect the refcnt of the returned instance. |
* The mutex may be used to guarantee the singleton is only constructed once. |