| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
| 9 #undef GetGlyphIndices | 9 #undef GetGlyphIndices |
| 10 | 10 |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 protected: | 488 protected: |
| 489 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE; | 489 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE; |
| 490 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const SK
_OVERRIDE; | 490 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const SK
_OVERRIDE; |
| 491 virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE; | 491 virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE; |
| 492 virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( | 492 virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( |
| 493 SkAdvancedTypefaceMetrics::PerGlyphInfo, | 493 SkAdvancedTypefaceMetrics::PerGlyphInfo, |
| 494 const uint32_t*, uint32_t) const SK_OVERRIDE; | 494 const uint32_t*, uint32_t) const SK_OVERRIDE; |
| 495 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE
; | 495 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE
; |
| 496 virtual int onCountGlyphs() const SK_OVERRIDE; | 496 virtual int onCountGlyphs() const SK_OVERRIDE; |
| 497 virtual int onGetUPEM() const SK_OVERRIDE; | 497 virtual int onGetUPEM() const SK_OVERRIDE; |
| 498 virtual SkTypeface::LocalizedStrings* onGetFamilyNames() const SK_OVERRIDE; | 498 virtual SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const SK_
OVERRIDE; |
| 499 virtual int onGetTableTags(SkFontTableTag tags[]) const SK_OVERRIDE; | 499 virtual int onGetTableTags(SkFontTableTag tags[]) const SK_OVERRIDE; |
| 500 virtual size_t onGetTableData(SkFontTableTag, size_t offset, | 500 virtual size_t onGetTableData(SkFontTableTag, size_t offset, |
| 501 size_t length, void* data) const SK_OVERRIDE; | 501 size_t length, void* data) const SK_OVERRIDE; |
| 502 virtual SkTypeface* onRefMatchingStyle(Style) const SK_OVERRIDE; | 502 virtual SkTypeface* onRefMatchingStyle(Style) const SK_OVERRIDE; |
| 503 }; | 503 }; |
| 504 | 504 |
| 505 class SkScalerContext_DW : public SkScalerContext { | 505 class SkScalerContext_DW : public SkScalerContext { |
| 506 public: | 506 public: |
| 507 SkScalerContext_DW(DWriteFontTypeface*, const SkDescriptor* desc); | 507 SkScalerContext_DW(DWriteFontTypeface*, const SkDescriptor* desc); |
| 508 virtual ~SkScalerContext_DW(); | 508 virtual ~SkScalerContext_DW(); |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 | 1123 |
| 1124 ++fIndex; | 1124 ++fIndex; |
| 1125 return true; | 1125 return true; |
| 1126 } | 1126 } |
| 1127 | 1127 |
| 1128 private: | 1128 private: |
| 1129 UINT32 fIndex; | 1129 UINT32 fIndex; |
| 1130 SkTScopedComPtr<IDWriteLocalizedStrings> fStrings; | 1130 SkTScopedComPtr<IDWriteLocalizedStrings> fStrings; |
| 1131 }; | 1131 }; |
| 1132 | 1132 |
| 1133 SkTypeface::LocalizedStrings* DWriteFontTypeface::onGetFamilyNames() const { | 1133 SkTypeface::LocalizedStrings* DWriteFontTypeface::onCreateFamilyNameIterator() c
onst { |
| 1134 SkTScopedComPtr<IDWriteLocalizedStrings> familyNames; | 1134 SkTScopedComPtr<IDWriteLocalizedStrings> familyNames; |
| 1135 HRNM(fDWriteFontFamily->GetFamilyNames(&familyNames), "Could not obtain fami
ly names."); | 1135 HRNM(fDWriteFontFamily->GetFamilyNames(&familyNames), "Could not obtain fami
ly names."); |
| 1136 | 1136 |
| 1137 return new LocalizedStrings_IDWriteLocalizedStrings(familyNames.release()); | 1137 return new LocalizedStrings_IDWriteLocalizedStrings(familyNames.release()); |
| 1138 } | 1138 } |
| 1139 | 1139 |
| 1140 int DWriteFontTypeface::onGetTableTags(SkFontTableTag tags[]) const { | 1140 int DWriteFontTypeface::onGetTableTags(SkFontTableTag tags[]) const { |
| 1141 DWRITE_FONT_FACE_TYPE type = fDWriteFontFace->GetType(); | 1141 DWRITE_FONT_FACE_TYPE type = fDWriteFontFace->GetType(); |
| 1142 if (type != DWRITE_FONT_FACE_TYPE_CFF && | 1142 if (type != DWRITE_FONT_FACE_TYPE_CFF && |
| 1143 type != DWRITE_FONT_FACE_TYPE_TRUETYPE && | 1143 type != DWRITE_FONT_FACE_TYPE_TRUETYPE && |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1860 | 1860 |
| 1861 WCHAR localeNameStorage[LOCALE_NAME_MAX_LENGTH]; | 1861 WCHAR localeNameStorage[LOCALE_NAME_MAX_LENGTH]; |
| 1862 WCHAR* localeName = NULL; | 1862 WCHAR* localeName = NULL; |
| 1863 int localeNameLen = GetUserDefaultLocaleName(localeNameStorage, LOCALE_NAME_
MAX_LENGTH); | 1863 int localeNameLen = GetUserDefaultLocaleName(localeNameStorage, LOCALE_NAME_
MAX_LENGTH); |
| 1864 if (localeNameLen) { | 1864 if (localeNameLen) { |
| 1865 localeName = localeNameStorage; | 1865 localeName = localeNameStorage; |
| 1866 }; | 1866 }; |
| 1867 | 1867 |
| 1868 return SkNEW_ARGS(SkFontMgr_DirectWrite, (sysFontCollection.get(), localeNam
e, localeNameLen)); | 1868 return SkNEW_ARGS(SkFontMgr_DirectWrite, (sysFontCollection.get(), localeNam
e, localeNameLen)); |
| 1869 } | 1869 } |
| OLD | NEW |