Text drawn with an SVG font has no spaces when word-rounding hacks are enabled
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Oct 2014 18:55:59 +0000 (18:55 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Oct 2014 18:55:59 +0000 (18:55 +0000)
commit286706db512d32852490de61400ff57fee03ba0f
tree3b77b0224670b463557a50c8056cbe4c5cf20735
parentb172c47e73a0a91dd1e9e19a5072e40527bf7ef4
Text drawn with an SVG font has no spaces when word-rounding 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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/svg/text/resources/Litherum.svg
LayoutTests/svg/text/svg-font-word-rounding-hacks-spaces-expected.html [new file with mode: 0644]
LayoutTests/svg/text/svg-font-word-rounding-hacks-spaces.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/SimpleFontData.h
Source/WebCore/svg/SVGFontData.cpp