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

Side by Side Diff: src/fonts/SkFontMgr_indirect.cpp

Issue 673443003: Update fontMgr to take list of bcp47 language tags. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits and loop fix Created 6 years, 1 month 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/core/SkFontHost.cpp ('k') | src/ports/SkFontConfigParser_android.h » ('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 "SkFontMgr_indirect.h" 8 #include "SkFontMgr_indirect.h"
9 9
10 #include "SkDataTable.h" 10 #include "SkDataTable.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 } 240 }
241 241
242 SkTypeface* SkFontMgr_Indirect::onMatchFamilyStyle(const char familyName[], 242 SkTypeface* SkFontMgr_Indirect::onMatchFamilyStyle(const char familyName[],
243 const SkFontStyle& fontStyle) const { 243 const SkFontStyle& fontStyle) const {
244 SkFontIdentity id = fProxy->matchNameStyle(familyName, fontStyle); 244 SkFontIdentity id = fProxy->matchNameStyle(familyName, fontStyle);
245 return this->createTypefaceFromFontId(id); 245 return this->createTypefaceFromFontId(id);
246 } 246 }
247 247
248 SkTypeface* SkFontMgr_Indirect::onMatchFamilyStyleCharacter(const char familyNam e[], 248 SkTypeface* SkFontMgr_Indirect::onMatchFamilyStyleCharacter(const char familyNam e[],
249 const SkFontStyle& s tyle, 249 const SkFontStyle& s tyle,
250 const char bpc47[], 250 const char* bcp47[],
251 uint32_t character) const { 251 int bcpLength,
252 SkFontIdentity id = fProxy->matchNameStyleCharacter(familyName, style, bpc47 , character); 252 SkUnichar character) const {
253 SkFontIdentity id = fProxy->matchNameStyleCharacter(familyName, style, bcp47 ,
254 bcpLength, character);
253 return this->createTypefaceFromFontId(id); 255 return this->createTypefaceFromFontId(id);
254 } 256 }
255 257
256 SkTypeface* SkFontMgr_Indirect::onMatchFaceStyle(const SkTypeface* familyMember, 258 SkTypeface* SkFontMgr_Indirect::onMatchFaceStyle(const SkTypeface* familyMember,
257 const SkFontStyle& fontStyle) c onst { 259 const SkFontStyle& fontStyle) c onst {
258 SkString familyName; 260 SkString familyName;
259 familyMember->getFamilyName(&familyName); 261 familyMember->getFamilyName(&familyName);
260 return this->matchFamilyStyle(familyName.c_str(), fontStyle); 262 return this->matchFamilyStyle(familyName.c_str(), fontStyle);
261 } 263 }
262 264
(...skipping 25 matching lines...) Expand all
288 face.reset(this->matchFamilyStyle(NULL, style)); 290 face.reset(this->matchFamilyStyle(NULL, style));
289 } 291 }
290 292
291 if (NULL == face.get()) { 293 if (NULL == face.get()) {
292 SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style); 294 SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style);
293 face.reset(this->createTypefaceFromFontId(fontId)); 295 face.reset(this->createTypefaceFromFontId(fontId));
294 } 296 }
295 297
296 return face.detach(); 298 return face.detach();
297 } 299 }
OLDNEW
« no previous file with comments | « src/core/SkFontHost.cpp ('k') | src/ports/SkFontConfigParser_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698