[vte] draw: Align the baseline across font styles



commit 83f98691b4b929537a6b33279f2b932de0512a5d
Author: Egmont Koblinger <egmont gmail com>
Date:   Fri Jun 28 10:19:19 2019 +0200

    draw: Align the baseline across font styles
    
    https://gitlab.gnome.org/GNOME/vte/issues/137

 src/vtedraw.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/vtedraw.cc b/src/vtedraw.cc
index 215e27ee..83396706 100644
--- a/src/vtedraw.cc
+++ b/src/vtedraw.cc
@@ -1493,7 +1493,9 @@ _vte_draw_text_internal (struct _vte_draw *draw,
 
                 _vte_draw_get_char_edges(draw, c, requests[i].columns, style, &x, NULL);
                 x += requests[i].x;
-                y = requests[i].y + draw->char_spacing.top + font->ascent;
+                /* Bold/italic versions might have different ascents. In order to align their
+                 * baselines, we offset by the normal font's ascent here. (Bug 137.) */
+                y = requests[i].y + draw->char_spacing.top + draw->fonts[VTE_DRAW_NORMAL]->ascent;
 
                 if (_vte_draw_unichar_is_local_graphic(c)) {
                         _vte_draw_terminal_draw_graphic(draw, c, color,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]