PATCH against CVS gnome-terminal - option to disable overstriking
- From: Tom Gilbert <gilbertt tomgilbert freeserve co uk>
- To: Gnome developer list <gnome-devel-list gnome org>
- Subject: PATCH against CVS gnome-terminal - option to disable overstriking
- Date: Wed, 29 Sep 1999 18:21:12 +0000
Hi folks,
I enclose a patch against the CVS version of gnome-terminal. It adds a
preference option to enable/disable font-overstriking.
Normally this is enabled if it is available in libZvt, this option
allows it to be disabled. I know several people (including myself) who
do not like to have bold fonts, especially when term'ing in color...
Feel free to ignore it if it doesn't 'fit in', I'll just keep patching
my local copy ;-)
I hope I haven't overlooked anything...
Tom.
--
.-------------------------------------------------------.
.^. | Tom Gilbert, England | tom@tomgilbert.freeserve.co.uk |
/V\ |----------------------| www.tomgilbert.freeserve.co.uk |
// \\ | Sites I recommend: `--------------------------------|
/( )\ | www.freshmeat.net www.enlightenment.org www.gnome.org |
^^-^^ `-------------------------------------------------------'
--- gnome-terminal.c Wed Sep 29 18:14:53 1999
+++ gnome-terminal.c.tom Wed Sep 29 18:12:46 1999
@@ -85,6 +85,7 @@
enum palette_enum color_type; /* The color mode */
enum color_set_enum color_set;
char *font; /* Font used by the terminals */
+ int use_boldfont; /* Use emboldening, if available? */
int scrollback; /* Number of scrollbacklines */
char *class;
enum scrollbar_position_enum scrollbar_position;
@@ -126,6 +127,7 @@
GtkWidget *pixmap_label;
GtkWidget *pixmap_entry;
GtkWidget *transparent_checkbox;
+ GtkWidget *use_boldfont_checkbox;
GtkWidget *shaded_checkbox;
#ifdef ZVT_BACKGROUND_SCROLL
GtkWidget *pixmap_scrollable_checkbox;
@@ -253,7 +255,7 @@
* Keep a copy of the current font name
*/
static void
-gnome_term_set_font (ZvtTerm *term, char *font_name)
+gnome_term_set_font (ZvtTerm *term, char *font_name, int use_boldfont)
{
char *s;
GdkFont *font;
@@ -261,7 +263,7 @@
font = gdk_font_load (font_name);
if (font) {
#ifdef ZVT_TERM_EMBOLDEN_SUPPORT
- if (zvt_term_get_capabilities(term) & ZVT_TERM_EMBOLDEN_SUPPORT)
+ if ((use_boldfont) && (zvt_term_get_capabilities(term) & ZVT_TERM_EMBOLDEN_SUPPORT))
zvt_term_set_fonts (term, font, 0);
else
#endif
@@ -448,6 +450,7 @@
cfg->scrollback = gnome_config_get_int ("scrollbacklines=100");
cfg->font = gnome_config_get_string ("font=" DEFAULT_FONT);
+ cfg->use_boldfont = gnome_config_get_bool ("use_boldfont=FALSE");
cfg->wordclass = gnome_config_get_string ("wordclass=-A-Za-z0-9,./?%&#");
p = gnome_config_get_string ("scrollpos=right");
if (strcasecmp (p, "left") == 0)
@@ -553,6 +556,7 @@
&& newcfg->background_pixmap;
#endif
+ newcfg->use_boldfont=GTK_TOGGLE_BUTTON(prefs->use_boldfont_checkbox)->active;
g_free (newcfg->font);
newcfg->font = g_strdup (gtk_entry_get_text (GTK_ENTRY (prefs->font_entry)));
@@ -616,7 +620,7 @@
cfg = terminal_config_dup (newcfg);
gtk_object_set_data (GTK_OBJECT (term), "config", cfg);
- gnome_term_set_font (term, cfg->font);
+ gnome_term_set_font (term, cfg->font, cfg->use_boldfont);
zvt_term_set_wordclass (term, cfg->wordclass);
zvt_term_set_bell(term, !cfg->bell);
zvt_term_set_blink (term, cfg->blink);
@@ -937,12 +941,13 @@
BACKCOLOR_ROW = 4,
CLASS_ROW = 1,
FONT_ROW = 2,
- BLINK_ROW = 3,
- MENUBAR_ROW = 4,
- BELL_ROW = 5,
- SWAPKEYS_ROW = 6,
- LOGIN_ROW = 7,
- WORDCLASS_ROW = 8,
+ BOLDFONT_ROW = 3,
+ BLINK_ROW = 4,
+ MENUBAR_ROW = 5,
+ BELL_ROW = 6,
+ SWAPKEYS_ROW = 7,
+ LOGIN_ROW = 8,
+ WORDCLASS_ROW = 9,
BACKGROUND_ROW = 1,
PIXMAP_FILE_ROW = 2,
SHADED_ROW = 4,
@@ -977,6 +982,7 @@
gnome_config_set_bool ("blinking", cfg->blink);
gnome_config_set_bool ("swap_del_and_backspace", cfg->swap_keys);
gnome_config_set_bool ("login_by_default", cfg->login_by_default);
+ gnome_config_set_bool ("use_boldfont", cfg->use_boldfont);
gnome_config_set_int ("scrollbacklines", cfg->scrollback);
gnome_config_set_int ("color_set", cfg->color_set);
if (cfg->color_type>=4)
@@ -1080,7 +1086,8 @@
gtk_object_set_user_data (GTK_OBJECT(prefs->font_entry), GTK_OBJECT(picker));
gtk_table_attach (GTK_TABLE (table), picker,
- 3, 5, FONT_ROW, FONT_ROW+1, GTK_FILL, 0, GNOME_PAD, GNOME_PAD);
+ 3, 5, FONT_ROW, FONT_ROW+1, GTK_FILL, 0, GNOME_PAD, GNOME_PAD);
+
/* Terminal class */
l = aligned_label (_("Terminal Class"));
gtk_table_attach (GTK_TABLE (table), l,
@@ -1109,6 +1116,15 @@
gtk_table_attach (GTK_TABLE (table), prefs->class_box,
2, 3, CLASS_ROW, CLASS_ROW+1, GTK_FILL, 0, GNOME_PAD, GNOME_PAD);
+ /* Use emboldening if available? */
+ prefs->use_boldfont_checkbox = gtk_check_button_new_with_label (_("Use font emboldening"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->use_boldfont_checkbox),
+ cfg->use_boldfont ? 1 : 0);
+ gtk_signal_connect (GTK_OBJECT (prefs->use_boldfont_checkbox), "toggled",
+ GTK_SIGNAL_FUNC (prop_changed), prefs);
+ gtk_table_attach (GTK_TABLE (table), prefs->use_boldfont_checkbox,
+ 2, 3, BOLDFONT_ROW, BOLDFONT_ROW+1, GTK_FILL, 0, GNOME_PAD, GNOME_PAD);
+
/* Blinking status */
prefs->blink_checkbox = gtk_check_button_new_with_label (_("Blinking cursor"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->blink_checkbox),
@@ -2000,7 +2016,7 @@
GTK_OBJECT(term));
zvt_term_set_scrollback (term, cfg->scrollback);
- gnome_term_set_font (term, cfg->font);
+ gnome_term_set_font (term, cfg->font, cfg->use_boldfont);
zvt_term_set_wordclass (term, cfg->wordclass);
zvt_term_set_bell (term, !cfg->bell);
zvt_term_set_blink (term, cfg->blink);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]