]> asedeno.scripts.mit.edu Git - PuTTY_svn.git/commitdiff
Improve shadow bold mode: set the default shadow bold offset to +1
authorSimon Tatham <anakin@pobox.com>
Sat, 2 Nov 2002 16:16:35 +0000 (16:16 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 2 Nov 2002 16:16:35 +0000 (16:16 +0000)
not -1 (it turns out _most_ X fonts prefer the former, though
irritatingly my favourite real X font used to prefer the latter
which was why I made the X version of my Font Of Choice do so too),
and also clip to the boundaries of the rectangle we should be
drawing text in. This still doesn't completely prevent display
corruption in the case where text drawn in one sweep is partially
overwritten in a future one, but gnome-terminal has this problem
too, and now we've got the right default SB offset _and_ offer the
opportunity to reconfigure it I think this is pretty good for now.

git-svn-id: http://svn.tartarus.org/sgt/putty@2184 cda61777-01e9-0310-a592-d414129be87e

settings.c
unix/pterm.1
unix/pterm.c

index bce2a62e9d9af1a905dbc852d9b46cc00cba4b7f..833a10d229e1bd5bd3cfed5d29b9941166f938cf 100644 (file)
@@ -626,7 +626,7 @@ void load_settings(char *section, int do_host, Config * cfg)
     gppi(sesskey, "LoginShell", 1, &cfg->login_shell);
     gppi(sesskey, "ScrollbarOnLeft", 0, &cfg->scrollbar_on_left);
     gpps(sesskey, "BoldFont", "", cfg->boldfont, sizeof(cfg->boldfont));
-    gppi(sesskey, "ShadowBoldOffset", -1, &cfg->shadowboldoffset);
+    gppi(sesskey, "ShadowBoldOffset", 1, &cfg->shadowboldoffset);
 
     close_settings_r(sesskey);
 }
index 8e55e9460c46f6d15c612bb8d103ed00cb3cbae4..6d9072505c4632c97edc446c9790260a39dd982b 100644 (file)
@@ -295,12 +295,13 @@ printing it twice at a one-pixel offset).
 .IP "\fBpterm.ShadowBoldOffset\fP"
 This resource can be set to an integer; the default is -1. It
 specifies the offset at which text is overprinted when using "shadow
-bold" mode. The default (-1) means that the text will be printed in
-the normal place, and also one character to the left; this seems to
+bold" mode. The default (1) means that the text will be printed in
+the normal place, and also one character to the right; this seems to
 work well for most X bitmap fonts, which have a blank line of pixels
-down the left-hand side. For some fonts, you may need to set this to
-+1, so that the text is overprinted one pixel to the right; for
-really large fonts, you may want to set it even higher.
+down the right-hand side. For some fonts, you may need to set this to
+-1, so that the text is overprinted one pixel to the left; for
+really large fonts, you may want to set it higher than 1 (in one
+direction or the other).
 .IP "\fBpterm.BoldAsColour\fP"
 This option should be set to either 0 or 1; the default is 1. It
 specifies the default state of auto wrap mode. When set to 1, bold
index 94b732de4c23c6417e398511a10870e501902a12..b1b98c1eb57e72df093979e3db34d1ae984bf12a 100644 (file)
@@ -1398,7 +1398,7 @@ void do_text_internal(Context ctx, int x, int y, char *text, int len,
     struct gui_data *inst = dctx->inst;
     GdkGC *gc = dctx->gc;
 
-    int nfg, nbg, t, fontid, shadow;
+    int nfg, nbg, t, fontid, shadow, rlen;
 
     /*
      * NYI:
@@ -1435,13 +1435,25 @@ void do_text_internal(Context ctx, int x, int y, char *text, int len,
            return;
        if (x + len*2 > inst->term->cols)
            len = (inst->term->cols-x)/2;    /* trim to LH half */
+       rlen = len * 2;
+    } else
+       rlen = len;
+
+    {
+       GdkRectangle r;
+
+       r.x = x*inst->font_width+cfg.window_border;
+       r.y = y*inst->font_height+cfg.window_border;
+       r.width = rlen*inst->font_width;
+       r.height = inst->font_height;
+       gdk_gc_set_clip_rectangle(gc, &r);
     }
 
     gdk_gc_set_foreground(gc, &inst->cols[nbg]);
     gdk_draw_rectangle(inst->pixmap, gc, 1,
                       x*inst->font_width+cfg.window_border,
                       y*inst->font_height+cfg.window_border,
-                      len*inst->font_width, inst->font_height);
+                      rlen*inst->font_width, inst->font_height);
 
     gdk_gc_set_foreground(gc, &inst->cols[nfg]);
     gdk_draw_text(inst->pixmap, inst->fonts[fontid], gc,