haikuwebkit/LayoutTests/svg/custom/svg-fonts-fallback.xhtml

82 lines
9.0 KiB
HTML
Raw Permalink Normal View History

2011-06-24 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Rob Buis. Integrate SVG Fonts within GlyphPage concept, removing the special SVG code paths from Font, making it possible to reuse the simple text code path for SVG Fonts https://bugs.webkit.org/show_bug.cgi?id=59085 font substitution doesn't work for HTML text using SVG fonts https://bugs.webkit.org/show_bug.cgi?id=17608 Selection rects are wrong for text with SVG fonts https://bugs.webkit.org/show_bug.cgi?id=25460 With @font-face, SVG fonts only work as primary, non-segmented https://bugs.webkit.org/show_bug.cgi?id=32227 When using SVG fonts with @font-face word-spacing and text-align: justify are not being honored https://bugs.webkit.org/show_bug.cgi?id=34236 SVG @font-face breaks text-overflow: ellipsis https://bugs.webkit.org/show_bug.cgi?id=36840 REGRESSION: SVG Font selection problems https://bugs.webkit.org/show_bug.cgi?id=41934 Rewrite the SVG Fonts support to fully integrate within the GlyphPage concept and the "simple" code path used to render platform fonts. That means the special logic for measuring text using SVG Fonts, calculating offset for positions, computing selection rects etc. is all gone now. There's no difference anymore between using a native font or a SVG Font, in terms of these operations. Update SVG pixel test baseline. Use all results that have been checked in when I landed the patch the last time. * platform/chromium/test_expectations.txt: * platform/mac/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.png: * platform/mac/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.png: * platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/fonts-glyph-04-t-expected.png: * platform/mac/svg/W3C-SVG-1.1/fonts-glyph-04-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.png: * platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.png: * platform/mac/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.txt: * platform/mac/svg/batik/text/textEffect-expected.png: * platform/mac/svg/batik/text/textEffect-expected.txt: * platform/mac/svg/batik/text/textEffect3-expected.png: * platform/mac/svg/batik/text/textEffect3-expected.txt: * platform/mac/svg/batik/text/xmlSpace-expected.png: * platform/mac/svg/batik/text/xmlSpace-expected.txt: * platform/mac/svg/custom/glyph-selection-lang-attribute-expected.png: * platform/mac/svg/custom/glyph-selection-lang-attribute-expected.txt: * platform/mac/svg/custom/svg-fonts-fallback-expected.png: Added. * platform/mac/svg/custom/svg-fonts-fallback-expected.txt: Added. * platform/mac/svg/custom/svg-fonts-segmented-expected.png: Added. * platform/mac/svg/custom/svg-fonts-segmented-expected.txt: Added. * platform/mac/svg/custom/svg-fonts-with-no-element-reference-expected.png: * platform/mac/svg/custom/svg-fonts-with-no-element-reference-expected.txt: * platform/mac/svg/custom/svg-fonts-without-missing-glyph-expected.png: * platform/mac/svg/custom/svg-fonts-without-missing-glyph-expected.txt: * platform/mac/svg/custom/svg-fonts-word-spacing-expected.png: Added. * platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt: Added. * platform/mac/svg/dynamic-updates/SVGFEConvolveMatrixElement-dom-preserveAlpha-attr-expected.png: * platform/mac/svg/dynamic-updates/SVGFEConvolveMatrixElement-svgdom-preserveAlpha-prop-expected.png: * platform/mac/svg/foreignObject/text-tref-02-b-expected.png: * platform/mac/svg/foreignObject/text-tref-02-b-expected.txt: * platform/mac/svg/text/text-altglyph-01-b-expected.png: * platform/mac/svg/text/text-altglyph-01-b-expected.txt: * platform/mac/svg/text/text-overflow-ellipsis-svgfont-expected.png: Added. * platform/mac/svg/text/text-overflow-ellipsis-svgfont-expected.txt: Added. * platform/mac/svg/text/text-text-04-t-expected.png: * platform/mac/svg/text/text-text-04-t-expected.txt: * platform/mac/svg/text/text-text-05-t-expected.png: * platform/mac/svg/text/text-text-05-t-expected.txt: * platform/mac/svg/text/text-text-06-t-expected.png: * platform/mac/svg/text/text-text-06-t-expected.txt: * platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.png: * platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.txt: * platform/mac/svg/wicd/test-rightsizing-b-expected.png: * platform/mac/svg/wicd/test-rightsizing-b-expected.txt: * platform/qt-mac/Skipped: * platform/qt-wk2/Skipped: * platform/qt-wk2/fast/dom/Window/window-properties-expected.txt: * platform/qt-wk2/fast/dom/Window/window-property-descriptors-expected.txt: * platform/qt-wk2/fast/dom/prototype-inheritance-2-expected.txt: * platform/qt/Skipped: * platform/qt/fast/dom/Window/window-properties-expected.png: Added. * platform/qt/fast/dom/Window/window-properties-expected.txt: * platform/qt/fast/dom/Window/window-property-descriptors-expected.png: Added. * platform/qt/fast/dom/Window/window-property-descriptors-expected.txt: * platform/qt/fast/dom/prototype-inheritance-2-expected.png: Added. * platform/qt/fast/dom/prototype-inheritance-2-expected.txt: * platform/qt/fast/dom/prototype-inheritance-expected.png: Added. * platform/qt/fast/dom/prototype-inheritance-expected.txt: * platform/qt/fast/js/global-constructors-expected.png: Added. * platform/qt/fast/js/global-constructors-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-01-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-01-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-03-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-03-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-04-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-04-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/filters-image-03-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/filters-image-03-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-grad-17-b-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-grad-17-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-grad-20-b-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-grad-20-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-pattern-03-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-pattern-03-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-pattern-04-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-pattern-04-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-01-b-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-01-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-02-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-02-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-03-b-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-03-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-04-b-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-04-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png: * platform/qt/svg/W3C-SVG-1.1/filters-turb-02-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1/render-elems-06-t-expected.png: * platform/qt/svg/W3C-SVG-1.1/render-elems-06-t-expected.txt: * platform/qt/svg/W3C-SVG-1.1/render-elems-07-t-expected.png: * platform/qt/svg/W3C-SVG-1.1/render-elems-07-t-expected.txt: * platform/qt/svg/W3C-SVG-1.1/render-elems-08-t-expected.png: * platform/qt/svg/W3C-SVG-1.1/render-elems-08-t-expected.txt: * platform/qt/svg/W3C-SVG-1.1/render-groups-01-b-expected.png: * platform/qt/svg/W3C-SVG-1.1/render-groups-01-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1/render-groups-03-t-expected.png: * platform/qt/svg/W3C-SVG-1.1/render-groups-03-t-expected.txt: * platform/qt/svg/custom/glyph-transformation-with-hkern-expected.png: Added. * platform/qt/svg/custom/glyph-transformation-with-hkern-expected.txt: Added. * platform/qt/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.png: * platform/qt/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.txt: * platform/qt/svg/custom/svg-features-expected.png: Added. * platform/qt/svg/custom/svg-features-expected.txt: Added. * platform/qt/svg/custom/svg-fonts-in-html-expected.png: * platform/qt/svg/custom/svg-fonts-in-html-expected.txt: * platform/qt/svg/foreignObject/text-tref-02-b-expected.png: * platform/qt/svg/foreignObject/text-tref-02-b-expected.txt: * platform/qt/svg/transforms/text-with-mask-with-svg-transform-expected.png: * platform/qt/svg/transforms/text-with-mask-with-svg-transform-expected.txt: * platform/qt/svg/wicd/test-rightsizing-b-expected.png: * platform/qt/svg/wicd/test-rightsizing-b-expected.txt: * svg/custom/resources/ABCFont.svg: * svg/custom/svg-fonts-fallback.xhtml: Added. * svg/custom/svg-fonts-segmented.xhtml: Added. * svg/custom/svg-fonts-word-spacing.html: Added. * svg/text/select-text-svgfont-expected.txt: Added. * svg/text/select-text-svgfont.html: Added. * svg/text/text-overflow-ellipsis-svgfont.html: Added. 2011-06-24 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Rob Buis. Integrate SVG Fonts within GlyphPage concept, removing the special SVG code paths from Font, making it possible to reuse the simple text code path for SVG Fonts https://bugs.webkit.org/show_bug.cgi?id=59085 * wtf/Platform.h: Force Qt-EWS into a full rebuild, otherwhise this patch breaks the EWS. 2011-06-24 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Rob Buis. Integrate SVG Fonts within GlyphPage concept, removing the special SVG code paths from Font, making it possible to reuse the simple text code path for SVG Fonts https://bugs.webkit.org/show_bug.cgi?id=59085 font substitution doesn't work for HTML text using SVG fonts https://bugs.webkit.org/show_bug.cgi?id=17608 Selection rects are wrong for text with SVG fonts https://bugs.webkit.org/show_bug.cgi?id=25460 With @font-face, SVG fonts only work as primary, non-segmented https://bugs.webkit.org/show_bug.cgi?id=32227 When using SVG fonts with @font-face word-spacing and text-align: justify are not being honored https://bugs.webkit.org/show_bug.cgi?id=34236 SVG @font-face breaks text-overflow: ellipsis https://bugs.webkit.org/show_bug.cgi?id=36840 REGRESSION: SVG Font selection problems https://bugs.webkit.org/show_bug.cgi?id=41934 Tests: svg/custom/svg-fonts-fallback.xhtml (for bug 17608, extended the original test from Mark Ambachtsheer) svg/custom/svg-fonts-segmented.xhtml (for bug 32227) svg/custom/svg-fonts-word-spacing.html (for bug 34236, from Michael Lewis) svg/text/select-text-svgfont.html (for bug 25460/41934, from Emil Schutte) svg/text/text-overflow-ellipsis-svgfont.html (for 36840, from Emil Schutte) Rewrite the SVG Fonts support to fully integrate within the GlyphPage concept and the "simple" code path used to render platform fonts. That means the special logic for measuring text using SVG Fonts, calculating offset for positions, computing selection rects etc. is all gone now. There's no difference anymore between using a native font or a SVG Font, in terms of these operations. This makes text selection using SVG Fonts possible again. * features.pri: Temporarily turn of SVG Fonts for Qt, as long as QRawFont support is not available and the fast path is disabled. * page/DOMWindow.idl: Touched file to force Qt regenerating the bindings. * platform/graphics/Font.cpp: Remove SVG Font special cases, the simple code path now handles SVG Fonts as well. (WebCore::Font::drawText): (WebCore::Font::drawEmphasisMarks): (WebCore::Font::width): (WebCore::Font::selectionRectForText): (WebCore::Font::offsetForPosition): (WebCore::Font::codePath): * platform/graphics/Font.h: Pass TextRun to drawGlyphBuffer/drawEmphasisMarks. Add new glyphDataAndPageForCharacter() method which returns a pair std::pair<GlyphData, GlyphPage*>, so we know the associated GlyphPage for a certain GlyphData object, which is needed to properly handle font fallback glyph matching for SVG Fonts.. (WebCore::Font::fontList): Add FontFallbackList accessor. * platform/graphics/FontFallbackList.h: Add getters/setters for glyphPageZero -- SVG Fonts support needs access to these objects from SVGTextRunRenderingContext. (WebCore::FontFallbackList::glyphPageZero): (WebCore::FontFallbackList::glyphPages): (WebCore::FontFallbackList::setGlyphPageZero): (WebCore::FontFallbackList::setGlyphPages): * platform/graphics/FontFastPath.cpp: (WebCore::Font::glyphDataForCharacter): Move implementation to glyphDataAndPageForCharacter(), and use that method from here. (WebCore::Font::glyphDataAndPageForCharacter): Does the same as before, just returns an additional GlyphPage* pointer. (WebCore::Font::getEmphasisMarkGlyphData): Remove SVG Fonts special case. (WebCore::Font::drawGlyphBuffer): Ditto. * platform/graphics/FontMetrics.h: (WebCore::scaleEmToUnits): Refactored scaleEmToUnits free function from SimpleFontDataMac/CGWin to share with SVGFontData/SVGTextRunRenderingContext. * platform/graphics/GlyphPageTreeNode.cpp: (WebCore::fill): Stop skipping SVG Fonts, they now also fill the GlyphPage using the glyphs defined in the SVG Font. * platform/graphics/SVGGlyph.h: s/isValid/isPartOfLigature/. Its usage has been changed. (WebCore::SVGGlyph::SVGGlyph): (WebCore::SVGGlyph::operator==): * platform/graphics/SimpleFontData.cpp: Change font size to be a float, not an int. (WebCore::SimpleFontData::SimpleFontData): * platform/graphics/SimpleFontData.h: Add new pure virtual methods to the AdditionalFontData interface, to be implemented in SVGFontData. (WebCore::SimpleFontData::widthForGlyph): Call widthForSVGGlyph, if we encounter a SVG glyph. * platform/graphics/TextRun.h: * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::glyphDataForCharacter): (WebCore::WidthIterator::advance): * platform/graphics/WidthIterator.h: Store several new members needed for SVG Fonts support (last processed glyph name used for kerning pair lookup) and a map mapping each character of a text to its arabic-form (if needed, to perform SVG glyph selection for Arabic text). (WebCore::WidthIterator::run): (WebCore::WidthIterator::runWidthSoFar): (WebCore::WidthIterator::lastGlyphName): (WebCore::WidthIterator::setLastGlyphName): (WebCore::WidthIterator::arabicForms): * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp: Use new scaleEmToUnits free function from FontMetrics.h. * platform/graphics/mac/SimpleFontDataMac.mm: Ditto. * platform/graphics/win/SimpleFontDataCGWin.cpp: Ditto. * rendering/svg/SVGTextLayoutAttributesBuilder.cpp: (WebCore::SVGTextLayoutAttributesBuilder::propagateLayoutAttributes): Handle UTF-16 surrogate pairs correctly, fixes the previous Acid3 regression. * rendering/svg/SVGTextMetrics.cpp: (WebCore::SVGTextMetrics::SVGTextMetrics): (WebCore::constructTextRun): (WebCore::SVGTextMetrics::measureCharacterRange): * rendering/svg/SVGTextMetrics.h: * rendering/svg/SVGTextRunRenderingContext.cpp: Remove drawTextUsingSVGFont/floatWidthUsingSVGFont/selectionRectForTextUsingSVGFont/offsetForPositionForTextUsingSVGFont. (WebCore::firstParentRendererForNonTextNode): Don't assert node() exists, doesn't hold true for generated render objects. (WebCore::renderObjectFromRun): Renamed from referencingRenderObjectFromRun. (WebCore::SVGTextRunRenderingContext::floatWidthUsingSVGFont): Remove extra "extraCharsAvailable" parameter, now solves via TextRun::charactersLength(). (WebCore::calculateEmUnitToPixelScaleFactor): Add helper method. (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs): Main drawing method, this actually creates/renders Paths. (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter): Part 1/2 of SVG Glyph selection code. * rendering/svg/SVGTextRunRenderingContext.h: * svg/SVGAltGlyphElement.cpp: (WebCore::SVGAltGlyphElement::hasValidGlyphElement): * svg/SVGAltGlyphElement.h: * svg/SVGFontData.cpp: (WebCore::SVGFontData::initializeFontData): Changed font size from int to float. (WebCore::SVGFontData::widthForSVGGlyph): Lookup a SVGGlyph from a Glyph using the glyph table in SVGFontElement and calculate its width. (WebCore::SVGFontData::applySVGGlyphSelection): Part 2/2 of SVG Glyph selection code. (WebCore::SVGFontData::fillSVGGlyphPage): Fill GlyphPage using glyphs defined in the SVG Font. (WebCore::SVGFontData::fillBMPGlyphs): Moved from the previous fillSVGGlyphPage implementation. (WebCore::SVGFontData::fillNonBMPGlyphs): Add non-bmp glyph handling, fixing the Acid3 regression (support using SVGGlyphs for UTF-16 surrogate pairs). * svg/SVGFontData.h: * svg/SVGFontElement.cpp: (WebCore::SVGFontElement::registerLigaturesInGlyphCache): Enable ligature registration for the use within GlyphPage. (WebCore::SVGFontElement::ensureGlyphCache): * svg/SVGGlyphMap.h: Switch to use SurrogatePairTextIterator, and switch glyph table from UChar to UChar32, just like GlyphPage, to handle glyphs from non-BMP correctly. (WebCore::SVGGlyphMap::addGlyph): Remove setting isValid, it's not needed anymore and gone. (WebCore::SVGGlyphMap::collectGlyphsForString): * svg/svgtags.in: Surround vkern in ENABLE_SVG_FONTS block. Canonical link: https://commits.webkit.org/79028@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-06-25 06:28:12 +00:00
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SVG Font Test</title>
<style>
@font-face {
font-family: 'TestFont1';
src: url('#TestFont1') format(svg);
}
@font-face {
font-family: 'TestFont2';
src: url('#TestFont2') format(svg);
}
@font-face {
font-family: 'TestFont3';
src: url('#TestFont3') format(svg);
}
</style>
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none">
<defs>
<font id="TestFont1">
<font-face font-family="TestFont1" font-weight="normal" font-style="normal" font-variant="normal" font-stretch="normal" units-per-em="2048.000000" x-height="987.500000" cap-height="1558.500000" ascent="2127.000000" descent="532.000000"/>
<missing-glyph d="M 0.000000 0.000000 L 987.500000 0.000000 L 987.500000 1558.500000 L 0.000000 1558.500000 Z M 0.000000 0.000000 " horiz-adv-x="987.500000"/>
<glyph unicode="a" d="M 860.000000 974.000000 L 1086.000000 974.000000 L 1086.000000 0.000000 L 860.000000 0.000000 L 860.000000 102.000000 C 767.332886 15.332900 667.667175 -28.000000 561.000000 -28.000000 C 426.332672 -28.000000 315.000427 20.666180 227.000000 118.000000 C 139.666229 217.333832 96.000000 341.332581 96.000000 490.000000 C 96.000000 636.000732 139.666229 757.666199 227.000000 855.000000 C 314.333771 952.333801 423.666016 1001.000000 555.000000 1001.000000 C 668.333923 1001.000000 769.999573 954.333801 860.000000 861.000000 Z M 326.000000 490.000000 C 326.000000 396.666199 350.999756 320.666962 401.000000 262.000000 C 452.333588 202.666367 516.999634 173.000000 595.000000 173.000000 C 678.333740 173.000000 745.666382 201.666382 797.000000 259.000000 C 848.333618 318.333618 874.000000 393.666199 874.000000 485.000000 C 874.000000 576.333801 848.333618 651.666382 797.000000 711.000000 C 745.666382 769.000305 679.000427 798.000000 597.000000 798.000000 C 519.666260 798.000000 455.000275 768.666931 403.000000 710.000000 C 351.666412 650.666382 326.000000 577.333740 326.000000 490.000000 Z M 1228.000000 0.000000 " horiz-adv-x="1228"/>
<glyph unicode=" " d="M 632.000000 0.000000 " horiz-adv-x="632"/>
</font>
<!-- Same as TestFont1, but without a missing-glyph element and one additional glyph -->
<font id="TestFont2">
<font-face font-family="TestFont2" font-weight="normal" font-style="normal" font-variant="normal" font-stretch="normal" units-per-em="2048.000000" x-height="987.500000" cap-height="1558.500000" ascent="2127.000000" descent="532.000000"/>
<glyph unicode="a" d="M 860.000000 974.000000 L 1086.000000 974.000000 L 1086.000000 0.000000 L 860.000000 0.000000 L 860.000000 102.000000 C 767.332886 15.332900 667.667175 -28.000000 561.000000 -28.000000 C 426.332672 -28.000000 315.000427 20.666180 227.000000 118.000000 C 139.666229 217.333832 96.000000 341.332581 96.000000 490.000000 C 96.000000 636.000732 139.666229 757.666199 227.000000 855.000000 C 314.333771 952.333801 423.666016 1001.000000 555.000000 1001.000000 C 668.333923 1001.000000 769.999573 954.333801 860.000000 861.000000 Z M 326.000000 490.000000 C 326.000000 396.666199 350.999756 320.666962 401.000000 262.000000 C 452.333588 202.666367 516.999634 173.000000 595.000000 173.000000 C 678.333740 173.000000 745.666382 201.666382 797.000000 259.000000 C 848.333618 318.333618 874.000000 393.666199 874.000000 485.000000 C 874.000000 576.333801 848.333618 651.666382 797.000000 711.000000 C 745.666382 769.000305 679.000427 798.000000 597.000000 798.000000 C 519.666260 798.000000 455.000275 768.666931 403.000000 710.000000 C 351.666412 650.666382 326.000000 577.333740 326.000000 490.000000 Z M 1228.000000 0.000000 " horiz-adv-x="1228"/>
<glyph unicode="o" d="M 96.000000 494.000000 C 96.000000 634.667358 146.332825 754.332825 247.000000 853.000000 C 347.667175 951.667175 470.332611 1001.000000 615.000000 1001.000000 C 760.334045 1001.000000 883.666138 951.333801 985.000000 852.000000 C 1085.000488 752.666199 1135.000000 630.667419 1135.000000 486.000000 C 1135.000000 339.999268 1084.667114 217.667160 984.000000 119.000000 C 882.666138 20.999510 758.334045 -28.000000 611.000000 -28.000000 C 464.999268 -28.000000 342.667145 21.999500 244.000000 122.000000 C 145.332840 220.667160 96.000000 344.665924 96.000000 494.000000 Z M 326.000000 490.000000 C 326.000000 392.666168 351.999725 315.666962 404.000000 259.000000 C 457.333588 201.666382 527.666260 173.000000 615.000000 173.000000 C 703.000427 173.000000 773.333069 201.333054 826.000000 258.000000 C 878.666931 314.666962 905.000000 390.332855 905.000000 485.000000 C 905.000000 579.667114 878.666931 655.333069 826.000000 712.000000 C 772.666382 769.333618 702.333740 798.000000 615.000000 798.000000 C 528.999573 798.000000 459.333588 769.333618 406.000000 712.000000 C 352.666412 654.666382 326.000000 580.667114 326.000000 490.000000 Z M 1231.000000 0.000000 " horiz-adv-x="1231"/>
<glyph unicode=" " d="M 632.000000 0.000000 " horiz-adv-x="632"/>
</font>
<!-- Same as TestFont1, but with one additional glyph -->
<font id="TestFont3">
<font-face font-family="TestFont3" font-weight="normal" font-style="normal" font-variant="normal" font-stretch="normal" units-per-em="2048.000000" x-height="987.500000" cap-height="1558.500000" ascent="2127.000000" descent="532.000000"/>
<missing-glyph d="M 0.000000 0.000000 L 987.500000 0.000000 L 987.500000 1558.500000 L 0.000000 1558.500000 Z M 0.000000 0.000000 " horiz-adv-x="987.500000"/>
<glyph unicode="a" d="M 860.000000 974.000000 L 1086.000000 974.000000 L 1086.000000 0.000000 L 860.000000 0.000000 L 860.000000 102.000000 C 767.332886 15.332900 667.667175 -28.000000 561.000000 -28.000000 C 426.332672 -28.000000 315.000427 20.666180 227.000000 118.000000 C 139.666229 217.333832 96.000000 341.332581 96.000000 490.000000 C 96.000000 636.000732 139.666229 757.666199 227.000000 855.000000 C 314.333771 952.333801 423.666016 1001.000000 555.000000 1001.000000 C 668.333923 1001.000000 769.999573 954.333801 860.000000 861.000000 Z M 326.000000 490.000000 C 326.000000 396.666199 350.999756 320.666962 401.000000 262.000000 C 452.333588 202.666367 516.999634 173.000000 595.000000 173.000000 C 678.333740 173.000000 745.666382 201.666382 797.000000 259.000000 C 848.333618 318.333618 874.000000 393.666199 874.000000 485.000000 C 874.000000 576.333801 848.333618 651.666382 797.000000 711.000000 C 745.666382 769.000305 679.000427 798.000000 597.000000 798.000000 C 519.666260 798.000000 455.000275 768.666931 403.000000 710.000000 C 351.666412 650.666382 326.000000 577.333740 326.000000 490.000000 Z M 1228.000000 0.000000 " horiz-adv-x="1228"/>
<glyph unicode="o" d="M 96.000000 494.000000 C 96.000000 634.667358 146.332825 754.332825 247.000000 853.000000 C 347.667175 951.667175 470.332611 1001.000000 615.000000 1001.000000 C 760.334045 1001.000000 883.666138 951.333801 985.000000 852.000000 C 1085.000488 752.666199 1135.000000 630.667419 1135.000000 486.000000 C 1135.000000 339.999268 1084.667114 217.667160 984.000000 119.000000 C 882.666138 20.999510 758.334045 -28.000000 611.000000 -28.000000 C 464.999268 -28.000000 342.667145 21.999500 244.000000 122.000000 C 145.332840 220.667160 96.000000 344.665924 96.000000 494.000000 Z M 326.000000 490.000000 C 326.000000 392.666168 351.999725 315.666962 404.000000 259.000000 C 457.333588 201.666382 527.666260 173.000000 615.000000 173.000000 C 703.000427 173.000000 773.333069 201.333054 826.000000 258.000000 C 878.666931 314.666962 905.000000 390.332855 905.000000 485.000000 C 905.000000 579.667114 878.666931 655.333069 826.000000 712.000000 C 772.666382 769.333618 702.333740 798.000000 615.000000 798.000000 C 528.999573 798.000000 459.333588 769.333618 406.000000 712.000000 C 352.666412 654.666382 326.000000 580.667114 326.000000 490.000000 Z M 1231.000000 0.000000 " horiz-adv-x="1231"/>
<glyph unicode=" " d="M 632.000000 0.000000 " horiz-adv-x="632"/>
</font>
</defs>
</svg>
<!-- Both rows should look identical -->
<p>
<!-- Should render as 'a <stroked_box> o' -->
<span style='font-size: 40px; '>a &#xbe2; o</span><br/>
<span style='font-family: NotExistant; font-size: 40px; '>a &#xbe2; o</span>
</p>
<hr/>
<!-- Should render as 'a <filled_box> o' using the SVG Font -->
<p>
<span style='font-family: TestFont1; font-size: 40px; '>a &#xbe2; o</span><br/>
</p>
<hr/>
<!-- Both rows should look identical -->
<p>
<!-- 'a', ' ', 'o' from TestFont3, '&#xbe2;' rendered using <missing-glyph> -->
<span style='font-family: TestFont3; font-size: 40px; '>a &#xbe2; o</span><br/>
<!-- 'a', ' ' from TestFont1, 'o' from TestFont2, '&#xbe2;' rendered using <missing-glyph> from TestFont1 -->
<span style='font-family: TestFont1, TestFont2; font-size: 40px; '>a &#xbe2; o</span>
</p>
<hr/>
<!-- Should render as 'a o' -->
<p>
<!-- 'a', ' ', 'o' from TestFont2, '&#xbe2;' can't be rendered, as none of the default fonts defines it -->
<span style='font-family: TestFont2; font-size: 40px; '>a &#xbe2; o</span><br/>
</p>
<rdar://problem/10520670> REGRESSION (r91738): didFinishLoad is called before custom fonts have finished loading https://bugs.webkit.org/show_bug.cgi?id=73688 Reviewed by Darin Adler. Source/WebCore: The problem was that after CSSFontFaceSource::getFontData() had scheduled a 0-delay timer to begin loading the font, but before that timer fired, the subresource loader appeared to have had no resources waiting to be loaded, and therefore didFinishLoad could be called. This change reworks the fix for <http://webkit.org/b/65123> so that while the load is still started on a 0-dealy timer, the subresource loader’s request count is incremented immediately, preventing it from hitting 0 while the font load is scheduled to begin. The delayed load mechanism is moved from CSSFontFaceSource into CSSFontSelector in order to safely handle the possibility of the latter being decommissioned while waiting for font loading to begin. * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::CSSFontFaceSource): Removed initializer for m_loadStartTimer. (WebCore::CSSFontFaceSource::~CSSFontFaceSource): Removed stopping of m_loadStartTimer. (WebCore::CSSFontFaceSource::getFontData): Replaced code to schedule loading on a timer with a call to CSSFontSelector::beginLoadingFontSoon. * css/CSSFontFaceSource.h: Removed m_loadStartTimer and m_fontSelector member variables. * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::CSSFontSelector): Added initialized for m_beginLoadingTimer. (WebCore::CSSFontSelector::~CSSFontSelector): Added call to clearDocument(), to deal with anything remaining in m_fontsToBeginLoading at this time. (WebCore::CSSFontSelector::clearDocument): Now stops m_beginLoadingTimer and balances incrementRequestCount() calls for anything remaining in m_fontsToBeginLoading. (WebCore::CSSFontSelector::beginLoadingFontSoon): Added. Schedules the actual call to CachedFont::beginLoadingIfNeeded on a 0-delay timer, and meanwhile increments the request count on the CachedResourceLoader, which ensures that didFinishLoad will not be called while waiting for the timer to fire. (WebCore::CSSFontSelector::beginLoadTimerFired): Added. Actually calls CachedFont::beginLoadIfNeeded and balances the incrementRequestCount() made when the timer was scheduled. * css/CSSFontSelector.h: LayoutTests: Reverted test chnages from r91738. These tests were made to wait for the fonts to finish loading using a DOM. Now again they do not need to. * fast/css/color-leakage.html: * fast/css/custom-font-xheight.html: * fast/css/font-face-multiple-faces.html: * fast/css/font-face-multiple-remote-sources.html: * fast/css/font-face-remote.html: * fast/css/font-face-woff.html: * fast/writing-mode/broken-ideograph-small-caps.html: * svg/W3C-SVG-1.1-SE/text-intro-09-b.svg: * svg/W3C-SVG-1.1/fonts-elem-07-b.svg: * svg/custom/svg-fonts-fallback.xhtml: * svg/custom/svg-fonts-in-html.html: * svg/custom/svg-fonts-segmented.xhtml: * svg/custom/svg-fonts-with-no-element-reference.html: * svg/custom/svg-fonts-without-missing-glyph.xhtml: * svg/text/text-overflow-ellipsis-svgfont.html: Canonical link: https://commits.webkit.org/90329@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-12-02 22:49:53 +00:00
2011-06-24 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Rob Buis. Integrate SVG Fonts within GlyphPage concept, removing the special SVG code paths from Font, making it possible to reuse the simple text code path for SVG Fonts https://bugs.webkit.org/show_bug.cgi?id=59085 font substitution doesn't work for HTML text using SVG fonts https://bugs.webkit.org/show_bug.cgi?id=17608 Selection rects are wrong for text with SVG fonts https://bugs.webkit.org/show_bug.cgi?id=25460 With @font-face, SVG fonts only work as primary, non-segmented https://bugs.webkit.org/show_bug.cgi?id=32227 When using SVG fonts with @font-face word-spacing and text-align: justify are not being honored https://bugs.webkit.org/show_bug.cgi?id=34236 SVG @font-face breaks text-overflow: ellipsis https://bugs.webkit.org/show_bug.cgi?id=36840 REGRESSION: SVG Font selection problems https://bugs.webkit.org/show_bug.cgi?id=41934 Rewrite the SVG Fonts support to fully integrate within the GlyphPage concept and the "simple" code path used to render platform fonts. That means the special logic for measuring text using SVG Fonts, calculating offset for positions, computing selection rects etc. is all gone now. There's no difference anymore between using a native font or a SVG Font, in terms of these operations. Update SVG pixel test baseline. Use all results that have been checked in when I landed the patch the last time. * platform/chromium/test_expectations.txt: * platform/mac/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.png: * platform/mac/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.png: * platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/fonts-glyph-04-t-expected.png: * platform/mac/svg/W3C-SVG-1.1/fonts-glyph-04-t-expected.txt: * platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.png: * platform/mac/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.txt: * platform/mac/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.png: * platform/mac/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.txt: * platform/mac/svg/batik/text/textEffect-expected.png: * platform/mac/svg/batik/text/textEffect-expected.txt: * platform/mac/svg/batik/text/textEffect3-expected.png: * platform/mac/svg/batik/text/textEffect3-expected.txt: * platform/mac/svg/batik/text/xmlSpace-expected.png: * platform/mac/svg/batik/text/xmlSpace-expected.txt: * platform/mac/svg/custom/glyph-selection-lang-attribute-expected.png: * platform/mac/svg/custom/glyph-selection-lang-attribute-expected.txt: * platform/mac/svg/custom/svg-fonts-fallback-expected.png: Added. * platform/mac/svg/custom/svg-fonts-fallback-expected.txt: Added. * platform/mac/svg/custom/svg-fonts-segmented-expected.png: Added. * platform/mac/svg/custom/svg-fonts-segmented-expected.txt: Added. * platform/mac/svg/custom/svg-fonts-with-no-element-reference-expected.png: * platform/mac/svg/custom/svg-fonts-with-no-element-reference-expected.txt: * platform/mac/svg/custom/svg-fonts-without-missing-glyph-expected.png: * platform/mac/svg/custom/svg-fonts-without-missing-glyph-expected.txt: * platform/mac/svg/custom/svg-fonts-word-spacing-expected.png: Added. * platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt: Added. * platform/mac/svg/dynamic-updates/SVGFEConvolveMatrixElement-dom-preserveAlpha-attr-expected.png: * platform/mac/svg/dynamic-updates/SVGFEConvolveMatrixElement-svgdom-preserveAlpha-prop-expected.png: * platform/mac/svg/foreignObject/text-tref-02-b-expected.png: * platform/mac/svg/foreignObject/text-tref-02-b-expected.txt: * platform/mac/svg/text/text-altglyph-01-b-expected.png: * platform/mac/svg/text/text-altglyph-01-b-expected.txt: * platform/mac/svg/text/text-overflow-ellipsis-svgfont-expected.png: Added. * platform/mac/svg/text/text-overflow-ellipsis-svgfont-expected.txt: Added. * platform/mac/svg/text/text-text-04-t-expected.png: * platform/mac/svg/text/text-text-04-t-expected.txt: * platform/mac/svg/text/text-text-05-t-expected.png: * platform/mac/svg/text/text-text-05-t-expected.txt: * platform/mac/svg/text/text-text-06-t-expected.png: * platform/mac/svg/text/text-text-06-t-expected.txt: * platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.png: * platform/mac/svg/transforms/text-with-mask-with-svg-transform-expected.txt: * platform/mac/svg/wicd/test-rightsizing-b-expected.png: * platform/mac/svg/wicd/test-rightsizing-b-expected.txt: * platform/qt-mac/Skipped: * platform/qt-wk2/Skipped: * platform/qt-wk2/fast/dom/Window/window-properties-expected.txt: * platform/qt-wk2/fast/dom/Window/window-property-descriptors-expected.txt: * platform/qt-wk2/fast/dom/prototype-inheritance-2-expected.txt: * platform/qt/Skipped: * platform/qt/fast/dom/Window/window-properties-expected.png: Added. * platform/qt/fast/dom/Window/window-properties-expected.txt: * platform/qt/fast/dom/Window/window-property-descriptors-expected.png: Added. * platform/qt/fast/dom/Window/window-property-descriptors-expected.txt: * platform/qt/fast/dom/prototype-inheritance-2-expected.png: Added. * platform/qt/fast/dom/prototype-inheritance-2-expected.txt: * platform/qt/fast/dom/prototype-inheritance-expected.png: Added. * platform/qt/fast/dom/prototype-inheritance-expected.txt: * platform/qt/fast/js/global-constructors-expected.png: Added. * platform/qt/fast/js/global-constructors-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-01-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-01-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-03-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-03-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-04-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/coords-dom-04-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/filters-image-03-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/filters-image-03-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-grad-17-b-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-grad-17-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-grad-20-b-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-grad-20-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-pattern-03-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-pattern-03-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-pattern-04-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/pservers-pattern-04-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-01-b-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-01-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-02-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-02-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-03-b-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-03-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-04-b-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-04-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.png: * platform/qt/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png: * platform/qt/svg/W3C-SVG-1.1/filters-turb-02-f-expected.txt: * platform/qt/svg/W3C-SVG-1.1/render-elems-06-t-expected.png: * platform/qt/svg/W3C-SVG-1.1/render-elems-06-t-expected.txt: * platform/qt/svg/W3C-SVG-1.1/render-elems-07-t-expected.png: * platform/qt/svg/W3C-SVG-1.1/render-elems-07-t-expected.txt: * platform/qt/svg/W3C-SVG-1.1/render-elems-08-t-expected.png: * platform/qt/svg/W3C-SVG-1.1/render-elems-08-t-expected.txt: * platform/qt/svg/W3C-SVG-1.1/render-groups-01-b-expected.png: * platform/qt/svg/W3C-SVG-1.1/render-groups-01-b-expected.txt: * platform/qt/svg/W3C-SVG-1.1/render-groups-03-t-expected.png: * platform/qt/svg/W3C-SVG-1.1/render-groups-03-t-expected.txt: * platform/qt/svg/custom/glyph-transformation-with-hkern-expected.png: Added. * platform/qt/svg/custom/glyph-transformation-with-hkern-expected.txt: Added. * platform/qt/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.png: * platform/qt/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.txt: * platform/qt/svg/custom/svg-features-expected.png: Added. * platform/qt/svg/custom/svg-features-expected.txt: Added. * platform/qt/svg/custom/svg-fonts-in-html-expected.png: * platform/qt/svg/custom/svg-fonts-in-html-expected.txt: * platform/qt/svg/foreignObject/text-tref-02-b-expected.png: * platform/qt/svg/foreignObject/text-tref-02-b-expected.txt: * platform/qt/svg/transforms/text-with-mask-with-svg-transform-expected.png: * platform/qt/svg/transforms/text-with-mask-with-svg-transform-expected.txt: * platform/qt/svg/wicd/test-rightsizing-b-expected.png: * platform/qt/svg/wicd/test-rightsizing-b-expected.txt: * svg/custom/resources/ABCFont.svg: * svg/custom/svg-fonts-fallback.xhtml: Added. * svg/custom/svg-fonts-segmented.xhtml: Added. * svg/custom/svg-fonts-word-spacing.html: Added. * svg/text/select-text-svgfont-expected.txt: Added. * svg/text/select-text-svgfont.html: Added. * svg/text/text-overflow-ellipsis-svgfont.html: Added. 2011-06-24 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Rob Buis. Integrate SVG Fonts within GlyphPage concept, removing the special SVG code paths from Font, making it possible to reuse the simple text code path for SVG Fonts https://bugs.webkit.org/show_bug.cgi?id=59085 * wtf/Platform.h: Force Qt-EWS into a full rebuild, otherwhise this patch breaks the EWS. 2011-06-24 Nikolas Zimmermann <nzimmermann@rim.com> Reviewed by Rob Buis. Integrate SVG Fonts within GlyphPage concept, removing the special SVG code paths from Font, making it possible to reuse the simple text code path for SVG Fonts https://bugs.webkit.org/show_bug.cgi?id=59085 font substitution doesn't work for HTML text using SVG fonts https://bugs.webkit.org/show_bug.cgi?id=17608 Selection rects are wrong for text with SVG fonts https://bugs.webkit.org/show_bug.cgi?id=25460 With @font-face, SVG fonts only work as primary, non-segmented https://bugs.webkit.org/show_bug.cgi?id=32227 When using SVG fonts with @font-face word-spacing and text-align: justify are not being honored https://bugs.webkit.org/show_bug.cgi?id=34236 SVG @font-face breaks text-overflow: ellipsis https://bugs.webkit.org/show_bug.cgi?id=36840 REGRESSION: SVG Font selection problems https://bugs.webkit.org/show_bug.cgi?id=41934 Tests: svg/custom/svg-fonts-fallback.xhtml (for bug 17608, extended the original test from Mark Ambachtsheer) svg/custom/svg-fonts-segmented.xhtml (for bug 32227) svg/custom/svg-fonts-word-spacing.html (for bug 34236, from Michael Lewis) svg/text/select-text-svgfont.html (for bug 25460/41934, from Emil Schutte) svg/text/text-overflow-ellipsis-svgfont.html (for 36840, from Emil Schutte) Rewrite the SVG Fonts support to fully integrate within the GlyphPage concept and the "simple" code path used to render platform fonts. That means the special logic for measuring text using SVG Fonts, calculating offset for positions, computing selection rects etc. is all gone now. There's no difference anymore between using a native font or a SVG Font, in terms of these operations. This makes text selection using SVG Fonts possible again. * features.pri: Temporarily turn of SVG Fonts for Qt, as long as QRawFont support is not available and the fast path is disabled. * page/DOMWindow.idl: Touched file to force Qt regenerating the bindings. * platform/graphics/Font.cpp: Remove SVG Font special cases, the simple code path now handles SVG Fonts as well. (WebCore::Font::drawText): (WebCore::Font::drawEmphasisMarks): (WebCore::Font::width): (WebCore::Font::selectionRectForText): (WebCore::Font::offsetForPosition): (WebCore::Font::codePath): * platform/graphics/Font.h: Pass TextRun to drawGlyphBuffer/drawEmphasisMarks. Add new glyphDataAndPageForCharacter() method which returns a pair std::pair<GlyphData, GlyphPage*>, so we know the associated GlyphPage for a certain GlyphData object, which is needed to properly handle font fallback glyph matching for SVG Fonts.. (WebCore::Font::fontList): Add FontFallbackList accessor. * platform/graphics/FontFallbackList.h: Add getters/setters for glyphPageZero -- SVG Fonts support needs access to these objects from SVGTextRunRenderingContext. (WebCore::FontFallbackList::glyphPageZero): (WebCore::FontFallbackList::glyphPages): (WebCore::FontFallbackList::setGlyphPageZero): (WebCore::FontFallbackList::setGlyphPages): * platform/graphics/FontFastPath.cpp: (WebCore::Font::glyphDataForCharacter): Move implementation to glyphDataAndPageForCharacter(), and use that method from here. (WebCore::Font::glyphDataAndPageForCharacter): Does the same as before, just returns an additional GlyphPage* pointer. (WebCore::Font::getEmphasisMarkGlyphData): Remove SVG Fonts special case. (WebCore::Font::drawGlyphBuffer): Ditto. * platform/graphics/FontMetrics.h: (WebCore::scaleEmToUnits): Refactored scaleEmToUnits free function from SimpleFontDataMac/CGWin to share with SVGFontData/SVGTextRunRenderingContext. * platform/graphics/GlyphPageTreeNode.cpp: (WebCore::fill): Stop skipping SVG Fonts, they now also fill the GlyphPage using the glyphs defined in the SVG Font. * platform/graphics/SVGGlyph.h: s/isValid/isPartOfLigature/. Its usage has been changed. (WebCore::SVGGlyph::SVGGlyph): (WebCore::SVGGlyph::operator==): * platform/graphics/SimpleFontData.cpp: Change font size to be a float, not an int. (WebCore::SimpleFontData::SimpleFontData): * platform/graphics/SimpleFontData.h: Add new pure virtual methods to the AdditionalFontData interface, to be implemented in SVGFontData. (WebCore::SimpleFontData::widthForGlyph): Call widthForSVGGlyph, if we encounter a SVG glyph. * platform/graphics/TextRun.h: * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::glyphDataForCharacter): (WebCore::WidthIterator::advance): * platform/graphics/WidthIterator.h: Store several new members needed for SVG Fonts support (last processed glyph name used for kerning pair lookup) and a map mapping each character of a text to its arabic-form (if needed, to perform SVG glyph selection for Arabic text). (WebCore::WidthIterator::run): (WebCore::WidthIterator::runWidthSoFar): (WebCore::WidthIterator::lastGlyphName): (WebCore::WidthIterator::setLastGlyphName): (WebCore::WidthIterator::arabicForms): * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp: Use new scaleEmToUnits free function from FontMetrics.h. * platform/graphics/mac/SimpleFontDataMac.mm: Ditto. * platform/graphics/win/SimpleFontDataCGWin.cpp: Ditto. * rendering/svg/SVGTextLayoutAttributesBuilder.cpp: (WebCore::SVGTextLayoutAttributesBuilder::propagateLayoutAttributes): Handle UTF-16 surrogate pairs correctly, fixes the previous Acid3 regression. * rendering/svg/SVGTextMetrics.cpp: (WebCore::SVGTextMetrics::SVGTextMetrics): (WebCore::constructTextRun): (WebCore::SVGTextMetrics::measureCharacterRange): * rendering/svg/SVGTextMetrics.h: * rendering/svg/SVGTextRunRenderingContext.cpp: Remove drawTextUsingSVGFont/floatWidthUsingSVGFont/selectionRectForTextUsingSVGFont/offsetForPositionForTextUsingSVGFont. (WebCore::firstParentRendererForNonTextNode): Don't assert node() exists, doesn't hold true for generated render objects. (WebCore::renderObjectFromRun): Renamed from referencingRenderObjectFromRun. (WebCore::SVGTextRunRenderingContext::floatWidthUsingSVGFont): Remove extra "extraCharsAvailable" parameter, now solves via TextRun::charactersLength(). (WebCore::calculateEmUnitToPixelScaleFactor): Add helper method. (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs): Main drawing method, this actually creates/renders Paths. (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter): Part 1/2 of SVG Glyph selection code. * rendering/svg/SVGTextRunRenderingContext.h: * svg/SVGAltGlyphElement.cpp: (WebCore::SVGAltGlyphElement::hasValidGlyphElement): * svg/SVGAltGlyphElement.h: * svg/SVGFontData.cpp: (WebCore::SVGFontData::initializeFontData): Changed font size from int to float. (WebCore::SVGFontData::widthForSVGGlyph): Lookup a SVGGlyph from a Glyph using the glyph table in SVGFontElement and calculate its width. (WebCore::SVGFontData::applySVGGlyphSelection): Part 2/2 of SVG Glyph selection code. (WebCore::SVGFontData::fillSVGGlyphPage): Fill GlyphPage using glyphs defined in the SVG Font. (WebCore::SVGFontData::fillBMPGlyphs): Moved from the previous fillSVGGlyphPage implementation. (WebCore::SVGFontData::fillNonBMPGlyphs): Add non-bmp glyph handling, fixing the Acid3 regression (support using SVGGlyphs for UTF-16 surrogate pairs). * svg/SVGFontData.h: * svg/SVGFontElement.cpp: (WebCore::SVGFontElement::registerLigaturesInGlyphCache): Enable ligature registration for the use within GlyphPage. (WebCore::SVGFontElement::ensureGlyphCache): * svg/SVGGlyphMap.h: Switch to use SurrogatePairTextIterator, and switch glyph table from UChar to UChar32, just like GlyphPage, to handle glyphs from non-BMP correctly. (WebCore::SVGGlyphMap::addGlyph): Remove setting isValid, it's not needed anymore and gone. (WebCore::SVGGlyphMap::collectGlyphsForString): * svg/svgtags.in: Surround vkern in ENABLE_SVG_FONTS block. Canonical link: https://commits.webkit.org/79028@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-06-25 06:28:12 +00:00
</body>
</html>