| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |