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 "SkFontConfigParser_android.h" | 8 #include "SkFontConfigParser_android.h" |
9 #include "SkFontDescriptor.h" | 9 #include "SkFontDescriptor.h" |
10 #include "SkFontHost_FreeType_common.h" | 10 #include "SkFontHost_FreeType_common.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 } | 129 } |
130 | 130 |
131 class SkFontStyleSet_Android : public SkFontStyleSet { | 131 class SkFontStyleSet_Android : public SkFontStyleSet { |
132 public: | 132 public: |
133 explicit SkFontStyleSet_Android(const FontFamily& family, const char* basePa
th) { | 133 explicit SkFontStyleSet_Android(const FontFamily& family, const char* basePa
th) { |
134 const SkString* cannonicalFamilyName = NULL; | 134 const SkString* cannonicalFamilyName = NULL; |
135 if (family.fNames.count() > 0) { | 135 if (family.fNames.count() > 0) { |
136 cannonicalFamilyName = &family.fNames[0]; | 136 cannonicalFamilyName = &family.fNames[0]; |
137 } | 137 } |
138 // TODO? make this lazy | 138 // TODO? make this lazy |
139 for (int i = 0; i < family.fFontFiles.count(); ++i) { | 139 for (int i = 0; i < family.fFonts.count(); ++i) { |
140 const FontFileInfo& fontFile = family.fFontFiles[i]; | 140 const FontFileInfo& fontFile = family.fFonts[i]; |
141 | 141 |
142 SkString pathName; | 142 SkString pathName; |
143 get_path_for_sys_fonts(basePath, fontFile.fFileName, &pathName); | 143 get_path_for_sys_fonts(basePath, fontFile.fFileName, &pathName); |
144 | 144 |
145 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(pathName.c_str()
)); | 145 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(pathName.c_str()
)); |
146 if (!stream.get()) { | 146 if (!stream.get()) { |
147 DEBUG_FONT(("---- SystemFonts[%d] file=%s (NOT EXIST)", i, pathN
ame.c_str())); | 147 DEBUG_FONT(("---- SystemFonts[%d] file=%s (NOT EXIST)", i, pathN
ame.c_str())); |
148 continue; | 148 continue; |
149 } | 149 } |
150 | 150 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 const char* mainConfigFile; | 504 const char* mainConfigFile; |
505 const char* fallbackConfigFile; | 505 const char* fallbackConfigFile; |
506 const char* basePath; | 506 const char* basePath; |
507 SkGetTestFontConfiguration(&mainConfigFile, &fallbackConfigFile, &basePath); | 507 SkGetTestFontConfiguration(&mainConfigFile, &fallbackConfigFile, &basePath); |
508 if (mainConfigFile) { | 508 if (mainConfigFile) { |
509 return SkNEW_ARGS(SkFontMgr_Android, (mainConfigFile, fallbackConfigFile
, basePath)); | 509 return SkNEW_ARGS(SkFontMgr_Android, (mainConfigFile, fallbackConfigFile
, basePath)); |
510 } | 510 } |
511 | 511 |
512 return SkNEW(SkFontMgr_Android); | 512 return SkNEW(SkFontMgr_Android); |
513 } | 513 } |
OLD | NEW |