ctrl_checkbox(s, "Allow terminal to use xterm 256-colour mode", '2',
HELPCTX(colours_xterm256), conf_checkbox_handler,
I(CONF_xterm_256_colour));
- ctrl_checkbox(s, "Bolded text is a different colour", 'b',
- HELPCTX(colours_bold),
- conf_checkbox_handler, I(CONF_bold_colour));
+ ctrl_radiobuttons(s, "Indicate bolded text by changing:", 'b', 3,
+ HELPCTX(colours_bold),
+ conf_radiobutton_handler, I(CONF_bold_style),
+ "The font", I(1),
+ "The colour", I(2),
+ "Both", I(3),
+ NULL);
str = dupprintf("Adjust the precise colours %s displays", appname);
s = ctrl_getset(b, "Window/Colours", "adjust", str);
change your terminal setting. On modern Linux machines, you could
try \cq{xterm-256color}.
-\S{config-boldcolour} \q{Bolded text is a different colour}
+\S{config-boldcolour} \q{Indicate bolded text by changing}
\cfg{winhelp-topic}{colours.bold}
When the server sends a \i{control sequence} indicating that some text
-should be displayed in \i{bold}, PuTTY can handle this two ways. It can
-either change the \i{font} for a bold version, or use the same font in a
-brighter colour. This control lets you choose which.
-
-By default the box is checked, so non-bold text is displayed in
-light grey and bold text is displayed in bright white (and similarly
-in other colours). If you uncheck the box, bold and non-bold text
-will be displayed in the same colour, and instead the font will
-change to indicate the difference.
+should be displayed in \i{bold}, PuTTY can handle this in several
+ways. It can either change the \i{font} for a bold version, or use the
+same font in a brighter colour, or it can do both (brighten the colour
+\e{and} embolden the font). This control lets you choose which.
+
+By default bold is indicated by colour, so non-bold text is displayed
+in light grey and bold text is displayed in bright white (and
+similarly in other colours). If you change the setting to \q{The font}
+box, bold and non-bold text will be displayed in the same colour, and
+instead the font will change to indicate the difference. If you select
+\q{Both}, the font and the colour will both change.
\S{config-logpalette} \q{Attempt to use \i{logical palettes}}
\dd Specify the font to use for bold text displayed in the terminal. If
the \cw{BoldAsColour} resource is set to 1 (the default), bold text
will be displayed in different colours instead of a different font,
-so this option will be ignored. If \cw{BoldAsColour} is set to 0
+so this option will be ignored. If \cw{BoldAsColour} is set to 0 or 2
and you do not specify a bold font, \cw{puttytel} will overprint the
normal font to make it look bolder.
\dd Specify the font to use for bold double-width characters
(typically Chinese, Japanese and Korean text). Like \cw{-fb}, this
-will be ignored unless the \cw{BoldAsColour} resource is set to 0.
+will be ignored unless the \cw{BoldAsColour} resource is set to 0 or 2.
\dt \cw{\-geometry} \e{geometry}
\dt \cw{\-bfg} \e{colour}
\dd Specify the foreground colour to use for bold text, if the
-\cw{BoldAsColour} resource is set to 1 (the default).
+\cw{BoldAsColour} resource is set to 1 (the default) or 2.
\dt \cw{\-bbg} \e{colour}
\dd Specify the foreground colour to use for bold reverse-video text, if
-the \cw{BoldAsColour} resource is set to 1 (the default). (This
+the \cw{BoldAsColour} resource is set to 1 (the default) or 2. (This
colour is best thought of as the bold version of the background
colour; so it only appears when text is displayed \e{in} the
background colour.)
\dd Specify the font to use for bold text displayed in the terminal. If
the \cw{BoldAsColour} resource is set to 1 (the default), bold text
will be displayed in different colours instead of a different font,
-so this option will be ignored. If \cw{BoldAsColour} is set to 0
+so this option will be ignored. If \cw{BoldAsColour} is set to 0 or 2
and you do not specify a bold font, \cw{pterm} will overprint the
normal font to make it look bolder.
\dd Specify the font to use for bold double-width characters
(typically Chinese, Japanese and Korean text). Like \cw{-fb}, this
-will be ignored unless the \cw{BoldAsColour} resource is set to 0.
+will be ignored unless the \cw{BoldAsColour} resource is set to 0 or 2.
\dt \cw{\-geometry} \e{geometry}
\dt \cw{\-bfg} \e{colour}
\dd Specify the foreground colour to use for bold text, if the
-\cw{BoldAsColour} resource is set to 1 (the default).
+\cw{BoldAsColour} resource is set to 1 (the default) or 2.
\dt \cw{\-bbg} \e{colour}
\dd Specify the foreground colour to use for bold reverse-video text, if
-the \cw{BoldAsColour} resource is set to 1 (the default). (This
+the \cw{BoldAsColour} resource is set to 1 (the default) or 2. (This
colour is best thought of as the bold version of the background
colour; so it only appears when text is displayed \e{in} the
background colour.)
\dd This resource is the same as the \cw{\-fb} command-line option: it
controls the font used to display bold text when \cw{BoldAsColour}
-is turned off. The default is unset (the font will be bolded by
+is set to 0 or 2. The default is unset (the font will be bolded by
printing it twice at a one-pixel offset).
\dt \cw{pterm.WideFont}
\dd This resource is the same as the \cw{\-fwb} command-line option: it
controls the font used to display double-width characters in bold,
-when \cw{BoldAsColour} is turned off. The default is unset
+when \cw{BoldAsColour} is set to 0 or 2. The default is unset
(double-width characters are displayed in bold by printing them
twice at a one-pixel offset).
\dt \cw{pterm.BoldAsColour}
-\dd 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
+\dd This option should be set to either 0, 1, or 2; the default is 1.
+It specifies how bold text should be displayed. When set to 1, bold
text is shown by displaying it in a brighter colour; when set to 0,
-bold text is shown by displaying it in a heavier font.
+bold text is shown by displaying it in a heavier font; when set to 2,
+both effects happen at once (a heavy font \e{and} a brighter colour).
\dt \cw{pterm.Colour0}, \cw{pterm.Colour1}, ..., \cw{pterm.Colour21}
If the \cw{BoldAsColour} resource is set to 1 (the default), bold
text will be displayed in different colours instead of a different
font, so this option will be ignored. If \cw{BoldAsColour} is set to
-0 and you do not specify a bold font, \cw{putty} will overprint the
+0 or 2 and you do not specify a bold font, \cw{putty} will overprint the
normal font to make it look bolder.
\dt \cw{\-fw} \e{font-name}
\dd Specify the font to use for bold double-width characters
(typically Chinese, Japanese and Korean text). Like \cw{-fb}, this
-will be ignored unless the \cw{BoldAsColour} resource is set to 0.
+will be ignored unless the \cw{BoldAsColour} resource is set to 0 or 2.
\dt \cw{\-geometry} \e{geometry}
\dt \cw{\-bfg} \e{colour}
\dd Specify the foreground colour to use for bold text, if the
-\cw{BoldAsColour} resource is set to 1 (the default).
+\cw{BoldAsColour} resource is set to 1 (the default) or 2.
\dt \cw{\-bbg} \e{colour}
\dd Specify the foreground colour to use for bold reverse-video
-text, if the \cw{BoldAsColour} resource is set to 1 (the default).
+text, if the \cw{BoldAsColour} resource is set to 1 (the default) or 2.
(This colour is best thought of as the bold version of the
background colour; so it only appears when text is displayed \e{in}
the background colour.)
nfg = nbg;
nbg = t;
}
- if (cfg.bold_colour && (attr & ATTR_BOLD)) {
+ if ((cfg.bold_style & 2) && (attr & ATTR_BOLD)) {
if (nfg < 16) nfg |= 8;
else if (nfg >= 256) nfg |= 1;
}
- if (cfg.bold_colour && (attr & ATTR_BLINK)) {
+ if ((cfg.bold_style & 2) && (attr & ATTR_BLINK)) {
if (nbg < 16) nbg |= 8;
else if (nbg >= 256) nbg |= 1;
}
widefactor = 1;
}
- /* FIXME: ATTR_BOLD without cfg.bold_colour */
+ /* FIXME: ATTR_BOLD if cfg.bold_style & 1 */
if ((lattr & LATTR_MODE) != LATTR_NORM) {
x *= 2;
X(INT, NONE, xterm_256_colour) \
X(INT, NONE, system_colour) \
X(INT, NONE, try_palette) \
- X(INT, NONE, bold_colour) \
+ X(INT, NONE, bold_style) \
X(INT, INT, colours) \
/* Selection options */ \
X(INT, NONE, mouse_is_xterm) \
write_setting_i(sesskey, "TryPalette", conf_get_int(conf, CONF_try_palette));
write_setting_i(sesskey, "ANSIColour", conf_get_int(conf, CONF_ansi_colour));
write_setting_i(sesskey, "Xterm256Colour", conf_get_int(conf, CONF_xterm_256_colour));
- write_setting_i(sesskey, "BoldAsColour", conf_get_int(conf, CONF_bold_colour));
+ write_setting_i(sesskey, "BoldAsColour", conf_get_int(conf, CONF_bold_style)-1);
for (i = 0; i < 22; i++) {
char buf[20], buf2[30];
gppi(sesskey, "TryPalette", 0, conf, CONF_try_palette);
gppi(sesskey, "ANSIColour", 1, conf, CONF_ansi_colour);
gppi(sesskey, "Xterm256Colour", 1, conf, CONF_xterm_256_colour);
- gppi(sesskey, "BoldAsColour", 1, conf, CONF_bold_colour);
+ i = gppi_raw(sesskey, "BoldAsColour", 0); conf_set_int(conf, CONF_bold_style, i+1);
for (i = 0; i < 22; i++) {
static const char *const defaults[] = {
guint32 input_event_time; /* Timestamp of the most recent input event. */
int reconfiguring;
/* Cached things out of conf that we refer to a lot */
- int bold_colour;
+ int bold_style;
int window_border;
int cursor_type;
};
static void cache_conf_values(struct gui_data *inst)
{
- inst->bold_colour = conf_get_int(inst->conf, CONF_bold_colour);
+ inst->bold_style = conf_get_int(inst->conf, CONF_bold_style);
inst->window_border = conf_get_int(inst->conf, CONF_window_border);
inst->cursor_type = conf_get_int(inst->conf, CONF_cursor_type);
}
nfg = nbg;
nbg = t;
}
- if (inst->bold_colour && (attr & ATTR_BOLD)) {
+ if ((inst->bold_style & 2) && (attr & ATTR_BOLD)) {
if (nfg < 16) nfg |= 8;
else if (nfg >= 256) nfg |= 1;
}
- if (inst->bold_colour && (attr & ATTR_BLINK)) {
+ if ((inst->bold_style & 2) && (attr & ATTR_BLINK)) {
if (nbg < 16) nbg |= 8;
else if (nbg >= 256) nbg |= 1;
}
widefactor = 1;
}
- if ((attr & ATTR_BOLD) && !inst->bold_colour) {
+ if ((attr & ATTR_BOLD) && (inst->bold_style & 1)) {
bold = 1;
fontid |= 1;
} else {
static LOGFONT lfont;
static int fontflag[FONT_MAXNO];
static enum {
- BOLD_COLOURS, BOLD_SHADOW, BOLD_FONT
-} bold_mode;
+ BOLD_NONE, BOLD_SHADOW, BOLD_FONT
+} bold_font_mode;
+static int bold_colours;
static enum {
UND_LINE, UND_FONT
} und_mode;
for (i = 0; i < FONT_MAXNO; i++)
fonts[i] = NULL;
- bold_mode = conf_get_int(conf, CONF_bold_colour) ?
- BOLD_COLOURS : BOLD_FONT;
+ bold_font_mode = conf_get_int(conf, CONF_bold_style) & 1 ?
+ BOLD_FONT : BOLD_NONE;
+ bold_colours = conf_get_int(conf, CONF_bold_style) & 2 ? TRUE : FALSE;
und_mode = UND_FONT;
font = conf_get_fontspec(conf, CONF_font);
}
}
- if (bold_mode == BOLD_FONT) {
+ if (bold_font_mode == BOLD_FONT) {
f(FONT_BOLD, font->charset, fw_bold, FALSE);
}
#undef f
fonts[FONT_UNDERLINE] = 0;
}
- if (bold_mode == BOLD_FONT &&
+ if (bold_font_mode == BOLD_FONT &&
fontsize[FONT_BOLD] != fontsize[FONT_NORMAL]) {
- bold_mode = BOLD_SHADOW;
+ bold_font_mode = BOLD_SHADOW;
DeleteObject(fonts[FONT_BOLD]);
fonts[FONT_BOLD] = 0;
}
conf_get_int(prev_conf, CONF_font_quality) ||
conf_get_int(conf, CONF_vtmode) !=
conf_get_int(prev_conf, CONF_vtmode) ||
- conf_get_int(conf, CONF_bold_colour) !=
- conf_get_int(prev_conf, CONF_bold_colour) ||
+ conf_get_int(conf, CONF_bold_style) !=
+ conf_get_int(prev_conf, CONF_bold_style) ||
resize_action == RESIZE_DISABLED ||
resize_action == RESIZE_EITHER ||
resize_action != conf_get_int(prev_conf,
int text_adjust = 0;
int xoffset = 0;
int maxlen, remaining, opaque;
+ int is_cursor = FALSE;
static int *lpDx = NULL;
static int lpDx_len = 0;
int *lpDx_maybe;
if ((attr & TATTR_ACTCURS) && (cursor_type == 0 || term->big_cursor)) {
attr &= ~(ATTR_REVERSE|ATTR_BLINK|ATTR_COLOURS);
- if (bold_mode == BOLD_COLOURS)
- attr &= ~ATTR_BOLD;
-
/* cursor fg and bg */
attr |= (260 << ATTR_FGSHIFT) | (261 << ATTR_BGSHIFT);
+ is_cursor = TRUE;
}
nfont = 0;
nfg = ((attr & ATTR_FGMASK) >> ATTR_FGSHIFT);
nbg = ((attr & ATTR_BGMASK) >> ATTR_BGSHIFT);
- if (bold_mode == BOLD_FONT && (attr & ATTR_BOLD))
+ if (bold_font_mode == BOLD_FONT && (attr & ATTR_BOLD))
nfont |= FONT_BOLD;
if (und_mode == UND_FONT && (attr & ATTR_UNDER))
nfont |= FONT_UNDERLINE;
nfg = nbg;
nbg = t;
}
- if (bold_mode == BOLD_COLOURS && (attr & ATTR_BOLD)) {
+ if (bold_colours && (attr & ATTR_BOLD) && !is_cursor) {
if (nfg < 16) nfg |= 8;
else if (nfg >= 256) nfg |= 1;
}
- if (bold_mode == BOLD_COLOURS && (attr & ATTR_BLINK)) {
+ if (bold_colours && (attr & ATTR_BLINK)) {
if (nbg < 16) nbg |= 8;
else if (nbg >= 256) nbg |= 1;
}
ETO_CLIPPED | (opaque ? ETO_OPAQUE : 0),
&line_box, uni_buf, nlen,
lpDx_maybe);
- if (bold_mode == BOLD_SHADOW && (attr & ATTR_BOLD)) {
+ if (bold_font_mode == BOLD_SHADOW && (attr & ATTR_BOLD)) {
SetBkMode(hdc, TRANSPARENT);
ExtTextOutW(hdc, x + xoffset - 1,
y - font_height * (lattr ==
y - font_height * (lattr == LATTR_BOT) + text_adjust,
ETO_CLIPPED | (opaque ? ETO_OPAQUE : 0),
&line_box, directbuf, len, lpDx_maybe);
- if (bold_mode == BOLD_SHADOW && (attr & ATTR_BOLD)) {
+ if (bold_font_mode == BOLD_SHADOW && (attr & ATTR_BOLD)) {
SetBkMode(hdc, TRANSPARENT);
/* GRR: This draws the character outside its box and
opaque && !(attr & TATTR_COMBINING));
/* And the shadow bold hack. */
- if (bold_mode == BOLD_SHADOW && (attr & ATTR_BOLD)) {
+ if (bold_font_mode == BOLD_SHADOW && (attr & ATTR_BOLD)) {
SetBkMode(hdc, TRANSPARENT);
ExtTextOutW(hdc, x + xoffset - 1,
y - font_height * (lattr ==
bgcolour = tmpcolour;
}
- if (bold_mode == BOLD_COLOURS && (attr[i] & ATTR_BOLD)) {
+ if (bold_colours && (attr[i] & ATTR_BOLD)) {
if (fgcolour < 8) /* ANSI colours */
fgcolour += 8;
else if (fgcolour >= 256) /* Default colours */
bgcolour = tmpcolour;
}
- if (bold_mode == BOLD_COLOURS && (attr[tindex] & ATTR_BOLD)) {
+ if (bold_colours && (attr[tindex] & ATTR_BOLD)) {
if (fgcolour < 8) /* ANSI colours */
fgcolour += 8;
else if (fgcolour >= 256) /* Default colours */
/*
* Collect other attributes
*/
- if (bold_mode != BOLD_COLOURS)
+ if (bold_font_mode != BOLD_NONE)
attrBold = attr[tindex] & ATTR_BOLD;
else
attrBold = 0;
bgcolour = -1; /* No coloring */
if (fgcolour >= 256) { /* Default colour */
- if (bold_mode == BOLD_COLOURS && (fgcolour & 1) && bgcolour == -1)
+ if (bold_colours && (fgcolour & 1) && bgcolour == -1)
attrBold = ATTR_BOLD; /* Emphasize text with bold attribute */
fgcolour = -1; /* No coloring */