| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov | 3 * Copyright (C) 2006 Alexey Proskuryakov |
| 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 } | 120 } |
| 121 if (CFMutableDictionaryRef dictionary = m_derivedFontData->compositeFont
References.get()) { | 121 if (CFMutableDictionaryRef dictionary = m_derivedFontData->compositeFont
References.get()) { |
| 122 bool isUsingPrinterFont = platformData().isPrinterFont(); | 122 bool isUsingPrinterFont = platformData().isPrinterFont(); |
| 123 NSFont *substituteFont = isUsingPrinterFont ? [key printerFont] : [k
ey screenFont]; | 123 NSFont *substituteFont = isUsingPrinterFont ? [key printerFont] : [k
ey screenFont]; |
| 124 | 124 |
| 125 CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(toCTFontRef(su
bstituteFont)); | 125 CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(toCTFontRef(su
bstituteFont)); |
| 126 bool syntheticBold = platformData().syntheticBold() && !(traits & kC
TFontBoldTrait); | 126 bool syntheticBold = platformData().syntheticBold() && !(traits & kC
TFontBoldTrait); |
| 127 bool syntheticOblique = platformData().syntheticOblique() && !(trait
s & kCTFontItalicTrait); | 127 bool syntheticOblique = platformData().syntheticOblique() && !(trait
s & kCTFontItalicTrait); |
| 128 | 128 |
| 129 FontPlatformData substitutePlatform(substituteFont, platformData().s
ize(), isUsingPrinterFont, syntheticBold, syntheticOblique, platformData().orien
tation(), platformData().widthVariant()); | 129 FontPlatformData substitutePlatform(substituteFont, platformData().s
ize(), isUsingPrinterFont, syntheticBold, syntheticOblique, platformData().orien
tation(), platformData().widthVariant()); |
| 130 SimpleFontData* value = new SimpleFontData(substitutePlatform, isCus
tomFont() ? CustomFontData::create(false) : 0); | 130 SimpleFontData* value = new SimpleFontData(substitutePlatform, isCus
tomFont() ? CustomFontData::create(false) : nullptr); |
| 131 if (value) { | 131 if (value) { |
| 132 CFDictionaryAddValue(dictionary, key, value); | 132 CFDictionaryAddValue(dictionary, key, value); |
| 133 return value; | 133 return value; |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 return 0; | 137 return 0; |
| 138 } | 138 } |
| 139 | 139 |
| 140 void SimpleFontData::platformInit() | 140 void SimpleFontData::platformInit() |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 | 329 |
| 330 NSFontTraitMask scaledFontTraits = [fontManager traitsOfFont:scaledFontD
ata.font()]; | 330 NSFontTraitMask scaledFontTraits = [fontManager traitsOfFont:scaledFontD
ata.font()]; |
| 331 scaledFontData.m_syntheticBold = (fontTraits & NSBoldFontMask) && !(scal
edFontTraits & NSBoldFontMask); | 331 scaledFontData.m_syntheticBold = (fontTraits & NSBoldFontMask) && !(scal
edFontTraits & NSBoldFontMask); |
| 332 scaledFontData.m_syntheticOblique = (fontTraits & NSItalicFontMask) && !
(scaledFontTraits & NSItalicFontMask); | 332 scaledFontData.m_syntheticOblique = (fontTraits & NSItalicFontMask) && !
(scaledFontTraits & NSItalicFontMask); |
| 333 | 333 |
| 334 // SimpleFontData::platformDestroy() takes care of not deleting the cach
ed font data twice. | 334 // SimpleFontData::platformDestroy() takes care of not deleting the cach
ed font data twice. |
| 335 return FontCache::fontCache()->fontDataFromFontPlatformData(&scaledFontD
ata); | 335 return FontCache::fontCache()->fontDataFromFontPlatformData(&scaledFontD
ata); |
| 336 } | 336 } |
| 337 END_BLOCK_OBJC_EXCEPTIONS; | 337 END_BLOCK_OBJC_EXCEPTIONS; |
| 338 | 338 |
| 339 return 0; | 339 return nullptr; |
| 340 } | 340 } |
| 341 | 341 |
| 342 void SimpleFontData::determinePitch() | 342 void SimpleFontData::determinePitch() |
| 343 { | 343 { |
| 344 NSFont* f = m_platformData.font(); | 344 NSFont* f = m_platformData.font(); |
| 345 // Special case Osaka-Mono. | 345 // Special case Osaka-Mono. |
| 346 // According to <rdar://problem/3999467>, we should treat Osaka-Mono as fixe
d pitch. | 346 // According to <rdar://problem/3999467>, we should treat Osaka-Mono as fixe
d pitch. |
| 347 // Note that the AppKit does not report Osaka-Mono as fixed pitch. | 347 // Note that the AppKit does not report Osaka-Mono as fixed pitch. |
| 348 | 348 |
| 349 // Special case MS-PGothic. | 349 // Special case MS-PGothic. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 RetainPtr<CGFontRef> runCGFont(AdoptCF, CTFontCopyGraphicsFont(runFont,
0)); | 437 RetainPtr<CGFontRef> runCGFont(AdoptCF, CTFontCopyGraphicsFont(runFont,
0)); |
| 438 if (!CFEqual(runCGFont.get(), cgFont.get())) | 438 if (!CFEqual(runCGFont.get(), cgFont.get())) |
| 439 return false; | 439 return false; |
| 440 } | 440 } |
| 441 | 441 |
| 442 addResult.storedValue->value = true; | 442 addResult.storedValue->value = true; |
| 443 return true; | 443 return true; |
| 444 } | 444 } |
| 445 | 445 |
| 446 } // namespace WebCore | 446 } // namespace WebCore |
| OLD | NEW |