Changeset 131365 in webkit
- Timestamp:
- Oct 15, 2012, 2:50:53 PM (14 years ago)
- Location:
- trunk/Source
- Files:
-
- 18 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/WebCore.exp.in (modified) (1 diff)
-
WebCore/platform/graphics/Font.cpp (modified) (2 diffs)
-
WebCore/platform/graphics/FontFastPath.cpp (modified) (5 diffs)
-
WebCore/platform/graphics/GlyphBuffer.h (modified) (3 diffs)
-
WebCore/platform/graphics/SimpleFontData.h (modified) (3 diffs)
-
WebCore/platform/graphics/WidthIterator.cpp (modified) (7 diffs)
-
WebCore/platform/graphics/WidthIterator.h (modified) (4 diffs)
-
WebCore/platform/graphics/mac/FontMac.mm (modified) (1 diff)
-
WebCore/platform/graphics/win/FontCGWin.cpp (modified) (2 diffs)
-
WebCore/platform/mac/WebCoreSystemInterface.h (modified) (1 diff)
-
WebCore/platform/mac/WebCoreSystemInterface.mm (modified) (1 diff)
-
WebCore/rendering/svg/SVGTextMetricsBuilder.cpp (modified) (1 diff)
-
WebCore/rendering/svg/SVGTextRunRenderingContext.cpp (modified) (1 diff)
-
WebKit/mac/ChangeLog (modified) (1 diff)
-
WebKit/mac/WebCoreSupport/WebSystemInterface.mm (modified) (1 diff)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r131363 r131365 1 2012-10-15 Dan Bernstein <mitz@apple.com> 2 3 WebCore part of <rdar://problem/12470680> Font’s fast code path doesn’t support kerning and ligatures 4 https://bugs.webkit.org/show_bug.cgi?id=99113 5 6 Reviewed by Tim Horton. 7 8 * WebCore.exp.in: Exported wkCTFontTransformGlyphs. 9 * platform/graphics/Font.cpp: 10 (WebCore::Font::width): Added a local GlyphBuffer to pass to floatWidthForSimpleText(). 11 (WebCore::Font::codePath): Rather than always use the complex code path when any typesetting 12 features are enabled, changed to do so only if WidthIterator doesn’t support this Font’s 13 typesetting features. 14 * platform/graphics/FontFastPath.cpp: 15 (WebCore::Font::getGlyphsAndAdvancesForSimpleText): Added a local GlyphBuffer to pass to 16 WidthIterator::advance() when advancing to or from the range of interest. Added a FIXME 17 about how this is not entirely correct when kerning or ligatures are enabled. 18 (WebCore::Font::selectionRectForSimpleText): Added a local GlyphBuffer to pass to 19 WidthIterator::advance() when advancing to or from the range of interest. 20 (WebCore::Font::offsetForPositionForSimpleText): Updated for the change to 21 WidthIterator::advanceOneCharacter(). 22 * platform/graphics/SimpleFontData.h: 23 (WebCore::SimpleFontData::applyTransforms): Added. Calls wkCTFontTransformGlyphs() where 24 available. 25 * platform/graphics/WidthIterator.cpp: 26 (WebCore::WidthIterator::WidthIterator): Added initializer for the new m_typesettingFeatures 27 data member. 28 (OriginalAdvancesForCharacterTreatedAsSpace): Added this data type, used to track spaces and 29 characters treated as spaces. 30 (WebCore::applyFontTransforms): Added. Applies shaping and positioning transforms, as 31 required by the typesetting features, to the glyphs recently added to a GlyphBuffer, while 32 maintaining the advances of characters that are treated as spaces and the characters 33 preceding them, if necessary. 34 (WebCore::WidthIterator::advanceInternal): Added calls to applyFontTransforms() at the end 35 of each contiguous run of glyphs from the same font. Also added code to maintain a vector 36 of spaces and characters treated as space. 37 (WebCore::WidthIterator::advanceOneCharacter): Changed the parameter type from a pointer to 38 a reference. 39 * platform/graphics/WidthIterator.h: 40 (WebCore::WidthIterator::supportsTypesettingFeatures): Added. Returns whether WidthIterator 41 instances support the typesetting features of the given font. Returns true if the font is 42 not a screen font and its typesetting features are kerning, ligatures or both. 43 (WebCore::WidthIterator::shouldApplyFontTransforms): Added. Returns true if the typesetting 44 features include kerning or ligatures. 45 * platform/mac/WebCoreSystemInterface.h: Defined wkCTFontTransformOptions and declared 46 wkCTFontTransformGlyphs. 47 * platform/mac/WebCoreSystemInterface.mm: Defined wkCTFontTransformGlyphs. 48 * rendering/svg/SVGTextMetricsBuilder.cpp: 49 (WebCore::SVGTextMetricsBuilder::advanceSimpleText): Added a local GlyphBuffer to pass to 50 WidthIterator::advance(). 51 * rendering/svg/SVGTextRunRenderingContext.cpp: 52 (WebCore::SVGTextRunRenderingContext::floatWidthUsingSVGFont): Ditto. 53 1 54 2012-10-15 Mark Lam <mark.lam@apple.com> 2 55 -
trunk/Source/WebCore/WebCore.exp.in
r131275 r131365 1458 1458 #endif 1459 1459 _wkCGPatternCreateWithImageAndTransform 1460 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 1461 _wkCTFontTransformGlyphs 1462 #endif 1460 1463 _wkCopyCFLocalizationPreferredName 1461 1464 _wkCopyCFURLResponseSuggestedFilename -
trunk/Source/WebCore/platform/graphics/Font.cpp
r130851 r131365 188 188 // returning them for simple text as well. 189 189 static bool returnFallbackFonts = canReturnFallbackFontsForComplexText(); 190 return floatWidthForSimpleText(run, 0, returnFallbackFonts ? fallbackFonts : 0, codePathToUse == SimpleWithGlyphOverflow || (glyphOverflow && glyphOverflow->computeBounds) ? glyphOverflow : 0); 190 GlyphBuffer glyphBuffer; 191 return floatWidthForSimpleText(run, &glyphBuffer, returnFallbackFonts ? fallbackFonts : 0, codePathToUse == SimpleWithGlyphOverflow || (glyphOverflow && glyphOverflow->computeBounds) ? glyphOverflow : 0); 191 192 } 192 193 … … 315 316 return Complex; 316 317 317 if (run.length() > 1 && typesettingFeatures())318 if (run.length() > 1 && !WidthIterator::supportsTypesettingFeatures(*this)) 318 319 return Complex; 319 320 -
trunk/Source/WebCore/platform/graphics/FontFastPath.cpp
r131311 r131365 329 329 330 330 WidthIterator it(this, run, 0, false, forTextEmphasis); 331 it.advance(from); 331 // FIXME: Using separate glyph buffers for the prefix and the suffix is incorrect when kerning or 332 // ligatures are enabled. 333 GlyphBuffer localGlyphBuffer; 334 it.advance(from, &localGlyphBuffer); 332 335 float beforeWidth = it.m_runWidthSoFar; 333 336 it.advance(to, &glyphBuffer); … … 340 343 if (run.rtl()) { 341 344 float finalRoundingWidth = it.m_finalRoundingWidth; 342 it.advance(run.length() );345 it.advance(run.length(), &localGlyphBuffer); 343 346 initialAdvance = finalRoundingWidth + it.m_runWidthSoFar - afterWidth; 344 347 } else … … 484 487 FloatRect Font::selectionRectForSimpleText(const TextRun& run, const FloatPoint& point, int h, int from, int to) const 485 488 { 489 GlyphBuffer glyphBuffer; 486 490 WidthIterator it(this, run); 487 it.advance(from );491 it.advance(from, &glyphBuffer); 488 492 float beforeWidth = it.m_runWidthSoFar; 489 it.advance(to );493 it.advance(to, &glyphBuffer); 490 494 float afterWidth = it.m_runWidthSoFar; 491 495 492 496 // Using roundf() rather than ceilf() for the right edge as a compromise to ensure correct caret positioning. 493 497 if (run.rtl()) { 494 it.advance(run.length() );498 it.advance(run.length(), &glyphBuffer); 495 499 float totalWidth = it.m_runWidthSoFar; 496 500 return FloatRect(floorf(point.x() + totalWidth - afterWidth), point.y(), roundf(point.x() + totalWidth - beforeWidth) - floorf(point.x() + totalWidth - afterWidth), h); … … 512 516 offset = it.m_currentCharacter; 513 517 float w; 514 if (!it.advanceOneCharacter(w, &localGlyphBuffer))518 if (!it.advanceOneCharacter(w, localGlyphBuffer)) 515 519 break; 516 520 delta += w; … … 527 531 offset = it.m_currentCharacter; 528 532 float w; 529 if (!it.advanceOneCharacter(w, &localGlyphBuffer))533 if (!it.advanceOneCharacter(w, localGlyphBuffer)) 530 534 break; 531 535 delta -= w; -
trunk/Source/WebCore/platform/graphics/GlyphBuffer.h
r120122 r131365 64 64 // can be passed directly to CGContextShowGlyphsWithAdvances in FontMac.mm 65 65 #if USE(CG) || (OS(DARWIN) && (PLATFORM(WX) || PLATFORM(CHROMIUM))) 66 typedef CGSize GlyphBufferAdvance; 66 struct GlyphBufferAdvance : CGSize { 67 public: 68 GlyphBufferAdvance(CGSize size) : CGSize(size) 69 { 70 } 71 72 void setWidth(CGFloat width) { this->CGSize::width = width; } 73 CGFloat width() const { return this->CGSize::width; } 74 }; 67 75 #elif OS(WINCE) 68 76 // There is no cross-platform code that uses the height of GlyphBufferAdvance, 69 77 // so we can save memory space on embedded devices by storing only the width 70 typedef float GlyphBufferAdvance; 78 struct GlyphBufferAdvance { 79 public: 80 GlyphBufferAdvance(float width) 81 : advance(width) 82 { 83 } 84 85 void setWidth(float width) { advance = width; } 86 float& width() { return advance; } 87 const float& width() const { return advance; } 88 89 private: 90 float advance; 91 }; 71 92 #else 72 93 typedef FloatSize GlyphBufferAdvance; … … 127 148 float advanceAt(int index) const 128 149 { 129 #if USE(CG) || (OS(DARWIN) && (PLATFORM(WX) || PLATFORM(CHROMIUM)))130 return m_advances[index].width;131 #elif OS(WINCE)132 return m_advances[index];133 #else134 150 return m_advances[index].width(); 135 #endif136 151 } 137 152 … … 197 212 ASSERT(!isEmpty()); 198 213 GlyphBufferAdvance& lastAdvance = m_advances.last(); 199 #if USE(CG) || (OS(DARWIN) && (PLATFORM(WX) || PLATFORM(CHROMIUM))) 200 lastAdvance.width += width; 201 #elif OS(WINCE) 202 lastAdvance += width; 203 #else 204 lastAdvance += FloatSize(width, 0); 205 #endif 214 lastAdvance.setWidth(lastAdvance.width() + width); 206 215 } 207 216 -
trunk/Source/WebCore/platform/graphics/SimpleFontData.h
r130231 r131365 30 30 #include "FontPlatformData.h" 31 31 #include "FloatRect.h" 32 #include "GlyphBuffer.h" 32 33 #include "GlyphMetricsMap.h" 33 34 #include "GlyphPageTreeNode.h" … … 38 39 #include <wtf/OwnPtr.h> 39 40 #include <wtf/PassOwnPtr.h> 41 #include <wtf/UnusedParam.h> 40 42 #include <wtf/text/StringHash.h> 43 44 #if PLATFORM(MAC) 45 #include "WebCoreSystemInterface.h" 46 #endif 41 47 42 48 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) || (PLATFORM(WX) && OS(DARWIN)) … … 191 197 #endif 192 198 199 bool applyTransforms(GlyphBufferGlyph* glyphs, GlyphBufferAdvance* advances, size_t glyphCount, TypesettingFeatures typesettingFeatures) const 200 { 201 #if !PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED <= 1080 202 UNUSED_PARAM(glyphs); 203 UNUSED_PARAM(advances); 204 UNUSED_PARAM(glyphCount); 205 UNUSED_PARAM(typesettingFeatures); 206 ASSERT_NOT_REACHED(); 207 return false; 208 #else 209 wkCTFontTransformOptions options = (typesettingFeatures & Kerning ? wkCTFontTransformApplyPositioning : 0) | (typesettingFeatures & Ligatures ? wkCTFontTransformApplyShaping : 0); 210 return wkCTFontTransformGlyphs(m_platformData.ctFont(), glyphs, reinterpret_cast<CGSize*>(advances), glyphCount, options); 211 #endif 212 } 213 193 214 #if PLATFORM(QT) 194 215 QRawFont getQtRawFont() const { return m_platformData.rawFont(); } -
trunk/Source/WebCore/platform/graphics/WidthIterator.cpp
r128692 r131365 44 44 , m_isAfterExpansion(!run.allowsLeadingExpansion()) 45 45 , m_finalRoundingWidth(0) 46 , m_typesettingFeatures(font->typesettingFeatures()) 46 47 , m_fallbackFonts(fallbackFonts) 47 48 , m_accountForGlyphBounds(accountForGlyphBounds) … … 85 86 } 86 87 88 struct OriginalAdvancesForCharacterTreatedAsSpace { 89 public: 90 OriginalAdvancesForCharacterTreatedAsSpace(bool isSpace, float advanceBefore, float advanceAt) 91 : characterIsSpace(isSpace) 92 , advanceBeforeCharacter(advanceBefore) 93 , advanceAtCharacter(advanceAt) 94 { 95 } 96 97 bool characterIsSpace; 98 float advanceBeforeCharacter; 99 float advanceAtCharacter; 100 }; 101 102 typedef Vector<pair<int, OriginalAdvancesForCharacterTreatedAsSpace>, 64> CharactersTreatedAsSpace; 103 104 static inline float applyFontTransforms(GlyphBuffer* glyphBuffer, bool ltr, int& lastGlyphCount, const SimpleFontData* fontData, TypesettingFeatures typesettingFeatures, CharactersTreatedAsSpace& charactersTreatedAsSpace) 105 { 106 ASSERT(typesettingFeatures & (Kerning | Ligatures)); 107 108 if (!glyphBuffer) 109 return 0; 110 111 int glyphBufferSize = glyphBuffer->size(); 112 if (glyphBuffer->size() <= lastGlyphCount) 113 return 0; 114 115 GlyphBufferAdvance* advances = glyphBuffer->advances(0); 116 float widthDifference = 0; 117 for (int i = lastGlyphCount; i < glyphBufferSize; ++i) 118 widthDifference -= advances[i].width(); 119 120 if (!ltr) { 121 for (int i = 0, end = glyphBuffer->size() - 1; i < glyphBuffer->size() / 2; ++i, --end) 122 glyphBuffer->swap(i, end); 123 } 124 125 fontData->applyTransforms(glyphBuffer->glyphs(lastGlyphCount), advances + lastGlyphCount, glyphBufferSize - lastGlyphCount, typesettingFeatures); 126 127 if (!ltr) { 128 for (int i = 0, end = glyphBuffer->size() - 1; i < glyphBuffer->size() / 2; ++i, --end) 129 glyphBuffer->swap(i, end); 130 } 131 132 for (size_t i = 0; i < charactersTreatedAsSpace.size(); ++i) { 133 int spaceOffset = charactersTreatedAsSpace[i].first; 134 const OriginalAdvancesForCharacterTreatedAsSpace& originalAdvances = charactersTreatedAsSpace[i].second; 135 if (spaceOffset && !originalAdvances.characterIsSpace) 136 glyphBuffer->advances(spaceOffset - 1)->setWidth(originalAdvances.advanceBeforeCharacter); 137 glyphBuffer->advances(spaceOffset)->setWidth(originalAdvances.advanceAtCharacter); 138 } 139 charactersTreatedAsSpace.clear(); 140 141 for (int i = lastGlyphCount; i < glyphBufferSize; ++i) 142 widthDifference += advances[i].width(); 143 144 lastGlyphCount = glyphBufferSize; 145 return widthDifference; 146 } 147 87 148 template <typename TextIterator> 88 149 inline unsigned WidthIterator::advanceInternal(TextIterator& textIterator, GlyphBuffer* glyphBuffer) … … 100 161 const SimpleFontData* primaryFont = m_font->primaryFont(); 101 162 const SimpleFontData* lastFontData = primaryFont; 163 int lastGlyphCount = glyphBuffer ? glyphBuffer->size() : 0; 102 164 103 165 UChar32 character = 0; 104 166 unsigned clusterLength = 0; 105 167 CharactersTreatedAsSpace charactersTreatedAsSpace; 106 168 while (textIterator.consume(character, clusterLength)) { 107 169 unsigned advanceLength = clusterLength; … … 133 195 134 196 if (fontData != lastFontData && width) { 197 if (shouldApplyFontTransforms()) 198 m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, m_typesettingFeatures, charactersTreatedAsSpace); 199 135 200 lastFontData = fontData; 136 201 if (m_fallbackFonts && fontData != primaryFont) { … … 188 253 } 189 254 255 if (shouldApplyFontTransforms() && glyphBuffer && Font::treatAsSpace(character)) 256 charactersTreatedAsSpace.append(make_pair(glyphBuffer->size(), 257 OriginalAdvancesForCharacterTreatedAsSpace(character == ' ', glyphBuffer->size() ? glyphBuffer->advanceAt(glyphBuffer->size() - 1) : 0, width))); 258 190 259 if (m_accountForGlyphBounds) { 191 260 bounds = fontData->boundsForGlyph(glyph); … … 240 309 } 241 310 311 if (shouldApplyFontTransforms()) 312 m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, m_typesettingFeatures, charactersTreatedAsSpace); 313 242 314 unsigned consumedCharacters = textIterator.currentCharacter() - m_currentCharacter; 243 315 m_currentCharacter = textIterator.currentCharacter(); … … 266 338 } 267 339 268 bool WidthIterator::advanceOneCharacter(float& width, GlyphBuffer *glyphBuffer)269 { 270 int oldSize = glyphBuffer ->size();271 advance(m_currentCharacter + 1, glyphBuffer);340 bool WidthIterator::advanceOneCharacter(float& width, GlyphBuffer& glyphBuffer) 341 { 342 int oldSize = glyphBuffer.size(); 343 advance(m_currentCharacter + 1, &glyphBuffer); 272 344 float w = 0; 273 for (int i = oldSize; i < glyphBuffer ->size(); ++i)274 w += glyphBuffer ->advanceAt(i);345 for (int i = oldSize; i < glyphBuffer.size(); ++i) 346 w += glyphBuffer.advanceAt(i); 275 347 width = w; 276 return glyphBuffer ->size() > oldSize;277 } 278 279 } 348 return glyphBuffer.size() > oldSize; 349 } 350 351 } -
trunk/Source/WebCore/platform/graphics/WidthIterator.h
r128572 r131365 23 23 #define WidthIterator_h 24 24 25 #include "Font.h" 25 26 #include "SVGGlyph.h" 26 27 #include <wtf/HashSet.h> … … 41 42 WidthIterator(const Font*, const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, bool accountForGlyphBounds = false, bool forTextEmphasis = false); 42 43 43 unsigned advance(int to, GlyphBuffer* = 0);44 bool advanceOneCharacter(float& width, GlyphBuffer * = 0);44 unsigned advance(int to, GlyphBuffer*); 45 bool advanceOneCharacter(float& width, GlyphBuffer&); 45 46 46 47 float maxGlyphBoundingBoxY() const { ASSERT(m_accountForGlyphBounds); return m_maxGlyphBoundingBoxY; } … … 57 58 Vector<SVGGlyph::ArabicForm>& arabicForms() { return m_arabicForms; } 58 59 #endif 60 61 static bool supportsTypesettingFeatures(const Font& font) 62 { 63 #if !PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED <= 1080 64 return !font.typesettingFeatures(); 65 #else 66 if (!font.isPrinterFont()) 67 return !font.typesettingFeatures(); 68 69 return !(font.typesettingFeatures() & ~(Kerning | Ligatures)); 70 #endif 71 } 59 72 60 73 const Font* m_font; … … 79 92 inline unsigned advanceInternal(TextIterator&, GlyphBuffer*); 80 93 94 bool shouldApplyFontTransforms() const { return m_typesettingFeatures & (Kerning | Ligatures); } 95 96 TypesettingFeatures m_typesettingFeatures; 81 97 HashSet<const SimpleFontData*>* m_fallbackFonts; 82 98 bool m_accountForGlyphBounds; -
trunk/Source/WebCore/platform/graphics/mac/FontMac.mm
r122670 r131365 242 242 // If shadows are ignoring transforms, then we haven't applied the Y coordinate flip yet, so down is negative. 243 243 float shadowTextY = point.y() + shadowOffset.height() * (context->shadowsIgnoreTransforms() ? -1 : 1); 244 showGlyphsWithAdvances(FloatPoint(shadowTextX, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);244 showGlyphsWithAdvances(FloatPoint(shadowTextX, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs); 245 245 if (syntheticBoldOffset) 246 showGlyphsWithAdvances(FloatPoint(shadowTextX + syntheticBoldOffset, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);246 showGlyphsWithAdvances(FloatPoint(shadowTextX + syntheticBoldOffset, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs); 247 247 context->setFillColor(fillColor, fillColorSpace); 248 248 } 249 249 250 showGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);250 showGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs); 251 251 if (syntheticBoldOffset) 252 showGlyphsWithAdvances(FloatPoint(point.x() + syntheticBoldOffset, point.y()), font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);252 showGlyphsWithAdvances(FloatPoint(point.x() + syntheticBoldOffset, point.y()), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs); 253 253 254 254 if (hasSimpleShadow) -
trunk/Source/WebCore/platform/graphics/win/FontCGWin.cpp
r126666 r131365 198 198 float shadowTextY = point.y() + translation.height() + shadowOffset.height() * (graphicsContext->shadowsIgnoreTransforms() ? -1 : 1); 199 199 CGContextSetTextPosition(cgContext, shadowTextX, shadowTextY); 200 CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);200 CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs); 201 201 if (font->syntheticBoldOffset()) { 202 202 CGContextSetTextPosition(cgContext, point.x() + translation.width() + shadowOffset.width() + font->syntheticBoldOffset(), point.y() + translation.height() + shadowOffset.height()); 203 CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);203 CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs); 204 204 } 205 205 graphicsContext->setFillColor(fillColor, ColorSpaceDeviceRGB); … … 207 207 208 208 CGContextSetTextPosition(cgContext, point.x() + translation.width(), point.y() + translation.height()); 209 CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);209 CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs); 210 210 if (font->syntheticBoldOffset()) { 211 211 CGContextSetTextPosition(cgContext, point.x() + translation.width() + font->syntheticBoldOffset(), point.y() + translation.height()); 212 CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);212 CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs); 213 213 } 214 214 -
trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h
r130567 r131365 236 236 extern CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*); 237 237 238 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 239 enum { 240 wkCTFontTransformApplyShaping = (1 << 0), 241 wkCTFontTransformApplyPositioning = (1 << 1) 242 }; 243 244 typedef int wkCTFontTransformOptions; 245 246 extern bool (*wkCTFontTransformGlyphs)(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, wkCTFontTransformOptions options); 247 #endif 248 238 249 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 239 250 -
trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm
r130567 r131365 137 137 138 138 CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*); 139 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 140 bool (*wkCTFontTransformGlyphs)(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, wkCTFontTransformOptions options); 141 #endif 142 139 143 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 140 144 CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options); -
trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
r130612 r131365 59 59 void SVGTextMetricsBuilder::advanceSimpleText() 60 60 { 61 unsigned metricsLength = m_simpleWidthIterator->advance(m_textPosition + 1); 61 GlyphBuffer glyphBuffer; 62 unsigned metricsLength = m_simpleWidthIterator->advance(m_textPosition + 1, &glyphBuffer); 62 63 if (!metricsLength) { 63 64 m_currentMetrics = SVGTextMetrics(); -
trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp
r130999 r131365 77 77 { 78 78 WidthIterator it(&font, run); 79 charsConsumed += it.advance(run.length()); 79 GlyphBuffer glyphBuffer; 80 charsConsumed += it.advance(run.length(), &glyphBuffer); 80 81 glyphName = it.lastGlyphName(); 81 82 return it.runWidthSoFar(); -
trunk/Source/WebKit/mac/ChangeLog
r131350 r131365 1 2012-10-15 Dan Bernstein <mitz@apple.com> 2 3 WebKit/mac part of <rdar://problem/12470680> Font’s fast code path doesn’t support kerning and ligatures 4 https://bugs.webkit.org/show_bug.cgi?id=99113 5 6 Reviewed by Tim Horton. 7 8 * WebCoreSupport/WebSystemInterface.mm: 9 (InitWebCoreSystemInterface): Added wkCTFontTransformGlyphs. 10 1 11 2012-10-15 David Kilzer <ddkilzer@apple.com> 2 12 -
trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
r130567 r131365 52 52 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 53 53 INIT(CGContextDrawsWithCorrectShadowOffsets); 54 #endif 55 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 56 INIT(CTFontTransformGlyphs); 54 57 #endif 55 58 INIT(CopyCFLocalizationPreferredName); -
trunk/Source/WebKit2/ChangeLog
r131354 r131365 1 2012-10-15 Dan Bernstein <mitz@apple.com> 2 3 WebKit2 part of <rdar://problem/12470680> Font’s fast code path doesn’t support kerning and ligatures 4 https://bugs.webkit.org/show_bug.cgi?id=99113 5 6 Reviewed by Tim Horton. 7 8 * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: 9 (InitWebCoreSystemInterface): Added wkCTFontTransformGlyphs. 10 1 11 2012-10-15 Christophe Dumez <christophe.dumez@intel.com> 2 12 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
r130567 r131365 47 47 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 48 48 INIT(CGContextDrawsWithCorrectShadowOffsets); 49 #endif 50 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 51 INIT(CTFontTransformGlyphs); 49 52 #endif 50 53 INIT(CopyCONNECTProxyResponse);
Note:
See TracChangeset
for help on using the changeset viewer.