haikuwebkit/LayoutTests/fast/text/single-character-shaping-ex...

16 lines
452 B
HTML
Raw Permalink Normal View History

[Cocoa] Single characters don't get shaped in the fast text codepath https://bugs.webkit.org/show_bug.cgi?id=186804 Reviewed by Alan Bujtas. Source/WebCore: Previously, single characters weren't shaped in the fast text codepath, because shaping in the fast text codepath was just for kerning and ligatures. Kerning didn't need to shape individual characters because kerning only applies to pairs of characters, and ligatures didn't need to shape individual characters because two characters are required to form a ligature. However, now that we want to replace the complex text codepath with a new-and-improved fast text codepath, we have to perform all shaping in the fast text codepath, regardless of how many characters are present. Test: fast/text/single-character-shaping.html * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::applyFontTransforms): (WebCore::WidthIterator::commitCurrentFontRange): (WebCore::WidthIterator::advanceInternal): (WebCore::WidthIterator::shouldApplyFontTransforms const): Deleted. * platform/graphics/WidthIterator.h: * platform/graphics/coretext/FontCoreText.cpp: (WebCore::Font::applyTransforms): Keep kerning disabled for single glyphs, because of performance. This will be able to be removed when rdar://82195405 is fixed. * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Tools: Huge thanks to Laurence Penney to contributing this test font!!! * Scripts/webkitpy/common/config/contributors.json: LayoutTests: Huge thanks to Laurence Penney to contributing this test font!!! * fast/text/resources/UniversTofu-GSUB-rvrn.ttf: Added. The license is Apache 2.0. * fast/text/single-character-shaping-expected.html: Added. * fast/text/single-character-shaping.html: Added. Canonical link: https://commits.webkit.org/240793@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-21 19:18:51 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
font-family: "WebFont";
src: url("resources/UniversTofu-GSUB-rvrn.ttf") format("truetype");
}
</style>
</head>
<body>
This test makes sure that individual characters are shaped in the fast text codepath. The test passes if you see a box with an X through it below.
<div style="font: 48px 'WebFont'; font-weight: 200; font-stretch: 200%; font-feature-settings: 'ABCD';">u</div>
</body>
</html>