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

Side by Side Diff: Source/platform/fonts/win/FontFallbackWin.cpp

Issue 1289733003: Update font fallbacks for Win10 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 years, 4 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 | Annotate | Revision Log
« 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 (c) 2006, 2007, 2008, 2009, 2010, 2012 Google Inc. All rights reser ved. 2 * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2012 Google Inc. All rights reser ved.
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 }; 100 };
101 101
102 static const FontMap fontMap[] = { 102 static const FontMap fontMap[] = {
103 {USCRIPT_LATIN, L"times new roman"}, 103 {USCRIPT_LATIN, L"times new roman"},
104 {USCRIPT_GREEK, L"times new roman"}, 104 {USCRIPT_GREEK, L"times new roman"},
105 {USCRIPT_CYRILLIC, L"times new roman"}, 105 {USCRIPT_CYRILLIC, L"times new roman"},
106 // FIXME: Consider trying new Vista fonts before XP fonts for CJK. 106 // FIXME: Consider trying new Vista fonts before XP fonts for CJK.
107 // Some Vista users do want to use Vista cleartype CJK fonts. If we 107 // Some Vista users do want to use Vista cleartype CJK fonts. If we
108 // did, the results of tests with CJK characters would have to be 108 // did, the results of tests with CJK characters would have to be
109 // regenerated for Vista. 109 // regenerated for Vista.
110 {USCRIPT_SIMPLIFIED_HAN, L"simsun"},
111 {USCRIPT_TRADITIONAL_HAN, L"pmingliu"},
112 {USCRIPT_HIRAGANA, L"ms pgothic"},
113 {USCRIPT_KATAKANA, L"ms pgothic"},
114 {USCRIPT_KATAKANA_OR_HIRAGANA, L"ms pgothic"},
115 {USCRIPT_THAANA, L"mv boli"}, 110 {USCRIPT_THAANA, L"mv boli"},
116 {USCRIPT_MONGOLIAN, L"mongolian balti"}, 111 {USCRIPT_MONGOLIAN, L"mongolian balti"},
117 // For USCRIPT_COMMON, we map blocks to scripts when 112 // For USCRIPT_COMMON, we map blocks to scripts when
118 // that makes sense. 113 // that makes sense.
119 }; 114 };
120 115
121 struct ScriptToFontFamilies { 116 struct ScriptToFontFamilies {
122 UScriptCode script; 117 UScriptCode script;
123 const UChar** families; 118 const UChar** families;
124 }; 119 };
125 120
126 // Kartika on Vista or earlier lacks the support for Chillu 121 // Kartika on Vista or earlier lacks the support for Chillu
127 // letters added to Unicode 5.1. 122 // letters added to Unicode 5.1.
128 // Try AnjaliOldLipi (a very widely used Malaylalam font with the full 123 // Try AnjaliOldLipi (a very widely used Malaylalam font with the full
129 // Unicode 5.x support) before falling back to Kartika. 124 // Unicode 5.x support) before falling back to Kartika.
130 static const UChar* malayalamFonts[] = {L"AnjaliOldLipi", L"Lohit Malayalam" , L"Kartika", L"Rachana", 0}; 125 static const UChar* malayalamFonts[] = {L"AnjaliOldLipi", L"Lohit Malayalam" , L"Kartika", L"Rachana", L"Nirmala UI", 0};
131 // Try Khmer OS before Vista fonts because 'Khmer OS' goes along better 126 // Try Khmer OS before Vista fonts because 'Khmer OS' goes along better
132 // with Latin and looks better/larger for the same size. 127 // with Latin and looks better/larger for the same size.
133 static const UChar* khmerFonts[] = {L"Khmer OS", L"MoolBoran", L"DaunPenh", L"Code2000", 0}; 128 static const UChar* khmerFonts[] = {L"Leelawadee UI", L"Khmer OS", L"MoolBor an", L"DaunPenh", L"Code2000", 0};
134 // For the following 6 scripts, two or fonts are listed. The fonts in 129 // For the following 6 scripts, two or fonts are listed. The fonts in
135 // the 1st slot are not available on Windows XP. To support these 130 // the 1st slot are not available on Windows XP. To support these
136 // scripts on XP, listed in the rest of slots are widely used 131 // scripts on XP, listed in the rest of slots are widely used
137 // fonts. 132 // fonts.
138 static const UChar* ethiopicFonts[] = {L"Nyala", L"Abyssinica SIL", L"Ethiop ia Jiret", L"Visual Geez Unicode", L"GF Zemen Unicode", 0}; 133 static const UChar* ethiopicFonts[] = {L"Nyala", L"Abyssinica SIL", L"Ethiop ia Jiret", L"Visual Geez Unicode", L"GF Zemen Unicode", L"Ebrima", 0};
139 static const UChar* oriyaFonts[] = {L"Kalinga", L"ori1Uni", L"Lohit Oriya", 0}; 134 static const UChar* oriyaFonts[] = {L"Kalinga", L"ori1Uni", L"Lohit Oriya", L"Nirmala UI", 0};
140 static const UChar* laoFonts[] = {L"DokChampa", L"Saysettha OT", L"Phetsarat h OT", L"Code2000", 0}; 135 static const UChar* laoFonts[] = {L"Leelawadee UI", L"DokChampa", L"Saysetth a OT", L"Phetsarath OT", L"Code2000", 0};
141 static const UChar* tibetanFonts[] = {L"Microsoft Himalaya", L"Jomolhari", L "Tibetan Machine Uni", 0}; 136 static const UChar* tibetanFonts[] = {L"Microsoft Himalaya", L"Jomolhari", L "Tibetan Machine Uni", 0};
142 static const UChar* sinhalaFonts[] = {L"Iskoola Pota", L"AksharUnicode", 0}; 137 static const UChar* sinhalaFonts[] = {L"Iskoola Pota", L"AksharUnicode", L"N irmala UI", 0};
143 static const UChar* yiFonts[] = {L"Microsoft Yi Balti", L"Nuosu SIL", L"Code 2000", 0}; 138 static const UChar* yiFonts[] = {L"Microsoft Yi Balti", L"Nuosu SIL", L"Code 2000", 0};
144 // http://www.bethmardutho.org/support/meltho/download/index.php 139 // http://www.bethmardutho.org/support/meltho/download/index.php
145 static const UChar* syriacFonts[] = {L"Estrangelo Edessa", L"Estrangelo Nisi bin", L"Code2000", 0}; 140 static const UChar* syriacFonts[] = {L"Estrangelo Edessa", L"Estrangelo Nisi bin", L"Code2000", 0};
146 static const UChar* myanmarFonts[] = {L"Myanmar Text", L"Padauk", L"Parabaik ", L"Myanmar3", L"Code2000", 0}; 141 static const UChar* myanmarFonts[] = {L"Myanmar Text", L"Padauk", L"Parabaik ", L"Myanmar3", L"Code2000", 0};
147 static const UChar* gothicFonts[] = {L"Segoe UI Symbol", 0}; 142 static const UChar* gothicFonts[] = {L"Segoe UI Symbol", 0};
148 static const UChar* hangulFonts[] = {L"gulim", L"Malgun Gothic", 0}; 143 static const UChar* hangulFonts[] = {L"gulim", L"Malgun Gothic", 0};
149 static const UChar* devanagariFonts[] = {L"mangal", L"Nirmala UI", 0}; 144 static const UChar* devanagariFonts[] = {L"mangal", L"Nirmala UI", 0};
150 static const UChar* gujaratiFonts[] = {L"shruti", L"Nirmala UI", 0}; 145 static const UChar* gujaratiFonts[] = {L"shruti", L"Nirmala UI", 0};
151 static const UChar* bengaliFonts[] = {L"vrinda", L"Nirmala UI", 0}; 146 static const UChar* bengaliFonts[] = {L"vrinda", L"Nirmala UI", 0};
152 static const UChar* teluguFonts[] = {L"gautami", L"Nirmala UI", 0}; 147 static const UChar* teluguFonts[] = {L"gautami", L"Nirmala UI", 0};
153 static const UChar* tamilFonts[] = {L"latha", L"Nirmala UI", 0}; 148 static const UChar* tamilFonts[] = {L"latha", L"Nirmala UI", 0};
154 static const UChar* kannadaFonts[] = {L"tunga", L"Nirmala UI", 0}; 149 static const UChar* kannadaFonts[] = {L"tunga", L"Nirmala UI", 0};
155 static const UChar* gurumukhiFonts[] = {L"raavi", L"Nirmala UI", 0}; 150 static const UChar* gurumukhiFonts[] = {L"raavi", L"Nirmala UI", 0};
156 static const UChar* thaiFonts[] = {L"tahoma", L"Leelawadee UI", L"Leelawadee ", 0}; 151 static const UChar* thaiFonts[] = {L"tahoma", L"Leelawadee UI", L"Leelawadee ", 0};
157 static const UChar* hebrewFonts[] = {L"david", L"Segoe UI", 0}; 152 static const UChar* hebrewFonts[] = {L"david", L"Segoe UI", 0};
158 static const UChar* arabicFonts[] = {L"tahoma", L"Segoe UI", 0}; 153 static const UChar* arabicFonts[] = {L"tahoma", L"Segoe UI", 0};
159 static const UChar* georgianFonts[] = {L"sylfaen", L"Segoe UI", 0}; 154 static const UChar* georgianFonts[] = {L"sylfaen", L"Segoe UI", 0};
160 static const UChar* armenianFonts[] = {L"sylfaen", L"Segoe UI", 0}; 155 static const UChar* armenianFonts[] = {L"sylfaen", L"Segoe UI", 0};
161 static const UChar* canadianAboriginalFonts[] = {L"euphemia", L"Gadugi", 0}; 156 static const UChar* canadianAboriginalFonts[] = {L"euphemia", L"Gadugi", 0};
162 static const UChar* cherokeeFonts[] = {L"plantagenet cherokee", L"Gadugi", 0 }; 157 static const UChar* cherokeeFonts[] = {L"plantagenet cherokee", L"Gadugi", 0 };
158 static const UChar* simplifiedHanFonts[] = {L"simsun", L"Microsoft YaHei", 0 };
159 static const UChar* traditionalHanFonts[] = {L"pmingliu", L"Microsoft JhengH ei", 0};
160 static const UChar* hiraganaFonts[] = {L"ms pgothic", L"Yu Gothic", L"Micros oft YaHei", 0};
161 static const UChar* katakanaFonts[] = {L"ms pgothic", L"Yu Gothic", L"Micros oft YaHei", 0};
162 static const UChar* katakanaOrHiraganaFonts[] = {L"ms pgothic", L"Yu Gothic" , L"Microsoft YaHei", 0};
163 163
164 static const ScriptToFontFamilies scriptToFontFamilies[] = { 164 static const ScriptToFontFamilies scriptToFontFamilies[] = {
165 {USCRIPT_MALAYALAM, malayalamFonts}, 165 {USCRIPT_MALAYALAM, malayalamFonts},
166 {USCRIPT_KHMER, khmerFonts}, 166 {USCRIPT_KHMER, khmerFonts},
167 {USCRIPT_ETHIOPIC, ethiopicFonts}, 167 {USCRIPT_ETHIOPIC, ethiopicFonts},
168 {USCRIPT_ORIYA, oriyaFonts}, 168 {USCRIPT_ORIYA, oriyaFonts},
169 {USCRIPT_LAO, laoFonts}, 169 {USCRIPT_LAO, laoFonts},
170 {USCRIPT_TIBETAN, tibetanFonts}, 170 {USCRIPT_TIBETAN, tibetanFonts},
171 {USCRIPT_SINHALA, sinhalaFonts}, 171 {USCRIPT_SINHALA, sinhalaFonts},
172 {USCRIPT_YI, yiFonts}, 172 {USCRIPT_YI, yiFonts},
173 {USCRIPT_SYRIAC, syriacFonts}, 173 {USCRIPT_SYRIAC, syriacFonts},
174 {USCRIPT_MYANMAR, myanmarFonts}, 174 {USCRIPT_MYANMAR, myanmarFonts},
175 {USCRIPT_GOTHIC, gothicFonts}, 175 {USCRIPT_GOTHIC, gothicFonts},
176 {USCRIPT_HANGUL, hangulFonts}, 176 {USCRIPT_HANGUL, hangulFonts},
177 {USCRIPT_DEVANAGARI, devanagariFonts}, 177 {USCRIPT_DEVANAGARI, devanagariFonts},
178 {USCRIPT_GUJARATI, gujaratiFonts}, 178 {USCRIPT_GUJARATI, gujaratiFonts},
179 {USCRIPT_BENGALI, bengaliFonts}, 179 {USCRIPT_BENGALI, bengaliFonts},
180 {USCRIPT_TELUGU, teluguFonts}, 180 {USCRIPT_TELUGU, teluguFonts},
181 {USCRIPT_TAMIL, tamilFonts}, 181 {USCRIPT_TAMIL, tamilFonts},
182 {USCRIPT_KANNADA, kannadaFonts}, 182 {USCRIPT_KANNADA, kannadaFonts},
183 {USCRIPT_GURMUKHI, gurumukhiFonts}, 183 {USCRIPT_GURMUKHI, gurumukhiFonts},
184 {USCRIPT_THAI, thaiFonts}, 184 {USCRIPT_THAI, thaiFonts},
185 {USCRIPT_HEBREW, hebrewFonts}, 185 {USCRIPT_HEBREW, hebrewFonts},
186 {USCRIPT_ARABIC, arabicFonts}, 186 {USCRIPT_ARABIC, arabicFonts},
187 {USCRIPT_GEORGIAN, georgianFonts}, 187 {USCRIPT_GEORGIAN, georgianFonts},
188 {USCRIPT_ARMENIAN, armenianFonts}, 188 {USCRIPT_ARMENIAN, armenianFonts},
189 {USCRIPT_CANADIAN_ABORIGINAL, canadianAboriginalFonts}, 189 {USCRIPT_CANADIAN_ABORIGINAL, canadianAboriginalFonts},
190 {USCRIPT_CHEROKEE, cherokeeFonts}, 190 {USCRIPT_CHEROKEE, cherokeeFonts},
191 {USCRIPT_SIMPLIFIED_HAN, simplifiedHanFonts},
192 {USCRIPT_TRADITIONAL_HAN, traditionalHanFonts},
193 {USCRIPT_HIRAGANA, hiraganaFonts},
194 {USCRIPT_KATAKANA, katakanaFonts},
195 {USCRIPT_KATAKANA_OR_HIRAGANA, katakanaOrHiraganaFonts},
191 }; 196 };
192 197
193 for (size_t i = 0; i < WTF_ARRAY_LENGTH(fontMap); ++i) 198 for (size_t i = 0; i < WTF_ARRAY_LENGTH(fontMap); ++i)
194 scriptFontMap[fontMap[i].script] = fontMap[i].family; 199 scriptFontMap[fontMap[i].script] = fontMap[i].family;
195 200
196 // FIXME: Instead of scanning the hard-coded list, we have to 201 // FIXME: Instead of scanning the hard-coded list, we have to
197 // use EnumFont* to 'inspect' fonts to pick up fonts covering scripts 202 // use EnumFont* to 'inspect' fonts to pick up fonts covering scripts
198 // when it's possible (e.g. using OS/2 table). If we do that, this 203 // when it's possible (e.g. using OS/2 table). If we do that, this
199 // had better be pulled out of here. 204 // had better be pulled out of here.
200 for (size_t i = 0; i < WTF_ARRAY_LENGTH(scriptToFontFamilies); ++i) { 205 for (size_t i = 0; i < WTF_ARRAY_LENGTH(scriptToFontFamilies); ++i) {
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 family = L"lucida sans unicode"; 410 family = L"lucida sans unicode";
406 } 411 }
407 } 412 }
408 413
409 if (scriptChecked) 414 if (scriptChecked)
410 *scriptChecked = script; 415 *scriptChecked = script;
411 return family; 416 return family;
412 } 417 }
413 418
414 } // namespace blink 419 } // namespace blink
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