| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009 The Android Open Source Project | 2 * Copyright 2009 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 "SkFontLCDConfig.h" | 8 #include "SkFontLCDConfig.h" |
| 9 #include "SkLazyPtr.h" | 9 #include "SkLazyPtr.h" |
| 10 | 10 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 return NULL; | 112 return NULL; |
| 113 } | 113 } |
| 114 virtual SkFontStyleSet* onMatchFamily(const char[]) const SK_OVERRIDE { | 114 virtual SkFontStyleSet* onMatchFamily(const char[]) const SK_OVERRIDE { |
| 115 return SkFontStyleSet::CreateEmpty(); | 115 return SkFontStyleSet::CreateEmpty(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 virtual SkTypeface* onMatchFamilyStyle(const char[], | 118 virtual SkTypeface* onMatchFamilyStyle(const char[], |
| 119 const SkFontStyle&) const SK_OVERRIDE
{ | 119 const SkFontStyle&) const SK_OVERRIDE
{ |
| 120 return NULL; | 120 return NULL; |
| 121 } | 121 } |
| 122 #ifdef SK_FM_NEW_MATCH_FAMILY_STYLE_CHARACTER |
| 122 virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], | 123 virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], |
| 123 const SkFontStyle& style, | 124 const SkFontStyle& style, |
| 124 const char bpc47[], | 125 const char* bcp47[], |
| 125 uint32_t character) const SK
_OVERRIDE { | 126 int bcp47Count, |
| 127 SkUnichar character) const S
K_OVERRIDE { |
| 128 #else |
| 129 virtual SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], |
| 130 const SkFontStyle& style, |
| 131 const char bcp47[], |
| 132 SkUnichar character) const S
K_OVERRIDE { |
| 133 #endif |
| 126 return NULL; | 134 return NULL; |
| 127 } | 135 } |
| 128 virtual SkTypeface* onMatchFaceStyle(const SkTypeface*, | 136 virtual SkTypeface* onMatchFaceStyle(const SkTypeface*, |
| 129 const SkFontStyle&) const SK_OVERRIDE { | 137 const SkFontStyle&) const SK_OVERRIDE { |
| 130 return NULL; | 138 return NULL; |
| 131 } | 139 } |
| 132 virtual SkTypeface* onCreateFromData(SkData*, int) const SK_OVERRIDE { | 140 virtual SkTypeface* onCreateFromData(SkData*, int) const SK_OVERRIDE { |
| 133 return NULL; | 141 return NULL; |
| 134 } | 142 } |
| 135 virtual SkTypeface* onCreateFromStream(SkStream*, int) const SK_OVERRIDE { | 143 virtual SkTypeface* onCreateFromStream(SkStream*, int) const SK_OVERRIDE { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 164 | 172 |
| 165 SkFontStyleSet* SkFontMgr::matchFamily(const char familyName[]) const { | 173 SkFontStyleSet* SkFontMgr::matchFamily(const char familyName[]) const { |
| 166 return emptyOnNull(this->onMatchFamily(familyName)); | 174 return emptyOnNull(this->onMatchFamily(familyName)); |
| 167 } | 175 } |
| 168 | 176 |
| 169 SkTypeface* SkFontMgr::matchFamilyStyle(const char familyName[], | 177 SkTypeface* SkFontMgr::matchFamilyStyle(const char familyName[], |
| 170 const SkFontStyle& fs) const { | 178 const SkFontStyle& fs) const { |
| 171 return this->onMatchFamilyStyle(familyName, fs); | 179 return this->onMatchFamilyStyle(familyName, fs); |
| 172 } | 180 } |
| 173 | 181 |
| 182 #ifdef SK_FM_NEW_MATCH_FAMILY_STYLE_CHARACTER |
| 174 SkTypeface* SkFontMgr::matchFamilyStyleCharacter(const char familyName[], const
SkFontStyle& style, | 183 SkTypeface* SkFontMgr::matchFamilyStyleCharacter(const char familyName[], const
SkFontStyle& style, |
| 175 const char bpc47[], uint32_t ch
aracter) const { | 184 const char* bcp47[], int bcp47C
ount, |
| 176 return this->onMatchFamilyStyleCharacter(familyName, style, bpc47, character
); | 185 SkUnichar character) const { |
| 186 return this->onMatchFamilyStyleCharacter(familyName, style, bcp47, bcp47Coun
t, character); |
| 177 } | 187 } |
| 188 #else |
| 189 SkTypeface* SkFontMgr::matchFamilyStyleCharacter(const char familyName[], const
SkFontStyle& style, |
| 190 const char bcp47[], SkUnichar c
haracter) const { |
| 191 return this->onMatchFamilyStyleCharacter(familyName, style, bcp47, character
); |
| 192 } |
| 193 #endif |
| 178 | 194 |
| 179 SkTypeface* SkFontMgr::matchFaceStyle(const SkTypeface* face, | 195 SkTypeface* SkFontMgr::matchFaceStyle(const SkTypeface* face, |
| 180 const SkFontStyle& fs) const { | 196 const SkFontStyle& fs) const { |
| 181 return this->onMatchFaceStyle(face, fs); | 197 return this->onMatchFaceStyle(face, fs); |
| 182 } | 198 } |
| 183 | 199 |
| 184 SkTypeface* SkFontMgr::createFromData(SkData* data, int ttcIndex) const { | 200 SkTypeface* SkFontMgr::createFromData(SkData* data, int ttcIndex) const { |
| 185 if (NULL == data) { | 201 if (NULL == data) { |
| 186 return NULL; | 202 return NULL; |
| 187 } | 203 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 211 SkFontMgr* sk_fontmgr_create_default() { | 227 SkFontMgr* sk_fontmgr_create_default() { |
| 212 SkFontMgr* fm = SkFontMgr::Factory(); | 228 SkFontMgr* fm = SkFontMgr::Factory(); |
| 213 return fm ? fm : SkNEW(SkEmptyFontMgr); | 229 return fm ? fm : SkNEW(SkEmptyFontMgr); |
| 214 } | 230 } |
| 215 | 231 |
| 216 SK_DECLARE_STATIC_LAZY_PTR(SkFontMgr, singleton, sk_fontmgr_create_default); | 232 SK_DECLARE_STATIC_LAZY_PTR(SkFontMgr, singleton, sk_fontmgr_create_default); |
| 217 | 233 |
| 218 SkFontMgr* SkFontMgr::RefDefault() { | 234 SkFontMgr* SkFontMgr::RefDefault() { |
| 219 return SkRef(singleton.get()); | 235 return SkRef(singleton.get()); |
| 220 } | 236 } |
| OLD | NEW |