Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r229165 - REGRESSION(r222843): [HarfBuzz] Combining enclosed ke…
…ycap not correctly handled https://bugs.webkit.org/show_bug.cgi?id=183246 Reviewed by Michael Catanzaro. Source/WebCore: We are not correctly handling the combining enclosed keycap since we switched to use ComplexTextController. This is because fontForCombiningCharacterSequence() always returns the font of the first character, without checking if that font can render the whole sequence or not. Before 222843, the shaper did that check when creating the text runs. In this case the sequence was split and a different font was used for the text and the mark. This patch makes fontForCombiningCharacterSequence() try to find a suitable font for the whole sequence, first looking at the CSS fallbacks and finally at system ones. The result is much better than the old one, because we use the same font for both the text and the mark. If there isn't any font to render the mark, then we fallback to use the first character font, since we will end up rendering the missing glyph character, it's better to use the same font than the first character one. Test: fast/text/combining-enclosing-keycap.html * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp: (WebCore::FontCascade::fontForCombiningCharacterSequence const): Check if the first charatcer font can render the whole sequence, trying with fallbacks otherwise. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::Font::canRenderCombiningCharacterSequence const): Check if the font face has glyphs for the whole sequence not just the first character. LayoutTests: * fast/text/combining-enclosing-keycap-expected.txt: Added. * platform/gtk/fast/text/combining-enclosing-keycap.html: Added. * platform/gtk/TestExpectations:
- Loading branch information
1 parent
45301a6
commit 11d40a5
Showing
7 changed files
with
145 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<span>#⃣</span> | ||
<span>0⃣</span> | ||
<span>1⃣</span> | ||
<span>2⃣</span> | ||
<span>3⃣</span> | ||
<span>4⃣</span> | ||
<span>5⃣</span> | ||
<span>6⃣</span> | ||
<span>7⃣</span> | ||
<span>8⃣</span> | ||
<span>9⃣</span> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
LayoutTests/platform/gtk/fast/text/combining-enclosing-keycap-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
layer at (0,0) size 800x600 | ||
RenderView at (0,0) size 800x600 | ||
layer at (0,0) size 800x34 | ||
RenderBlock {HTML} at (0,0) size 800x34 | ||
RenderBody {BODY} at (8,8) size 784x18 | ||
RenderInline {SPAN} at (0,0) size 10x17 | ||
RenderText {#text} at (0,0) size 10x17 | ||
text run at (0,0) width 10: "#\x{20E3}" | ||
RenderText {#text} at (10,0) size 4x17 | ||
text run at (10,0) width 4: " " | ||
RenderInline {SPAN} at (0,0) size 10x17 | ||
RenderText {#text} at (14,0) size 10x17 | ||
text run at (14,0) width 10: "0\x{20E3}" | ||
RenderText {#text} at (24,0) size 4x17 | ||
text run at (24,0) width 4: " " | ||
RenderInline {SPAN} at (0,0) size 10x17 | ||
RenderText {#text} at (28,0) size 10x17 | ||
text run at (28,0) width 10: "1\x{20E3}" | ||
RenderText {#text} at (38,0) size 4x17 | ||
text run at (38,0) width 4: " " | ||
RenderInline {SPAN} at (0,0) size 10x17 | ||
RenderText {#text} at (42,0) size 10x17 | ||
text run at (42,0) width 10: "2\x{20E3}" | ||
RenderText {#text} at (52,0) size 4x17 | ||
text run at (52,0) width 4: " " | ||
RenderInline {SPAN} at (0,0) size 10x17 | ||
RenderText {#text} at (56,0) size 10x17 | ||
text run at (56,0) width 10: "3\x{20E3}" | ||
RenderText {#text} at (66,0) size 4x17 | ||
text run at (66,0) width 4: " " | ||
RenderInline {SPAN} at (0,0) size 10x17 | ||
RenderText {#text} at (70,0) size 10x17 | ||
text run at (70,0) width 10: "4\x{20E3}" | ||
RenderText {#text} at (80,0) size 4x17 | ||
text run at (80,0) width 4: " " | ||
RenderInline {SPAN} at (0,0) size 10x17 | ||
RenderText {#text} at (84,0) size 10x17 | ||
text run at (84,0) width 10: "5\x{20E3}" | ||
RenderText {#text} at (94,0) size 4x17 | ||
text run at (94,0) width 4: " " | ||
RenderInline {SPAN} at (0,0) size 10x17 | ||
RenderText {#text} at (98,0) size 10x17 | ||
text run at (98,0) width 10: "6\x{20E3}" | ||
RenderText {#text} at (108,0) size 4x17 | ||
text run at (108,0) width 4: " " | ||
RenderInline {SPAN} at (0,0) size 10x17 | ||
RenderText {#text} at (112,0) size 10x17 | ||
text run at (112,0) width 10: "7\x{20E3}" | ||
RenderText {#text} at (122,0) size 4x17 | ||
text run at (122,0) width 4: " " | ||
RenderInline {SPAN} at (0,0) size 10x17 | ||
RenderText {#text} at (126,0) size 10x17 | ||
text run at (126,0) width 10: "8\x{20E3}" | ||
RenderText {#text} at (136,0) size 4x17 | ||
text run at (136,0) width 4: " " | ||
RenderInline {SPAN} at (0,0) size 10x17 | ||
RenderText {#text} at (140,0) size 10x17 | ||
text run at (140,0) width 10: "9\x{20E3}" | ||
RenderText {#text} at (0,0) size 0x0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters