| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkDataTable.h" | 8 #include "SkDataTable.h" |
| 9 #include "SkFontMgr.h" | 9 #include "SkFontMgr.h" |
| 10 #include "SkFontMgr_indirect.h" | 10 #include "SkFontMgr_indirect.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 177 } |
| 178 | 178 |
| 179 SkTypeface* SkFontMgr_Indirect::onCreateFromFile(const char path[], int ttcIndex
) const { | 179 SkTypeface* SkFontMgr_Indirect::onCreateFromFile(const char path[], int ttcIndex
) const { |
| 180 return fImpl->createFromFile(path, ttcIndex); | 180 return fImpl->createFromFile(path, ttcIndex); |
| 181 } | 181 } |
| 182 | 182 |
| 183 SkTypeface* SkFontMgr_Indirect::onCreateFromData(SkData* data, int ttcIndex) con
st { | 183 SkTypeface* SkFontMgr_Indirect::onCreateFromData(SkData* data, int ttcIndex) con
st { |
| 184 return fImpl->createFromData(data, ttcIndex); | 184 return fImpl->createFromData(data, ttcIndex); |
| 185 } | 185 } |
| 186 | 186 |
| 187 #ifdef SK_VERY_LEGACY_CREATE_TYPEFACE | |
| 188 SkTypeface* SkFontMgr_Indirect::onLegacyCreateTypeface(const char familyName[], | |
| 189 unsigned styleBits) const
{ | |
| 190 SkFontStyle style = SkFontStyle::FromOldStyle(styleBits); | |
| 191 #else | |
| 192 SkTypeface* SkFontMgr_Indirect::onLegacyCreateTypeface(const char familyName[], | 187 SkTypeface* SkFontMgr_Indirect::onLegacyCreateTypeface(const char familyName[], |
| 193 SkFontStyle style) const
{ | 188 SkFontStyle style) const
{ |
| 194 #endif | |
| 195 SkAutoTUnref<SkTypeface> face(this->matchFamilyStyle(familyName, style)); | 189 SkAutoTUnref<SkTypeface> face(this->matchFamilyStyle(familyName, style)); |
| 196 | 190 |
| 197 if (nullptr == face.get()) { | 191 if (nullptr == face.get()) { |
| 198 face.reset(this->matchFamilyStyle(nullptr, style)); | 192 face.reset(this->matchFamilyStyle(nullptr, style)); |
| 199 } | 193 } |
| 200 | 194 |
| 201 if (nullptr == face.get()) { | 195 if (nullptr == face.get()) { |
| 202 SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style); | 196 SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style); |
| 203 face.reset(this->createTypefaceFromFontId(fontId)); | 197 face.reset(this->createTypefaceFromFontId(fontId)); |
| 204 } | 198 } |
| 205 | 199 |
| 206 return face.release(); | 200 return face.release(); |
| 207 } | 201 } |
| OLD | NEW |