Changeset 64915 in webkit
- Timestamp:
- Aug 7, 2010, 11:59:43 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r64912 r64915 1 2010-08-07 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 Created a separate SimpleFontData constructor exclusively for SVG fonts and moved the CTFontRef 6 from SimpleFontData to FontPlatformData. 7 https://bugs.webkit.org/show_bug.cgi?id=43674 8 9 * wtf/Platform.h: Moved definitions of WTF_USE_CORE_TEXT and WTF_USE_ATSUI here from WebCore/config.h. 10 1 11 2010-08-07 Zoltan Herczeg <zherczeg@webkit.org> 2 12 -
trunk/JavaScriptCore/wtf/Platform.h
r64818 r64915 1033 1033 #endif 1034 1034 1035 #if PLATFORM(MAC) 1036 /* Complex text framework */ 1037 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) 1038 #define WTF_USE_ATSUI 0 1039 #define WTF_USE_CORE_TEXT 1 1040 #else 1041 #define WTF_USE_ATSUI 1 1042 #define WTF_USE_CORE_TEXT 0 1043 #endif 1044 1035 1045 /* Accelerated compositing */ 1036 #if PLATFORM(MAC)1037 1046 #if !defined(BUILDING_ON_TIGER) 1038 1047 #define WTF_USE_ACCELERATED_COMPOSITING 1 -
trunk/WebCore/ChangeLog
r64914 r64915 1 2010-08-07 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 Created a separate SimpleFontData constructor exclusively for SVG fonts and moved the CTFontRef 6 from SimpleFontData to FontPlatformData. 7 https://bugs.webkit.org/show_bug.cgi?id=43674 8 9 * config.h: Moved definitions of WTF_USE_CORE_TEXT and WTF_USE_ATSUI from here to wtf/Platform.h. 10 * css/CSSFontFaceSource.cpp: 11 (WebCore::CSSFontFaceSource::getFontData): Use new SimpleFontData constructor for SVG fonts. 12 * platform/graphics/SimpleFontData.cpp: 13 (WebCore::SimpleFontData::SimpleFontData): Separated into two constructors, one for 14 PlatformFontData-based fonts and one for SVG fonts. 15 * platform/graphics/SimpleFontData.h: Moved the m_CTFont member variable and the getCTFont() 16 accessor from here… 17 * platform/graphics/mac/FontPlatformData.h: …to here, renaming the latter ctFont(). 18 * platform/graphics/mac/FontPlatformDataMac.mm: 19 (WebCore::FontPlatformData::FontPlatformData): Copy m_CTFont. 20 (WebCore::FontPlatformData::operator=): Copy m_CTFont. 21 (WebCore::FontPlatformData::setFont): Clear m_CTFont. 22 (WebCore::FontPlatformData::ctFont): Moved here from SimpleFontDataCoreText.cpp and renamed. 23 * platform/graphics/mac/SimpleFontDataCoreText.cpp: 24 (WebCore::SimpleFontData::getCFStringAttributes): Updated to use FontPlatformData::ctFont(). 25 * svg/SVGFontData.cpp: 26 (WebCore::SVGFontData::SVGFontData): Added an assertion. 27 1 28 2010-08-07 Adam Barth <abarth@webkit.org> 2 29 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r64909 r64915 1424 1424 7AFD4A8B1131C2760035B883 /* ScriptBreakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1425 1425 7AFD4FF4113277B60035B883 /* ScriptDebugListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1426 81BE209811F4AB8D00915DFA /* IDBCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 81BE209311F4AB8D00915DFA /* IDBCursor.cpp */; };1427 1426 81BE209711F4AB8D00915DFA /* IDBCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 81BE209211F4AB8D00915DFA /* IDBCursor.h */; }; 1428 1427 81BE209811F4AB8D00915DFA /* IDBCursorBackendImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 81BE209311F4AB8D00915DFA /* IDBCursorBackendImpl.cpp */; }; 1429 81BE209911F4AB8D00915DFA /* IDBCursorBackendImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 81BE209411F4AB8D00915DFA /* IDBCursorBackendImpl.h */; }; 1430 81BE209B11F4AB8D00915DFA /* IDBCursorBackendInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 81BE209611F4AB8D00915DFA /* IDBCursorBackendInterface.h */; }; 1428 81BE209911F4AB8D00915DFA /* IDBCursorBackendInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 81BE209411F4AB8D00915DFA /* IDBCursorBackendInterface.h */; }; 1431 1429 81BE20D211F4BC3200915DFA /* JSIDBCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 81BE20A711F4B66F00915DFA /* JSIDBCursor.cpp */; }; 1432 1430 81BE20D311F4BC3200915DFA /* JSIDBCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 81BE20A811F4B66F00915DFA /* JSIDBCursor.h */; }; … … 7260 7258 81BE209211F4AB8D00915DFA /* IDBCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursor.h; sourceTree = "<group>"; }; 7261 7259 81BE209311F4AB8D00915DFA /* IDBCursorBackendImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBCursorBackendImpl.cpp; sourceTree = "<group>"; }; 7262 81BE209411F4AB8D00915DFA /* IDBCursorBackendImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursorBackendImpl.h; sourceTree = "<group>"; };7263 7260 81BE209411F4AB8D00915DFA /* IDBCursorBackendInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBCursorBackendInterface.h; sourceTree = "<group>"; }; 7264 7261 81BE209C11F4ABBD00915DFA /* IDBCursor.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBCursor.idl; sourceTree = "<group>"; }; … … 10098 10095 B6566269120B115A006EA85C /* IDBTransaction.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBTransaction.idl; sourceTree = "<group>"; }; 10099 10096 B656626D120B116B006EA85C /* IDBTransactionBackendInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransactionBackendInterface.h; sourceTree = "<group>"; }; 10100 B656626E120B1227006EA85C /* JSIDBTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSIDBTransaction.h;path = JSIDBTransaction.h; sourceTree = "<group>"; };10101 B656626F120B1227006EA85C /* JSIDBTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSIDBTransaction.cpp;path = JSIDBTransaction.cpp; sourceTree = "<group>"; };10097 B656626E120B1227006EA85C /* JSIDBTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBTransaction.h; sourceTree = "<group>"; }; 10098 B656626F120B1227006EA85C /* JSIDBTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBTransaction.cpp; sourceTree = "<group>"; }; 10102 10099 B734B180119B9911006587BD /* FontTranscoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FontTranscoder.cpp; path = transcoder/FontTranscoder.cpp; sourceTree = "<group>"; }; 10103 10100 B734B182119B991D006587BD /* FontTranscoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FontTranscoder.h; path = transcoder/FontTranscoder.h; sourceTree = "<group>"; }; … … 11469 11466 C585A69A11D4FB3D004C3E4B /* IDBAny.idl */, 11470 11467 C585A69B11D4FB3D004C3E4B /* IDBCallbacks.h */, 11471 81BE209211F4AB8D00915DFA /* IDBCursor. cpp*/,11468 81BE209211F4AB8D00915DFA /* IDBCursor.h */, 11472 11469 81BE209211F4AB8D00915DFA /* IDBCursor.h */, 11473 11470 81BE209C11F4ABBD00915DFA /* IDBCursor.idl */, 11474 11471 81BE209311F4AB8D00915DFA /* IDBCursorBackendImpl.cpp */, 11475 81BE209411F4AB8D00915DFA /* IDBCursorBackendImpl.h */, 11476 81BE209511F4AB8D00915DFA /* IDBCursorBackendInterface.h */, 11472 81BE209411F4AB8D00915DFA /* IDBCursorBackendInterface.h */, 11477 11473 C585A6A311D4FB3D004C3E4B /* IDBDatabase.cpp */, 11478 11474 C585A6A411D4FB3D004C3E4B /* IDBDatabase.h */, … … 18716 18712 C585A6CF11D4FB3D004C3E4B /* IDBCallbacks.h in Headers */, 18717 18713 81BE209711F4AB8D00915DFA /* IDBCursor.h in Headers */, 18718 81BE209911F4AB8D00915DFA /* IDBCursorBackendImpl.h in Headers */, 18719 81BE209B11F4AB8D00915DFA /* IDBCursorBackendInterface.h in Headers */, 18714 81BE209911F4AB8D00915DFA /* IDBCursorBackendInterface.h in Headers */, 18720 18715 C585A6D811D4FB3D004C3E4B /* IDBDatabase.h in Headers */, 18721 18716 B61762621203490800EF9114 /* IDBDatabaseBackendImpl.h in Headers */, … … 21166 21161 C585A6CC11D4FB3D004C3E4B /* IDBAny.cpp in Sources */, 21167 21162 C585A66211D4FAC5004C3E4B /* IDBBindingUtilities.cpp in Sources */, 21168 81BE209811F4AB8D00915DFA /* IDBCursor .cpp in Sources */,21163 81BE209811F4AB8D00915DFA /* IDBCursorBackendImpl.cpp in Sources */, 21169 21164 81BE209811F4AB8D00915DFA /* IDBCursorBackendImpl.cpp in Sources */, 21170 21165 B691C1F91206D4A00025D980 /* IDBDatabase.cpp in Sources */, -
trunk/WebCore/config.h
r64591 r64915 156 156 157 157 #if PLATFORM(MAC) 158 // ATSUI vs. CoreText159 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)160 #define WTF_USE_ATSUI 0161 #define WTF_USE_CORE_TEXT 1162 #else163 #define WTF_USE_ATSUI 1164 #define WTF_USE_CORE_TEXT 0165 #endif166 167 158 // New theme 168 159 #define WTF_USE_NEW_THEME 1 -
trunk/WebCore/css/CSSFontFaceSource.cpp
r64528 r64915 1 1 /* 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 154 154 } 155 155 156 SVGFontData* svgFontData = new SVGFontData(fontFaceElement); 157 fontData.set(new SimpleFontData(m_font->platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic, fontDescription.renderingMode()), true, false, svgFontData)); 156 fontData.set(new SimpleFontData(adoptPtr(new SVGFontData(fontFaceElement)), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic)); 158 157 } 159 158 } else … … 169 168 #if ENABLE(SVG_FONTS) 170 169 // In-Document SVG Fonts 171 if (m_svgFontFaceElement) { 172 SVGFontData* svgFontData = new SVGFontData(m_svgFontFaceElement); 173 fontData.set(new SimpleFontData(FontPlatformData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic), true, false, svgFontData)); 174 } 170 if (m_svgFontFaceElement) 171 fontData.set(new SimpleFontData(adoptPtr(new SVGFontData(m_svgFontFaceElement)), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic)); 175 172 #endif 176 173 } -
trunk/WebCore/platform/graphics/SimpleFontData.cpp
r58474 r64915 1 1 /* 2 * Copyright (C) 2005, 2008 Apple Computer, Inc.All rights reserved.2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 Alexey Proskuryakov 4 4 * … … 48 48 namespace WebCore { 49 49 50 SimpleFontData::SimpleFontData(const FontPlatformData& f, bool customFont, bool loading, SVGFontData* svgFontData)50 SimpleFontData::SimpleFontData(const FontPlatformData& platformData, bool isCustomFont, bool isLoading) 51 51 : m_maxCharWidth(-1) 52 52 , m_avgCharWidth(-1) 53 53 , m_unitsPerEm(defaultUnitsPerEm) 54 , m_platformData( f)54 , m_platformData(platformData) 55 55 , m_treatAsFixedPitch(false) 56 #if ENABLE(SVG_FONTS) 57 , m_svgFontData(svgFontData) 58 #endif 59 , m_isCustomFont(customFont) 60 , m_isLoading(loading) 56 , m_isCustomFont(isCustomFont) 57 , m_isLoading(isLoading) 61 58 , m_smallCapsFontData(0) 62 59 { 63 #if !ENABLE(SVG_FONTS)64 UNUSED_PARAM(svgFontData);65 #else66 if (SVGFontFaceElement* svgFontFaceElement = svgFontData ? svgFontData->svgFontFaceElement() : 0) {67 m_unitsPerEm = svgFontFaceElement->unitsPerEm();68 69 double scale = f.size();70 if (m_unitsPerEm)71 scale /= m_unitsPerEm;72 73 m_ascent = static_cast<int>(svgFontFaceElement->ascent() * scale);74 m_descent = static_cast<int>(svgFontFaceElement->descent() * scale);75 m_xHeight = static_cast<int>(svgFontFaceElement->xHeight() * scale);76 m_lineGap = 0.1f * f.size();77 m_lineSpacing = m_ascent + m_descent + m_lineGap;78 79 SVGFontElement* associatedFontElement = svgFontFaceElement->associatedFontElement();80 81 Vector<SVGGlyphIdentifier> spaceGlyphs;82 associatedFontElement->getGlyphIdentifiersForString(String(" ", 1), spaceGlyphs);83 m_spaceWidth = spaceGlyphs.isEmpty() ? m_xHeight : static_cast<float>(spaceGlyphs.first().horizontalAdvanceX * scale);84 85 Vector<SVGGlyphIdentifier> numeralZeroGlyphs;86 associatedFontElement->getGlyphIdentifiersForString(String("0", 1), numeralZeroGlyphs);87 m_avgCharWidth = numeralZeroGlyphs.isEmpty() ? m_spaceWidth : static_cast<float>(numeralZeroGlyphs.first().horizontalAdvanceX * scale);88 89 Vector<SVGGlyphIdentifier> letterWGlyphs;90 associatedFontElement->getGlyphIdentifiersForString(String("W", 1), letterWGlyphs);91 m_maxCharWidth = letterWGlyphs.isEmpty() ? m_ascent : static_cast<float>(letterWGlyphs.first().horizontalAdvanceX * scale);92 93 // FIXME: is there a way we can get the space glyph from the SVGGlyphIdentifier above?94 m_spaceGlyph = 0;95 m_zeroWidthSpaceGlyph = 0;96 determinePitch();97 m_adjustedSpaceWidth = roundf(m_spaceWidth);98 m_missingGlyphData.fontData = this;99 m_missingGlyphData.glyph = 0;100 return;101 }102 #endif103 104 60 platformInit(); 105 61 platformGlyphInit(); 106 62 platformCharWidthInit(); 107 63 } 64 65 #if ENABLE(SVG_FONTS) 66 SimpleFontData::SimpleFontData(PassOwnPtr<SVGFontData> svgFontData, int size, bool syntheticBold, bool syntheticItalic) 67 : m_platformData(FontPlatformData(size, syntheticBold, syntheticItalic)) 68 , m_treatAsFixedPitch(false) 69 , m_svgFontData(svgFontData) 70 , m_isCustomFont(true) 71 , m_isLoading(false) 72 , m_smallCapsFontData(0) 73 { 74 SVGFontFaceElement* svgFontFaceElement = m_svgFontData->svgFontFaceElement(); 75 m_unitsPerEm = svgFontFaceElement->unitsPerEm(); 76 77 double scale = size; 78 if (m_unitsPerEm) 79 scale /= m_unitsPerEm; 80 81 m_ascent = static_cast<int>(svgFontFaceElement->ascent() * scale); 82 m_descent = static_cast<int>(svgFontFaceElement->descent() * scale); 83 m_xHeight = static_cast<int>(svgFontFaceElement->xHeight() * scale); 84 m_lineGap = 0.1f * size; 85 m_lineSpacing = m_ascent + m_descent + m_lineGap; 86 87 SVGFontElement* associatedFontElement = svgFontFaceElement->associatedFontElement(); 88 89 Vector<SVGGlyphIdentifier> spaceGlyphs; 90 associatedFontElement->getGlyphIdentifiersForString(String(" ", 1), spaceGlyphs); 91 m_spaceWidth = spaceGlyphs.isEmpty() ? m_xHeight : static_cast<float>(spaceGlyphs.first().horizontalAdvanceX * scale); 92 93 Vector<SVGGlyphIdentifier> numeralZeroGlyphs; 94 associatedFontElement->getGlyphIdentifiersForString(String("0", 1), numeralZeroGlyphs); 95 m_avgCharWidth = numeralZeroGlyphs.isEmpty() ? m_spaceWidth : static_cast<float>(numeralZeroGlyphs.first().horizontalAdvanceX * scale); 96 97 Vector<SVGGlyphIdentifier> letterWGlyphs; 98 associatedFontElement->getGlyphIdentifiersForString(String("W", 1), letterWGlyphs); 99 m_maxCharWidth = letterWGlyphs.isEmpty() ? m_ascent : static_cast<float>(letterWGlyphs.first().horizontalAdvanceX * scale); 100 101 // FIXME: is there a way we can get the space glyph from the SVGGlyphIdentifier above? 102 m_spaceGlyph = 0; 103 m_zeroWidthSpaceGlyph = 0; 104 determinePitch(); 105 m_adjustedSpaceWidth = roundf(m_spaceWidth); 106 m_missingGlyphData.fontData = this; 107 m_missingGlyphData.glyph = 0; 108 } 109 #endif 108 110 109 111 #if !PLATFORM(QT) -
trunk/WebCore/platform/graphics/SimpleFontData.h
r62677 r64915 2 2 * This file is part of the internal font implementation. 3 3 * 4 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.4 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved. 5 5 * Copyright (C) 2007-2008 Torch Mobile, Inc. 6 6 * … … 33 33 #include <wtf/OwnPtr.h> 34 34 #include <wtf/PassOwnPtr.h> 35 #include <wtf/RetainPtr.h> 35 36 36 37 #if USE(ATSUI) 37 38 typedef struct OpaqueATSUStyle* ATSUStyle; 38 #endif39 40 #if USE(CORE_TEXT)41 #include <ApplicationServices/ApplicationServices.h>42 #include <wtf/RetainPtr.h>43 39 #endif 44 40 … … 63 59 64 60 class FontDescription; 65 class FontPlatformData;66 61 class SharedBuffer; 67 62 class SVGFontData; … … 71 66 class SimpleFontData : public FontData { 72 67 public: 73 SimpleFontData(const FontPlatformData&, bool customFont = false, bool loading = false, SVGFontData* data = 0); 68 SimpleFontData(const FontPlatformData&, bool isCustomFont = false, bool isLoading = false); 69 #if ENABLE(SVG_FONTS) 70 SimpleFontData(PassOwnPtr<SVGFontData>, int size, bool syntheticBold, bool syntheticItalic); 71 #endif 74 72 virtual ~SimpleFontData(); 75 73 76 public:77 74 const FontPlatformData& platformData() const { return m_platformData; } 78 75 SimpleFontData* smallCapsFontData(const FontDescription& fontDescription) const; … … 132 129 133 130 #if USE(CORE_TEXT) 134 CTFontRef getCTFont() const;135 131 CFDictionaryRef getCFStringAttributes(TypesettingFeatures) const; 136 132 #endif … … 237 233 238 234 #if USE(CORE_TEXT) 239 mutable RetainPtr<CTFontRef> m_CTFont;240 235 mutable HashMap<unsigned, RetainPtr<CFDictionaryRef> > m_CFStringAttributes; 241 236 #endif -
trunk/WebCore/platform/graphics/mac/FontPlatformData.h
r64861 r64915 3 3 * It should not be included by source files outside of it. 4 4 * 5 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.5 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 6 6 * 7 7 * This library is free software; you can redistribute it and/or … … 115 115 void setFont(NSFont *font); 116 116 117 #if USE(CORE_TEXT) 118 CTFontRef ctFont() const; 119 #endif 120 117 121 bool roundsGlyphAdvances() const; 118 122 bool allowsLigatures() const; … … 133 137 134 138 NSFont *m_font; 139 135 140 #ifndef BUILDING_ON_TIGER 136 141 RetainPtr<CGFontRef> m_cgFont; 137 142 #else 138 143 CGFontRef m_cgFont; // It is not necessary to refcount this, since either an NSFont owns it or some CachedFont has it referenced. 144 #endif 145 146 #if USE(CORE_TEXT) 147 mutable RetainPtr<CTFontRef> m_CTFont; 139 148 #endif 140 149 -
trunk/WebCore/platform/graphics/mac/FontPlatformDataMac.mm
r62186 r64915 62 62 m_atsuFontID = f.m_atsuFontID; 63 63 m_isColorBitmapFont = f.m_isColorBitmapFont; 64 #if USE(CORE_TEXT) 65 m_CTFont = f.m_CTFont; 66 #endif 64 67 } 65 68 … … 85 88 m_font = f.m_font; 86 89 m_isColorBitmapFont = f.m_isColorBitmapFont; 90 #if USE(CORE_TEXT) 91 m_CTFont = f.m_CTFont; 92 #endif 87 93 return *this; 88 94 } … … 108 114 m_isColorBitmapFont = CTFontGetSymbolicTraits(toCTFontRef(font)) & kCTFontColorGlyphsTrait; 109 115 #endif 116 #if USE(CORE_TEXT) 117 m_CTFont = 0; 118 #endif 110 119 } 111 120 … … 120 129 } 121 130 131 #if USE(CORE_TEXT) 132 CTFontRef FontPlatformData::ctFont() const 133 { 134 if (m_font) 135 return toCTFontRef(m_font); 136 if (!m_CTFont) 137 m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, 0)); 138 return m_CTFont.get(); 139 } 140 #endif // USE(CORE_TEXT) 141 122 142 #ifndef NDEBUG 123 143 String FontPlatformData::description() const -
trunk/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
r58581 r64915 42 42 namespace WebCore { 43 43 44 CTFontRef SimpleFontData::getCTFont() const45 {46 if (getNSFont())47 return toCTFontRef(getNSFont());48 if (!m_CTFont)49 m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_platformData.cgFont(), m_platformData.size(), 0, 0));50 return m_CTFont.get();51 }52 53 44 CFDictionaryRef SimpleFontData::getCFStringAttributes(TypesettingFeatures typesettingFeatures) const 54 45 { … … 71 62 static CFNumberRef kerningAdjustment = CFNumberCreate(kCFAllocatorDefault, kCFNumberFloatType, &kerningAdjustmentValue); 72 63 static const void* keysWithKerningDisabled[] = { kCTFontAttributeName, kCTKernAttributeName, kCTLigatureAttributeName }; 73 const void* valuesWithKerningDisabled[] = { getCTFont(), kerningAdjustment, allowLigatures64 const void* valuesWithKerningDisabled[] = { platformData().ctFont(), kerningAdjustment, allowLigatures 74 65 ? ligaturesAllowed : ligaturesNotAllowed }; 75 66 attributesDictionary.adoptCF(CFDictionaryCreate(0, keysWithKerningDisabled, valuesWithKerningDisabled, … … 79 70 // By omitting the kCTKernAttributeName attribute, we get Core Text's standard kerning. 80 71 static const void* keysWithKerningEnabled[] = { kCTFontAttributeName, kCTLigatureAttributeName }; 81 const void* valuesWithKerningEnabled[] = { getCTFont(), allowLigatures ? ligaturesAllowed : ligaturesNotAllowed };72 const void* valuesWithKerningEnabled[] = { platformData().ctFont(), allowLigatures ? ligaturesAllowed : ligaturesNotAllowed }; 82 73 attributesDictionary.adoptCF(CFDictionaryCreate(0, keysWithKerningEnabled, valuesWithKerningEnabled, 83 74 sizeof(keysWithKerningEnabled) / sizeof(*keysWithKerningEnabled), -
trunk/WebCore/svg/SVGFontData.cpp
r64579 r64915 34 34 , m_verticalAdvanceY(fontFaceElement->verticalAdvanceY()) 35 35 { 36 ASSERT_ARG(fontFaceElement, fontFaceElement); 36 37 } 37 38
Note:
See TracChangeset
for help on using the changeset viewer.