| OLD | NEW |
| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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"}, | 110 {USCRIPT_SIMPLIFIED_HAN, L"simsun"}, |
| 111 {USCRIPT_TRADITIONAL_HAN, L"pmingliu"}, | 111 {USCRIPT_TRADITIONAL_HAN, L"pmingliu"}, |
| 112 {USCRIPT_HIRAGANA, L"ms pgothic"}, | 112 {USCRIPT_HIRAGANA, L"ms pgothic"}, |
| 113 {USCRIPT_KATAKANA, L"ms pgothic"}, | 113 {USCRIPT_KATAKANA, L"ms pgothic"}, |
| 114 {USCRIPT_KATAKANA_OR_HIRAGANA, L"ms pgothic"}, | 114 {USCRIPT_KATAKANA_OR_HIRAGANA, L"ms pgothic"}, |
| 115 {USCRIPT_HANGUL, L"gulim"}, | |
| 116 {USCRIPT_THAI, L"tahoma"}, | 115 {USCRIPT_THAI, L"tahoma"}, |
| 117 {USCRIPT_HEBREW, L"david"}, | 116 {USCRIPT_HEBREW, L"david"}, |
| 118 {USCRIPT_ARABIC, L"tahoma"}, | 117 {USCRIPT_ARABIC, L"tahoma"}, |
| 119 {USCRIPT_DEVANAGARI, L"mangal"}, | 118 {USCRIPT_DEVANAGARI, L"mangal"}, |
| 120 {USCRIPT_BENGALI, L"vrinda"}, | 119 {USCRIPT_BENGALI, L"vrinda"}, |
| 121 {USCRIPT_GURMUKHI, L"raavi"}, | 120 {USCRIPT_GURMUKHI, L"raavi"}, |
| 122 {USCRIPT_GUJARATI, L"shruti"}, | 121 {USCRIPT_GUJARATI, L"shruti"}, |
| 123 {USCRIPT_TAMIL, L"latha"}, | 122 {USCRIPT_TAMIL, L"latha"}, |
| 124 {USCRIPT_TELUGU, L"gautami"}, | 123 {USCRIPT_TELUGU, L"gautami"}, |
| 125 {USCRIPT_KANNADA, L"tunga"}, | 124 {USCRIPT_KANNADA, L"tunga"}, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 153 static const UChar* ethiopicFonts[] = {L"Nyala", L"Abyssinica SIL", L"Ethiop
ia Jiret", L"Visual Geez Unicode", L"GF Zemen Unicode", 0}; | 152 static const UChar* ethiopicFonts[] = {L"Nyala", L"Abyssinica SIL", L"Ethiop
ia Jiret", L"Visual Geez Unicode", L"GF Zemen Unicode", 0}; |
| 154 static const UChar* oriyaFonts[] = {L"Kalinga", L"ori1Uni", L"Lohit Oriya",
0}; | 153 static const UChar* oriyaFonts[] = {L"Kalinga", L"ori1Uni", L"Lohit Oriya",
0}; |
| 155 static const UChar* laoFonts[] = {L"DokChampa", L"Saysettha OT", L"Phetsarat
h OT", L"Code2000", 0}; | 154 static const UChar* laoFonts[] = {L"DokChampa", L"Saysettha OT", L"Phetsarat
h OT", L"Code2000", 0}; |
| 156 static const UChar* tibetanFonts[] = {L"Microsoft Himalaya", L"Jomolhari", L
"Tibetan Machine Uni", 0}; | 155 static const UChar* tibetanFonts[] = {L"Microsoft Himalaya", L"Jomolhari", L
"Tibetan Machine Uni", 0}; |
| 157 static const UChar* sinhalaFonts[] = {L"Iskoola Pota", L"AksharUnicode", 0}; | 156 static const UChar* sinhalaFonts[] = {L"Iskoola Pota", L"AksharUnicode", 0}; |
| 158 static const UChar* yiFonts[] = {L"Microsoft Yi Balti", L"Nuosu SIL", L"Code
2000", 0}; | 157 static const UChar* yiFonts[] = {L"Microsoft Yi Balti", L"Nuosu SIL", L"Code
2000", 0}; |
| 159 // http://www.bethmardutho.org/support/meltho/download/index.php | 158 // http://www.bethmardutho.org/support/meltho/download/index.php |
| 160 static const UChar* syriacFonts[] = {L"Estrangelo Edessa", L"Estrangelo Nisi
bin", L"Code2000", 0}; | 159 static const UChar* syriacFonts[] = {L"Estrangelo Edessa", L"Estrangelo Nisi
bin", L"Code2000", 0}; |
| 161 static const UChar* myanmarFonts[] = {L"Myanmar Text", L"Padauk", L"Parabaik
", L"Myanmar3", L"Code2000", 0}; | 160 static const UChar* myanmarFonts[] = {L"Myanmar Text", L"Padauk", L"Parabaik
", L"Myanmar3", L"Code2000", 0}; |
| 162 static const UChar* gothicFonts[] = {L"Segoe UI Symbol", 0}; | 161 static const UChar* gothicFonts[] = {L"Segoe UI Symbol", 0}; |
| 162 static const UChar* hangulFonts[] = {L"gulim", L"Malgun Gothic", 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 }; | 177 }; |
| 177 | 178 |
| 178 for (size_t i = 0; i < WTF_ARRAY_LENGTH(fontMap); ++i) | 179 for (size_t i = 0; i < WTF_ARRAY_LENGTH(fontMap); ++i) |
| 179 scriptFontMap[fontMap[i].script] = fontMap[i].family; | 180 scriptFontMap[fontMap[i].script] = fontMap[i].family; |
| 180 | 181 |
| 181 // FIXME: Instead of scanning the hard-coded list, we have to | 182 // FIXME: Instead of scanning the hard-coded list, we have to |
| 182 // use EnumFont* to 'inspect' fonts to pick up fonts covering scripts | 183 // use EnumFont* to 'inspect' fonts to pick up fonts covering scripts |
| 183 // when it's possible (e.g. using OS/2 table). If we do that, this | 184 // when it's possible (e.g. using OS/2 table). If we do that, this |
| 184 // had better be pulled out of here. | 185 // had better be pulled out of here. |
| 185 for (size_t i = 0; i < WTF_ARRAY_LENGTH(scriptToFontFamilies); ++i) { | 186 for (size_t i = 0; i < WTF_ARRAY_LENGTH(scriptToFontFamilies); ++i) { |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 family = L"lucida sans unicode"; | 391 family = L"lucida sans unicode"; |
| 391 } | 392 } |
| 392 } | 393 } |
| 393 | 394 |
| 394 if (scriptChecked) | 395 if (scriptChecked) |
| 395 *scriptChecked = script; | 396 *scriptChecked = script; |
| 396 return family; | 397 return family; |
| 397 } | 398 } |
| 398 | 399 |
| 399 } // namespace blink | 400 } // namespace blink |
| OLD | NEW |