Bug 1074735 pt 1 - Use more sensible values for underline and strikeout position in vertical font metrics. r=smontagu
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -3426,21 +3426,20 @@ gfxFont::CreateVerticalMetrics()
// come up with for aveCharWidth.
metrics->maxAdvance = std::max(metrics->maxAdvance, metrics->aveCharWidth);
// Thickness of underline and strikeout may have been read from tables,
// but in case they were not present, ensure a minimum of 1 pixel.
// We synthesize our own positions, as font metrics don't provide these
// for vertical layout.
metrics->underlineSize = std::max(1.0, metrics->underlineSize);
- metrics->underlineOffset = 0; // XXX to be adjusted
+ metrics->underlineOffset = - metrics->maxDescent - metrics->underlineSize;
metrics->strikeoutSize = std::max(1.0, metrics->strikeoutSize);
- metrics->strikeoutOffset =
- metrics->maxDescent - 0.5 * metrics->strikeoutSize;
+ metrics->strikeoutOffset = - 0.5 * metrics->strikeoutSize;
// Somewhat arbitrary values for now, subject to future refinement...
metrics->spaceWidth = metrics->aveCharWidth;
metrics->zeroOrAveCharWidth = metrics->aveCharWidth;
metrics->maxHeight = metrics->maxAscent + metrics->maxDescent;
metrics->xHeight = metrics->emHeight / 2;
return metrics;