diff options
author | jvanverth@google.com <jvanverth@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-06 23:31:44 +0000 |
---|---|---|
committer | jvanverth@google.com <jvanverth@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-06 23:31:44 +0000 |
commit | 323652568bbadfe7cf8c919d676e6b81fbff8c8c (patch) | |
tree | 48fe9c01cc144acebb91206a7f14522e0f467e73 /ports/SkFontHost_win_dw.cpp | |
parent | 0d6e372beb9a8659a639f6ad1854d198dec38624 (diff) | |
download | src-323652568bbadfe7cf8c919d676e6b81fbff8c8c.tar.gz |
Reverting r10589: Add getFamilyNames to SkTypeface
git-svn-id: http://skia.googlecode.com/svn/trunk/src@10590 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'ports/SkFontHost_win_dw.cpp')
-rw-r--r-- | ports/SkFontHost_win_dw.cpp | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/ports/SkFontHost_win_dw.cpp b/ports/SkFontHost_win_dw.cpp index cee8b362..beec056e 100644 --- a/ports/SkFontHost_win_dw.cpp +++ b/ports/SkFontHost_win_dw.cpp @@ -495,7 +495,6 @@ protected: virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE; virtual int onCountGlyphs() const SK_OVERRIDE; virtual int onGetUPEM() const SK_OVERRIDE; - virtual SkTypeface::LocalizedStrings* onGetFamilyNames() const SK_OVERRIDE; virtual int onGetTableTags(SkFontTableTag tags[]) const SK_OVERRIDE; virtual size_t onGetTableData(SkFontTableTag, size_t offset, size_t length, void* data) const SK_OVERRIDE; @@ -1089,54 +1088,6 @@ int DWriteFontTypeface::onGetUPEM() const { return metrics.designUnitsPerEm; } -class LocalizedStrings_IDWriteLocalizedStrings : public SkTypeface::LocalizedStrings { -public: - /** Takes ownership of the IDWriteLocalizedStrings. */ - explicit LocalizedStrings_IDWriteLocalizedStrings(IDWriteLocalizedStrings* strings) - : fIndex(0), fStrings(strings) - { } - - virtual bool next(SkTypeface::LocalizedString* localizedString) SK_OVERRIDE { - if (fIndex >= fStrings->GetCount()) { - return false; - } - - // String - UINT32 stringLength; - HRBM(fStrings->GetStringLength(fIndex, &stringLength), "Could not get string length."); - stringLength += 1; - - SkSMallocWCHAR wString(stringLength); - HRBM(fStrings->GetString(fIndex, wString.get(), stringLength), "Could not get string."); - - HRB(wchar_to_skstring(wString.get(), &localizedString->fString)); - - // Locale - UINT32 localeLength; - HRBM(fStrings->GetLocaleNameLength(fIndex, &localeLength), "Could not get locale length."); - localeLength += 1; - - SkSMallocWCHAR wLocale(localeLength); - HRBM(fStrings->GetLocaleName(fIndex, wLocale.get(), localeLength), "Could not get locale."); - - HRB(wchar_to_skstring(wLocale.get(), &localizedString->fLanguage)); - - ++fIndex; - return true; - } - -private: - UINT32 fIndex; - SkTScopedComPtr<IDWriteLocalizedStrings> fStrings; -}; - -SkTypeface::LocalizedStrings* DWriteFontTypeface::onGetFamilyNames() const { - SkTScopedComPtr<IDWriteLocalizedStrings> familyNames; - HRNM(fDWriteFontFamily->GetFamilyNames(&familyNames), "Could not obtain family names."); - - return new LocalizedStrings_IDWriteLocalizedStrings(familyNames.release()); -} - int DWriteFontTypeface::onGetTableTags(SkFontTableTag tags[]) const { DWRITE_FONT_FACE_TYPE type = fDWriteFontFace->GetType(); if (type != DWRITE_FONT_FACE_TYPE_CFF && @@ -1705,7 +1656,6 @@ public: DWRITE_FONT_STRETCH width = (DWRITE_FONT_STRETCH)pattern.width(); SkTScopedComPtr<IDWriteFont> font; - // TODO: perhaps use GetMatchingFonts and get the least simulated? HRNM(fFontFamily->GetFirstMatchingFont(weight, width, slant, &font), "Could not match font in family."); |