Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 switch (localeToScriptCodeForFontSelection(locale)) { | 50 switch (localeToScriptCodeForFontSelection(locale)) { |
| 51 case USCRIPT_SIMPLIFIED_HAN: | 51 case USCRIPT_SIMPLIFIED_HAN: |
| 52 return "zh-Hans"; | 52 return "zh-Hans"; |
| 53 case USCRIPT_TRADITIONAL_HAN: | 53 case USCRIPT_TRADITIONAL_HAN: |
| 54 return "zh-Hant"; | 54 return "zh-Hant"; |
| 55 default: | 55 default: |
| 56 return locale.ascii(); | 56 return locale.ascii(); |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 | 59 |
| 60 void FontCache::acceptLanguagesChanged(const String&) | |
|
tkent
2016/02/12 04:01:19
Style nit: This should be
void ...() {}
or
voi
kojii
2016/02/12 04:33:47
Done, add TODO for planned platforms (win/android)
| |
| 61 { } | |
| 62 | |
| 60 static AtomicString getFamilyNameForCharacter(UChar32 c, const FontDescription& fontDescription) | 63 static AtomicString getFamilyNameForCharacter(UChar32 c, const FontDescription& fontDescription) |
| 61 { | 64 { |
| 62 RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault()); | 65 RefPtr<SkFontMgr> fm = adoptRef(SkFontMgr::RefDefault()); |
| 63 const char* bcp47Locales[2]; | 66 const char* bcp47Locales[2]; |
| 64 int localeCount = 0; | 67 int localeCount = 0; |
| 65 CString defaultLocale = toSkFontMgrLocale(defaultLanguage()); | 68 CString defaultLocale = toSkFontMgrLocale(defaultLanguage()); |
| 66 bcp47Locales[localeCount++] = defaultLocale.data(); | 69 bcp47Locales[localeCount++] = defaultLocale.data(); |
| 67 CString fontLocale; | 70 CString fontLocale; |
| 68 if (!fontDescription.locale().isEmpty()) { | 71 if (!fontDescription.locale().isEmpty()) { |
| 69 fontLocale = toSkFontMgrLocale(fontDescription.locale()); | 72 fontLocale = toSkFontMgrLocale(fontDescription.locale()); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 break; | 106 break; |
| 104 default: | 107 default: |
| 105 // For other scripts, use the default generic family mapping logic. | 108 // For other scripts, use the default generic family mapping logic. |
| 106 return familyName; | 109 return familyName; |
| 107 } | 110 } |
| 108 | 111 |
| 109 return getFamilyNameForCharacter(examplerChar, fontDescription); | 112 return getFamilyNameForCharacter(examplerChar, fontDescription); |
| 110 } | 113 } |
| 111 | 114 |
| 112 } // namespace blink | 115 } // namespace blink |
| OLD | NEW |