| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 #ifdef SK_BUILD_FOR_MAC | 10 #ifdef SK_BUILD_FOR_MAC |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 | 447 |
| 448 SkString fName; | 448 SkString fName; |
| 449 AutoCFRelease<CTFontRef> fFontRef; | 449 AutoCFRelease<CTFontRef> fFontRef; |
| 450 SkFontStyle fFontStyle; | 450 SkFontStyle fFontStyle; |
| 451 | 451 |
| 452 protected: | 452 protected: |
| 453 friend class SkFontHost; // to access our protected members for deprecate
d methods | 453 friend class SkFontHost; // to access our protected members for deprecate
d methods |
| 454 | 454 |
| 455 virtual int onGetUPEM() const SK_OVERRIDE; | 455 virtual int onGetUPEM() const SK_OVERRIDE; |
| 456 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE; | 456 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE; |
| 457 virtual SkTypeface::LocalizedStrings* onGetFamilyNames() const SK_OVERRIDE; | 457 virtual SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const SK_
OVERRIDE; |
| 458 virtual int onGetTableTags(SkFontTableTag tags[]) const SK_OVERRIDE; | 458 virtual int onGetTableTags(SkFontTableTag tags[]) const SK_OVERRIDE; |
| 459 virtual size_t onGetTableData(SkFontTableTag, size_t offset, | 459 virtual size_t onGetTableData(SkFontTableTag, size_t offset, |
| 460 size_t length, void* data) const SK_OVERRIDE; | 460 size_t length, void* data) const SK_OVERRIDE; |
| 461 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const SK
_OVERRIDE; | 461 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const SK
_OVERRIDE; |
| 462 virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE; | 462 virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE; |
| 463 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE
; | 463 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE
; |
| 464 virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( | 464 virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( |
| 465 SkAdvancedTypefaceMetrics::PerGlyphInfo, | 465 SkAdvancedTypefaceMetrics::PerGlyphInfo, |
| 466 const uint32_t*, uint32_t) const SK_OVERRIDE; | 466 const uint32_t*, uint32_t) const SK_OVERRIDE; |
| 467 virtual int onCharsToGlyphs(const void* chars, Encoding, uint16_t glyphs[], | 467 virtual int onCharsToGlyphs(const void* chars, Encoding, uint16_t glyphs[], |
| (...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1743 } | 1743 } |
| 1744 | 1744 |
| 1745 /////////////////////////////////////////////////////////////////////////////// | 1745 /////////////////////////////////////////////////////////////////////////////// |
| 1746 /////////////////////////////////////////////////////////////////////////////// | 1746 /////////////////////////////////////////////////////////////////////////////// |
| 1747 | 1747 |
| 1748 int SkTypeface_Mac::onGetUPEM() const { | 1748 int SkTypeface_Mac::onGetUPEM() const { |
| 1749 AutoCFRelease<CGFontRef> cgFont(CTFontCopyGraphicsFont(fFontRef, NULL)); | 1749 AutoCFRelease<CGFontRef> cgFont(CTFontCopyGraphicsFont(fFontRef, NULL)); |
| 1750 return CGFontGetUnitsPerEm(cgFont); | 1750 return CGFontGetUnitsPerEm(cgFont); |
| 1751 } | 1751 } |
| 1752 | 1752 |
| 1753 SkTypeface::LocalizedStrings* SkTypeface_Mac::onGetFamilyNames() const { | 1753 SkTypeface::LocalizedStrings* SkTypeface_Mac::onCreateFamilyNameIterator() const
{ |
| 1754 SkTypeface::LocalizedStrings* nameIter = | 1754 SkTypeface::LocalizedStrings* nameIter = |
| 1755 SkOTUtils::LocalizedStrings_NameTable::CreateForFamilyNames(*this); | 1755 SkOTUtils::LocalizedStrings_NameTable::CreateForFamilyNames(*this); |
| 1756 if (NULL == nameIter) { | 1756 if (NULL == nameIter) { |
| 1757 AutoCFRelease<CFStringRef> cfLanguage; | 1757 AutoCFRelease<CFStringRef> cfLanguage; |
| 1758 AutoCFRelease<CFStringRef> cfFamilyName( | 1758 AutoCFRelease<CFStringRef> cfFamilyName( |
| 1759 CTFontCopyLocalizedName(fFontRef, kCTFontFamilyNameKey, &cfLanguage)
); | 1759 CTFontCopyLocalizedName(fFontRef, kCTFontFamilyNameKey, &cfLanguage)
); |
| 1760 | 1760 |
| 1761 SkString skLanguage; | 1761 SkString skLanguage; |
| 1762 SkString skFamilyName; | 1762 SkString skFamilyName; |
| 1763 if (cfLanguage.get()) { | 1763 if (cfLanguage.get()) { |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2305 } | 2305 } |
| 2306 return create_from_dataProvider(provider); | 2306 return create_from_dataProvider(provider); |
| 2307 } | 2307 } |
| 2308 | 2308 |
| 2309 #endif | 2309 #endif |
| 2310 | 2310 |
| 2311 SkFontMgr* SkFontMgr::Factory() { | 2311 SkFontMgr* SkFontMgr::Factory() { |
| 2312 return SkNEW(SkFontMgr_Mac); | 2312 return SkNEW(SkFontMgr_Mac); |
| 2313 } | 2313 } |
| 2314 #endif | 2314 #endif |
| OLD | NEW |