From: Mikko Rasa Date: Fri, 22 Jul 2016 19:00:48 +0000 (+0300) Subject: Use cap height instead of ascent for midline alignment X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=9f04e2425664d6600f430a0af89f8d9d50767998 Use cap height instead of ascent for midline alignment --- diff --git a/source/text.cpp b/source/text.cpp index e3a85400..03421f54 100644 --- a/source/text.cpp +++ b/source/text.cpp @@ -61,7 +61,7 @@ void Text::set_alignment(HorizontalAlign ha, VerticalAlign va) { case DESCENT: v = -font.get_descent(); break; case BASELINE: v = 0.0f; break; - case MIDLINE: v = font.get_ascent()/2; break; // XXX Midline should be cap height / 2 + case MIDLINE: v = font.get_cap_height()/2; break; case ASCENT: v = font.get_ascent(); break; default: throw invalid_argument("Text::set_alignment"); }