Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /svg/text/reftests/textLength-list-x-spacingAndGlyphs.svg - WPT Dashboard Interop Dashboard
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" viewBox="0 0 400 100"
class="reftest-wait"
onload="document.fonts.ready.then(function() { document.documentElement.classList.remove('reftest-wait'); })">
<metadata>
<title>textLength with lengthAdjust=spacingAndGlyphs applies across all glyphs of the element when x is a list of values</title>
<h:link rel="match" href="textLength-list-x-spacingAndGlyphs-ref.svg"/>
<h:link rel="stylesheet" type="text/css" href="/fonts/ahem.css"/>
</metadata>
<!-- Same as the y-list case but with x supplied per glyph. The explicit x
values match the natural advance positions for 50px Ahem ("X" = 50 units
wide), so visual positioning without textLength would be identical to
the reference. What differs is chunk-formation: WebKit starts a new chunk
at each explicit x, giving 12 chunks. textLength must still apply
element-wide; the reference below uses a single-value x (one chunk). -->
<text x="0 50 100 150 200 250 300 350 400 450 500 550" y="80"
font-family="Ahem" font-size="50"
textLength="400" lengthAdjust="spacingAndGlyphs"
fill="black">XXXXXXXXXXXX</text>
</svg>