
On Wed, 2013-03-13 at 13:50 -0700, mathog wrote:
There have been user requests for underline (a text decoration) going back years and years. Since it has not shown up I assume this means that some library Inkscape depends on cannot do this. I checked the most obvious suspects and did not find a definitive smoking gun:
- Freetype does support underlining (both location and
thickness). http://www.cs.sunysb.edu/documentation/freetype-2.1.9/docs/tutorial/step2.ht...
- SVG supports it with "text-decoration:underline".
3 Pango supports it: https://developer.gnome.org/pango/stable/PangoMarkupFormat.html
- Cairo - not sure. (Maybe this is the guilty party?)
So, is there a document somewhere which explains why Inkscape cannot underline? I looked for a while but all Google turned up were lots of threads about how Inkscape does not have underline, but not _why_ it does not.
I looked at this a couple of years ago. I don't remember the details, but I seem to recall that the code isn't structured very well to add the underlining. There was a GSOC project last summer that would have made it easier to add new features to text but it wasn't successful. SVG text decoration isn't the simplest thing in the world, see the example in the spec:
http://www.w3.org/TR/SVG/text.html#TextDecorationProperties
I don't think it is a library problem. Freetype gives the position of the underline (but doesn't draw it). SVG gives the rules of how to fill and stroke an underline. We don't use Pango markup for rendering on the canvas (it is more for marking up text in widgets and it doesn't handle strokes). We probably need to draw the underlines ourselves.
Note, Firefox also doesn't support text decoration. Chrome does but with some stroke artifacts (where ever the styling on the main text changes). Only Batik seems to do it right.
Tav
PS. Patches welcomed.