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 "SkFontMgr.h" | 8 #include "SkFontMgr.h" |
9 #include "SkFontStyle.h" | 9 #include "SkFontStyle.h" |
10 #include "SkFontConfigInterface.h" | 10 #include "SkFontConfigInterface.h" |
| 11 #include "SkFontConfigTypeface.h" |
11 #include "SkMath.h" | 12 #include "SkMath.h" |
12 #include "SkString.h" | 13 #include "SkString.h" |
13 #include "SkTDArray.h" | 14 #include "SkTDArray.h" |
14 | 15 |
15 // for now we pull these in directly. eventually we will solely rely on the | 16 // for now we pull these in directly. eventually we will solely rely on the |
16 // SkFontConfigInterface instance. | 17 // SkFontConfigInterface instance. |
17 #include <fontconfig/fontconfig.h> | 18 #include <fontconfig/fontconfig.h> |
18 #include <unistd.h> | 19 #include <unistd.h> |
19 | 20 |
20 // borrow this global from SkFontHost_fontconfig. eventually that file should | 21 // borrow this global from SkFontHost_fontconfig. eventually that file should |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 virtual SkTypeface* onMatchFaceStyle(const SkTypeface*, | 261 virtual SkTypeface* onMatchFaceStyle(const SkTypeface*, |
261 const SkFontStyle&) { return NULL; } | 262 const SkFontStyle&) { return NULL; } |
262 | 263 |
263 virtual SkTypeface* onCreateFromData(SkData*, int ttcIndex) { return NULL; } | 264 virtual SkTypeface* onCreateFromData(SkData*, int ttcIndex) { return NULL; } |
264 virtual SkTypeface* onCreateFromStream(SkStream*, int ttcIndex) { | 265 virtual SkTypeface* onCreateFromStream(SkStream*, int ttcIndex) { |
265 return NULL; | 266 return NULL; |
266 } | 267 } |
267 virtual SkTypeface* onCreateFromFile(const char path[], int ttcIndex) { | 268 virtual SkTypeface* onCreateFromFile(const char path[], int ttcIndex) { |
268 return NULL; | 269 return NULL; |
269 } | 270 } |
| 271 |
| 272 virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], |
| 273 unsigned styleBits) SK_OVERRIDE { |
| 274 return FontConfigTypeface::LegacyCreateTypeface(NULL, familyName, |
| 275 (SkTypeface::Style)styleBits); |
| 276 } |
270 }; | 277 }; |
271 | 278 |
272 SkFontMgr* SkFontMgr::Factory() { | 279 SkFontMgr* SkFontMgr::Factory() { |
273 SkFontConfigInterface* fci = RefFCI(); | 280 SkFontConfigInterface* fci = RefFCI(); |
274 return fci ? SkNEW_ARGS(SkFontMgr_fontconfig, (fci)) : NULL; | 281 return fci ? SkNEW_ARGS(SkFontMgr_fontconfig, (fci)) : NULL; |
275 } | 282 } |
OLD | NEW |