- From: therahedwig via GitHub <sysbot+gh@w3.org>
- Date: Sun, 30 Oct 2022 13:48:13 +0000
- To: public-svg-issues@w3.org
I managed to find a satisfying solution, though it does involve computing my own text-decorations. ![image](https://user-images.githubusercontent.com/1759191/198881365-b8f88831-a23c-4f81-b8b5-9880debd8a62.png) - Before the textPath algorithm is applied to the text, create a recursive function that accepts a textPath. - in that function, first calculate the children, pass down the textPath if you have one on the current node, otherwise pass down null. - Then (if a text-decoration needs to be created), proceed to create decoration boxes for each text chunk by encapsulating the bounding boxes of all paths that are part of that text chunk. - Now, for a simple straight line while a textPath is present, you could do one of the following: - Proper solution would be to create a bezier curve that's a subsection of the textPath that corresponds to the width and offset of the decoration box, and use the offset as necessary for underline, overline and line-through. - Simpler solution is to create a polyline with very small segments (I am using 4*underline stroke width), and then use the positioning algorithm as used to position text on path to adjust this polyline to fit the path. - Take this path and use it to create a stroke with the font-metrics associated with the current span. - Cache the resulting path somewhere while letting the text layout algorithm finish. Then when painting, use the paint order described in text-decor (so, underline, overline, glyphs, line-through). -- GitHub Notification of comment by therahedwig Please view or discuss this issue at https://github.com/w3c/svgwg/issues/883#issuecomment-1296263221 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Sunday, 30 October 2022 13:48:15 UTC