]> git.pld-linux.org Git - packages/gnome-terminal.git/blob - gnome-terminal-font_smoothing.patch
- merged 2.7.3 from DEVEL
[packages/gnome-terminal.git] / gnome-terminal-font_smoothing.patch
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
12           smoothing behavior.
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
21 @@ -1784,7 +1784,7 @@
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 @@
31                       </child>
32  
33                       <child>
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>
44 -
45 -                         <child>
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>
50 -
51 -                             <child>
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>
65 -                               </widget>
66 -                               <packing>
67 -                                 <property name="padding">1</property>
68 -                                 <property name="expand">False</property>
69 -                                 <property name="fill">False</property>
70 -                               </packing>
71 -                             </child>
72 -
73 -                             <child>
74 -                               <widget class="GtkHBox" id="hbox6">
75 -                                 <property name="visible">True</property>
76 -                                 <property name="homogeneous">False</property>
77 -                                 <property name="spacing">0</property>
78 -
79 -                                 <child>
80 -                                   <widget class="GtkLabel" id="label64">
81 -                                     <property name="visible">True</property>
82 -                                     <property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;None&lt;/i&gt;&lt;/small&gt;</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>
92 -                                   </widget>
93 -                                   <packing>
94 -                                     <property name="padding">0</property>
95 -                                     <property name="expand">False</property>
96 -                                     <property name="fill">False</property>
97 -                                   </packing>
98 -                                 </child>
99 -
100 -                                 <child>
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>
110 -                                   </widget>
111 -                                   <packing>
112 -                                     <property name="padding">0</property>
113 -                                     <property name="expand">True</property>
114 -                                     <property name="fill">True</property>
115 -                                   </packing>
116 -                                 </child>
117 -
118 -                                 <child>
119 -                                   <widget class="GtkLabel" id="label63">
120 -                                     <property name="visible">True</property>
121 -                                     <property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;Maximum&lt;/i&gt;&lt;/small&gt;</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>
131 -                                   </widget>
132 -                                   <packing>
133 -                                     <property name="padding">0</property>
134 -                                     <property name="expand">False</property>
135 -                                     <property name="fill">False</property>
136 -                                   </packing>
137 -                                 </child>
138 -                               </widget>
139 -                               <packing>
140 -                                 <property name="padding">1</property>
141 -                                 <property name="expand">True</property>
142 -                                 <property name="fill">True</property>
143 -                               </packing>
144 -                             </child>
145 -                           </widget>
146 -                         </child>
147 -                       </widget>
148 -                       <packing>
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>
153 -                       </packing>
154 -                     </child>
155 -
156 -                     <child>
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>
164 +                       </packing>
165 +                     </child>
166 +
167 +                     <child>
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>
178 +
179 +                         <child>
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>
184 +
185 +                             <child>
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>
199 +                               </widget>
200 +                               <packing>
201 +                                 <property name="padding">1</property>
202 +                                 <property name="expand">False</property>
203 +                                 <property name="fill">False</property>
204 +                               </packing>
205 +                             </child>
206 +
207 +                             <child>
208 +                               <widget class="GtkHBox" id="hbox6">
209 +                                 <property name="visible">True</property>
210 +                                 <property name="homogeneous">False</property>
211 +                                 <property name="spacing">0</property>
212 +
213 +                                 <child>
214 +                                   <widget class="GtkLabel" id="label64">
215 +                                     <property name="visible">True</property>
216 +                                     <property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;None&lt;/i&gt;&lt;/small&gt;</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>
226 +                                   </widget>
227 +                                   <packing>
228 +                                     <property name="padding">0</property>
229 +                                     <property name="expand">False</property>
230 +                                     <property name="fill">False</property>
231 +                                   </packing>
232 +                                 </child>
233 +
234 +                                 <child>
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>
244 +                                   </widget>
245 +                                   <packing>
246 +                                     <property name="padding">0</property>
247 +                                     <property name="expand">True</property>
248 +                                     <property name="fill">True</property>
249 +                                   </packing>
250 +                                 </child>
251 +
252 +                                 <child>
253 +                                   <widget class="GtkLabel" id="label63">
254 +                                     <property name="visible">True</property>
255 +                                     <property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;Maximum&lt;/i&gt;&lt;/small&gt;</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>
265 +                                   </widget>
266 +                                   <packing>
267 +                                     <property name="padding">0</property>
268 +                                     <property name="expand">False</property>
269 +                                     <property name="fill">False</property>
270 +                                   </packing>
271 +                                 </child>
272 +                               </widget>
273 +                               <packing>
274 +                                 <property name="padding">1</property>
275 +                                 <property name="expand">True</property>
276 +                                 <property name="fill">True</property>
277 +                               </packing>
278 +                             </child>
279 +                           </widget>
280 +                         </child>
281 +                       </widget>
282 +                       <packing>
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>
288 +                       </packing>
289 +                     </child>
290 +
291 +                     <child>
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>
299 +
300 +                         <child>
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>
314 +                           </widget>
315 +                           <packing>
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>
322 +                           </packing>
323 +                         </child>
324 +
325 +                         <child>
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>
330 +
331 +                             <child>
332 +                               <widget class="GtkMenu" id="menu1">
333 +
334 +                                 <child>
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>
339 +                                   </widget>
340 +                                 </child>
341 +
342 +                                 <child>
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>
347 +                                   </widget>
348 +                                 </child>
349 +
350 +                                 <child>
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>
355 +                                   </widget>
356 +                                 </child>
357 +                               </widget>
358 +                             </child>
359 +                           </widget>
360 +                           <packing>
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>
367 +                           </packing>
368 +                         </child>
369 +                       </widget>
370 +                       <packing>
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>
376                         </packing>
377                       </child>
378                     </widget>
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
381 @@ -458,6 +458,21 @@
382      </schema>
383  
384      <schema>
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>
390 +      <locale name="C">
391 +        <short>Font smoothing behavior</short>
392 +        <long>
393 +         Controls the font smoothing behavior for this profile.  Possibilities
394 +         are "default", "enabled", and "disabled".
395 +        </long>
396 +      </locale>
397 +    </schema>
398 +
399 +    <schema>
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
405 @@ -135,6 +135,8 @@
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);
413  
414 @@ -336,6 +338,9 @@
415    if (mask->use_system_font)
416      profile_editor_update_use_system_font (editor, profile);
417  
418 +  if (mask->font_smoothing)
419 +    profile_editor_update_font_smoothing (editor, profile);
420 +
421    if (mask->font)
422      profile_editor_update_font (editor, profile);
423    
424 @@ -737,6 +742,17 @@
425  }
426  
427  static void
428 +font_smoothing_changed (GtkWidget       *option_menu,
429 +                        TerminalProfile *profile)
430 +{
431 +  int i;
432 +
433 +  i = gtk_option_menu_get_history (GTK_OPTION_MENU (option_menu));
434 +
435 +  terminal_profile_set_font_smoothing (profile, i);
436 +}
437 +
438 +static void
439  font_set (GtkWidget       *fontpicker,
440            TerminalProfile *profile)
441  {
442 @@ -1172,6 +1188,7 @@
443        if (terminal_widget_supports_pango_fonts ())
444          {
445            GtkWidget *font_label;
446 +         GtkWidget *font_smoothing_optionmenu;
447            
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));
454 +
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),
460 +                            profile);
461          }
462        else
463          {
464 @@ -1439,6 +1463,9 @@
465    set_insensitive (editor, "system-font-checkbutton",
466                     mask->use_system_font);
467  
468 +  set_insensitive (editor, "font-smoothing-optionmenu",
469 +                   mask->font_smoothing);
470 +
471    
472    {
473      int i;
474 @@ -1976,6 +2003,19 @@
475    
476    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w),
477                                  terminal_profile_get_use_system_font (profile));
478 +}
479 +
480 +static void
481 +profile_editor_update_font_smoothing (GtkWidget       *editor,
482 +                                      TerminalProfile *profile)
483 +{
484 +  GtkWidget *w;
485 +
486 +  w = profile_editor_get_widget (editor, "font-smoothing-optionmenu");
487 +
488 +  gtk_option_menu_set_history (GTK_OPTION_MENU (w),
489 +                               terminal_profile_get_font_smoothing (profile));
490 +
491  }
492  
493  static void
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
496 @@ -68,6 +68,7 @@
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"
503  
504 @@ -93,6 +94,7 @@
505    TerminalTitleMode title_mode;
506    char *word_chars;
507    TerminalScrollbarPosition scrollbar_position;
508 +  TerminalFontSmoothing font_smoothing;
509    int scrollback_lines;
510    TerminalExitAction exit_action;
511    char *custom_command;
512 @@ -167,6 +169,13 @@
513    { -1, NULL }
514  };
515  
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" },
520 +  { -1, NULL }
521 +};
522 +
523  static const GConfEnumStringPair exit_actions[] = {
524    { TERMINAL_EXIT_CLOSE, "close" },
525    { TERMINAL_EXIT_RESTART, "restart" },
526 @@ -290,6 +299,7 @@
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 @@
535    g_free (key);
536  }
537  
538 +TerminalFontSmoothing
539 +terminal_profile_get_font_smoothing (TerminalProfile *profile)
540 +{
541 +  g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), 0);
542 +
543 +  return profile->priv->font_smoothing;
544 +}
545 +
546 +void
547 +terminal_profile_set_font_smoothing (TerminalProfile      *profile,
548 +                                     TerminalFontSmoothing setting)
549 +{
550 +  char *key;
551 +  const char *smoothing_behavior;
552 +
553 +  RETURN_IF_NOTIFYING (profile);
554 +
555 +  key = gconf_concat_dir_and_key (profile->priv->profile_dir,
556 +                                  KEY_FONT_SMOOTHING);
557 +
558 +  smoothing_behavior = gconf_enum_to_string (font_smoothing_behaviors, setting);
559 +
560 +  gconf_client_set_string (profile->priv->conf,
561 +                           key,
562 +                           smoothing_behavior,
563 +                           NULL);
564 +
565 +  g_free (key);
566 +}
567 +
568  gboolean
569  terminal_profile_get_use_skey (TerminalProfile *profile)
570  {
571 @@ -1648,6 +1688,25 @@
572  }
573  
574  static gboolean
575 +set_font_smoothing (TerminalProfile *profile,
576 +                    const char      *str_val)
577 +{
578 +  int behavior; /* TerminalFontSmoothing */
579 +
580 +  if (str_val &&
581 +      gconf_string_to_enum (font_smoothing_behaviors, str_val, &behavior) &&
582 +      behavior != profile->priv->font_smoothing)
583 +    {
584 +      profile->priv->font_smoothing = behavior;
585 +      return TRUE;
586 +    }
587 +  else
588 +    {
589 +      return FALSE;
590 +    }
591 +}
592 +
593 +static gboolean
594  set_exit_action (TerminalProfile *profile,
595                   const char      *str_val)
596  {
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);
603    
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);
611     }
612    
613 @@ -2858,6 +2919,16 @@
614    gconf_client_set_bool (base_profile->priv->conf,
615                           key, base_profile->priv->use_system_font,
616                           &err);
617 +  BAIL_OUT_CHECK ();
618 +
619 +  g_free (key);
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,
625 +                           key, cs,
626 +                           &err);
627    BAIL_OUT_CHECK ();
628  
629    g_free (key);
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
632 @@ -65,6 +65,7 @@
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;
639  
640 @@ -95,6 +96,13 @@
641    TERMINAL_SCROLLBAR_HIDDEN
642  } TerminalScrollbarPosition;
643  
644 +typedef enum
645 +{
646 +  TERMINAL_FONT_SMOOTHING_DEFAULT,
647 +  TERMINAL_FONT_SMOOTHING_ENABLED,
648 +  TERMINAL_FONT_SMOOTHING_DISABLED
649 +} TerminalFontSmoothing;
650 +
651  typedef enum 
652  {
653    TERMINAL_EXIT_CLOSE,
654 @@ -183,6 +191,7 @@
655  
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);
661  
662 @@ -256,6 +265,9 @@
663  
664  void terminal_profile_set_use_system_font       (TerminalProfile        *profile,
665                                                  gboolean                setting);
666 +
667 +void terminal_profile_set_font_smoothing         (TerminalProfile        *profile,
668 +                                                  TerminalFontSmoothing   setting);
669  
670  void terminal_profile_set_use_skey              (TerminalProfile        *profile,
671                                                  gboolean                setting);
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 ())
676      {
677        PangoFontDescription *desc;
678 +      TerminalFontSmoothing font_smoothing;
679  
680        if (terminal_profile_get_use_system_font (profile))
681          desc = get_system_monospace_font ();
682        else
683          desc = pango_font_description_copy (terminal_profile_get_font (profile));
684  
685 +      font_smoothing = terminal_profile_get_font_smoothing (profile);
686 +
687        pango_font_description_set_size (desc,
688                                         screen->priv->font_scale *
689                                         pango_font_description_get_size (desc));
690  
691 -      terminal_widget_set_pango_font (term, desc);
692 +      terminal_widget_set_pango_font (term, desc, font_smoothing);
693  
694        pango_font_description_free (desc);
695      }
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 @@
699  
700  void
701  terminal_widget_set_pango_font (GtkWidget                  *widget,
702 -                                const PangoFontDescription *font_desc)
703 +                                const PangoFontDescription *font_desc,
704 +                                TerminalFontSmoothing       font_smoothing)
705  {
706 +  VteTerminalAntiAlias vte_antialias;
707 +
708    g_return_if_fail (font_desc != NULL);
709 -  vte_terminal_set_font (VTE_TERMINAL (widget), font_desc);
710 +
711 +  switch (font_smoothing) {
712 +    case TERMINAL_FONT_SMOOTHING_ENABLED:
713 +      vte_antialias = VTE_ANTI_ALIAS_FORCE_ENABLE;
714 +      break;
715 +    case TERMINAL_FONT_SMOOTHING_DISABLED:
716 +      vte_antialias = VTE_ANTI_ALIAS_FORCE_DISABLE;
717 +      break;
718 +    default:
719 +      vte_antialias = VTE_ANTI_ALIAS_USE_DEFAULT;
720 +      break;
721 +  }
722 +
723 +  vte_terminal_set_font_full (VTE_TERMINAL (widget), font_desc, vte_antialias);
724  }
725  
726  gboolean
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
729 @@ -156,7 +156,8 @@
730                                            int         len);
731  
732  void terminal_widget_set_pango_font (GtkWidget                  *widget,
733 -                                     const PangoFontDescription *font_desc);
734 +                                     const PangoFontDescription *font_desc,
735 +                                     TerminalFontSmoothing       font_smoothing);
736  
737  gboolean terminal_widget_supports_pango_fonts (void);
This page took 0.151683 seconds and 3 git commands to generate.