| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkFontConfigInterface.h" | 8 #include "SkFontConfigInterface.h" |
| 9 #include "SkFontConfigTypeface.h" | 9 #include "SkFontConfigTypeface.h" |
| 10 #include "SkFontMgr.h" | 10 #include "SkFontMgr.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 | 311 |
| 312 SkTypeface* face = FontConfigTypeface::Create(style, isFixedWidth, strea
m.release()); | 312 SkTypeface* face = FontConfigTypeface::Create(style, isFixedWidth, strea
m.release()); |
| 313 return face; | 313 return face; |
| 314 } | 314 } |
| 315 | 315 |
| 316 SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override
{ | 316 SkTypeface* onCreateFromFile(const char path[], int ttcIndex) const override
{ |
| 317 SkAutoTDelete<SkStreamAsset> stream(SkStream::NewFromFile(path)); | 317 SkAutoTDelete<SkStreamAsset> stream(SkStream::NewFromFile(path)); |
| 318 return stream.get() ? this->createFromStream(stream.release(), ttcIndex)
: nullptr; | 318 return stream.get() ? this->createFromStream(stream.release(), ttcIndex)
: nullptr; |
| 319 } | 319 } |
| 320 | 320 |
| 321 #ifdef SK_VERY_LEGACY_CREATE_TYPEFACE | |
| 322 SkTypeface* onLegacyCreateTypeface(const char familyName[], unsigned styleBi
ts) const override { | |
| 323 SkTypeface::Style style = static_cast<SkTypeface::Style>(styleBits); | |
| 324 #else | |
| 325 SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle styl
e) const override { | 321 SkTypeface* onLegacyCreateTypeface(const char familyName[], SkFontStyle styl
e) const override { |
| 326 #endif | |
| 327 FCLocker lock; | 322 FCLocker lock; |
| 328 return FontConfigTypeface::LegacyCreateTypeface(familyName, style); | 323 return FontConfigTypeface::LegacyCreateTypeface(familyName, style); |
| 329 } | 324 } |
| 330 }; | 325 }; |
| 331 | 326 |
| 332 SkFontMgr* SkFontMgr::Factory() { | 327 SkFontMgr* SkFontMgr::Factory() { |
| 333 SkFontConfigInterface* fci = RefFCI(); | 328 SkFontConfigInterface* fci = RefFCI(); |
| 334 return fci ? new SkFontMgr_fontconfig(fci) : nullptr; | 329 return fci ? new SkFontMgr_fontconfig(fci) : nullptr; |
| 335 } | 330 } |
| OLD | NEW |