OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 Google Inc. | 2 * Copyright 2008 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 "SkFontDescriptor.h" | 9 #include "SkFontDescriptor.h" |
10 #include "SkFontHost.h" | 10 #include "SkFontHost.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 const char* last = strrchr(str, '/'); | 230 const char* last = strrchr(str, '/'); |
231 return last ? last + 1 : NULL; | 231 return last ? last + 1 : NULL; |
232 } | 232 } |
233 | 233 |
234 static bool is_lower(char c) { | 234 static bool is_lower(char c) { |
235 return c >= 'a' && c <= 'z'; | 235 return c >= 'a' && c <= 'z'; |
236 } | 236 } |
237 | 237 |
238 #include "SkFontMgr.h" | 238 #include "SkFontMgr.h" |
239 #include <fontconfig/fontconfig.h> | 239 #include <fontconfig/fontconfig.h> |
| 240 #include <unistd.h> |
240 | 241 |
241 static int get_int(FcPattern* pattern, const char field[]) { | 242 static int get_int(FcPattern* pattern, const char field[]) { |
242 int value; | 243 int value; |
243 if (FcPatternGetInteger(pattern, field, 0, &value) != FcResultMatch) { | 244 if (FcPatternGetInteger(pattern, field, 0, &value) != FcResultMatch) { |
244 value = SK_MinS32; | 245 value = SK_MinS32; |
245 } | 246 } |
246 return value; | 247 return value; |
247 } | 248 } |
248 | 249 |
249 static const char* get_name(FcPattern* pattern, const char field[]) { | 250 static const char* get_name(FcPattern* pattern, const char field[]) { |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 } | 471 } |
471 virtual SkTypeface* onCreateFromFile(const char path[], int ttcIndex) { | 472 virtual SkTypeface* onCreateFromFile(const char path[], int ttcIndex) { |
472 return NULL; | 473 return NULL; |
473 } | 474 } |
474 }; | 475 }; |
475 | 476 |
476 SkFontMgr* SkFontMgr::Factory() { | 477 SkFontMgr* SkFontMgr::Factory() { |
477 SkFontConfigInterface* fci = RefFCI(); | 478 SkFontConfigInterface* fci = RefFCI(); |
478 return fci ? SkNEW_ARGS(SkFontMgr_fontconfig, (fci)) : NULL; | 479 return fci ? SkNEW_ARGS(SkFontMgr_fontconfig, (fci)) : NULL; |
479 } | 480 } |
OLD | NEW |