| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 if (fontDescription.style()) | 217 if (fontDescription.style()) |
| 218 actualTraits = [fontManager traitsOfFont:nsFont]; | 218 actualTraits = [fontManager traitsOfFont:nsFont]; |
| 219 NSInteger actualWeight = [fontManager weightOfFont:nsFont]; | 219 NSInteger actualWeight = [fontManager weightOfFont:nsFont]; |
| 220 | 220 |
| 221 NSFont *platformFont = useHinting() ? [nsFont screenFont] : [nsFont printerF
ont]; | 221 NSFont *platformFont = useHinting() ? [nsFont screenFont] : [nsFont printerF
ont]; |
| 222 bool syntheticBold = (isAppKitFontWeightBold(weight) && !isAppKitFontWeightB
old(actualWeight)) || fontDescription.isSyntheticBold(); | 222 bool syntheticBold = (isAppKitFontWeightBold(weight) && !isAppKitFontWeightB
old(actualWeight)) || fontDescription.isSyntheticBold(); |
| 223 bool syntheticItalic = ((traits & NSFontItalicTrait) && !(actualTraits & NSF
ontItalicTrait)) || fontDescription.isSyntheticItalic(); | 223 bool syntheticItalic = ((traits & NSFontItalicTrait) && !(actualTraits & NSF
ontItalicTrait)) || fontDescription.isSyntheticItalic(); |
| 224 | 224 |
| 225 // FontPlatformData::font() can be null for the case of Chromium out-of-proc
ess font loading. | 225 // FontPlatformData::font() can be null for the case of Chromium out-of-proc
ess font loading. |
| 226 // In that case, we don't want to use the platformData. | 226 // In that case, we don't want to use the platformData. |
| 227 OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platfo
rmFont, size, syntheticBold, syntheticItalic, fontDescription.orientation(), fon
tDescription.widthVariant())); | 227 OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platfo
rmFont, size, syntheticBold, syntheticItalic, fontDescription.orientation())); |
| 228 if (!platformData->font()) | 228 if (!platformData->font()) |
| 229 return 0; | 229 return 0; |
| 230 return platformData.leakPtr(); | 230 return platformData.leakPtr(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace blink | 233 } // namespace blink |
| OLD | NEW |