OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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" // Keep this before any #ifdef ... | 8 #include "SkTypes.h" // Keep this before any #ifdef ... |
9 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) | 9 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) |
10 | 10 |
(...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2029 get_str(CTFontCopyFamilyName(fFontRef), familyName); | 2029 get_str(CTFontCopyFamilyName(fFontRef), familyName); |
2030 } | 2030 } |
2031 | 2031 |
2032 void SkTypeface_Mac::onGetFontDescriptor(SkFontDescriptor* desc, | 2032 void SkTypeface_Mac::onGetFontDescriptor(SkFontDescriptor* desc, |
2033 bool* isLocalStream) const { | 2033 bool* isLocalStream) const { |
2034 SkString tmpStr; | 2034 SkString tmpStr; |
2035 | 2035 |
2036 desc->setFamilyName(get_str(CTFontCopyFamilyName(fFontRef), &tmpStr)); | 2036 desc->setFamilyName(get_str(CTFontCopyFamilyName(fFontRef), &tmpStr)); |
2037 desc->setFullName(get_str(CTFontCopyFullName(fFontRef), &tmpStr)); | 2037 desc->setFullName(get_str(CTFontCopyFullName(fFontRef), &tmpStr)); |
2038 desc->setPostscriptName(get_str(CTFontCopyPostScriptName(fFontRef), &tmpStr)
); | 2038 desc->setPostscriptName(get_str(CTFontCopyPostScriptName(fFontRef), &tmpStr)
); |
2039 desc->setStyle(this->fontStyle()); | |
2040 *isLocalStream = fIsLocalStream; | 2039 *isLocalStream = fIsLocalStream; |
2041 } | 2040 } |
2042 | 2041 |
2043 int SkTypeface_Mac::onCharsToGlyphs(const void* chars, Encoding encoding, | 2042 int SkTypeface_Mac::onCharsToGlyphs(const void* chars, Encoding encoding, |
2044 uint16_t glyphs[], int glyphCount) const | 2043 uint16_t glyphs[], int glyphCount) const |
2045 { | 2044 { |
2046 // Undocumented behavior of CTFontGetGlyphsForCharacters with non-bmp code p
oints: | 2045 // Undocumented behavior of CTFontGetGlyphsForCharacters with non-bmp code p
oints: |
2047 // When a surrogate pair is detected, the glyph index used is the index of t
he high surrogate. | 2046 // When a surrogate pair is detected, the glyph index used is the index of t
he high surrogate. |
2048 // It is documented that if a mapping is unavailable, the glyph will be set
to 0. | 2047 // It is documented that if a mapping is unavailable, the glyph will be set
to 0. |
2049 | 2048 |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2578 | 2577 |
2579 return SkSafeRef(GetDefaultFace()); | 2578 return SkSafeRef(GetDefaultFace()); |
2580 } | 2579 } |
2581 }; | 2580 }; |
2582 | 2581 |
2583 /////////////////////////////////////////////////////////////////////////////// | 2582 /////////////////////////////////////////////////////////////////////////////// |
2584 | 2583 |
2585 SkFontMgr* SkFontMgr::Factory() { return new SkFontMgr_Mac; } | 2584 SkFontMgr* SkFontMgr::Factory() { return new SkFontMgr_Mac; } |
2586 | 2585 |
2587 #endif//defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) | 2586 #endif//defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) |
OLD | NEW |