Make the shadow bold offset configurable, after discovering that
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 17 Oct 2002 16:51:01 +0000 (16:51 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 17 Oct 2002 16:51:01 +0000 (16:51 +0000)
7x13 goes the other way to all other X fonts I've ever seen. (Arrgh.)

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

putty.h
settings.c
unix/pterm.1
unix/pterm.c

diff --git a/putty.h b/putty.h
index 9d00154..cbccef7 100644 (file)
--- a/putty.h
+++ b/putty.h
@@ -374,6 +374,7 @@ struct config_tag {
     int login_shell;
     int scrollbar_on_left;
     char boldfont[64];
+    int shadowboldoffset;
 };
 
 /*
index 0d7123a..71ae49e 100644 (file)
@@ -313,6 +313,7 @@ void save_settings(char *section, int do_host, Config * cfg)
     write_setting_i(sesskey, "LoginShell", cfg->login_shell);
     write_setting_i(sesskey, "ScrollbarOnLeft", cfg->scrollbar_on_left);
     write_setting_s(sesskey, "BoldFont", cfg->boldfont);
+    write_setting_i(sesskey, "ShadowBoldOffset", cfg->shadowboldoffset);
     close_settings_w(sesskey);
 }
 
@@ -609,6 +610,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);
 
     close_settings_r(sesskey);
 }
index 744ff6f..345fb76 100644 (file)
@@ -270,6 +270,15 @@ This resource is the same as the \fI-fb\fP command-line option: it
 controls the font used to display bold text when \fIBoldAsColour\fP
 is turned off. The default is unset (the font will be bolded by
 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
+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.
 .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 ebdc5a8..a459958 100644 (file)
@@ -1296,16 +1296,9 @@ void do_text_internal(Context ctx, int x, int y, char *text, int len,
                  y*inst->font_height+cfg.window_border+inst->fonts[0]->ascent,
                  text, len);
 
-    /*
-     * X fonts seem to be pretty consistent about leaving the
-     * _left_ pixel of the cell blank rather than the right. Hence
-     * I'm going to hard-code shadow bolding as displaying one
-     * pixel to the left rather than try to work out whether it
-     * should be left or right.
-     */
     if (shadow) {
        gdk_draw_text(inst->pixmap, inst->fonts[fontid], gc,
-                     x*inst->font_width+cfg.window_border - 1,
+                     x*inst->font_width+cfg.window_border + cfg.shadowboldoffset,
                      y*inst->font_height+cfg.window_border+inst->fonts[0]->ascent,
                      text, len);
     }