WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
WIP
patch.txt (text/plain), 22.37 KB, created by
Myles C. Maxfield
on 2020-08-01 02:54:26 PDT
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Myles C. Maxfield
Created:
2020-08-01 02:54:26 PDT
Size:
22.37 KB
patch
obsolete
>diff --git a/Source/WTF/wtf/PlatformUse.h b/Source/WTF/wtf/PlatformUse.h >index fa32d47e37b..cc0347cd530 100644 >--- a/Source/WTF/wtf/PlatformUse.h >+++ b/Source/WTF/wtf/PlatformUse.h >@@ -301,6 +301,7 @@ > #define USE_DARWIN_REGISTER_MACROS 1 > #endif > >-#if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101600) >-#define USE_CTFONTTRANSFORMGLYPHSWITHLANGUAGE 1 >+//#if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 110000) >+#if PLATFORM(COCOA) && !(PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500) >+#define USE_CTFONTSHAPEGLYPHS 1 > #endif >diff --git a/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h b/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h >index 7d214eda9f5..673863f5ae2 100644 >--- a/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h >+++ b/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h >@@ -46,6 +46,12 @@ typedef CF_OPTIONS(uint32_t, CTFontTransformOptions) { > kCTFontTransformApplyPositioning = (1 << 1) > }; > >+typedef CF_OPTIONS(CFOptionFlags, CTFontShapeOptions) { >+ kCTFontShapeWithKerning = (1 << 0), >+ kCTFontShapeWithClusterComposition = (1 << 1), >+ kCTFontShapeRightToLeft = (1 << 2), >+}; >+ > typedef CF_OPTIONS(uint32_t, CTFontDescriptorOptions) { > kCTFontDescriptorOptionSystemUIFont = 1 << 1, > kCTFontDescriptorOptionPreferAppleSystemFont = kCTFontOptionsPreferSystemFont >@@ -92,7 +98,7 @@ extern const CFStringRef kCTFontCSSFamilyMonospace; > extern const CFStringRef kCTFontCSSFamilySystemUI; > > bool CTFontTransformGlyphs(CTFontRef, CGGlyph glyphs[], CGSize advances[], CFIndex count, CTFontTransformOptions); >-CGSize CTFontTransformGlyphsWithLanguage(CTFontRef, CGGlyph[], CGSize[], CFIndex count, CTFontTransformOptions, CFStringRef language, void (^handler)(CFRange, CGGlyph**, CGSize**)); >+CGSize CTFontShapeGlyphs(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CGPoint origins[], CFIndex indexes[], const UniChar chars[], CFIndex count, CTFontShapeOptions options, CFStringRef language, void (^handler)(CFRange, CGGlyph**, CGSize**, CGPoint**, CFIndex**)); > > CGSize CTRunGetInitialAdvance(CTRunRef); > CTLineRef CTLineCreateWithUniCharProvider(CTUniCharProviderCallback, CTUniCharDisposeCallback, void* refCon); >diff --git a/Source/WebCore/platform/graphics/Font.cpp b/Source/WebCore/platform/graphics/Font.cpp >index 9ae69068f3e..6ef978927c3 100644 >--- a/Source/WebCore/platform/graphics/Font.cpp >+++ b/Source/WebCore/platform/graphics/Font.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2005, 2008, 2010, 2015 Apple Inc. All rights reserved. >+ * Copyright (C) 2005-2020 Apple Inc. All rights reserved. > * Copyright (C) 2006 Alexey Proskuryakov > * > * Redistribution and use in source and binary forms, with or without >@@ -512,7 +512,7 @@ RefPtr<Font> Font::createScaledFont(const FontDescription& fontDescription, floa > } > > #if !PLATFORM(COCOA) >-void Font::applyTransforms(GlyphBuffer&, unsigned, bool, bool, const AtomString&) const >+void Font::applyTransforms(GlyphBuffer&, unsigned, unsigned, bool, bool, const AtomString&, StringView, TextDirection) const > { > } > #endif >diff --git a/Source/WebCore/platform/graphics/Font.h b/Source/WebCore/platform/graphics/Font.h >index eaf9dac420a..8ec3380d7b7 100644 >--- a/Source/WebCore/platform/graphics/Font.h >+++ b/Source/WebCore/platform/graphics/Font.h >@@ -1,7 +1,7 @@ > /* > * This file is part of the internal font implementation. > * >- * Copyright (C) 2006, 2008, 2010, 2015-2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2006-2020 Apple Inc. All rights reserved. > * Copyright (C) 2007-2008 Torch Mobile, Inc. > * > * This library is free software; you can redistribute it and/or >@@ -207,7 +207,7 @@ public: > #endif > > bool canRenderCombiningCharacterSequence(const UChar*, size_t) const; >- void applyTransforms(GlyphBuffer&, unsigned beginningIndex, bool enableKerning, bool requiresShaping, const AtomString& locale) const; >+ void applyTransforms(GlyphBuffer&, unsigned beginningGlyphIndex, unsigned beginningStringIndex, bool enableKerning, bool requiresShaping, const AtomString& locale, StringView text, TextDirection) const; > > #if PLATFORM(WIN) > SCRIPT_FONTPROPERTIES* scriptFontProperties() const; >diff --git a/Source/WebCore/platform/graphics/FontCascade.cpp b/Source/WebCore/platform/graphics/FontCascade.cpp >index 1c1f1fca570..da5f8dde8e5 100644 >--- a/Source/WebCore/platform/graphics/FontCascade.cpp >+++ b/Source/WebCore/platform/graphics/FontCascade.cpp >@@ -426,7 +426,7 @@ float FontCascade::width(const TextRun& run, HashSet<const Font*>* fallbackFonts > return result; > } > >-float FontCascade::widthForSimpleText(StringView text) const >+float FontCascade::widthForSimpleText(StringView text, TextDirection textDirection) const > { > if (text.isNull() || text.isEmpty()) > return 0; >@@ -448,7 +448,7 @@ float FontCascade::widthForSimpleText(StringView text) const > glyphBuffer.add(glyph, &font, glyphWidth); > } > if (hasKerningOrLigatures) { >- font.applyTransforms(glyphBuffer, 0, enableKerning(), requiresShaping(), fontDescription().computedLocale()); >+ font.applyTransforms(glyphBuffer, 0, 0, enableKerning(), requiresShaping(), fontDescription().computedLocale(), text, textDirection); > // This is needed only to match the result of the slow path. Same glyph widths but different floating point arithmentics can > // produce different run width. > float runWidthDifferenceWithTransformApplied = -runWidth; >diff --git a/Source/WebCore/platform/graphics/FontCascade.h b/Source/WebCore/platform/graphics/FontCascade.h >index 77cb16ab490..98e97e1b2bd 100644 >--- a/Source/WebCore/platform/graphics/FontCascade.h >+++ b/Source/WebCore/platform/graphics/FontCascade.h >@@ -116,7 +116,7 @@ public: > > float widthOfTextRange(const TextRun&, unsigned from, unsigned to, HashSet<const Font*>* fallbackFonts = 0, float* outWidthBeforeRange = nullptr, float* outWidthAfterRange = nullptr) const; > WEBCORE_EXPORT float width(const TextRun&, HashSet<const Font*>* fallbackFonts = 0, GlyphOverflow* = 0) const; >- float widthForSimpleText(StringView text) const; >+ float widthForSimpleText(StringView text, TextDirection = TextDirection::LTR /* matches default argument of TextRun constructor */) const; > > std::unique_ptr<TextLayout, TextLayoutDeleter> createLayout(RenderText&, float xPos, bool collapseWhiteSpace) const; > static float width(TextLayout&, unsigned from, unsigned len, HashSet<const Font*>* fallbackFonts = 0); >diff --git a/Source/WebCore/platform/graphics/TextRun.h b/Source/WebCore/platform/graphics/TextRun.h >index ecbc5eea9b9..736f287fce6 100644 >--- a/Source/WebCore/platform/graphics/TextRun.h >+++ b/Source/WebCore/platform/graphics/TextRun.h >@@ -43,6 +43,7 @@ struct GlyphData; > class TextRun { > WTF_MAKE_FAST_ALLOCATED; > public: >+ // LTR default argument matches FontCascade::widthForSimpleText()'s default argument > explicit TextRun(const String& text, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = DefaultExpansion, TextDirection direction = TextDirection::LTR, bool directionalOverride = false, bool characterScanForCodePath = true) > : m_text(text) > , m_tabSize(0) >@@ -59,6 +60,7 @@ public: > ASSERT(!m_text.isNull()); > } > >+ // LTR default argument matches FontCascade::widthForSimpleText()'s default argument > explicit TextRun(StringView stringView, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = DefaultExpansion, TextDirection direction = TextDirection::LTR, bool directionalOverride = false, bool characterScanForCodePath = true) > : TextRun(stringView.toStringWithoutCopying(), xpos, expansion, expansionBehavior, direction, directionalOverride, characterScanForCodePath) > { >diff --git a/Source/WebCore/platform/graphics/WidthIterator.cpp b/Source/WebCore/platform/graphics/WidthIterator.cpp >index 8a04461f0be..32b59c141cf 100644 >--- a/Source/WebCore/platform/graphics/WidthIterator.cpp >+++ b/Source/WebCore/platform/graphics/WidthIterator.cpp >@@ -76,27 +76,25 @@ static inline bool isSoftBankEmoji(UChar32 codepoint) > return codepoint >= 0xE001 && codepoint <= 0xE537; > } > >-inline auto WidthIterator::shouldApplyFontTransforms(const GlyphBuffer* glyphBuffer, unsigned lastGlyphCount, UChar32 previousCharacter) const -> TransformsType >+inline auto WidthIterator::shouldApplyFontTransforms(const GlyphBuffer* glyphBuffer, unsigned lastGlyphCount, unsigned currentCharacterIndex) const -> TransformsType > { >- if (glyphBuffer && glyphBuffer->size() == (lastGlyphCount + 1) && isSoftBankEmoji(previousCharacter)) >+ if (glyphBuffer && glyphBuffer->size() == (lastGlyphCount + 1) && currentCharacterIndex && isSoftBankEmoji(m_run.text()[currentCharacterIndex - 1])) > return TransformsType::Forced; > if (m_run.length() <= 1 || !(m_enableKerning || m_requiresShaping)) > return TransformsType::None; > return TransformsType::NotForced; > } > >-inline float WidthIterator::applyFontTransforms(GlyphBuffer* glyphBuffer, bool ltr, unsigned& lastGlyphCount, const Font* font, UChar32 previousCharacter, bool force, CharactersTreatedAsSpace& charactersTreatedAsSpace) >+inline float WidthIterator::applyFontTransforms(GlyphBuffer* glyphBuffer, bool ltr, unsigned lastGlyphCount, unsigned currentCharacterIndex, const Font* font, bool force, CharactersTreatedAsSpace& charactersTreatedAsSpace) > { >- ASSERT_UNUSED(previousCharacter, shouldApplyFontTransforms(glyphBuffer, lastGlyphCount, previousCharacter) != WidthIterator::TransformsType::None); >+ ASSERT(shouldApplyFontTransforms(glyphBuffer, lastGlyphCount, currentCharacterIndex) != WidthIterator::TransformsType::None); > > if (!glyphBuffer) > return 0; > > auto glyphBufferSize = glyphBuffer->size(); >- if (!force && glyphBufferSize <= lastGlyphCount + 1) { >- lastGlyphCount = glyphBufferSize; >+ if (!force && glyphBufferSize <= lastGlyphCount + 1) > return 0; >- } > > GlyphBufferAdvance* advances = glyphBuffer->advances(0); > float beforeWidth = 0; >@@ -107,7 +105,7 @@ inline float WidthIterator::applyFontTransforms(GlyphBuffer* glyphBuffer, bool l > if (!ltr) > glyphBuffer->reverse(lastGlyphCount, glyphBufferSize - lastGlyphCount); > >- font->applyTransforms(*glyphBuffer, lastGlyphCount, m_enableKerning, m_requiresShaping, m_font->fontDescription().computedLocale()); >+ font->applyTransforms(*glyphBuffer, lastGlyphCount, m_currentCharacter, m_enableKerning, m_requiresShaping, m_font->fontDescription().computedLocale(), m_run.text(), m_run.direction()); > glyphBufferSize = glyphBuffer->size(); > > for (unsigned i = lastGlyphCount; i < glyphBufferSize; ++i) >@@ -135,7 +133,6 @@ inline float WidthIterator::applyFontTransforms(GlyphBuffer* glyphBuffer, bool l > for (unsigned i = lastGlyphCount; i < glyphBufferSize; ++i) > afterWidth += advances[i].width(); > >- lastGlyphCount = glyphBufferSize; > return afterWidth - beforeWidth; > } > >@@ -171,7 +168,7 @@ static inline std::pair<bool, bool> expansionLocation(bool ideograph, bool treat > template <typename TextIterator> > inline void WidthIterator::advanceInternal(TextIterator& textIterator, GlyphBuffer* glyphBuffer) > { >- // The core logic here needs to match SimpleLineLayout::widthForSimpleText() >+ // The core logic here needs to match FontCascade::widthForSimpleText() > bool rtl = m_run.rtl(); > bool hasExtraSpacing = (m_font->letterSpacing() || m_font->wordSpacing() || m_expansion) && !m_run.spacingDisabled(); > >@@ -191,13 +188,14 @@ inline void WidthIterator::advanceInternal(TextIterator& textIterator, GlyphBuff > const Font* lastFontData = &primaryFont; > unsigned lastGlyphCount = glyphBuffer ? glyphBuffer->size() : 0; > >+ auto currentCharacter = textIterator.currentIndex(); > UChar32 character = 0; >- UChar32 previousCharacter = 0; > unsigned clusterLength = 0; > CharactersTreatedAsSpace charactersTreatedAsSpace; > String normalizedSpacesStringCache; > // We are iterating in string order, not glyph order. Compare this to ComplexTextController::adjustGlyphsAndAdvances() > while (textIterator.consume(character, clusterLength)) { >+ currentCharacter = textIterator.currentIndex(); > unsigned advanceLength = clusterLength; > bool characterMustDrawSomething = !isDefaultIgnorableCodePoint(character); > #if USE(FREETYPE) >@@ -208,7 +206,6 @@ inline void WidthIterator::advanceInternal(TextIterator& textIterator, GlyphBuff > continue; > } > #endif >- int currentCharacter = textIterator.currentIndex(); > const GlyphData& glyphData = m_font->glyphDataForCharacter(character, rtl); > Glyph glyph = glyphData.glyph; > if (!glyph && !characterMustDrawSomething) { >@@ -230,12 +227,12 @@ inline void WidthIterator::advanceInternal(TextIterator& textIterator, GlyphBuff > } > > if (font != lastFontData && width) { >- auto transformsType = shouldApplyFontTransforms(glyphBuffer, lastGlyphCount, previousCharacter); >- if (transformsType != TransformsType::None) { >- m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, previousCharacter, transformsType == TransformsType::Forced, charactersTreatedAsSpace); >- if (glyphBuffer) >- glyphBuffer->shrink(lastGlyphCount); >- } >+ auto transformsType = shouldApplyFontTransforms(glyphBuffer, lastGlyphCount, currentCharacter); >+ if (transformsType != TransformsType::None) >+ m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, currentCharacter, lastFontData, transformsType == TransformsType::Forced, charactersTreatedAsSpace); >+ if (glyphBuffer) >+ lastGlyphCount = glyphBuffer->size(); >+ m_currentCharacter = currentCharacter; > > lastFontData = font; > if (m_fallbackFonts && font != &primaryFont) { >@@ -316,7 +313,7 @@ inline void WidthIterator::advanceInternal(TextIterator& textIterator, GlyphBuff > m_isAfterExpansion = false; > } > >- auto transformsType = shouldApplyFontTransforms(glyphBuffer, lastGlyphCount, previousCharacter); >+ auto transformsType = shouldApplyFontTransforms(glyphBuffer, lastGlyphCount, currentCharacter); > if (transformsType != TransformsType::None && glyphBuffer && FontCascade::treatAsSpace(character)) { > charactersTreatedAsSpace.append(std::make_pair(glyphBuffer->size(), > OriginalAdvancesForCharacterTreatedAsSpace(character == ' ', glyphBuffer->size() ? glyphBuffer->advanceAt(glyphBuffer->size() - 1).width() : 0, width))); >@@ -348,7 +345,6 @@ inline void WidthIterator::advanceInternal(TextIterator& textIterator, GlyphBuff > m_minGlyphBoundingBoxY = std::min(m_minGlyphBoundingBoxY, bounds.y()); > m_lastGlyphOverflow = std::max<float>(0, bounds.maxX() - width); > } >- previousCharacter = character; > } > > if (glyphBuffer && leftoverJustificationWidth) { >@@ -358,14 +354,12 @@ inline void WidthIterator::advanceInternal(TextIterator& textIterator, GlyphBuff > glyphBuffer->add(lastFontData->spaceGlyph(), lastFontData, leftoverJustificationWidth, m_run.length() - 1); > } > >- auto transformsType = shouldApplyFontTransforms(glyphBuffer, lastGlyphCount, previousCharacter); >+ auto transformsType = shouldApplyFontTransforms(glyphBuffer, lastGlyphCount, currentCharacter); > if (transformsType != TransformsType::None) { >- m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, previousCharacter, transformsType == TransformsType::Forced, charactersTreatedAsSpace); >- if (glyphBuffer) >- glyphBuffer->shrink(lastGlyphCount); >+ m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, currentCharacter, lastFontData, transformsType == TransformsType::Forced, charactersTreatedAsSpace); > } >- > m_currentCharacter = textIterator.currentIndex(); >+ > m_runWidthSoFar += widthSinceLastRounding; > m_finalRoundingWidth = lastRoundingWidth; > } >diff --git a/Source/WebCore/platform/graphics/WidthIterator.h b/Source/WebCore/platform/graphics/WidthIterator.h >index c09dd8727e5..f4bd5f90549 100644 >--- a/Source/WebCore/platform/graphics/WidthIterator.h >+++ b/Source/WebCore/platform/graphics/WidthIterator.h >@@ -61,8 +61,8 @@ private: > inline void advanceInternal(TextIterator&, GlyphBuffer*); > > enum class TransformsType { None, Forced, NotForced }; >- TransformsType shouldApplyFontTransforms(const GlyphBuffer*, unsigned lastGlyphCount, UChar32 previousCharacter) const; >- float applyFontTransforms(GlyphBuffer*, bool ltr, unsigned& lastGlyphCount, const Font*, UChar32 previousCharacter, bool force, CharactersTreatedAsSpace&); >+ TransformsType shouldApplyFontTransforms(const GlyphBuffer*, unsigned lastGlyphCount, unsigned currentCharacterIndex) const; >+ float applyFontTransforms(GlyphBuffer*, bool ltr, unsigned lastGlyphCount, unsigned currentCharacterIndex, const Font*, bool force, CharactersTreatedAsSpace&); > > const FontCascade* m_font; > const TextRun& m_run; >diff --git a/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm b/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm >index 8b8c9d67d7d..5c43da4add5 100644 >--- a/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm >+++ b/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm >@@ -544,26 +544,59 @@ RefPtr<Font> Font::platformCreateScaledFont(const FontDescription&, float scaleF > return createDerivativeFont(scaledFont.get(), size, m_platformData.orientation(), fontTraits, m_platformData.syntheticBold(), m_platformData.syntheticOblique()); > } > >-void Font::applyTransforms(GlyphBuffer& glyphBuffer, unsigned beginningIndex, bool enableKerning, bool requiresShaping, const AtomString& locale) const >+void Font::applyTransforms(GlyphBuffer& glyphBuffer, unsigned beginningGlyphIndex, unsigned beginningStringIndex, bool enableKerning, bool requiresShaping, const AtomString& locale, StringView text, TextDirection textDirection) const > { > // FIXME: Implement GlyphBuffer initial advance. >- CTFontTransformOptions options = (enableKerning ? kCTFontTransformApplyPositioning : 0) | (requiresShaping ? kCTFontTransformApplyShaping : 0); >-#if USE(CTFONTTRANSFORMGLYPHSWITHLANGUAGE) >- auto handler = ^(CFRange range, CGGlyph** newGlyphsPointer, CGSize** newAdvancesPointer) { >+#if USE(CTFONTSHAPEGLYPHS) >+ UNUSED_PARAM(requiresShaping); >+ auto handler = ^(CFRange range, CGGlyph** newGlyphsPointer, CGSize** newAdvancesPointer, CGPoint** newOffsetsPointer, CFIndex** newIndicesPointer) { > range.location = std::min(std::max(range.location, static_cast<CFIndex>(0)), static_cast<CFIndex>(glyphBuffer.size())); > if (range.length < 0) { > range.length = std::min(range.location, -range.length); > range.location = range.location - range.length; >- glyphBuffer.remove(beginningIndex + range.location, range.length); >+ glyphBuffer.remove(beginningGlyphIndex + range.location, range.length); > } else >- glyphBuffer.makeHole(beginningIndex + range.location, range.length, this); >- *newGlyphsPointer = glyphBuffer.glyphs(beginningIndex); >- *newAdvancesPointer = glyphBuffer.advances(beginningIndex); >- }; >- CTFontTransformGlyphsWithLanguage(m_platformData.ctFont(), glyphBuffer.glyphs(beginningIndex), reinterpret_cast<CGSize*>(glyphBuffer.advances(beginningIndex)), glyphBuffer.size() - beginningIndex, options, LocaleCocoa::canonicalLanguageIdentifierFromString(locale).string().createCFString().get(), handler); >+ glyphBuffer.makeHole(beginningGlyphIndex + range.location, range.length, this); >+ >+ *newGlyphsPointer = glyphBuffer.glyphs(beginningGlyphIndex); >+ *newAdvancesPointer = glyphBuffer.advances(beginningGlyphIndex); >+ *newOffsetsPointer = glyphBuffer.origins(beginningGlyphIndex); >+ *newIndicesPointer = glyphBuffer.offsetsInString(beginningGlyphIndex); >+ }; >+ >+ auto substring = text.substring(beginningStringIndex); >+ auto upconvertedCharacters = substring.upconvertedCharacters(); >+ auto localeString = LocaleCocoa::canonicalLanguageIdentifierFromString(locale).string().createCFString(); >+ CTFontShapeOptions options = kCTFontShapeWithClusterComposition >+ | (enableKerning ? kCTFontShapeWithKerning : 0) >+ | (textDirection == TextDirection::RTL ? kCTFontShapeRightToLeft : 0); >+ >+ for (unsigned i = 0; i < glyphBuffer.size() - beginningGlyphIndex; ++i) >+ glyphBuffer.offsetsInString(beginningGlyphIndex)[i] -= beginningGlyphIndex; >+ >+ CTFontShapeGlyphs( >+ m_platformData.ctFont(), >+ glyphBuffer.glyphs(beginningGlyphIndex), >+ reinterpret_cast<CGSize*>(glyphBuffer.advances(beginningGlyphIndex)), >+ reinterpret_cast<CGPoint*>(glyphBuffer.origins(beginningGlyphIndex)), >+ glyphBuffer.offsetsInString(beginningGlyphIndex), >+ reinterpret_cast<const UniChar*>(upconvertedCharacters.get()), >+ text.length(), >+ options, >+ localeString.get(), >+ handler); >+ >+ for (unsigned i = 0; i < glyphBuffer.size() - beginningGlyphIndex; ++i) >+ glyphBuffer.offsetsInString(beginningGlyphIndex)[i] += beginningGlyphIndex; >+ > #else >+ >+ UNUSED_PARAM(beginningStringIndex); > UNUSED_PARAM(locale); >- CTFontTransformGlyphs(m_platformData.ctFont(), glyphBuffer.glyphs(beginningIndex), reinterpret_cast<CGSize*>(glyphBuffer.advances(beginningIndex)), glyphBuffer.size() - beginningIndex, options); >+ UNUSED_PARAM(text); >+ UNUSED_PARAM(textDirection); >+ CTFontTransformOptions options = (enableKerning ? kCTFontTransformApplyPositioning : 0) | (requiresShaping ? kCTFontTransformApplyShaping : 0); >+ CTFontTransformGlyphs(m_platformData.ctFont(), glyphBuffer.glyphs(beginningGlyphIndex), reinterpret_cast<CGSize*>(glyphBuffer.advances(beginningGlyphIndex)), glyphBuffer.size() - beginningGlyphIndex, options); > #endif > } > >diff --git a/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp b/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp >index 32579da0617..ff6fc8d8329 100644 >--- a/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp >+++ b/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp >@@ -41,7 +41,7 @@ RetainPtr<CFDictionaryRef> Font::getCFStringAttributes(bool enableKerning, FontO > values[0] = platformData().ctFont(); > size_t count = 1; > >-#if USE(CTFONTTRANSFORMGLYPHSWITHLANGUAGE) >+#if USE(CTFONTSHAPEGLYPHS) > RetainPtr<CFStringRef> localeString; > if (!locale.isEmpty()) { > localeString = locale.string().createCFString();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 215059
:
405781
|
405906
|
405909
|
405912
|
405966
|
405967
|
405978
|
406101
|
406134
|
406135
|
406263
|
406276
|
406282
|
406289
|
406291
|
406332
|
406333
|
406358