Kozea/WeasyPrint — pull request #89 by ariofrio (2013-05-17 17:08:05+00:00)
Title: Position and size text decorations with font metrics

[The spec][] asks that overlines be drawn aligned "with respect to the highest over EM-box edge" of the text. I don't know what that means, but I looked at [Firefox]'s and [Chrome]'s source code, and they use ascent of the font. Now we do too.

[the spec]: http://dev.w3.org/csswg/css-text-decor-3/#line-position
[firefox]: http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsTextFrameThebes.cpp?rev=747173e387c9#5915
[chrome]: https://github.com/WebKit/webkit/blob/bd7748145a239da220a6fe6bb4b2898d65977be8/Source/WebCore/rendering/InlineTextBox.cpp#L1144

I took the opportunity to let Pango tell us where to place the underline and the strikethrough.

Finally, I made the decoration line width proportional to the font size, with a factor of 18. This roughly simulates Firefox's behavior on my computer, since I couldn't find the relevant code.