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

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

Issue 1023313002: Add font "index" to lmp parser. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make debug message consistent. Created 5 years, 9 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 | « no previous file | no next file » | 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 2011 The Android Open Source Project 2 * Copyright 2011 The Android Open Source Project
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 "SkFontMgr_android.h" 9 #include "SkFontMgr_android.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // NOTE: we ignore the style. 152 // NOTE: we ignore the style.
153 // The element should contain a filename. 153 // The element should contain a filename.
154 for (size_t i = 0; ATTS_NON_NULL(attributes, i); i += 2) { 154 for (size_t i = 0; ATTS_NON_NULL(attributes, i); i += 2) {
155 const char* name = attributes[i]; 155 const char* name = attributes[i];
156 const char* value = attributes[i+1]; 156 const char* value = attributes[i+1];
157 size_t nameLen = strlen(name); 157 size_t nameLen = strlen(name);
158 if (MEMEQ("weight", name, nameLen)) { 158 if (MEMEQ("weight", name, nameLen)) {
159 if (!parse_non_negative_integer(value, &file->fWeight)) { 159 if (!parse_non_negative_integer(value, &file->fWeight)) {
160 SkDebugf("---- Font weight %s (INVALID)", value); 160 SkDebugf("---- Font weight %s (INVALID)", value);
161 } 161 }
162 } else if (MEMEQ("index", name, nameLen)) {
163 if (!parse_non_negative_integer(value, &file->fIndex)) {
164 SkDebugf("---- Font index %s (INVALID)", value);
165 }
162 } 166 }
163 } 167 }
164 XML_SetCharacterDataHandler(self->fParser, font_file_name_handler); 168 XML_SetCharacterDataHandler(self->fParser, font_file_name_handler);
165 } 169 }
166 170
167 static FontFamily* find_family(FamilyData* self, const SkString& familyName) { 171 static FontFamily* find_family(FamilyData* self, const SkString& familyName) {
168 for (int i = 0; i < self->fFamilies.count(); i++) { 172 for (int i = 0; i < self->fFamilies.count(); i++) {
169 FontFamily* candidate = self->fFamilies[i]; 173 FontFamily* candidate = self->fFamilies[i];
170 for (int j = 0; j < candidate->fNames.count(); j++) { 174 for (int j = 0; j < candidate->fNames.count(); j++) {
171 if (candidate->fNames[j] == familyName) { 175 if (candidate->fNames[j] == familyName) {
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 const char* tag = fTag.c_str(); 627 const char* tag = fTag.c_str();
624 628
625 // strip off the rightmost "-.*" 629 // strip off the rightmost "-.*"
626 const char* parentTagEnd = strrchr(tag, '-'); 630 const char* parentTagEnd = strrchr(tag, '-');
627 if (parentTagEnd == NULL) { 631 if (parentTagEnd == NULL) {
628 return SkLanguage(); 632 return SkLanguage();
629 } 633 }
630 size_t parentTagLen = parentTagEnd - tag; 634 size_t parentTagLen = parentTagEnd - tag;
631 return SkLanguage(tag, parentTagLen); 635 return SkLanguage(tag, parentTagLen);
632 } 636 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698