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

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

Issue 326763002: Adding WebFallbackFont and renaming SimpleFontFamily (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing mac build Created 6 years, 6 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 12, // FontWeight900 93 12, // FontWeight900
94 }; 94 };
95 return appKitFontWeights[fontWeight]; 95 return appKitFontWeights[fontWeight];
96 } 96 }
97 97
98 static inline bool isAppKitFontWeightBold(NSInteger appKitFontWeight) 98 static inline bool isAppKitFontWeightBold(NSInteger appKitFontWeight)
99 { 99 {
100 return appKitFontWeight >= 7; 100 return appKitFontWeight >= 7;
101 } 101 }
102 102
103 PassRefPtr<SimpleFontData> FontCache::platformFallbackForCharacter(const FontDes cription& fontDescription, UChar32 character, const SimpleFontData* fontDataToSu bstitute) 103 PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip tion& fontDescription, UChar32 character, const SimpleFontData* fontDataToSubsti tute)
104 { 104 {
105 // FIXME: We should fix getFallbackFamily to take a UChar32 105 // FIXME: We should fix getFallbackFamily to take a UChar32
106 // and remove this split-to-UChar16 code. 106 // and remove this split-to-UChar16 code.
107 UChar codeUnits[2]; 107 UChar codeUnits[2];
108 int codeUnitsLength; 108 int codeUnitsLength;
109 if (character <= 0xFFFF) { 109 if (character <= 0xFFFF) {
110 codeUnits[0] = character; 110 codeUnits[0] = character;
111 codeUnitsLength = 1; 111 codeUnitsLength = 1;
112 } else { 112 } else {
113 codeUnits[0] = U16_LEAD(character); 113 codeUnits[0] = U16_LEAD(character);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 // FontPlatformData::font() can be null for the case of Chromium out-of-proc ess font loading. 224 // FontPlatformData::font() can be null for the case of Chromium out-of-proc ess font loading.
225 // In that case, we don't want to use the platformData. 225 // In that case, we don't want to use the platformData.
226 OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platfo rmFont, size, syntheticBold, syntheticOblique, fontDescription.orientation(), fo ntDescription.widthVariant())); 226 OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platfo rmFont, size, syntheticBold, syntheticOblique, fontDescription.orientation(), fo ntDescription.widthVariant()));
227 if (!platformData->font()) 227 if (!platformData->font())
228 return 0; 228 return 0;
229 return platformData.leakPtr(); 229 return platformData.leakPtr();
230 } 230 }
231 231
232 } // namespace WebCore 232 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/fonts/linux/FontCacheLinux.cpp ('k') | Source/platform/fonts/skia/FontCacheSkia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698