[svgwg] How are text-decoration and textPath supposed to interact? (#883)

therahedwig has just created a new issue for https://github.com/w3c/svgwg:

== How are text-decoration and textPath supposed to interact? ==
So, [SVG2](https://svgwg.org/svg2-draft/text.html#TextDecorationProperties) suggests we use the [CSS Text Decoration module](https://www.w3.org/TR/css-text-decor-3/) for the text-decoration keyword.

That module suggests that text-decoration is applied tree-wise. So...

``` xml
<text fill="blue" style="text-decoration:underline; font-family:A;">
  <tspan fill="red" style="text-decoration:underline; font-family:B;">Blah</tspan>
</text>
```
Will have a blue line drawn under a red "Blah", which uses the font-metrics of font 'A' for the underline width and offset.

However, how does this interact with textPath elements?

Right now, from what I can see, both Firefox and Chromium try to position the underline right underneath the related character. Inkscape doesn't draw it at all (and in the past it would be a straight underline under all the characters).

Firefox only draws the text decoration for nested characters as long as the fill isn't set as an attribute, and will always use the current character's fill for the associated text-decoration.

Chromium uses the fill of the point at which the text-decoration was declared, but then uses the font-metrics of the current character for the size of the text-decoration.

So that's three different approaches. It occurred to me that css-text-decor really isn't designed to consider textPath, given that it keeps talking about an 'decorating box' and SVG never suggests what to do with any kind of decorating box when using textPath. So what exactly is expected behaviour here?

Please view or discuss this issue at https://github.com/w3c/svgwg/issues/883 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 15 May 2022 11:06:09 UTC