Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: src/ports/SkFontMgr_android.cpp

Issue 446473003: Parser for new fonts.xml format (Closed) Base URL: https://skia.googlesource.com/skia.git@fcparse-lmp-2
Patch Set: Rebase and add missing && Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ports/SkFontConfigParser_android.cpp ('k') | tests/FontConfigParser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/ports/SkFontConfigParser_android.cpp ('k') | tests/FontConfigParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698