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

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

Issue 1312903004: Fix emoji font fallback logic on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « LayoutTests/fast/text/emoji-font-fallback-win-expected.html ('k') | 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « LayoutTests/fast/text/emoji-font-fallback-win-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698