OLD | NEW |
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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 FallbackListShaperCache::iterator iter; | 408 FallbackListShaperCache::iterator iter; |
409 for (iter = gFallbackListShaperCache->begin(); | 409 for (iter = gFallbackListShaperCache->begin(); |
410 iter != gFallbackListShaperCache->end(); | 410 iter != gFallbackListShaperCache->end(); |
411 ++iter) { | 411 ++iter) { |
412 shapeResultCacheSize += iter->value->byteSize(); | 412 shapeResultCacheSize += iter->value->byteSize(); |
413 } | 413 } |
414 dump->addScalar("size", "bytes", shapeResultCacheSize); | 414 dump->addScalar("size", "bytes", shapeResultCacheSize); |
415 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocate
dObjectPoolName)); | 415 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocate
dObjectPoolName)); |
416 } | 416 } |
417 | 417 |
| 418 // SkFontMgr requires script-based locale names, like "zh-Hant" and "zh-Hans", |
| 419 // instead of "zh-CN" and "zh-TW". |
| 420 CString toSkFontMgrLocale(const String& locale) |
| 421 { |
| 422 if (!locale.startsWith("zh", TextCaseInsensitive)) |
| 423 return locale.ascii(); |
| 424 |
| 425 switch (localeToScriptCodeForFontSelection(locale)) { |
| 426 case USCRIPT_SIMPLIFIED_HAN: |
| 427 return "zh-Hans"; |
| 428 case USCRIPT_TRADITIONAL_HAN: |
| 429 return "zh-Hant"; |
| 430 default: |
| 431 return locale.ascii(); |
| 432 } |
| 433 } |
418 | 434 |
419 } // namespace blink | 435 } // namespace blink |
OLD | NEW |