Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r174466 - Text drawn with an SVG font has no spaces when word-r…
…ounding hacks are enabled https://bugs.webkit.org/show_bug.cgi?id=137463 Reviewed by Darin Adler. Source/WebCore: When rounding hacks are enabled, we use the "adjusted space width" instead of the regular space width. However, the SVG-font-specific implementation of the SimpleFontData constructor doesn't initialize this value, so it was getting set to an undefined value (which happened to be close to 0 in my tests). Test: svg/text/svg-font-word-rounding-hacks-spaces.html * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::getFontData): (WebCore::CSSFontFaceSource::ensureFontData): * loader/cache/CachedFont.cpp: (WebCore::CachedFont::ensureCustomFontData): (WebCore::CachedFont::getSVGFontById): * platform/graphics/SimpleFontData.h: * svg/SVGFontData.cpp: (WebCore::SVGFontData::initializeFontData): LayoutTests: Make sure that spaces are present. * svg/text/svg-font-word-rounding-hacks-spaces.html: * svg/text/svg-font-word-rounding-hacks-spaces-expected.html: Canonical link: https://commits.webkit.org/154760.113@webkitgtk/2.6 git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@174965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
b4bdd8e
commit 879e935
Showing
7 changed files
with
92 additions
and
6 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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
LayoutTests/svg/text/svg-font-word-rounding-hacks-spaces-expected.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
.blackbox { | ||
display: inline-block; | ||
width: 14px; | ||
height: 21px; | ||
background: black; | ||
} | ||
.whitebox { | ||
display: inline-block; | ||
width: 14px; | ||
height: 21px; | ||
background: white; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
This test makes sure that text drawn with an SVG font with word-wrapping hacks has spaces. | ||
The test is successful if the space between the two boxes below is the same as the width of each of the boxes. | ||
<div><div class="blackbox"></div><div class="whitebox"></div><div class="blackbox"></div></div> | ||
</body> | ||
</html> |
20 changes: 20 additions & 0 deletions
20
LayoutTests/svg/text/svg-font-word-rounding-hacks-spaces.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
@font-face { | ||
font-family: 'Litherum'; | ||
src: url("resources/Litherum.svg") format(svg) | ||
} | ||
</style> | ||
<script> | ||
if (window.internals) | ||
window.internals.allowRoundingHacks(); | ||
</script> | ||
</head> | ||
<body> | ||
This test makes sure that text drawn with an SVG font with word-wrapping hacks has spaces. | ||
The test is successful if the space between the two boxes below is the same as the width of each of the boxes. | ||
<div style="font: 14px Litherum;">a a</div> | ||
</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
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