expose getFamilyName to public SkTypeface

git-svn-id: http://skia.googlecode.com/svn/trunk@10418 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2013-07-29 18:54:08 +00:00
parent e8232bc6f0
commit 08df48d241
2 changed files with 14 additions and 0 deletions

View File

@ -224,6 +224,13 @@ public:
*/
int getUnitsPerEm() const;
/**
* Return the family name for this typeface. It will always be returned
* encoded as UTF8, but the language of the name is whatever the host
* platform chooses.
*/
void getFamilyName(SkString* name) const;
/**
* Return a stream for the contents of the font data, or NULL on failure.
* If ttcIndex is not null, it is set to the TrueTypeCollection index

View File

@ -195,6 +195,13 @@ int SkTypeface::getUnitsPerEm() const {
return this->onGetUPEM();
}
void SkTypeface::getFamilyName(SkString* name) const {
bool isLocal = false;
SkFontDescriptor desc(this->style());
this->onGetFontDescriptor(&desc, &isLocal);
name->set(desc.getFamilyName());
}
SkAdvancedTypefaceMetrics* SkTypeface::getAdvancedTypefaceMetrics(
SkAdvancedTypefaceMetrics::PerGlyphInfo info,
const uint32_t* glyphIDs,