1 2004-05-10 Joe Marcus Clarke <marcus@FreeBSD.org>
2 * src/gnome-terminal.glade2: add an option menu for controlling the
3 font smoothing behavior in the terminal.
4 * src/gnome-terminal.schemas.in: add a key for font smoothing behavior.
5 * src/profile-editor.c(font_smoothing_changed,
6 profile_editor_update_font_smoothing): new functions for controlling
7 font smoothing behavior.
8 * src/terminal-profile.c(terminal_profile_get_font_smoothing,
9 terminal_profile_set_font_smoothing, set_font_smoothing): new
10 functions for controlling font smoothing behavior.
11 * src/terminal-profile.h: add function prototypes for controlling font
13 * src/terminal-screen.c(terminal_screen_update_on_realize):
14 * src/terminal-widget-zvt.c(terminal_widget_set_pango_font):
15 * src/terminal-widget-vte.c(terminal_widget_set_pango_font): add
16 support for setting font smoothing behavior in terminal widgets.
17 * src/terminal-widget.h(terminal_widget_set_pango_font): modify
18 prototype to support a font smoothing argument.
19 --- src/gnome-terminal.glade2.orig Mon Mar 1 20:06:53 2004
20 +++ src/gnome-terminal.glade2 Mon May 10 14:38:56 2004
22 <widget class="GtkTable" id="table29">
23 <property name="border_width">12</property>
24 <property name="visible">True</property>
25 - <property name="n_rows">6</property>
26 + <property name="n_rows">7</property>
27 <property name="n_columns">1</property>
28 <property name="homogeneous">False</property>
29 <property name="row_spacing">12</property>
30 @@ -1859,129 +1859,6 @@
34 - <widget class="GtkAlignment" id="alignment15">
35 - <property name="visible">True</property>
36 - <property name="xalign">0</property>
37 - <property name="yalign">0.1</property>
38 - <property name="xscale">0.95</property>
39 - <property name="yscale">0</property>
40 - <property name="top_padding">0</property>
41 - <property name="bottom_padding">0</property>
42 - <property name="left_padding">0</property>
43 - <property name="right_padding">0</property>
46 - <widget class="GtkVBox" id="darken-background-vbox">
47 - <property name="visible">True</property>
48 - <property name="homogeneous">False</property>
49 - <property name="spacing">0</property>
52 - <widget class="GtkLabel" id="darken-background-scale-label">
53 - <property name="visible">True</property>
54 - <property name="label" translatable="yes">_Shade transparent or image background:</property>
55 - <property name="use_underline">True</property>
56 - <property name="use_markup">False</property>
57 - <property name="justify">GTK_JUSTIFY_LEFT</property>
58 - <property name="wrap">False</property>
59 - <property name="selectable">False</property>
60 - <property name="xalign">0</property>
61 - <property name="yalign">0.5</property>
62 - <property name="xpad">0</property>
63 - <property name="ypad">0</property>
64 - <property name="mnemonic_widget">darken-background-scale</property>
67 - <property name="padding">1</property>
68 - <property name="expand">False</property>
69 - <property name="fill">False</property>
74 - <widget class="GtkHBox" id="hbox6">
75 - <property name="visible">True</property>
76 - <property name="homogeneous">False</property>
77 - <property name="spacing">0</property>
80 - <widget class="GtkLabel" id="label64">
81 - <property name="visible">True</property>
82 - <property name="label" translatable="yes"><small><i>None</i></small></property>
83 - <property name="use_underline">False</property>
84 - <property name="use_markup">True</property>
85 - <property name="justify">GTK_JUSTIFY_LEFT</property>
86 - <property name="wrap">False</property>
87 - <property name="selectable">False</property>
88 - <property name="xalign">0.5</property>
89 - <property name="yalign">0.5</property>
90 - <property name="xpad">6</property>
91 - <property name="ypad">0</property>
94 - <property name="padding">0</property>
95 - <property name="expand">False</property>
96 - <property name="fill">False</property>
101 - <widget class="GtkHScale" id="darken-background-scale">
102 - <property name="visible">True</property>
103 - <property name="can_focus">True</property>
104 - <property name="draw_value">False</property>
105 - <property name="value_pos">GTK_POS_BOTTOM</property>
106 - <property name="digits">2</property>
107 - <property name="update_policy">GTK_UPDATE_DELAYED</property>
108 - <property name="inverted">False</property>
109 - <property name="adjustment">0.1 0 1 0.01 0.1 0</property>
112 - <property name="padding">0</property>
113 - <property name="expand">True</property>
114 - <property name="fill">True</property>
119 - <widget class="GtkLabel" id="label63">
120 - <property name="visible">True</property>
121 - <property name="label" translatable="yes"><small><i>Maximum</i></small></property>
122 - <property name="use_underline">False</property>
123 - <property name="use_markup">True</property>
124 - <property name="justify">GTK_JUSTIFY_LEFT</property>
125 - <property name="wrap">False</property>
126 - <property name="selectable">False</property>
127 - <property name="xalign">0.5</property>
128 - <property name="yalign">0.5</property>
129 - <property name="xpad">6</property>
130 - <property name="ypad">0</property>
133 - <property name="padding">0</property>
134 - <property name="expand">False</property>
135 - <property name="fill">False</property>
140 - <property name="padding">1</property>
141 - <property name="expand">True</property>
142 - <property name="fill">True</property>
149 - <property name="left_attach">0</property>
150 - <property name="right_attach">1</property>
151 - <property name="top_attach">5</property>
152 - <property name="bottom_attach">6</property>
157 <widget class="GtkHBox" id="hbox7">
158 <property name="visible">True</property>
159 <property name="homogeneous">False</property>
160 @@ -2154,6 +2031,218 @@
161 <property name="top_attach">2</property>
162 <property name="bottom_attach">3</property>
163 <property name="y_options">fill</property>
168 + <widget class="GtkAlignment" id="alignment15">
169 + <property name="visible">True</property>
170 + <property name="xalign">0</property>
171 + <property name="yalign">0.1</property>
172 + <property name="xscale">0.95</property>
173 + <property name="yscale">0</property>
174 + <property name="top_padding">0</property>
175 + <property name="bottom_padding">0</property>
176 + <property name="left_padding">0</property>
177 + <property name="right_padding">0</property>
180 + <widget class="GtkVBox" id="darken-background-vbox">
181 + <property name="visible">True</property>
182 + <property name="homogeneous">False</property>
183 + <property name="spacing">0</property>
186 + <widget class="GtkLabel" id="darken-background-scale-label">
187 + <property name="visible">True</property>
188 + <property name="label" translatable="yes">_Shade transparent or image background:</property>
189 + <property name="use_underline">True</property>
190 + <property name="use_markup">False</property>
191 + <property name="justify">GTK_JUSTIFY_LEFT</property>
192 + <property name="wrap">False</property>
193 + <property name="selectable">False</property>
194 + <property name="xalign">0</property>
195 + <property name="yalign">0.5</property>
196 + <property name="xpad">0</property>
197 + <property name="ypad">0</property>
198 + <property name="mnemonic_widget">darken-background-scale</property>
201 + <property name="padding">1</property>
202 + <property name="expand">False</property>
203 + <property name="fill">False</property>
208 + <widget class="GtkHBox" id="hbox6">
209 + <property name="visible">True</property>
210 + <property name="homogeneous">False</property>
211 + <property name="spacing">0</property>
214 + <widget class="GtkLabel" id="label64">
215 + <property name="visible">True</property>
216 + <property name="label" translatable="yes"><small><i>None</i></small></property>
217 + <property name="use_underline">False</property>
218 + <property name="use_markup">True</property>
219 + <property name="justify">GTK_JUSTIFY_LEFT</property>
220 + <property name="wrap">False</property>
221 + <property name="selectable">False</property>
222 + <property name="xalign">0.5</property>
223 + <property name="yalign">0.5</property>
224 + <property name="xpad">6</property>
225 + <property name="ypad">0</property>
228 + <property name="padding">0</property>
229 + <property name="expand">False</property>
230 + <property name="fill">False</property>
235 + <widget class="GtkHScale" id="darken-background-scale">
236 + <property name="visible">True</property>
237 + <property name="can_focus">True</property>
238 + <property name="draw_value">False</property>
239 + <property name="value_pos">GTK_POS_BOTTOM</property>
240 + <property name="digits">2</property>
241 + <property name="update_policy">GTK_UPDATE_DELAYED</property>
242 + <property name="inverted">False</property>
243 + <property name="adjustment">0.1 0 1 0.01 0.1 0</property>
246 + <property name="padding">0</property>
247 + <property name="expand">True</property>
248 + <property name="fill">True</property>
253 + <widget class="GtkLabel" id="label63">
254 + <property name="visible">True</property>
255 + <property name="label" translatable="yes"><small><i>Maximum</i></small></property>
256 + <property name="use_underline">False</property>
257 + <property name="use_markup">True</property>
258 + <property name="justify">GTK_JUSTIFY_LEFT</property>
259 + <property name="wrap">False</property>
260 + <property name="selectable">False</property>
261 + <property name="xalign">0.5</property>
262 + <property name="yalign">0.5</property>
263 + <property name="xpad">6</property>
264 + <property name="ypad">0</property>
267 + <property name="padding">0</property>
268 + <property name="expand">False</property>
269 + <property name="fill">False</property>
274 + <property name="padding">1</property>
275 + <property name="expand">True</property>
276 + <property name="fill">True</property>
283 + <property name="left_attach">0</property>
284 + <property name="right_attach">1</property>
285 + <property name="top_attach">5</property>
286 + <property name="bottom_attach">6</property>
287 + <property name="y_options">fill</property>
292 + <widget class="GtkTable" id="table34">
293 + <property name="visible">True</property>
294 + <property name="n_rows">1</property>
295 + <property name="n_columns">2</property>
296 + <property name="homogeneous">False</property>
297 + <property name="row_spacing">12</property>
298 + <property name="column_spacing">12</property>
301 + <widget class="GtkLabel" id="label68">
302 + <property name="visible">True</property>
303 + <property name="label" translatable="yes">_Font smoothing:</property>
304 + <property name="use_underline">True</property>
305 + <property name="use_markup">False</property>
306 + <property name="justify">GTK_JUSTIFY_CENTER</property>
307 + <property name="wrap">False</property>
308 + <property name="selectable">False</property>
309 + <property name="xalign">0</property>
310 + <property name="yalign">0.5</property>
311 + <property name="xpad">0</property>
312 + <property name="ypad">0</property>
313 + <property name="mnemonic_widget">font-smoothing-optionmenu</property>
316 + <property name="left_attach">0</property>
317 + <property name="right_attach">1</property>
318 + <property name="top_attach">0</property>
319 + <property name="bottom_attach">1</property>
320 + <property name="x_options">fill</property>
321 + <property name="y_options"></property>
326 + <widget class="GtkOptionMenu" id="font-smoothing-optionmenu">
327 + <property name="visible">True</property>
328 + <property name="can_focus">True</property>
329 + <property name="history">0</property>
332 + <widget class="GtkMenu" id="menu1">
335 + <widget class="GtkMenuItem" id="default1">
336 + <property name="visible">True</property>
337 + <property name="label" translatable="yes">Default</property>
338 + <property name="use_underline">True</property>
343 + <widget class="GtkMenuItem" id="enabled1">
344 + <property name="visible">True</property>
345 + <property name="label" translatable="yes">Enabled</property>
346 + <property name="use_underline">True</property>
351 + <widget class="GtkMenuItem" id="disabled1">
352 + <property name="visible">True</property>
353 + <property name="label" translatable="yes">Disabled</property>
354 + <property name="use_underline">True</property>
361 + <property name="left_attach">1</property>
362 + <property name="right_attach">2</property>
363 + <property name="top_attach">0</property>
364 + <property name="bottom_attach">1</property>
365 + <property name="x_options">fill</property>
366 + <property name="y_options"></property>
371 + <property name="left_attach">0</property>
372 + <property name="right_attach">1</property>
373 + <property name="top_attach">6</property>
374 + <property name="bottom_attach">7</property>
375 + <property name="x_options">fill</property>
379 --- src/gnome-terminal.schemas.in.orig Mon May 10 14:39:24 2004
380 +++ src/gnome-terminal.schemas Mon May 10 14:42:43 2004
385 + <key>/schemas/apps/gnome-terminal/profiles/Default/font_smoothing</key>
386 + <applyto>/apps/gnome-terminal/profiles/Default/font_smoothing</applyto>
387 + <owner>gnome-terminal</owner>
388 + <type>string</type>
389 + <default>default</default>
391 + <short>Font smoothing behavior</short>
393 + Controls the font smoothing behavior for this profile. Possibilities
394 + are "default", "enabled", and "disabled".
400 <key>/schemas/apps/gnome-terminal/profiles/Default/background_type</key>
401 <applyto>/apps/gnome-terminal/profiles/Default/background_type</applyto>
402 <owner>gnome-terminal</owner>
403 --- src/profile-editor.c.orig Sat Feb 14 02:22:21 2004
404 +++ src/profile-editor.c Mon May 10 14:39:01 2004
406 TerminalProfile *profile);
407 static void profile_editor_update_use_system_font (GtkWidget *widget,
408 TerminalProfile *profile);
409 +static void profile_editor_update_font_smoothing (GtkWidget *widget,
410 + TerminalProfile *profile);
411 static void profile_editor_update_font (GtkWidget *widget,
412 TerminalProfile *profile);
415 if (mask->use_system_font)
416 profile_editor_update_use_system_font (editor, profile);
418 + if (mask->font_smoothing)
419 + profile_editor_update_font_smoothing (editor, profile);
422 profile_editor_update_font (editor, profile);
428 +font_smoothing_changed (GtkWidget *option_menu,
429 + TerminalProfile *profile)
433 + i = gtk_option_menu_get_history (GTK_OPTION_MENU (option_menu));
435 + terminal_profile_set_font_smoothing (profile, i);
439 font_set (GtkWidget *fontpicker,
440 TerminalProfile *profile)
442 @@ -1172,6 +1188,7 @@
443 if (terminal_widget_supports_pango_fonts ())
445 GtkWidget *font_label;
446 + GtkWidget *font_smoothing_optionmenu;
448 fontsel = gtk_font_button_new ();
449 g_object_set_data (G_OBJECT (editor), "font-selector", fontsel);
450 @@ -1206,6 +1223,13 @@
451 glade_xml_get_widget (xml,
452 "profile-icon-label"));
453 g_object_unref (G_OBJECT (size_group));
455 + font_smoothing_optionmenu =
456 + glade_xml_get_widget (xml, "font-smoothing-optionmenu");
457 + profile_editor_update_font_smoothing (editor, profile);
458 + g_signal_connect (G_OBJECT (font_smoothing_optionmenu), "changed",
459 + G_CALLBACK (font_smoothing_changed),
464 @@ -1439,6 +1463,9 @@
465 set_insensitive (editor, "system-font-checkbutton",
466 mask->use_system_font);
468 + set_insensitive (editor, "font-smoothing-optionmenu",
469 + mask->font_smoothing);
474 @@ -1976,6 +2003,19 @@
476 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w),
477 terminal_profile_get_use_system_font (profile));
481 +profile_editor_update_font_smoothing (GtkWidget *editor,
482 + TerminalProfile *profile)
486 + w = profile_editor_get_widget (editor, "font-smoothing-optionmenu");
488 + gtk_option_menu_set_history (GTK_OPTION_MENU (w),
489 + terminal_profile_get_font_smoothing (profile));
494 --- src/terminal-profile.c.orig Tue Sep 30 20:06:17 2003
495 +++ src/terminal-profile.c Mon May 10 14:39:01 2004
497 #define KEY_DELETE_BINDING "delete_binding"
498 #define KEY_USE_THEME_COLORS "use_theme_colors"
499 #define KEY_USE_SYSTEM_FONT "use_system_font"
500 +#define KEY_FONT_SMOOTHING "font_smoothing"
501 #define KEY_USE_SKEY "use_skey"
502 #define KEY_FONT "font"
505 TerminalTitleMode title_mode;
507 TerminalScrollbarPosition scrollbar_position;
508 + TerminalFontSmoothing font_smoothing;
509 int scrollback_lines;
510 TerminalExitAction exit_action;
511 char *custom_command;
516 +static const GConfEnumStringPair font_smoothing_behaviors[] = {
517 + { TERMINAL_FONT_SMOOTHING_DEFAULT, "default" },
518 + { TERMINAL_FONT_SMOOTHING_ENABLED, "enabled" },
519 + { TERMINAL_FONT_SMOOTHING_DISABLED, "disabled" },
523 static const GConfEnumStringPair exit_actions[] = {
524 { TERMINAL_EXIT_CLOSE, "close" },
525 { TERMINAL_EXIT_RESTART, "restart" },
527 profile->priv->delete_binding = TERMINAL_ERASE_ESCAPE_SEQUENCE;
528 profile->priv->use_theme_colors = TRUE;
529 profile->priv->use_system_font = TRUE;
530 + profile->priv->font_smoothing = TERMINAL_FONT_SMOOTHING_DEFAULT;
531 profile->priv->use_skey = TRUE;
532 profile->priv->font = pango_font_description_new ();
533 pango_font_description_set_family (profile->priv->font,
534 @@ -1438,6 +1448,36 @@
538 +TerminalFontSmoothing
539 +terminal_profile_get_font_smoothing (TerminalProfile *profile)
541 + g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), 0);
543 + return profile->priv->font_smoothing;
547 +terminal_profile_set_font_smoothing (TerminalProfile *profile,
548 + TerminalFontSmoothing setting)
551 + const char *smoothing_behavior;
553 + RETURN_IF_NOTIFYING (profile);
555 + key = gconf_concat_dir_and_key (profile->priv->profile_dir,
556 + KEY_FONT_SMOOTHING);
558 + smoothing_behavior = gconf_enum_to_string (font_smoothing_behaviors, setting);
560 + gconf_client_set_string (profile->priv->conf,
562 + smoothing_behavior,
569 terminal_profile_get_use_skey (TerminalProfile *profile)
571 @@ -1648,6 +1688,25 @@
575 +set_font_smoothing (TerminalProfile *profile,
576 + const char *str_val)
578 + int behavior; /* TerminalFontSmoothing */
581 + gconf_string_to_enum (font_smoothing_behaviors, str_val, &behavior) &&
582 + behavior != profile->priv->font_smoothing)
584 + profile->priv->font_smoothing = behavior;
594 set_exit_action (TerminalProfile *profile,
597 @@ -1981,6 +2040,7 @@
598 UPDATE_STRING (KEY_DELETE_BINDING, delete_binding);
599 UPDATE_BOOLEAN (KEY_USE_THEME_COLORS, use_theme_colors);
600 UPDATE_BOOLEAN (KEY_USE_SYSTEM_FONT, use_system_font);
601 + UPDATE_STRING (KEY_FONT_SMOOTHING, font_smoothing);
602 UPDATE_STRING (KEY_FONT, font);
604 #undef UPDATE_BOOLEAN
605 @@ -2127,6 +2187,7 @@
606 UPDATE_STRING (KEY_DELETE_BINDING, delete_binding, NULL);
607 UPDATE_BOOLEAN (KEY_USE_THEME_COLORS, use_theme_colors, TRUE);
608 UPDATE_BOOLEAN (KEY_USE_SYSTEM_FONT, use_system_font, TRUE);
609 + UPDATE_STRING (KEY_FONT_SMOOTHING, font_smoothing, NULL);
610 UPDATE_STRING (KEY_FONT, font, NULL);
613 @@ -2858,6 +2919,16 @@
614 gconf_client_set_bool (base_profile->priv->conf,
615 key, base_profile->priv->use_system_font,
620 + key = gconf_concat_dir_and_key (profile_dir,
621 + KEY_FONT_SMOOTHING);
622 + cs = gconf_enum_to_string (font_smoothing_behaviors,
623 + base_profile->priv->font_smoothing);
624 + gconf_client_set_string (base_profile->priv->conf,
630 --- src/terminal-profile.h.orig Sun Dec 8 00:00:25 2002
631 +++ src/terminal-profile.h Mon May 10 14:39:01 2004
633 unsigned int delete_binding : 1;
634 unsigned int use_theme_colors : 1;
635 unsigned int use_system_font : 1;
636 + unsigned int font_smoothing : 1;
637 unsigned int font : 1;
638 } TerminalSettingMask;
641 TERMINAL_SCROLLBAR_HIDDEN
642 } TerminalScrollbarPosition;
646 + TERMINAL_FONT_SMOOTHING_DEFAULT,
647 + TERMINAL_FONT_SMOOTHING_ENABLED,
648 + TERMINAL_FONT_SMOOTHING_DISABLED
649 +} TerminalFontSmoothing;
656 gboolean terminal_profile_get_use_theme_colors (TerminalProfile *profile);
657 gboolean terminal_profile_get_use_system_font (TerminalProfile *profile);
658 +TerminalFontSmoothing terminal_profile_get_font_smoothing (TerminalProfile *profile);
659 gboolean terminal_profile_get_use_skey (TerminalProfile *profile);
660 const PangoFontDescription* terminal_profile_get_font (TerminalProfile *profile);
664 void terminal_profile_set_use_system_font (TerminalProfile *profile,
667 +void terminal_profile_set_font_smoothing (TerminalProfile *profile,
668 + TerminalFontSmoothing setting);
670 void terminal_profile_set_use_skey (TerminalProfile *profile,
672 --- src/terminal-screen.c.orig Fri Feb 20 18:14:09 2004
673 +++ src/terminal-screen.c Mon May 10 14:39:01 2004
674 @@ -727,17 +727,20 @@
675 if (terminal_widget_supports_pango_fonts ())
677 PangoFontDescription *desc;
678 + TerminalFontSmoothing font_smoothing;
680 if (terminal_profile_get_use_system_font (profile))
681 desc = get_system_monospace_font ();
683 desc = pango_font_description_copy (terminal_profile_get_font (profile));
685 + font_smoothing = terminal_profile_get_font_smoothing (profile);
687 pango_font_description_set_size (desc,
688 screen->priv->font_scale *
689 pango_font_description_get_size (desc));
691 - terminal_widget_set_pango_font (term, desc);
692 + terminal_widget_set_pango_font (term, desc, font_smoothing);
694 pango_font_description_free (desc);
696 --- src/terminal-widget-vte.c.orig Tue Sep 30 20:06:17 2003
697 +++ src/terminal-widget-vte.c Mon May 10 14:39:01 2004
698 @@ -565,10 +565,26 @@
701 terminal_widget_set_pango_font (GtkWidget *widget,
702 - const PangoFontDescription *font_desc)
703 + const PangoFontDescription *font_desc,
704 + TerminalFontSmoothing font_smoothing)
706 + VteTerminalAntiAlias vte_antialias;
708 g_return_if_fail (font_desc != NULL);
709 - vte_terminal_set_font (VTE_TERMINAL (widget), font_desc);
711 + switch (font_smoothing) {
712 + case TERMINAL_FONT_SMOOTHING_ENABLED:
713 + vte_antialias = VTE_ANTI_ALIAS_FORCE_ENABLE;
715 + case TERMINAL_FONT_SMOOTHING_DISABLED:
716 + vte_antialias = VTE_ANTI_ALIAS_FORCE_DISABLE;
719 + vte_antialias = VTE_ANTI_ALIAS_USE_DEFAULT;
723 + vte_terminal_set_font_full (VTE_TERMINAL (widget), font_desc, vte_antialias);
727 --- src/terminal-widget.h.orig Mon Dec 2 23:07:17 2002
728 +++ src/terminal-widget.h Mon May 10 14:39:01 2004
732 void terminal_widget_set_pango_font (GtkWidget *widget,
733 - const PangoFontDescription *font_desc);
734 + const PangoFontDescription *font_desc,
735 + TerminalFontSmoothing font_smoothing);
737 gboolean terminal_widget_supports_pango_fonts (void);