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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 switch ([font renderingMode]) { | 73 switch ([font renderingMode]) { |
74 case NSFontIntegerAdvancementsRenderingMode: return kCGFontRenderingMode
1BitPixelAligned; | 74 case NSFontIntegerAdvancementsRenderingMode: return kCGFontRenderingMode
1BitPixelAligned; |
75 case NSFontAntialiasedIntegerAdvancementsRenderingMode: return kCGFontRe
nderingModeAntialiasedPixelAligned; | 75 case NSFontAntialiasedIntegerAdvancementsRenderingMode: return kCGFontRe
nderingModeAntialiasedPixelAligned; |
76 default: return kCGFontRenderingModeAntialiased; | 76 default: return kCGFontRenderingModeAntialiased; |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 using namespace std; | 80 using namespace std; |
81 | 81 |
82 namespace WebCore { | 82 namespace blink { |
83 | 83 |
84 static bool fontHasVerticalGlyphs(CTFontRef ctFont) | 84 static bool fontHasVerticalGlyphs(CTFontRef ctFont) |
85 { | 85 { |
86 // The check doesn't look neat but this is what AppKit does for vertical wri
ting... | 86 // The check doesn't look neat but this is what AppKit does for vertical wri
ting... |
87 RetainPtr<CFArrayRef> tableTags(AdoptCF, CTFontCopyAvailableTables(ctFont, k
CTFontTableOptionNoOptions)); | 87 RetainPtr<CFArrayRef> tableTags(AdoptCF, CTFontCopyAvailableTables(ctFont, k
CTFontTableOptionNoOptions)); |
88 CFIndex numTables = CFArrayGetCount(tableTags.get()); | 88 CFIndex numTables = CFArrayGetCount(tableTags.get()); |
89 for (CFIndex index = 0; index < numTables; ++index) { | 89 for (CFIndex index = 0; index < numTables; ++index) { |
90 CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(t
ableTags.get(), index); | 90 CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(t
ableTags.get(), index); |
91 if (tag == kCTFontTableVhea || tag == kCTFontTableVORG) | 91 if (tag == kCTFontTableVhea || tag == kCTFontTableVORG) |
92 return true; | 92 return true; |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(runAttri
butes, kCTFontAttributeName)); | 446 CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(runAttri
butes, kCTFontAttributeName)); |
447 RetainPtr<CGFontRef> runCGFont(AdoptCF, CTFontCopyGraphicsFont(runFont,
0)); | 447 RetainPtr<CGFontRef> runCGFont(AdoptCF, CTFontCopyGraphicsFont(runFont,
0)); |
448 if (!CFEqual(runCGFont.get(), cgFont.get())) | 448 if (!CFEqual(runCGFont.get(), cgFont.get())) |
449 return false; | 449 return false; |
450 } | 450 } |
451 | 451 |
452 addResult.storedValue->value = true; | 452 addResult.storedValue->value = true; |
453 return true; | 453 return true; |
454 } | 454 } |
455 | 455 |
456 } // namespace WebCore | 456 } // namespace blink |
OLD | NEW |