From eb506f62431adf9d89221d5ee8234f0e85eecf6f Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 3 Aug 2023 07:10:31 +1000 Subject: [PATCH] minor change to xcb drawing and scaling 1/ ask for "monospace", not "mono" 2/ default to 12 point 3/ scale up and down by same ratio. use 1.2 like others 4/ fix font_description size calc, which was weird. Signed-off-by: NeilBrown --- display-x11-xcb.c | 8 ++++---- lib-tile.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/display-x11-xcb.c b/display-x11-xcb.c index a82dfdb3..4cf2aa11 100644 --- a/display-x11-xcb.c +++ b/display-x11-xcb.c @@ -336,7 +336,7 @@ static void parse_attrs( char *fg = NULL, *bg = NULL; bool ul = False; bool inv = False; - int size = 10*1000; + int size = 12*1000; PangoFontDescription *fd = NULL; PangoStyle style = PANGO_STYLE_NORMAL; PangoVariant variant = PANGO_VARIANT_NORMAL; @@ -345,7 +345,7 @@ static void parse_attrs( if (fdp) { fd = pango_font_description_new(); *fdp = fd; - pango_font_description_set_family_static(fd, "mono"); + pango_font_description_set_family_static(fd, "monospace"); } while ((word = strsep(&ap, ",")) != NULL) { @@ -415,7 +415,7 @@ static void parse_attrs( } else if (bgp) bgp->g = -1; if (fd) { - pango_font_description_set_size(fd, size * scale / PANGO_SCALE); + pango_font_description_set_size(fd, PANGO_SCALE * size /1000 * scale / 1000); if (style != PANGO_STYLE_NORMAL) pango_font_description_set_style(fd, style); if (variant != PANGO_VARIANT_NORMAL) @@ -1839,7 +1839,7 @@ static struct pane *xcb_display_init(const char *d safe, if (!fd) goto abort; xd->fd = fd; - pango_font_description_set_family(xd->fd, "mono"); + pango_font_description_set_family(xd->fd, "monospace"); pango_font_description_set_size(xd->fd, 12 * PANGO_SCALE); layout = pango_cairo_create_layout(xd->cairo); diff --git a/lib-tile.c b/lib-tile.c index b1d6f63f..d402350d 100644 --- a/lib-tile.c +++ b/lib-tile.c @@ -873,11 +873,11 @@ DEF_CMD(tile_window_scale_relative) if (rpt > 10) rpt = 10; if (rpt < -10) rpt = -10; while (rpt > 0) { - scale = scale * 11/10; + scale = scale * 12/10; rpt -= 1; } while (rpt < 0) { - scale = scale * 9 / 10; + scale = scale * 10/ 12; rpt += 1; } -- 2.39.5