| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 // infer a script based on the unicode block of a character. | 279 // infer a script based on the unicode block of a character. |
| 280 if (script <= USCRIPT_INHERITED || U_FAILURE(err)) | 280 if (script <= USCRIPT_INHERITED || U_FAILURE(err)) |
| 281 script = getScriptBasedOnUnicodeBlock(ucs4); | 281 script = getScriptBasedOnUnicodeBlock(ucs4); |
| 282 return script; | 282 return script; |
| 283 } | 283 } |
| 284 | 284 |
| 285 const UChar* getFontBasedOnUnicodeBlock(int ucs4, SkFontMgr* fontManager) | 285 const UChar* getFontBasedOnUnicodeBlock(int ucs4, SkFontMgr* fontManager) |
| 286 { | 286 { |
| 287 static const UChar* emojiFonts[] = {L"Segoe UI Emoji", L"Segoe UI Symbol"}; | 287 static const UChar* emojiFonts[] = {L"Segoe UI Emoji", L"Segoe UI Symbol"}; |
| 288 static const UChar* symbolFont = L"Segoe UI Symbol"; | 288 static const UChar* symbolFont = L"Segoe UI Symbol"; |
| 289 const UChar* emojiFont = 0; | 289 static const UChar* emojiFont = 0; |
| 290 static bool initialized = false; | 290 static bool initialized = false; |
| 291 if (!initialized) { | 291 if (!initialized) { |
| 292 for (size_t i = 0; i < WTF_ARRAY_LENGTH(emojiFonts); i++) { | 292 for (size_t i = 0; i < WTF_ARRAY_LENGTH(emojiFonts); i++) { |
| 293 if (isFontPresent(emojiFonts[i], fontManager)) { | 293 if (isFontPresent(emojiFonts[i], fontManager)) { |
| 294 emojiFont = emojiFonts[i]; | 294 emojiFont = emojiFonts[i]; |
| 295 break; | 295 break; |
| 296 } | 296 } |
| 297 } | 297 } |
| 298 initialized = true; | 298 initialized = true; |
| 299 } | 299 } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 family = L"lucida sans unicode"; | 411 family = L"lucida sans unicode"; |
| 412 } | 412 } |
| 413 } | 413 } |
| 414 | 414 |
| 415 if (scriptChecked) | 415 if (scriptChecked) |
| 416 *scriptChecked = script; | 416 *scriptChecked = script; |
| 417 return family; | 417 return family; |
| 418 } | 418 } |
| 419 | 419 |
| 420 } // namespace blink | 420 } // namespace blink |
| OLD | NEW |