]> git.neil.brown.name Git - edlib.git/commitdiff
minor change to xcb drawing and scaling
authorNeilBrown <neil@brown.name>
Wed, 2 Aug 2023 21:10:31 +0000 (07:10 +1000)
committerNeilBrown <neil@brown.name>
Wed, 2 Aug 2023 22:09:50 +0000 (08:09 +1000)
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 <neil@brown.name>
display-x11-xcb.c
lib-tile.c

index a82dfdb3811ea00434e37202eed695145592f327..4cf2aa11acf0c94830f9d8e2f5aa84e537abc7f8 100644 (file)
@@ -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);
index b1d6f63f4a442096b9cf3e9dfb9194c7fa924898..d402350d7c5827bea4c55f663006cba417cf6ac7 100644 (file)
@@ -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;
        }