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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm

Issue 1693563003: Take Accept-Language into account in CJK font fallback for Android/Win (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@aceept-lang
Patch Set: Fix non-Windows builds Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 void FontCache::platformInit() 89 void FontCache::platformInit()
90 { 90 {
91 CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, fontCacheRegisteredFontsChangedNotificationCallback, kCTFontManagerRegisteredFon tsChangedNotification, 0, CFNotificationSuspensionBehaviorDeliverImmediately); 91 CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, fontCacheRegisteredFontsChangedNotificationCallback, kCTFontManagerRegisteredFon tsChangedNotification, 0, CFNotificationSuspensionBehaviorDeliverImmediately);
92 } 92 }
93 93
94 static inline bool isAppKitFontWeightBold(NSInteger appKitFontWeight) 94 static inline bool isAppKitFontWeightBold(NSInteger appKitFontWeight)
95 { 95 {
96 return appKitFontWeight >= 7; 96 return appKitFontWeight >= 7;
97 } 97 }
98 98
99 void FontCache::acceptLanguagesChanged(const String&) {}
100
101 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip tion& fontDescription, UChar32 character, const SimpleFontData* fontDataToSubsti tute) 99 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip tion& fontDescription, UChar32 character, const SimpleFontData* fontDataToSubsti tute)
102 { 100 {
103 // FIXME: We should fix getFallbackFamily to take a UChar32 101 // FIXME: We should fix getFallbackFamily to take a UChar32
104 // and remove this split-to-UChar16 code. 102 // and remove this split-to-UChar16 code.
105 UChar codeUnits[2]; 103 UChar codeUnits[2];
106 int codeUnitsLength; 104 int codeUnitsLength;
107 if (character <= 0xFFFF) { 105 if (character <= 0xFFFF) {
108 codeUnits[0] = character; 106 codeUnits[0] = character;
109 codeUnitsLength = 1; 107 codeUnitsLength = 1;
110 } else { 108 } else {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 for (size_t i = 0; i < WTF_ARRAY_LENGTH(kSymbolsAndMathFontsMac); ++i) 242 for (size_t i = 0; i < WTF_ARRAY_LENGTH(kSymbolsAndMathFontsMac); ++i)
245 returnVector.append(kSymbolsAndMathFontsMac[i]); 243 returnVector.append(kSymbolsAndMathFontsMac[i]);
246 break; 244 break;
247 default: 245 default:
248 ASSERT_NOT_REACHED(); 246 ASSERT_NOT_REACHED();
249 } 247 }
250 return returnVector; 248 return returnVector;
251 } 249 }
252 250
253 } // namespace blink 251 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698