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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/FontCache.cpp

Issue 1740593002: Use Skia's matchFamilyStyleCharacter API for font fallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 FallbackListShaperCache::iterator iter; 375 FallbackListShaperCache::iterator iter;
376 for (iter = gFallbackListShaperCache->begin(); 376 for (iter = gFallbackListShaperCache->begin();
377 iter != gFallbackListShaperCache->end(); 377 iter != gFallbackListShaperCache->end();
378 ++iter) { 378 ++iter) {
379 shapeResultCacheSize += iter->value->byteSize(); 379 shapeResultCacheSize += iter->value->byteSize();
380 } 380 }
381 dump->addScalar("size", "bytes", shapeResultCacheSize); 381 dump->addScalar("size", "bytes", shapeResultCacheSize);
382 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocate dObjectPoolName)); 382 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocate dObjectPoolName));
383 } 383 }
384 384
385 // SkFontMgr requires script-based locale names, like "zh-Hant" and "zh-Hans",
386 // instead of "zh-CN" and "zh-TW".
387 CString toSkFontMgrLocale(const String& locale)
388 {
389 if (!locale.startsWith("zh", TextCaseInsensitive))
390 return locale.ascii();
391
392 switch (localeToScriptCodeForFontSelection(locale)) {
393 case USCRIPT_SIMPLIFIED_HAN:
394 return "zh-Hans";
395 case USCRIPT_TRADITIONAL_HAN:
396 return "zh-Hant";
397 default:
398 return locale.ascii();
399 }
400 }
385 401
386 } // namespace blink 402 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/FontCache.h ('k') | third_party/WebKit/Source/platform/fonts/FontDescription.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698