haikuwebkit/LayoutTests/fast/encoding/denormalised-voiced-japanes...

12 lines
518 B
HTML
Raw Permalink Normal View History

[Cocoa] Migrate from CTFontTransformGlyphsWithLanguage() to CTFontShapeGlyphs() https://bugs.webkit.org/show_bug.cgi?id=215059 Reviewed by Darin Adler. Source/WebCore: This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. The solution for https://bugs.webkit.org/show_bug.cgi?id=214769 requires applying letter-spacing after text shaping. Today, we apply letter-spacing before text shaping which is wrong. However, if we want to apply letter-spacing after text shaping, we need to use CTFontShapeGlyphs(), which returns the glyph -> string mapping, which allows us to determine which glyphs to add letter-spacing to. Updates existing tests. Tests: fast/text/international/kana-voiced-sound-marks-1.html fast/text/international/kana-voiced-sound-marks-2.html * platform/graphics/Font.cpp: (WebCore::Font::applyTransforms const): * platform/graphics/Font.h: * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthForSimpleText const): (WebCore::FontCascade::characterRangeCodePath): (WebCore::FontCascade::layoutSimpleText const): * platform/graphics/FontCascade.h: * platform/graphics/SurrogatePairAwareTextIterator.cpp: (WebCore::SurrogatePairAwareTextIterator::consumeSlowCase): Now that we're using CTFontShapeGlyphs(), the shaping routine can and does look at the underlying character string to perform character composition. This means that the glyph buffer needs to match exactly what is in the string. We can't do any shenanigans where we pretend the string has characters that aren't actually there. * platform/graphics/SurrogatePairAwareTextIterator.h: (WebCore::SurrogatePairAwareTextIterator::consume): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::shouldApplyFontTransforms const): (WebCore::WidthIterator::applyFontTransforms): Reversing the glyph buffer for rtl content needs to be done inside platform-specific code, because its behavior depends on which platform shaping routine is being used. (WebCore::WidthIterator::commitCurrentFontRange): (WebCore::WidthIterator::advanceInternal): * platform/graphics/WidthIterator.h: * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::applyTransforms const): * platform/graphics/mac/SimpleFontDataCoreText.cpp: (WebCore::Font::getCFStringAttributes const): Source/WebCore/PAL: * pal/spi/cocoa/CoreTextSPI.h: Source/WTF: * wtf/PlatformUse.h: Rename CTFONTTRANSFORMGLYPHSWITHLANGUAGE to CTFONTSHAPEGLYPHS, because that's the new function. LayoutTests: * fast/encoding/denormalised-voiced-japanese-chars-expected.html: Copied from LayoutTests/fast/encoding/denormalised-voiced-japanese-chars.html. * fast/encoding/denormalised-voiced-japanese-chars.html: Update to be a reftest. * fast/text/international/kana-voiced-sound-marks-1-expected.html: Copied from LayoutTests/imported/blink/fast/text/international/kana-voiced-sound-marks-expected.html. Make the test more robust. * fast/text/international/kana-voiced-sound-marks-1.html: Renamed from LayoutTests/imported/blink/fast/text/international/kana-voiced-sound-marks.html. Make the test more robust. * fast/text/international/kana-voiced-sound-marks-2-expected.html: Copied from LayoutTests/imported/blink/fast/text/international/kana-voiced-sound-marks-expected.html. Make the test more robust. * fast/text/international/kana-voiced-sound-marks-2.html: Renamed from LayoutTests/imported/blink/fast/text/international/kana-voiced-sound-marks-expected.html. Make the test more robust. * fast/text/soft-hyphen-min-preferred-width-expected.html: * fast/text/soft-hyphen-min-preferred-width.html: Update to be more robust. * platform/gtk/fast/encoding/denormalised-voiced-japanese-chars-expected.png: Removed. * platform/gtk/fast/encoding/denormalised-voiced-japanese-chars-expected.txt: Removed. * platform/ios/fast/encoding/denormalised-voiced-japanese-chars-expected.txt: Removed. * platform/mac-bigsur/svg/W3C-I18N/tspan-direction-rtl-expected.txt: Added Big Sur -expected result. * platform/mac-bigsur/svg/text/bidi-tspans-expected.txt: Ditto. * platform/mac/fast/encoding/denormalised-voiced-japanese-chars-expected.png: Removed. * platform/mac/fast/encoding/denormalised-voiced-japanese-chars-expected.txt: Removed. * platform/win/fast/encoding/denormalised-voiced-japanese-chars-expected.txt: Removed. * platform/wincairo/fast/encoding/denormalised-voiced-japanese-chars-expected.txt: Removed. * platform/wpe/fast/encoding/denormalised-voiced-japanese-chars-expected.txt: Removed. Canonical link: https://commits.webkit.org/228138@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@265487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-11 04:23:51 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body>
This test checks that the decomposed unicode version of voiced japanese hiragana and katakana characters are rendered the same as the precomposed version.
<h2 style="font-family: 'Hiragino Mincho ProN';">バナナとパナマ</h2>
</body>
</html>