Index: include/core/SkFontHost.h |
diff --git a/include/core/SkFontHost.h b/include/core/SkFontHost.h |
index 5900cc631f54c52e8ff85948ff3de59bb8bd1177..8858ecb8177883a5ffa14a8ae5d9b9c09bcf2dd8 100644 |
--- a/include/core/SkFontHost.h |
+++ b/include/core/SkFontHost.h |
@@ -24,7 +24,7 @@ typedef uint32_t SkFontTableTag; |
This class is ported to each environment. It is responsible for bridging |
the gap between the (sort of) abstract class SkTypeface and the |
platform-specific implementation that provides access to font files. |
- |
+ |
One basic task is for each create (subclass of) SkTypeface, the FontHost is |
resonsible for assigning a uniqueID. The ID should be unique for the |
underlying font file/data, not unique per typeface instance. Thus it is |
@@ -36,7 +36,7 @@ typedef uint32_t SkFontTableTag; |
returned). Either way, the fontID for those instance(s) will be the same. |
In addition, the fontID should never be set to 0. That value is used as a |
sentinel to indicate no-font-id. |
- |
+ |
The major aspects are: |
1) Given either a name/style, return a subclass of SkTypeface that |
references the closest matching font available on the host system. |
@@ -65,17 +65,17 @@ public: |
/** Return a new typeface given the data buffer. If the data does not |
represent a valid font, returns null. |
- |
+ |
If a typeface instance is returned, the caller is responsible for |
calling unref() on the typeface when they are finished with it. |
- |
+ |
The returned typeface may or may not have called ref() on the stream |
parameter. If the typeface has not called ref(), then it may have made |
a copy of the releveant data. In either case, the caller is still |
- responsible for its refcnt ownership of the stream. |
+ responsible for its refcnt ownership of the stream. |
*/ |
static SkTypeface* CreateTypefaceFromStream(SkStream*); |
- |
+ |
/** Return a new typeface from the specified file path. If the file does not |
represent a valid font, this returns null. If a typeface is returned, |
the caller is responsible for calling unref() when it is no longer used. |
@@ -83,13 +83,13 @@ public: |
static SkTypeface* CreateTypefaceFromFile(const char path[]); |
/////////////////////////////////////////////////////////////////////////// |
- |
+ |
/** Returns true if the specified unique ID matches an existing font. |
Returning false is similar to calling OpenStream with an invalid ID, |
which will return NULL in that case. |
*/ |
static bool ValidFontID(SkFontID uniqueID); |
- |
+ |
/** Return a new stream to read the font data, or null if the uniqueID does |
not match an existing typeface. .The caller must call stream->unref() |
when it is finished reading the data. |
@@ -138,7 +138,7 @@ public: |
static SkTypeface* Deserialize(SkStream*); |
/////////////////////////////////////////////////////////////////////////// |
- |
+ |
/** Return a subclass of SkScalarContext |
*/ |
static SkScalerContext* CreateScalerContext(const SkDescriptor* desc); |
@@ -181,10 +181,17 @@ public: |
names, etc.) should be populated. |
@return The returned object has already been referenced. NULL is |
returned if the font is not found. |
+ @param glyphIDs For per-glyph info, specify subset of the font by |
+ giving glyph ids. Each integer represents a glyph |
+ id. Passing NULL means all glyphs in the font. |
+ @param glyphIDsCount Number of elements in subsetGlyphIds. Ignored if |
+ glyphIDs is NULL. |
*/ |
static SkAdvancedTypefaceMetrics* GetAdvancedTypefaceMetrics( |
SkFontID fontID, |
- SkAdvancedTypefaceMetrics::PerGlyphInfo perGlyphInfo); |
+ SkAdvancedTypefaceMetrics::PerGlyphInfo perGlyphInfo, |
+ const uint32_t* glyphIDs, |
+ uint32_t glyphIDsCount); |
/** Return the number of tables in the font |
*/ |
@@ -199,7 +206,7 @@ public: |
/** Given a table tag, return the size of its contents, or 0 if not present |
*/ |
static size_t GetTableSize(SkFontID, SkFontTableTag); |
- |
+ |
/** Copy the contents of a table into data (allocated by the caller). Note |
that the contents of the table will be in their native endian order |
(which for most truetype tables is big endian). If the table tag is |
@@ -293,4 +300,3 @@ public: |
}; |
#endif |
- |