haikuwebkit/LayoutTests/fast/text/locale-shaping-complex-expe...

9 lines
142 B
HTML
Raw Permalink Normal View History

[Cocoa] Glyph lookup should be language-sensitive (specifically between Yiddish and Hebrew) https://bugs.webkit.org/show_bug.cgi?id=77568 <rdar://problem/14649193> Reviewed by Simon Fraser. Source/WebCore: Switch from CTFontTransformGlyphs() to CTFontTransformGlyphsWithLanguage(). CTFontTransformGlyphsWithLanguage() accepts a callback when it needs to insert glyphs and the glyph buffer isn't big enough. This patch hooks up this callback to a "makeHole()" function which reallocs the glyph buffer so the hole can be filled in by shaping. We cache the CFDictionaries of the CFAttributedString we pass into CoreText using a HashMap stored in Font. Tests: fast/text/locale-shaping-complex.html fast/text/locale-shaping.html * platform/graphics/Font.cpp: (WebCore::Font::applyTransforms const): * platform/graphics/Font.h: (WebCore::Font::CFStringAttributesKey::CFStringAttributesKey): (WebCore::Font::CFStringAttributesKey::operator== const): (WebCore::Font::CFStringAttributesKey::operator!= const): (WebCore::Font::CFStringAttributesKey::isHashTableDeletedValue const): (WebCore::Font::CFStringAttributesKey::computeHash const): (WebCore::Font::CFStringAttributesKeyHash::hash): (WebCore::Font::CFStringAttributesKeyHash::equal): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthForSimpleText const): * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::isEmpty const): (WebCore::GlyphBuffer::size const): (WebCore::GlyphBuffer::clear): (WebCore::GlyphBuffer::advances const): (WebCore::GlyphBuffer::fontAt const): (WebCore::GlyphBuffer::add): (WebCore::GlyphBuffer::remove): (WebCore::GlyphBuffer::makeHole): (WebCore::GlyphBuffer::shrink): (WebCore::GlyphBuffer::swap): (WebCore::GlyphBuffer::advancesCount const): Deleted. * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::applyFontTransforms): * platform/graphics/WidthIterator.h: * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::applyTransforms const): * platform/graphics/mac/ComplexTextControllerCoreText.mm: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): * platform/graphics/mac/SimpleFontDataCoreText.cpp: (WebCore::Font::getCFStringAttributes const): Source/WebCore/PAL: * pal/spi/cocoa/CoreTextSPI.h: Source/WTF: * wtf/Platform.h: LayoutTests: * fast/text/locale-shaping-complex-expected-mismatch.html: Added. * fast/text/locale-shaping-complex.html: Added. * fast/text/locale-shaping-expected-mismatch.html: Added. * fast/text/locale-shaping.html: Added. * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/219347@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-14 22:13:54 +00:00
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div lang="arab" style="font: 100px 'Comic Sans MS';">&#xED;&#xED;A&#x300;</div>
</body>
</html>