Comment 20 for bug 172133

Revision history for this message
David Mathog (mathog) wrote :

Re: 19

Overline height is my mistake. Setting the draw for overline at the top of the ascender was too high. I was lowering the bottom until it looked right, but forgot to lower the top too. If you want to temporarily fix yours change drawing-text.cpp line 178 from

            Geom::Point(0.0, tsp_asc_adj -_nrstyle.underline_position),

to

            Geom::Point(0.0, tsp_asc_adj -_nrstyle.underline_position + 1 * _nrstyle.underline_thickness);

This position is not specified by any font, or at least not in a way that Freetype2 can return it, so we have to punt.

The thickness is read from the font. If the font specifies really thin, that's what we get. If the font is corrupt and specifies something ridiculous, we get that too. An alternative would be to make the width something like (ascender + descender)/20, or use values like that to set upper and lower limits for line thickness.

Agreed that parts of this code are not very solid. I need to run it in valgrind, some of this may be due to uninitialized variables, which it might catch. Unfortunately that is not an option on WIndows, and it is much less well behaved there than on Linux.

Just obtained some Hebrew SVG's to test this section, odds are R->L text will have the line drawn in completely the wrong place now. (Hebrew does not work very well in Inkscape in any case, the problem is not the pure R->L parts, but the embedded L-R sections, for instance, number strings. Some of those sections it is really hard to even select the text you want to change, the cursor dances around like it has a mind of its own. Unadulterated Hebrew also blows up parts of my EMF output code pretty severely, for instance, the first character, which should be all the way at the right end of a text fragment, ends up drawn all the way at the left!)