Index: capplets/font/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/font/Makefile.am,v
retrieving revision 1.10
diff -u -r1.10 Makefile.am
--- capplets/font/Makefile.am	28 Nov 2004 08:14:04 -0000	1.10
+++ capplets/font/Makefile.am	9 Apr 2005 08:42:53 -0000
@@ -4,6 +4,7 @@
 	$(top_builddir)/capplets/common/libcommon.la \
 	$(FONT_CAPPLET_LIBS)
 gnome_font_properties_SOURCES = \
+	xft2.c		\
 	main.c		
 gnome_font_properties_LDFLAGS = -export-dynamic
 
Index: capplets/font/font-properties.glade
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/font/font-properties.glade,v
retrieving revision 1.21
diff -u -r1.21 font-properties.glade
--- capplets/font/font-properties.glade	1 Jan 2005 23:18:31 -0000	1.21
+++ capplets/font/font-properties.glade	9 Apr 2005 08:42:56 -0000
@@ -12,6 +12,12 @@
   <property name="modal">False</property>
   <property name="resizable">False</property>
   <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
   <property name="has_separator">False</property>
 
   <child internal-child="vbox">
@@ -33,18 +39,95 @@
 	      <property name="label">gtk-help</property>
 	      <property name="use_stock">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
 	      <property name="response_id">-11</property>
 	    </widget>
 	  </child>
 
 	  <child>
-	    <widget class="GtkButton" id="closebutton1">
+	    <widget class="GtkButton" id="go_to_font_button">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <property name="response_id">1</property>
+
+	      <child>
+		<widget class="GtkAlignment" id="alignment18">
+		  <property name="visible">True</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xscale">0</property>
+		  <property name="yscale">0</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">0</property>
+		  <property name="right_padding">0</property>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox9">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">2</property>
+
+		      <child>
+			<widget class="GtkImage" id="image3">
+			  <property name="visible">True</property>
+			  <property name="stock">gtk-jump-to</property>
+			  <property name="icon_size">4</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label22">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">Go to Font Folder</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkButton" id="button6">
 	      <property name="visible">True</property>
 	      <property name="can_default">True</property>
 	      <property name="can_focus">True</property>
 	      <property name="label">gtk-close</property>
 	      <property name="use_stock">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
 	      <property name="response_id">-7</property>
 	    </widget>
 	  </child>
@@ -58,39 +141,46 @@
       </child>
 
       <child>
-	<widget class="GtkVBox" id="vbox19">
-	  <property name="border_width">5</property>
+	<widget class="GtkNotebook" id="notebook">
 	  <property name="visible">True</property>
-	  <property name="homogeneous">False</property>
-	  <property name="spacing">18</property>
+	  <property name="can_focus">True</property>
+	  <property name="show_tabs">True</property>
+	  <property name="show_border">True</property>
+	  <property name="tab_pos">GTK_POS_TOP</property>
+	  <property name="scrollable">False</property>
+	  <property name="enable_popup">False</property>
 
 	  <child>
 	    <widget class="GtkTable" id="table3">
+	      <property name="border_width">6</property>
 	      <property name="visible">True</property>
-	      <property name="n_rows">4</property>
-	      <property name="n_columns">2</property>
+	      <property name="n_rows">7</property>
+	      <property name="n_columns">3</property>
 	      <property name="homogeneous">False</property>
 	      <property name="row_spacing">6</property>
 	      <property name="column_spacing">12</property>
 
 	      <child>
-		<widget class="GtkLabel" id="label5">
+		<widget class="GtkLabel" id="label20">
 		  <property name="visible">True</property>
-		  <property name="label" translatable="yes">_Application font:</property>
-		  <property name="use_underline">True</property>
-		  <property name="use_markup">False</property>
-		  <property name="justify">GTK_JUSTIFY_RIGHT</property>
+		  <property name="label" translatable="yes">&lt;b&gt;General Fonts&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
 		  <property name="wrap">False</property>
 		  <property name="selectable">False</property>
 		  <property name="xalign">0</property>
 		  <property name="yalign">0.5</property>
 		  <property name="xpad">0</property>
 		  <property name="ypad">0</property>
-		  <property name="mnemonic_widget">application_font</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
 		</widget>
 		<packing>
 		  <property name="left_attach">0</property>
-		  <property name="right_attach">1</property>
+		  <property name="right_attach">3</property>
 		  <property name="top_attach">0</property>
 		  <property name="bottom_attach">1</property>
 		  <property name="x_options">fill</property>
@@ -99,20 +189,16 @@
 	      </child>
 
 	      <child>
-		<widget class="GnomeFontPicker" id="application_font">
+		<widget class="GtkFixed" id="fixed1">
+		  <property name="width_request">6</property>
 		  <property name="visible">True</property>
-		  <property name="tooltip" translatable="yes">Set the font for applications</property>
-		  <property name="can_focus">True</property>
-		  <property name="mode">GNOME_FONT_PICKER_MODE_FONT_INFO</property>
-		  <property name="show_size">True</property>
-		  <property name="use_font_in_label">True</property>
-		  <property name="label_font_size">14</property>
 		</widget>
 		<packing>
-		  <property name="left_attach">1</property>
-		  <property name="right_attach">2</property>
-		  <property name="top_attach">0</property>
-		  <property name="bottom_attach">1</property>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">1</property>
+		  <property name="bottom_attach">3</property>
+		  <property name="x_options">fill</property>
 		  <property name="y_options">fill</property>
 		</packing>
 	      </child>
@@ -131,12 +217,16 @@
 		  <property name="xpad">0</property>
 		  <property name="ypad">0</property>
 		  <property name="mnemonic_widget">desktop_font</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
 		</widget>
 		<packing>
-		  <property name="left_attach">0</property>
-		  <property name="right_attach">1</property>
-		  <property name="top_attach">1</property>
-		  <property name="bottom_attach">2</property>
+		  <property name="left_attach">1</property>
+		  <property name="right_attach">2</property>
+		  <property name="top_attach">2</property>
+		  <property name="bottom_attach">3</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
 		</packing>
@@ -151,6 +241,36 @@
 		  <property name="show_size">True</property>
 		  <property name="use_font_in_label">True</property>
 		  <property name="label_font_size">14</property>
+		  <property name="focus_on_click">True</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">2</property>
+		  <property name="right_attach">3</property>
+		  <property name="top_attach">2</property>
+		  <property name="bottom_attach">3</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label5">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">_Application font:</property>
+		  <property name="use_underline">True</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_RIGHT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="mnemonic_widget">application_font</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
 		</widget>
 		<packing>
 		  <property name="left_attach">1</property>
@@ -163,6 +283,54 @@
 	      </child>
 
 	      <child>
+		<widget class="GnomeFontPicker" id="application_font">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Set the font for applications</property>
+		  <property name="can_focus">True</property>
+		  <property name="mode">GNOME_FONT_PICKER_MODE_FONT_INFO</property>
+		  <property name="show_size">True</property>
+		  <property name="use_font_in_label">True</property>
+		  <property name="label_font_size">14</property>
+		  <property name="focus_on_click">True</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">2</property>
+		  <property name="right_attach">3</property>
+		  <property name="top_attach">1</property>
+		  <property name="bottom_attach">2</property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label21">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Document Fonts&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">3</property>
+		  <property name="top_attach">4</property>
+		  <property name="bottom_attach">5</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
 		<widget class="GtkLabel" id="label12">
 		  <property name="visible">True</property>
 		  <property name="label" translatable="yes">_Window title font:</property>
@@ -176,12 +344,16 @@
 		  <property name="xpad">0</property>
 		  <property name="ypad">0</property>
 		  <property name="mnemonic_widget">window_title_font</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
 		</widget>
 		<packing>
-		  <property name="left_attach">0</property>
-		  <property name="right_attach">1</property>
-		  <property name="top_attach">2</property>
-		  <property name="bottom_attach">3</property>
+		  <property name="left_attach">1</property>
+		  <property name="right_attach">2</property>
+		  <property name="top_attach">5</property>
+		  <property name="bottom_attach">6</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
 		</packing>
@@ -195,18 +367,33 @@
 		  <property name="show_size">True</property>
 		  <property name="use_font_in_label">True</property>
 		  <property name="label_font_size">14</property>
+		  <property name="focus_on_click">True</property>
 		</widget>
 		<packing>
-		  <property name="left_attach">1</property>
-		  <property name="right_attach">2</property>
-		  <property name="top_attach">2</property>
-		  <property name="bottom_attach">3</property>
+		  <property name="left_attach">2</property>
+		  <property name="right_attach">3</property>
+		  <property name="top_attach">5</property>
+		  <property name="bottom_attach">6</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
 		</packing>
 	      </child>
 
 	      <child>
+		<widget class="GtkFixed" id="fixed3">
+		  <property name="visible">True</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">5</property>
+		  <property name="bottom_attach">7</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+
+	      <child>
 		<widget class="GtkLabel" id="label13">
 		  <property name="visible">True</property>
 		  <property name="label" translatable="yes">_Terminal font:</property>
@@ -220,12 +407,16 @@
 		  <property name="xpad">0</property>
 		  <property name="ypad">0</property>
 		  <property name="mnemonic_widget">monospace_font</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
 		</widget>
 		<packing>
-		  <property name="left_attach">0</property>
-		  <property name="right_attach">1</property>
-		  <property name="top_attach">3</property>
-		  <property name="bottom_attach">4</property>
+		  <property name="left_attach">1</property>
+		  <property name="right_attach">2</property>
+		  <property name="top_attach">6</property>
+		  <property name="bottom_attach">7</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
 		</packing>
@@ -240,26 +431,65 @@
 		  <property name="show_size">True</property>
 		  <property name="use_font_in_label">True</property>
 		  <property name="label_font_size">14</property>
+		  <property name="focus_on_click">True</property>
 		</widget>
 		<packing>
-		  <property name="left_attach">1</property>
-		  <property name="right_attach">2</property>
+		  <property name="left_attach">2</property>
+		  <property name="right_attach">3</property>
+		  <property name="top_attach">6</property>
+		  <property name="bottom_attach">7</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkFixed" id="fixed2">
+		  <property name="height_request">5</property>
+		  <property name="visible">True</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">3</property>
 		  <property name="top_attach">3</property>
 		  <property name="bottom_attach">4</property>
 		  <property name="x_options">fill</property>
-		  <property name="y_options"></property>
+		  <property name="y_options">fill</property>
 		</packing>
 	      </child>
 	    </widget>
 	    <packing>
-	      <property name="padding">0</property>
-	      <property name="expand">True</property>
-	      <property name="fill">True</property>
+	      <property name="tab_expand">False</property>
+	      <property name="tab_fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label17">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">Font Preferences</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0.5</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="type">tab</property>
 	    </packing>
 	  </child>
 
 	  <child>
 	    <widget class="GtkVBox" id="vbox20">
+	      <property name="border_width">6</property>
 	      <property name="visible">True</property>
 	      <property name="homogeneous">False</property>
 	      <property name="spacing">6</property>
@@ -277,6 +507,10 @@
 		  <property name="yalign">0.5</property>
 		  <property name="xpad">0</property>
 		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
 		</widget>
 		<packing>
 		  <property name="padding">0</property>
@@ -292,18 +526,9 @@
 		  <property name="spacing">0</property>
 
 		  <child>
-		    <widget class="GtkLabel" id="label14">
+		    <widget class="GtkFixed" id="fixed7">
+		      <property name="width_request">12</property>
 		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">    </property>
-		      <property name="use_underline">False</property>
-		      <property name="use_markup">False</property>
-		      <property name="justify">GTK_JUSTIFY_LEFT</property>
-		      <property name="wrap">False</property>
-		      <property name="selectable">False</property>
-		      <property name="xalign">0.5</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xpad">0</property>
-		      <property name="ypad">0</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -315,7 +540,7 @@
 		  <child>
 		    <widget class="GtkTable" id="font_render_frame">
 		      <property name="visible">True</property>
-		      <property name="n_rows">3</property>
+		      <property name="n_rows">2</property>
 		      <property name="n_columns">2</property>
 		      <property name="homogeneous">False</property>
 		      <property name="row_spacing">6</property>
@@ -334,6 +559,7 @@
 			      <property name="label" translatable="yes">_Monochrome</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -352,6 +578,10 @@
 			      <property name="yalign">0.5</property>
 			      <property name="xscale">1</property>
 			      <property name="yscale">1</property>
+			      <property name="top_padding">0</property>
+			      <property name="bottom_padding">0</property>
+			      <property name="left_padding">0</property>
+			      <property name="right_padding">0</property>
 
 			      <child>
 				<widget class="GtkDrawingArea" id="monochrome_sample">
@@ -371,34 +601,7 @@
 			  <property name="right_attach">1</property>
 			  <property name="top_attach">0</property>
 			  <property name="bottom_attach">1</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkAlignment" id="alignment13">
-			  <property name="visible">True</property>
-			  <property name="xalign">1</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xscale">0</property>
-			  <property name="yscale">1</property>
-
-			  <child>
-			    <widget class="GtkButton" id="details_button">
-			      <property name="visible">True</property>
-			      <property name="can_focus">True</property>
-			      <property name="label" translatable="yes">D_etails...</property>
-			      <property name="use_underline">True</property>
-			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="left_attach">1</property>
-			  <property name="right_attach">2</property>
-			  <property name="top_attach">2</property>
-			  <property name="bottom_attach">3</property>
-			  <property name="x_options">fill</property>
-			  <property name="y_options"></property>
+			  <property name="y_options">fill</property>
 			</packing>
 		      </child>
 
@@ -415,6 +618,7 @@
 			      <property name="label" translatable="yes">Best _shapes</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -434,6 +638,10 @@
 			      <property name="yalign">0.5</property>
 			      <property name="xscale">1</property>
 			      <property name="yscale">1</property>
+			      <property name="top_padding">0</property>
+			      <property name="bottom_padding">0</property>
+			      <property name="left_padding">0</property>
+			      <property name="right_padding">0</property>
 
 			      <child>
 				<widget class="GtkDrawingArea" id="best_shapes_sample">
@@ -453,22 +661,24 @@
 			  <property name="right_attach">2</property>
 			  <property name="top_attach">0</property>
 			  <property name="bottom_attach">1</property>
+			  <property name="y_options">fill</property>
 			</packing>
 		      </child>
 
 		      <child>
-			<widget class="GtkVBox" id="vbox3">
+			<widget class="GtkVBox" id="vbox4">
 			  <property name="visible">True</property>
 			  <property name="homogeneous">False</property>
 			  <property name="spacing">6</property>
 
 			  <child>
-			    <widget class="GtkRadioButton" id="best_contrast_radio">
+			    <widget class="GtkRadioButton" id="subpixel_radio">
 			      <property name="visible">True</property>
 			      <property name="can_focus">True</property>
-			      <property name="label" translatable="yes">Best co_ntrast</property>
+			      <property name="label" translatable="yes">Sub_pixel smoothing (LCDs)</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -482,15 +692,19 @@
 			  </child>
 
 			  <child>
-			    <widget class="GtkAlignment" id="alignment3">
+			    <widget class="GtkAlignment" id="alignment4">
 			      <property name="visible">True</property>
 			      <property name="xalign">0.5</property>
 			      <property name="yalign">0.5</property>
 			      <property name="xscale">1</property>
 			      <property name="yscale">1</property>
+			      <property name="top_padding">0</property>
+			      <property name="bottom_padding">0</property>
+			      <property name="left_padding">0</property>
+			      <property name="right_padding">0</property>
 
 			      <child>
-				<widget class="GtkDrawingArea" id="best_contrast_sample">
+				<widget class="GtkDrawingArea" id="subpixel_sample">
 				  <property name="visible">True</property>
 				</widget>
 			      </child>
@@ -503,26 +717,28 @@
 			  </child>
 			</widget>
 			<packing>
-			  <property name="left_attach">0</property>
-			  <property name="right_attach">1</property>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">2</property>
 			  <property name="top_attach">1</property>
 			  <property name="bottom_attach">2</property>
+			  <property name="y_options">fill</property>
 			</packing>
 		      </child>
 
 		      <child>
-			<widget class="GtkVBox" id="vbox4">
+			<widget class="GtkVBox" id="vbox3">
 			  <property name="visible">True</property>
 			  <property name="homogeneous">False</property>
 			  <property name="spacing">6</property>
 
 			  <child>
-			    <widget class="GtkRadioButton" id="subpixel_radio">
+			    <widget class="GtkRadioButton" id="best_contrast_radio">
 			      <property name="visible">True</property>
 			      <property name="can_focus">True</property>
-			      <property name="label" translatable="yes">Sub_pixel smoothing (LCDs)</property>
+			      <property name="label" translatable="yes">Best co_ntrast</property>
 			      <property name="use_underline">True</property>
 			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
 			      <property name="active">False</property>
 			      <property name="inconsistent">False</property>
 			      <property name="draw_indicator">True</property>
@@ -536,15 +752,19 @@
 			  </child>
 
 			  <child>
-			    <widget class="GtkAlignment" id="alignment4">
+			    <widget class="GtkAlignment" id="alignment3">
 			      <property name="visible">True</property>
 			      <property name="xalign">0.5</property>
 			      <property name="yalign">0.5</property>
 			      <property name="xscale">1</property>
 			      <property name="yscale">1</property>
+			      <property name="top_padding">0</property>
+			      <property name="bottom_padding">0</property>
+			      <property name="left_padding">0</property>
+			      <property name="right_padding">0</property>
 
 			      <child>
-				<widget class="GtkDrawingArea" id="subpixel_sample">
+				<widget class="GtkDrawingArea" id="best_contrast_sample">
 				  <property name="visible">True</property>
 				</widget>
 			      </child>
@@ -557,10 +777,11 @@
 			  </child>
 			</widget>
 			<packing>
-			  <property name="left_attach">1</property>
-			  <property name="right_attach">2</property>
+			  <property name="left_attach">0</property>
+			  <property name="right_attach">1</property>
 			  <property name="top_attach">1</property>
 			  <property name="bottom_attach">2</property>
+			  <property name="y_options">fill</property>
 			</packing>
 		      </child>
 		    </widget>
@@ -573,128 +794,84 @@
 		</widget>
 		<packing>
 		  <property name="padding">0</property>
-		  <property name="expand">True</property>
+		  <property name="expand">False</property>
 		  <property name="fill">True</property>
 		</packing>
 	      </child>
-	    </widget>
-	    <packing>
-	      <property name="padding">0</property>
-	      <property name="expand">True</property>
-	      <property name="fill">True</property>
-	    </packing>
-	  </child>
-	</widget>
-	<packing>
-	  <property name="padding">0</property>
-	  <property name="expand">True</property>
-	  <property name="fill">True</property>
-	</packing>
-      </child>
-    </widget>
-  </child>
-</widget>
-
-<widget class="GtkDialog" id="render_details">
-  <property name="border_width">5</property>
-  <property name="title" translatable="yes">Font Rendering Details</property>
-  <property name="type">GTK_WINDOW_TOPLEVEL</property>
-  <property name="window_position">GTK_WIN_POS_NONE</property>
-  <property name="modal">False</property>
-  <property name="resizable">False</property>
-  <property name="destroy_with_parent">False</property>
-  <property name="has_separator">False</property>
-
-  <child internal-child="vbox">
-    <widget class="GtkVBox" id="dialog-vbox3">
-      <property name="visible">True</property>
-      <property name="homogeneous">False</property>
-      <property name="spacing">2</property>
-
-      <child internal-child="action_area">
-	<widget class="GtkHButtonBox" id="dialog-action_area3">
-	  <property name="visible">True</property>
-	  <property name="layout_style">GTK_BUTTONBOX_END</property>
-
-	  <child>
-	    <widget class="GtkButton" id="button1">
-	      <property name="visible">True</property>
-	      <property name="can_default">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="label">gtk-help</property>
-	      <property name="use_stock">True</property>
-	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="response_id">-11</property>
-	    </widget>
-	  </child>
-
-	  <child>
-	    <widget class="GtkButton" id="go_to_font_button">
-	      <property name="visible">True</property>
-	      <property name="can_default">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="label" translatable="yes">Go _to font folder</property>
-	      <property name="use_underline">True</property>
-	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="response_id">1</property>
-	    </widget>
-	  </child>
-
-	  <child>
-	    <widget class="GtkButton" id="button3">
-	      <property name="visible">True</property>
-	      <property name="can_default">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="label">gtk-close</property>
-	      <property name="use_stock">True</property>
-	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="response_id">-7</property>
-	    </widget>
-	  </child>
-	</widget>
-	<packing>
-	  <property name="padding">0</property>
-	  <property name="expand">False</property>
-	  <property name="fill">True</property>
-	  <property name="pack_type">GTK_PACK_END</property>
-	</packing>
-      </child>
 
-      <child>
-	<widget class="GtkVBox" id="vbox7">
-	  <property name="border_width">5</property>
-	  <property name="visible">True</property>
-	  <property name="homogeneous">False</property>
-	  <property name="spacing">12</property>
+	      <child>
+		<widget class="GtkFixed" id="fixed8">
+		  <property name="height_request">3</property>
+		  <property name="visible">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
 
-	  <child>
-	    <widget class="GtkAlignment" id="alignment5">
-	      <property name="visible">True</property>
-	      <property name="xalign">0</property>
-	      <property name="yalign">0.5</property>
-	      <property name="xscale">0</property>
-	      <property name="yscale">1</property>
+	      <child>
+		<widget class="GtkLabel" id="label23">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Screen Resolution&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
 
 	      <child>
-		<widget class="GtkHBox" id="hbox1">
+		<widget class="GtkHBox" id="hbox11">
 		  <property name="visible">True</property>
 		  <property name="homogeneous">False</property>
-		  <property name="spacing">10</property>
+		  <property name="spacing">6</property>
+
+		  <child>
+		    <widget class="GtkFixed" id="fixed6">
+		      <property name="width_request">12</property>
+		      <property name="visible">True</property>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
 
 		  <child>
-		    <widget class="GtkLabel" id="label11">
+		    <widget class="GtkLabel" id="label27">
 		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">R_esolution:</property>
+		      <property name="label" translatable="yes">_Resolution:</property>
 		      <property name="use_underline">True</property>
 		      <property name="use_markup">False</property>
-		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="justify">GTK_JUSTIFY_RIGHT</property>
 		      <property name="wrap">False</property>
 		      <property name="selectable">False</property>
-		      <property name="xalign">0.5</property>
+		      <property name="xalign">0</property>
 		      <property name="yalign">0.5</property>
 		      <property name="xpad">0</property>
 		      <property name="ypad">0</property>
 		      <property name="mnemonic_widget">dpi_spinner</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -718,12 +895,12 @@
 		    <packing>
 		      <property name="padding">0</property>
 		      <property name="expand">True</property>
-		      <property name="fill">False</property>
+		      <property name="fill">True</property>
 		    </packing>
 		  </child>
 
 		  <child>
-		    <widget class="GtkLabel" id="label16">
+		    <widget class="GtkLabel" id="label25">
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">dots per inch</property>
 		      <property name="use_underline">False</property>
@@ -735,6 +912,10 @@
 		      <property name="yalign">0.5</property>
 		      <property name="xpad">0</property>
 		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -743,747 +924,39 @@
 		    </packing>
 		  </child>
 		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">True</property>
+		</packing>
 	      </child>
 	    </widget>
 	    <packing>
-	      <property name="padding">0</property>
-	      <property name="expand">False</property>
-	      <property name="fill">False</property>
+	      <property name="tab_expand">False</property>
+	      <property name="tab_fill">True</property>
 	    </packing>
 	  </child>
 
 	  <child>
-	    <widget class="GtkVBox" id="vbox8">
+	    <widget class="GtkLabel" id="label18">
 	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">0</property>
-
-	      <child>
-		<widget class="GtkLabel" id="label8">
-		  <property name="visible">True</property>
-		  <property name="label" translatable="yes">&lt;b&gt;Smoothing&lt;/b&gt;:</property>
-		  <property name="use_underline">False</property>
-		  <property name="use_markup">True</property>
-		  <property name="justify">GTK_JUSTIFY_LEFT</property>
-		  <property name="wrap">False</property>
-		  <property name="selectable">False</property>
-		  <property name="xalign">0</property>
-		  <property name="yalign">0.5</property>
-		  <property name="xpad">0</property>
-		  <property name="ypad">0</property>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">False</property>
-		  <property name="fill">False</property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkTable" id="table5">
-		  <property name="visible">True</property>
-		  <property name="n_rows">2</property>
-		  <property name="n_columns">2</property>
-		  <property name="homogeneous">False</property>
-		  <property name="row_spacing">0</property>
-		  <property name="column_spacing">0</property>
-
-		  <child>
-		    <widget class="GtkVBox" id="vbox12">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkRadioButton" id="antialias_none_radio">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="label" translatable="yes">_None</property>
-			  <property name="use_underline">True</property>
-			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="active">False</property>
-			  <property name="inconsistent">False</property>
-			  <property name="draw_indicator">True</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkAlignment" id="alignment6">
-			  <property name="border_width">5</property>
-			  <property name="visible">True</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xscale">1</property>
-			  <property name="yscale">1</property>
-
-			  <child>
-			    <widget class="GtkDrawingArea" id="antialias_none_sample">
-			      <property name="visible">True</property>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">0</property>
-		      <property name="right_attach">1</property>
-		      <property name="top_attach">0</property>
-		      <property name="bottom_attach">1</property>
-		      <property name="x_options">fill</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkVBox" id="vbox13">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkRadioButton" id="antialias_grayscale_radio">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="label" translatable="yes">Gra_yscale</property>
-			  <property name="use_underline">True</property>
-			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="active">False</property>
-			  <property name="inconsistent">False</property>
-			  <property name="draw_indicator">True</property>
-			  <property name="group">antialias_none_radio</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkAlignment" id="alignment7">
-			  <property name="border_width">5</property>
-			  <property name="visible">True</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xscale">1</property>
-			  <property name="yscale">1</property>
-
-			  <child>
-			    <widget class="GtkDrawingArea" id="antialias_grayscale_sample">
-			      <property name="visible">True</property>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">1</property>
-		      <property name="right_attach">2</property>
-		      <property name="top_attach">0</property>
-		      <property name="bottom_attach">1</property>
-		      <property name="y_options">fill</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkVBox" id="vbox14">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkRadioButton" id="antialias_subpixel_radio">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="label" translatable="yes">Sub_pixel (LCDs)</property>
-			  <property name="use_underline">True</property>
-			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="active">False</property>
-			  <property name="inconsistent">False</property>
-			  <property name="draw_indicator">True</property>
-			  <property name="group">antialias_none_radio</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkAlignment" id="alignment8">
-			  <property name="border_width">5</property>
-			  <property name="visible">True</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xscale">1</property>
-			  <property name="yscale">1</property>
-
-			  <child>
-			    <widget class="GtkDrawingArea" id="antialias_subpixel_sample">
-			      <property name="visible">True</property>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">0</property>
-		      <property name="right_attach">1</property>
-		      <property name="top_attach">1</property>
-		      <property name="bottom_attach">2</property>
-		      <property name="x_options">fill</property>
-		    </packing>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">True</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="padding">0</property>
-	      <property name="expand">True</property>
-	      <property name="fill">True</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkVBox" id="vbox9">
-	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">0</property>
-
-	      <child>
-		<widget class="GtkLabel" id="label9">
-		  <property name="visible">True</property>
-		  <property name="label" translatable="yes">&lt;b&gt;Hinting&lt;/b&gt;:</property>
-		  <property name="use_underline">False</property>
-		  <property name="use_markup">True</property>
-		  <property name="justify">GTK_JUSTIFY_LEFT</property>
-		  <property name="wrap">False</property>
-		  <property name="selectable">False</property>
-		  <property name="xalign">0</property>
-		  <property name="yalign">0.5</property>
-		  <property name="xpad">0</property>
-		  <property name="ypad">0</property>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">False</property>
-		  <property name="fill">False</property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkTable" id="table6">
-		  <property name="visible">True</property>
-		  <property name="n_rows">2</property>
-		  <property name="n_columns">2</property>
-		  <property name="homogeneous">False</property>
-		  <property name="row_spacing">0</property>
-		  <property name="column_spacing">0</property>
-
-		  <child>
-		    <widget class="GtkVBox" id="vbox15">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkRadioButton" id="hint_none_radio">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="label" translatable="yes">N_one</property>
-			  <property name="use_underline">True</property>
-			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="active">False</property>
-			  <property name="inconsistent">False</property>
-			  <property name="draw_indicator">True</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkAlignment" id="alignment9">
-			  <property name="border_width">5</property>
-			  <property name="visible">True</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xscale">1</property>
-			  <property name="yscale">1</property>
-
-			  <child>
-			    <widget class="GtkDrawingArea" id="hint_none_sample">
-			      <property name="visible">True</property>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">0</property>
-		      <property name="right_attach">1</property>
-		      <property name="top_attach">0</property>
-		      <property name="bottom_attach">1</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkVBox" id="vbox16">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkRadioButton" id="hint_slight_radio">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="label" translatable="yes">_Slight</property>
-			  <property name="use_underline">True</property>
-			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="active">False</property>
-			  <property name="inconsistent">False</property>
-			  <property name="draw_indicator">True</property>
-			  <property name="group">hint_none_radio</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkAlignment" id="alignment10">
-			  <property name="border_width">5</property>
-			  <property name="visible">True</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xscale">1</property>
-			  <property name="yscale">1</property>
-
-			  <child>
-			    <widget class="GtkDrawingArea" id="hint_slight_sample">
-			      <property name="visible">True</property>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">1</property>
-		      <property name="right_attach">2</property>
-		      <property name="top_attach">0</property>
-		      <property name="bottom_attach">1</property>
-		      <property name="y_options">fill</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkVBox" id="vbox17">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkRadioButton" id="hint_medium_radio">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="label" translatable="yes">_Medium</property>
-			  <property name="use_underline">True</property>
-			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="active">False</property>
-			  <property name="inconsistent">False</property>
-			  <property name="draw_indicator">True</property>
-			  <property name="group">hint_none_radio</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkAlignment" id="alignment11">
-			  <property name="border_width">5</property>
-			  <property name="visible">True</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xscale">1</property>
-			  <property name="yscale">1</property>
-
-			  <child>
-			    <widget class="GtkDrawingArea" id="hint_medium_sample">
-			      <property name="visible">True</property>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">0</property>
-		      <property name="right_attach">1</property>
-		      <property name="top_attach">1</property>
-		      <property name="bottom_attach">2</property>
-		      <property name="x_options">fill</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkVBox" id="vbox18">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkRadioButton" id="hint_full_radio">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="label" translatable="yes">_Full</property>
-			  <property name="use_underline">True</property>
-			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="active">False</property>
-			  <property name="inconsistent">False</property>
-			  <property name="draw_indicator">True</property>
-			  <property name="group">hint_none_radio</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkAlignment" id="alignment12">
-			  <property name="border_width">5</property>
-			  <property name="visible">True</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xscale">1</property>
-			  <property name="yscale">1</property>
-
-			  <child>
-			    <widget class="GtkDrawingArea" id="hint_full_sample">
-			      <property name="visible">True</property>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">1</property>
-		      <property name="right_attach">2</property>
-		      <property name="top_attach">1</property>
-		      <property name="bottom_attach">2</property>
-		      <property name="x_options">fill</property>
-		      <property name="y_options">fill</property>
-		    </packing>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">True</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="padding">0</property>
-	      <property name="expand">True</property>
-	      <property name="fill">True</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkVBox" id="vbox10">
-	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">0</property>
-
-	      <child>
-		<widget class="GtkLabel" id="label10">
-		  <property name="visible">True</property>
-		  <property name="label" translatable="yes">&lt;b&gt;Subpixel order&lt;/b&gt;:</property>
-		  <property name="use_underline">False</property>
-		  <property name="use_markup">True</property>
-		  <property name="justify">GTK_JUSTIFY_LEFT</property>
-		  <property name="wrap">False</property>
-		  <property name="selectable">False</property>
-		  <property name="xalign">0</property>
-		  <property name="yalign">0.5</property>
-		  <property name="xpad">0</property>
-		  <property name="ypad">0</property>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">False</property>
-		  <property name="fill">False</property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkTable" id="table7">
-		  <property name="visible">True</property>
-		  <property name="n_rows">2</property>
-		  <property name="n_columns">2</property>
-		  <property name="homogeneous">False</property>
-		  <property name="row_spacing">5</property>
-		  <property name="column_spacing">5</property>
-
-		  <child>
-		    <widget class="GtkHBox" id="hbox2">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkRadioButton" id="subpixel_rgb_radio">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="label" translatable="yes">_RGB</property>
-			  <property name="use_underline">True</property>
-			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="active">False</property>
-			  <property name="inconsistent">False</property>
-			  <property name="draw_indicator">True</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkImage" id="subpixel_rgb_image">
-			  <property name="visible">True</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-			<packing>
-			  <property name="padding">5</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">0</property>
-		      <property name="right_attach">1</property>
-		      <property name="top_attach">0</property>
-		      <property name="bottom_attach">1</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkHBox" id="hbox3">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkRadioButton" id="subpixel_bgr_radio">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="label" translatable="yes">_BGR</property>
-			  <property name="use_underline">True</property>
-			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="active">False</property>
-			  <property name="inconsistent">False</property>
-			  <property name="draw_indicator">True</property>
-			  <property name="group">subpixel_rgb_radio</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkImage" id="subpixel_bgr_image">
-			  <property name="visible">True</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-			<packing>
-			  <property name="padding">5</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">1</property>
-		      <property name="right_attach">2</property>
-		      <property name="top_attach">0</property>
-		      <property name="bottom_attach">1</property>
-		      <property name="y_options">fill</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkHBox" id="hbox4">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkRadioButton" id="subpixel_vrgb_radio">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="label" translatable="yes">_VRGB</property>
-			  <property name="use_underline">True</property>
-			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="active">False</property>
-			  <property name="inconsistent">False</property>
-			  <property name="draw_indicator">True</property>
-			  <property name="group">subpixel_rgb_radio</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkImage" id="subpixel_vrgb_image">
-			  <property name="visible">True</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-			<packing>
-			  <property name="padding">5</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">0</property>
-		      <property name="right_attach">1</property>
-		      <property name="top_attach">1</property>
-		      <property name="bottom_attach">2</property>
-		      <property name="x_options">fill</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkHBox" id="hbox5">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">0</property>
-
-		      <child>
-			<widget class="GtkRadioButton" id="subpixel_vbgr_radio">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="label" translatable="yes">VB_GR</property>
-			  <property name="use_underline">True</property>
-			  <property name="relief">GTK_RELIEF_NORMAL</property>
-			  <property name="active">False</property>
-			  <property name="inconsistent">False</property>
-			  <property name="draw_indicator">True</property>
-			  <property name="group">subpixel_rgb_radio</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkImage" id="subpixel_vbgr_image">
-			  <property name="visible">True</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-			<packing>
-			  <property name="padding">5</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">1</property>
-		      <property name="right_attach">2</property>
-		      <property name="top_attach">1</property>
-		      <property name="bottom_attach">2</property>
-		      <property name="x_options">fill</property>
-		      <property name="y_options">fill</property>
-		    </packing>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">True</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
+	      <property name="label" translatable="yes">Rendering</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0.5</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
-	      <property name="padding">0</property>
-	      <property name="expand">True</property>
-	      <property name="fill">True</property>
+	      <property name="type">tab</property>
 	    </packing>
 	  </child>
 	</widget>
@@ -1504,6 +977,12 @@
   <property name="modal">False</property>
   <property name="resizable">True</property>
   <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
   <property name="has_separator">False</property>
 
   <child internal-child="vbox">
@@ -1526,6 +1005,7 @@
 	      <property name="label">gtk-cancel</property>
 	      <property name="use_stock">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
 	      <property name="response_id">-6</property>
 	    </widget>
 	  </child>
@@ -1536,6 +1016,7 @@
 	      <property name="can_default">True</property>
 	      <property name="can_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
 	      <property name="response_id">1</property>
 
 	      <child>
@@ -1545,6 +1026,10 @@
 		  <property name="yalign">0.5</property>
 		  <property name="xscale">0</property>
 		  <property name="yscale">0</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">0</property>
+		  <property name="right_padding">0</property>
 
 		  <child>
 		    <widget class="GtkHBox" id="hbox7">
@@ -1582,6 +1067,10 @@
 			  <property name="yalign">0.5</property>
 			  <property name="xpad">0</property>
 			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
 			</widget>
 			<packing>
 			  <property name="padding">0</property>
@@ -1641,6 +1130,10 @@
 	      <property name="yalign">0.5</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
 	    </widget>
 	    <packing>
 	      <property name="padding">0</property>
Index: capplets/font/main.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/font/main.c,v
retrieving revision 1.31
diff -u -r1.31 main.c
--- capplets/font/main.c	20 Aug 2004 16:50:57 -0000	1.31
+++ capplets/font/main.c	9 Apr 2005 08:42:57 -0000
@@ -1,5 +1,7 @@
 /* This program was written with lots of love under the GPL by Jonathan
- * Blandford <jrb@gnome.org>
+ * Blandford <jrb@gnome.org>.
+ * Complete new GUI, got gid of the details dialog and made many other changes
+ * by Samuel Abels <spam debain org>.
  */
 
 #include <config.h>
@@ -12,909 +14,559 @@
 #include <math.h>
 
 #ifdef HAVE_XFT2
-#include <gdk/gdkx.h>
-#include <X11/Xft/Xft.h>
+#  include "xft2.c"
 #endif /* HAVE_XFT2 */
 
 #include "capplet-util.h"
 #include "activate-settings-daemon.h"
 #include "gconf-property-editor.h"
 
-#ifdef HAVE_XFT2
-static void cb_show_details (GtkWidget *button,
-			     GtkWindow *parent);
-#endif /* HAVE_XFT2 */
+#define GTK_FONT_KEY_DIR               "/desktop/gnome/interface"
+#define GTK_FONT_KEY                   GTK_FONT_KEY_DIR "/font_name"
+#define MONOSPACE_FONT_KEY             GTK_FONT_KEY_DIR "/monospace_font_name"
+#define DESKTOP_FONT_KEY               "/apps/nautilus/preferences/desktop_font"
+#define METACITY_DIR                   "/apps/metacity/general"
+#define WINDOW_TITLE_FONT_KEY          METACITY_DIR "/titlebar_font"
+#define WINDOW_TITLE_USES_SYSTEM_KEY   METACITY_DIR "/titlebar_uses_system_font"
 
-#define GTK_FONT_KEY           "/desktop/gnome/interface/font_name"
-#define DESKTOP_FONT_KEY       "/apps/nautilus/preferences/desktop_font"
+#define MAX_FONT_POINT_WITHOUT_WARNING 32
+#define MAX_FONT_SIZE_WITHOUT_WARNING  (MAX_FONT_POINT_WITHOUT_WARNING * 1024)
+#define PICKER_DIALOG_DATA_STRING      "picker-dialog-data-string"
 
-#define METACITY_DIR "/apps/metacity/general"
-#define WINDOW_TITLE_FONT_KEY METACITY_DIR "/titlebar_font"
-#define WINDOW_TITLE_USES_SYSTEM_KEY METACITY_DIR "/titlebar_uses_system_font"
-#define MONOSPACE_FONT_KEY "/desktop/gnome/interface/monospace_font_name"
+#define GLADEFILE                      GLADEDIR "/font-properties.glade"
 
 #ifdef HAVE_XFT2
-#define FONT_RENDER_DIR "/desktop/gnome/font_rendering"
-#define FONT_ANTIALIASING_KEY FONT_RENDER_DIR "/antialiasing"
-#define FONT_HINTING_KEY      FONT_RENDER_DIR "/hinting"
-#define FONT_RGBA_ORDER_KEY   FONT_RENDER_DIR "/rgba_order"
-#define FONT_DPI_KEY          FONT_RENDER_DIR "/dpi"
+#define FONT_RENDER_DIR                "/desktop/gnome/font_rendering"
+#define FONT_ANTIALIASING_KEY          FONT_RENDER_DIR "/antialiasing"
+#define FONT_HINTING_KEY               FONT_RENDER_DIR "/hinting"
+#define FONT_RGBA_ORDER_KEY            FONT_RENDER_DIR "/rgba_order"
+#define FONT_DPI_KEY                   FONT_RENDER_DIR "/dpi"
 
+static GConfEnumStringPair antialias_enums[] = {
+  { ANTIALIAS_NONE,      "none" },
+  { ANTIALIAS_GRAYSCALE, "grayscale" },
+  { ANTIALIAS_RGBA,      "rgba" },
+  { -1,                  NULL }
+};
+
+static GConfEnumStringPair hint_enums[] = {
+  { HINT_NONE,   "none" },
+  { HINT_SLIGHT, "slight" },
+  { HINT_MEDIUM, "medium" },
+  { HINT_FULL,   "full" },
+  { -1,          NULL }
+};
 #endif /* HAVE_XFT2 */
-static gboolean in_change = FALSE;
-static gchar *old_font = NULL;
 
-#define MAX_FONT_POINT_WITHOUT_WARNING 32
-#define MAX_FONT_SIZE_WITHOUT_WARNING MAX_FONT_POINT_WITHOUT_WARNING*1024
-#define PICKER_DIALOG_DATA_STRING "picker-dialog-data-string"
-static GladeXML *
-create_dialog (void)
-{
-  GladeXML *dialog;
 
-  dialog = glade_xml_new (GLADEDIR "/font-properties.glade", "font_dialog", NULL);
+static gboolean in_change = FALSE;
+static gchar*   old_font  = NULL;
 
-  return dialog;
-}
 
-static void
-cb_dialog_response (GtkDialog *dialog, gint response_id)
+static GladeXML*
+create_dialog(void)
 {
-	if (response_id == GTK_RESPONSE_HELP)
-		capplet_help (GTK_WINDOW (dialog),
-			"user-guide.xml",
-			"goscustdesk-38");
-	else
-		gtk_main_quit ();
+  GladeXML* dialog = glade_xml_new(GLADEFILE, "font_dialog", NULL);
+  g_return_val_if_fail(dialog != NULL, NULL);
+  return dialog;
 }
 
-#ifdef HAVE_XFT2
-
-/*
- * Code for displaying previews of font rendering with various Xft options
- */
 
 static void
-sample_size_request (GtkWidget      *darea,
-		     GtkRequisition *requisition)
+on_dialog_response(GtkDialog* dialog, gint response_id)
 {
-	GdkPixbuf *pixbuf = g_object_get_data (G_OBJECT (darea), "sample-pixbuf");
-
-	requisition->width = gdk_pixbuf_get_width (pixbuf) + 2;
-	requisition->height = gdk_pixbuf_get_height (pixbuf) + 2;
+  switch (response_id) {
+  case GTK_RESPONSE_HELP:
+    capplet_help(GTK_WINDOW(dialog), "user-guide.xml", "goscustdesk-38");
+    break;
+    
+  case 1: /* "Go to Font Folder" */
+		g_spawn_command_line_async ("nautilus --no-desktop fonts:///", NULL);
+    break;
+    
+  default:
+    gtk_main_quit();
+    break;
+  }
 }
 
+
+#ifdef HAVE_XFT2
+/* Purpose: Get the font rendering properties from gconf and store them in
+ * the given enums.
+ */
 static void
-sample_expose (GtkWidget      *darea,
-	       GdkEventExpose *expose)
+font_render_get_gconf(Antialiasing* antialiasing, Hinting* hinting)
 {
-	GdkPixbuf *pixbuf = g_object_get_data (G_OBJECT (darea), "sample-pixbuf");
-	int width = gdk_pixbuf_get_width (pixbuf);
-	int height = gdk_pixbuf_get_height (pixbuf);
-
-	int x = (darea->allocation.width - width) / 2;
-	int y = (darea->allocation.height - height) / 2;
-
-	gdk_draw_rectangle (darea->window, darea->style->white_gc, TRUE,
-			    0, 0,
-			    darea->allocation.width, darea->allocation.height);
-	gdk_draw_rectangle (darea->window, darea->style->black_gc, FALSE,
-			    0, 0,
-			    darea->allocation.width - 1, darea->allocation.height - 1);
-
-	gdk_pixbuf_render_to_drawable (pixbuf, darea->window, NULL,
-				       0, 0, x, y, width, height,
-				       GDK_RGB_DITHER_NORMAL, 0, 0);
+  int          val           = ANTIALIAS_GRAYSCALE;
+  GConfClient* client        = gconf_client_get_default();
+  char*        antialias_str = gconf_client_get_string(client,
+                                                       FONT_ANTIALIASING_KEY,
+                                                       NULL);
+  char*        hint_str      = gconf_client_get_string(client,
+                                                       FONT_HINTING_KEY,
+                                                       NULL);
+  
+  if (antialias_str) {
+    gconf_string_to_enum(antialias_enums, antialias_str, &val);
+    g_free(antialias_str);
+  }
+  *antialiasing = val;
+  
+  val = HINT_FULL;
+  if (hint_str) {
+    gconf_string_to_enum(hint_enums, hint_str, &val);
+    g_free(hint_str);
+  }
+  *hinting = val;
+  
+  g_object_unref(client);
 }
 
-typedef enum {
-	ANTIALIAS_NONE,
-	ANTIALIAS_GRAYSCALE,
-	ANTIALIAS_RGBA
-} Antialiasing;
 
-static GConfEnumStringPair antialias_enums[] = {
-	{ ANTIALIAS_NONE,      "none" },
-	{ ANTIALIAS_GRAYSCALE, "grayscale" },
-	{ ANTIALIAS_RGBA,      "rgba" },
-	{ -1,                  NULL }
-};
-
-typedef enum {
-	HINT_NONE,
-	HINT_SLIGHT,
-	HINT_MEDIUM,
-	HINT_FULL
-} Hinting;
-
-static GConfEnumStringPair hint_enums[] = {
-	{ HINT_NONE,   "none" },
-	{ HINT_SLIGHT, "slight" },
-	{ HINT_MEDIUM, "medium" },
-	{ HINT_FULL,   "full" },
-	{ -1,          NULL }
-};
-
-typedef enum {
-	RGBA_RGB,
-	RGBA_BGR,
-	RGBA_VRGB,
-	RGBA_VBGR
-} RgbaOrder;
-
-static GConfEnumStringPair rgba_order_enums[] = {
-	{ RGBA_RGB,  "rgb" },
-	{ RGBA_BGR,  "bgr" },
-	{ RGBA_VRGB, "vrgb" },
-	{ RGBA_VBGR, "vbgr" },
-	{ -1,         NULL }
-};
+typedef struct {
+  Antialiasing antialiasing;
+  Hinting      hinting;
+  GtkWidget*   radio;
+} FontPair;
 
-static XftFont *
-open_pattern (FcPattern   *pattern,
-	      Antialiasing antialiasing,
-	      Hinting      hinting)
-{
-#ifdef FC_HINT_STYLE
-	static const int hintstyles[] = { FC_HINT_NONE, FC_HINT_SLIGHT, FC_HINT_MEDIUM, FC_HINT_FULL };
-#endif /* FC_HINT_STYLE */
-
-	FcPattern *res_pattern;
-	FcResult result;
-	XftFont *font;
-
-	Display *xdisplay = gdk_x11_get_default_xdisplay ();
-	int screen = gdk_x11_get_default_screen ();
-
-	res_pattern = XftFontMatch (xdisplay, screen, pattern, &result);
-	if (res_pattern == NULL)
-		return NULL;
-
-	FcPatternDel (res_pattern, FC_HINTING);
-	FcPatternAddBool (res_pattern, FC_HINTING, hinting != HINT_NONE);
-
-#ifdef FC_HINT_STYLE
-	FcPatternDel (res_pattern, FC_HINT_STYLE);
-	FcPatternAddInteger (res_pattern, FC_HINT_STYLE, hintstyles[hinting]);
-#endif /* FC_HINT_STYLE */
-
-	FcPatternDel (res_pattern, FC_ANTIALIAS);
-	FcPatternAddBool (res_pattern, FC_ANTIALIAS, antialiasing != ANTIALIAS_NONE);
-
-	FcPatternDel (res_pattern, FC_RGBA);
-	FcPatternAddInteger (res_pattern, FC_RGBA,
-			     antialiasing == ANTIALIAS_RGBA ? FC_RGBA_RGB : FC_RGBA_NONE);
-
-	FcPatternDel (res_pattern, FC_DPI);
-	FcPatternAddInteger (res_pattern, FC_DPI, 96);
-
-	font = XftFontOpenPattern (xdisplay, res_pattern);
-	if (!font)
-		FcPatternDestroy (res_pattern);
-
-	return font;
-}
-
-static void
-setup_font_sample (GtkWidget   *darea,
-		   Antialiasing antialiasing,
-		   Hinting      hinting)
-{
-	const char *string1 = "abcfgop AO ";
-	const char *string2 = "abcfgop";
-
-	XftColor black, white;
-	XRenderColor rendcolor;
-
-	Display *xdisplay = gdk_x11_get_default_xdisplay ();
-
-	GdkColormap *colormap = gdk_rgb_get_colormap ();
-	Colormap xcolormap = GDK_COLORMAP_XCOLORMAP (colormap);
-
-	GdkVisual *visual = gdk_colormap_get_visual (colormap);
-	Visual *xvisual = GDK_VISUAL_XVISUAL (visual);
-
-	FcPattern *pattern;
-	XftFont *font1, *font2;
-	XGlyphInfo extents1 = { 0 };
-	XGlyphInfo extents2 = { 0 };
-	GdkPixmap *pixmap;
-	XftDraw *draw;
-	GdkPixbuf *tmp_pixbuf, *pixbuf;
-
-	int width, height;
-	int ascent, descent;
-
-	pattern = FcPatternBuild (NULL,
-				  FC_FAMILY, FcTypeString, "Serif",
-				  FC_SLANT, FcTypeInteger, FC_SLANT_ROMAN,
-				  FC_SIZE, FcTypeDouble, 18.,
-				  NULL);
-	font1 = open_pattern (pattern, antialiasing, hinting);
-	FcPatternDestroy (pattern);
-
-	pattern = FcPatternBuild (NULL,
-				  FC_FAMILY, FcTypeString, "Serif",
-				  FC_SLANT, FcTypeInteger, FC_SLANT_ITALIC,
-				  FC_SIZE, FcTypeDouble, 20.,
-				  NULL);
-	font2 = open_pattern (pattern, antialiasing, hinting);
-	FcPatternDestroy (pattern);
-
-	if (font1)
-		XftTextExtentsUtf8 (xdisplay, font1, (char *)string1, strlen (string1), &extents1);
-	if (font2)
-		XftTextExtentsUtf8 (xdisplay, font2, (char *)string2, strlen (string2), &extents2);
-
-	ascent = 0;
-	if (font1)
-		ascent = MAX (ascent, font1->ascent);
-	if (font2)
-		ascent = MAX (ascent, font2->ascent);
-
-	descent = 0;
-	if (font1)
-		descent = MAX (descent, font1->descent);
-	if (font2)
-		descent = MAX (descent, font2->descent);
-
-	width = extents1.xOff + extents2.xOff + 4;
-
-	height = ascent + descent + 2;
-
-	pixmap = gdk_pixmap_new (NULL, width, height, visual->depth);
-
-	draw = XftDrawCreate (xdisplay, GDK_DRAWABLE_XID (pixmap), xvisual, xcolormap);
-
-	rendcolor.red = 0;
-	rendcolor.green = 0;
-	rendcolor.blue = 0;
-	rendcolor.alpha = 0xffff;
-	XftColorAllocValue (xdisplay, xvisual, xcolormap, &rendcolor, &black);
-	
-	rendcolor.red = 0xffff;
-	rendcolor.green = 0xffff;
-	rendcolor.blue = 0xffff;
-	rendcolor.alpha = 0xffff;
-	XftColorAllocValue (xdisplay, xvisual, xcolormap, &rendcolor, &white);
-	XftDrawRect (draw, &white, 0, 0, width, height);
-	if (font1)
-		XftDrawStringUtf8 (draw, &black, font1,
-				   2, 2 + ascent,
-				   (char *)string1, strlen (string1));
-	if (font2)
-		XftDrawStringUtf8 (draw, &black, font2,
-				   2 + extents1.xOff, 2 + ascent,
-				   (char *)string2, strlen (string2));
-
-	XftDrawDestroy (draw);
-
-	if (font1)
-		XftFontClose (xdisplay, font1);
-	if (font2)
-		XftFontClose (xdisplay, font2);
-
-	tmp_pixbuf = gdk_pixbuf_get_from_drawable (NULL, pixmap, colormap, 0, 0, 0, 0, width, height);
-	pixbuf = gdk_pixbuf_scale_simple (tmp_pixbuf, 1 * width, 1 * height, GDK_INTERP_TILES);
-
-	g_object_unref (pixmap);
-	g_object_unref (tmp_pixbuf);
-
-	g_object_set_data_full (G_OBJECT (darea), "sample-pixbuf",
-				pixbuf, (GDestroyNotify)g_object_unref);
+static GSList* font_pairs = NULL;
 
-	g_signal_connect (darea, "size_request", G_CALLBACK (sample_size_request), NULL);
-	g_signal_connect (darea, "expose_event", G_CALLBACK (sample_expose), NULL);
-}
-
-/*
- * Code implementing a group of radio buttons with different Xft option combinations.
+/* Purpose: Walk through all toggle buttons and activate the one that
+ * represents the current state from gconf.
  * If one of the buttons is matched by the GConf key, we pick it. Otherwise we
  * show the group as inconsistent.
  */
 static void
-font_render_get_gconf (Antialiasing *antialiasing,
-		       Hinting      *hinting)
+font_render_load(void)
 {
-	GConfClient *client = gconf_client_get_default ();
-	char *antialias_str = gconf_client_get_string (client, FONT_ANTIALIASING_KEY, NULL);
-	char *hint_str = gconf_client_get_string (client, FONT_HINTING_KEY, NULL);
-	int val;
-
-	val = ANTIALIAS_GRAYSCALE;
-	if (antialias_str) {
-		gconf_string_to_enum (antialias_enums, antialias_str, &val);
-		g_free (antialias_str);
-	}
-	*antialiasing = val;
-
-	val = HINT_FULL;
-	if (hint_str) {
-		gconf_string_to_enum (hint_enums, hint_str, &val);
-		g_free (hint_str);
-	}
-	*hinting = val;
-
-	g_object_unref (client);
+  Antialiasing antialiasing;
+  Hinting      hinting;
+  gboolean     inconsistent = TRUE;
+  GSList*      tmp_list     = NULL;
+  
+  font_render_get_gconf(&antialiasing, &hinting);
+  in_change = TRUE;
+  
+  /* Select the correct radio button. */
+  for (tmp_list = font_pairs; tmp_list; tmp_list = tmp_list->next) {
+    FontPair* pair = tmp_list->data;
+  
+    if (antialiasing == pair->antialiasing && hinting == pair->hinting) {
+      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pair->radio), TRUE);
+      inconsistent = FALSE;
+    }
+  }
+  
+  /* If nothing was selected above, mark all radio buttons inconsistent. */
+  /* Otherwise mark them consistent. */
+  for (tmp_list = font_pairs; tmp_list; tmp_list = tmp_list->next) {
+    FontPair* pair = tmp_list->data;
+    gtk_toggle_button_set_inconsistent(GTK_TOGGLE_BUTTON(pair->radio),
+                                       inconsistent);
+  }
+  
+  in_change = FALSE;
 }
 
-typedef struct {
-	Antialiasing antialiasing;
-	Hinting hinting;
-	GtkWidget *radio;
-} FontPair;
-
-static GSList *font_pairs = NULL;
 
 static void
-font_render_load (void)
+on_gconf_font_render_changed(GConfClient* client,
+                             guint        cnxn_id,
+                             GConfEntry*  entry,
+                             gpointer     user_data)
 {
-	Antialiasing antialiasing;
-	Hinting hinting;
-	gboolean inconsistent = TRUE;
-	GSList *tmp_list;
-
-	font_render_get_gconf (&antialiasing, &hinting);
-
-	in_change = TRUE;
-
-	for (tmp_list = font_pairs; tmp_list; tmp_list = tmp_list->next) {
-		FontPair *pair = tmp_list->data;
-
-		if (antialiasing == pair->antialiasing && hinting == pair->hinting) {
-			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pair->radio), TRUE);
-			inconsistent = FALSE;
-		}
-	}
-
-	for (tmp_list = font_pairs; tmp_list; tmp_list = tmp_list->next) {
-		FontPair *pair = tmp_list->data;
-
-		gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (pair->radio), inconsistent);
-	}
-
-	in_change = FALSE;
+  font_render_load();
 }
 
-static void
-font_render_changed (GConfClient *client,
-                     guint        cnxn_id,
-                     GConfEntry  *entry,
-                     gpointer     user_data)
-{
-	font_render_load ();
-}
 
 static void
-font_radio_toggled (GtkToggleButton *toggle_button,
-		    FontPair        *pair)
+on_font_radio_toggled(GtkToggleButton* toggle_button, FontPair* pair)
 {
 	if (!in_change) {
-		GConfClient *client = gconf_client_get_default ();
+		GConfClient* client = gconf_client_get_default();
 
-		gconf_client_set_string (client, FONT_ANTIALIASING_KEY,
-					 gconf_enum_to_string (antialias_enums, pair->antialiasing),
-					 NULL);
-		gconf_client_set_string (client, FONT_HINTING_KEY,
-					 gconf_enum_to_string (hint_enums, pair->hinting),
-					 NULL);
+		gconf_client_set_string(client,
+                            FONT_ANTIALIASING_KEY,
+                            gconf_enum_to_string(antialias_enums,
+                                                 pair->antialiasing),
+                            NULL);
+		gconf_client_set_string(client,
+                            FONT_HINTING_KEY,
+					                  gconf_enum_to_string(hint_enums, pair->hinting),
+					                  NULL);
 
 		g_object_unref (client);
 	}
-
-	/* Restore back to the previous state until we get notification
+  
+	/* Restore back to the previous state until we get notification.
 	 */
 	font_render_load ();
 }
 
-static void
-setup_font_pair (GtkWidget    *radio,
-		 GtkWidget    *darea,
-		 Antialiasing  antialiasing,
-		 Hinting       hinting)
-{
-	FontPair *pair = g_new (FontPair, 1);
-
-	pair->antialiasing = antialiasing;
-	pair->hinting = hinting;
-	pair->radio = radio;
-
-	setup_font_sample (darea, antialiasing, hinting);
-	font_pairs = g_slist_prepend (font_pairs, pair);
-
-	g_signal_connect (radio, "toggled",
-			  G_CALLBACK (font_radio_toggled), pair);
-}
-#endif /* HAVE_XFT2 */
 
+/* Purpose: Loads the font DPI settings from gconf.
+ */
 static void
-metacity_titlebar_load_sensitivity (GConfClient *client,
-				    GladeXML    *dialog)
+dpi_load(GConfClient* client, GtkSpinButton* spinner)
 {
-	gtk_widget_set_sensitive (WID ("window_title_font"),
-				  !gconf_client_get_bool (client,
-							  WINDOW_TITLE_USES_SYSTEM_KEY,
-							  NULL));
+  gdouble dpi = gconf_client_get_float (client, FONT_DPI_KEY, NULL);
+  
+  if (dpi < 50.)
+    dpi = 50.;
+  
+  in_change = TRUE;
+  gtk_spin_button_set_value(spinner, dpi);
+  in_change = FALSE;
 }
 
+
+/* Purpose: Gconf DPI setting callback.
+ */
 static void
-metacity_changed (GConfClient *client,
-		  guint        cnxn_id,
-		  GConfEntry  *entry,
-		  gpointer     user_data)
+on_gconf_dpi_changed(GConfClient* client,
+                     guint        cnxn_id,
+                     GConfEntry*  entry,
+                     gpointer     user_data)
 {
-	if (strcmp (entry->key, WINDOW_TITLE_USES_SYSTEM_KEY) == 0)
-		metacity_titlebar_load_sensitivity (client, user_data);
+  dpi_load(client, user_data);
 }
 
 
-
-/* returns 0 if the font is safe, otherwise returns the size in points. */
-static gint
-new_font_dangerous (const char *new_font)
+/* Purpose: DPI spinbutton callback.
+ */
+static void
+on_spinbutton_dpi_changed(GtkSpinButton* spinner, GConfClient* client)
 {
-	PangoFontDescription *pfd;
-	gboolean retval = 0;
-
-	pfd = pango_font_description_from_string (new_font);
-	if (pfd == NULL)
-		/* an invalid font was passed in.  This isn't our problem. */
-		return 0;
-
-	if (pango_font_description_get_set_fields (pfd) & PANGO_FONT_MASK_SIZE) {
-		if (pango_font_description_get_size (pfd) >= MAX_FONT_SIZE_WITHOUT_WARNING) {
-			retval = pango_font_description_get_size (pfd)/1024;
-		}
-	}
-	pango_font_description_free (pfd);
-
-	return retval;
+	/* Like any time when using a spin button with GConf, there is
+	 * a race condition here. When we change, we send the new
+	 * value to GCOnf, then restore to the old value until
+	 * we get a response to emulate the proper model/view behavior.
+	 *
+	 * If the user changes the value faster than responses are
+	 * received from GConf, this may cause mild strange effects.
+	 */
+	gdouble new_dpi = gtk_spin_button_get_value(spinner);
+	gconf_client_set_float(client, FONT_DPI_KEY, new_dpi, NULL);
+	dpi_load(client, spinner);
 }
 
-static GConfValue *
-application_font_to_gconf (GConfPropertyEditor *peditor,
-			   GConfValue          *value)
-{
-	GConfValue *new_value;
-	const char *new_font;
-	GtkWidget *font_picker;
-	GladeXML *dialog;
-	gint danger_level;
-
-	font_picker = (GtkWidget *) gconf_property_editor_get_ui_control (peditor);
-	g_assert (font_picker);
-
-	dialog = glade_xml_new (GLADEDIR "/font-properties.glade", "font_size_warning_dialog", NULL);
-
-	new_value = gconf_value_new (GCONF_VALUE_STRING);
-	new_font = gconf_value_get_string (value);
-	if (new_font_dangerous (old_font)) {
-		/* If we're already too large, we don't warn again. */
-		gconf_value_set_string (new_value, new_font);
-		return new_value;
-	}
-
-	danger_level = new_font_dangerous (new_font);
-	if (danger_level) {
-		GtkWidget *font_size_warning_dialog;
-		gchar *warning_label;
-		gchar *warning_label2;
-
-		font_size_warning_dialog = WID ("font_size_warning_dialog");
-		if (danger_level > MAX_FONT_POINT_WITHOUT_WARNING) {
-			warning_label = g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s",
-							 _("Font may be too large"),
-							 ngettext ("The font selected is %d point large, and may make it difficult to effectively use the computer.  It is recommended that you select a size smaller than %d.",
-								   "The font selected is %d points large, and may make it difficult to effectively use the computer.  It is recommended that you select a size smaller than %d.",
-								   danger_level));
-			warning_label2 = g_strdup_printf (warning_label, danger_level, MAX_FONT_POINT_WITHOUT_WARNING);
-		} else {
-			warning_label = g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s",
-							 _("Font may be too large"),
-							 ngettext ("The font selected is %d point large, and may make it difficult to effectively use the computer.  It is recommended that you select a smaller sized font.",
-								   "The font selected is %d points large, and may make it difficult to effectively use the computer.  It is recommended that you select a smaller sized font.",
-								   danger_level));
-			warning_label2 = g_strdup_printf (warning_label, danger_level);
-		}
-		gtk_label_set_markup (GTK_LABEL (WID ("font_size_warning_label")), warning_label2);
-		if (gtk_dialog_run (GTK_DIALOG (font_size_warning_dialog)) == 1) {
-			gconf_value_set_string (new_value, new_font);
-		} else {
-			gconf_value_set_string (new_value, old_font);
-			gnome_font_picker_set_font_name (GNOME_FONT_PICKER (font_picker), old_font);
-		}
-		gtk_widget_destroy (font_size_warning_dialog);
-	} else {
-		gconf_value_set_string (new_value, new_font);
-	}
-
-	return new_value;
-}
 
+/* Purpose: Add the given antialiasing/hinting combination to our font list
+ * and set the drawing area up accordingly.
+ */
 static void
-application_font_changed (GtkWidget *font_picker)
+setup_font_pair(GtkWidget*   radio,
+                GtkWidget*   darea,
+                Antialiasing antialiasing,
+                Hinting      hinting)
 {
-	const gchar *font;
+	FontPair* pair = g_new(FontPair, 1);
 
-	font = gnome_font_picker_get_font_name (GNOME_FONT_PICKER (font_picker));
-	g_free (old_font);
-	old_font = g_strdup (font);
+	pair->antialiasing = antialiasing;
+	pair->hinting      = hinting;
+	pair->radio        = radio;
+  
+	setup_font_sample(darea, antialiasing, hinting);
+	font_pairs = g_slist_prepend(font_pairs, pair);
+  
+	g_signal_connect(radio, "toggled", G_CALLBACK(on_font_radio_toggled), pair);
 }
-
-static void
-setup_dialog (GladeXML *dialog)
-{
-  GConfClient *client;
-  GtkWidget *widget;
-  GObject *peditor;
-
-  client = gconf_client_get_default ();
-
-  gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-  gconf_client_add_dir (client, "/apps/nautilus/preferences", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-  gconf_client_add_dir (client, METACITY_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-#ifdef HAVE_XFT2
-  gconf_client_add_dir (client, FONT_RENDER_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-#endif  /* HAVE_XFT2 */
-
-  g_object_set_data (G_OBJECT (WID ("application_font")), PICKER_DIALOG_DATA_STRING, dialog);
-  peditor = gconf_peditor_new_font (NULL, GTK_FONT_KEY,
-		  		    WID ("application_font"),
-				    PEDITOR_FONT_COMBINED,
-				    "conv-from-widget-cb", application_font_to_gconf,
-				    NULL);
-  g_signal_connect_swapped (G_OBJECT (peditor), "value-changed", (GCallback) application_font_changed, WID ("application_font"));
-  application_font_changed (WID ("application_font"));
-  peditor = gconf_peditor_new_font (NULL, DESKTOP_FONT_KEY,
-		  		    WID ("desktop_font"),
-				    PEDITOR_FONT_COMBINED, NULL);
-
-  peditor = gconf_peditor_new_font (NULL, WINDOW_TITLE_FONT_KEY,
-		  		    WID ("window_title_font"),
-				    PEDITOR_FONT_COMBINED, NULL);
-
-  peditor = gconf_peditor_new_font (NULL, MONOSPACE_FONT_KEY,
-		  		    WID ("monospace_font"),
-				    PEDITOR_FONT_COMBINED, NULL);
-
-  gconf_client_notify_add (client, METACITY_DIR,
-			   metacity_changed,
-			   dialog, NULL, NULL);
-
-  metacity_titlebar_load_sensitivity (client, dialog);
-
-  widget = WID ("font_dialog");
-  capplet_set_icon (widget, "gnome-settings-font");
-
-#ifdef HAVE_XFT2
-  setup_font_pair (WID ("monochrome_radio"),    WID ("monochrome_sample"),    ANTIALIAS_NONE,      HINT_FULL);
-  setup_font_pair (WID ("best_shapes_radio"),   WID ("best_shapes_sample"),   ANTIALIAS_GRAYSCALE, HINT_MEDIUM);
-  setup_font_pair (WID ("best_contrast_radio"), WID ("best_contrast_sample"), ANTIALIAS_GRAYSCALE, HINT_FULL);
-  setup_font_pair (WID ("subpixel_radio"),      WID ("subpixel_sample"),      ANTIALIAS_RGBA,      HINT_FULL);
-
-  font_render_load ();
-
-  gconf_client_notify_add (client, FONT_RENDER_DIR,
-			   font_render_changed,
-			   NULL, NULL, NULL);
-
-  g_signal_connect (WID ("details_button"),
- 		    "clicked",
- 		    G_CALLBACK (cb_show_details), widget);
-#else /* !HAVE_XFT2 */
-  gtk_widget_hide (WID ("font_render_frame"));
 #endif /* HAVE_XFT2 */
 
-  g_signal_connect (G_OBJECT (widget),
-    "response",
-    G_CALLBACK (cb_dialog_response), NULL);
-
-  gtk_widget_show (widget);
-
-  g_object_unref (client);
-}
-
-#ifdef HAVE_XFT2
-/*
- * EnumGroup - a group of radio buttons tied to a string enumeration
- *             value. We add this here because the gconf peditor
- *             equivalent of this is both painful to use (you have
- *             to supply functions to convert from enums to indices)
- *             and conceptually broken (the order of radio buttons
- *             in a group when using Glade is not predictable.
- */
-typedef struct
-{
-	GConfClient *client;
-	GSList *items;
-	const gchar *gconf_key;
-	GConfEnumStringPair *enums;
-	int default_value;
-} EnumGroup;
-
-typedef struct
-{
-	EnumGroup *group;
-	GtkWidget *widget;
-	int value;
-} EnumItem;
 
 static void
-enum_group_load (EnumGroup *group)
+metacity_titlebar_load_sensitivity(GConfClient* client, GladeXML* dialog)
 {
-	char *str = gconf_client_get_string (group->client, group->gconf_key, NULL);
-	int val = group->default_value;
-	GSList *tmp_list;
-
-	if (str)
-		gconf_string_to_enum (group->enums, str, &val);
-
-	g_free (str);
-
-	in_change = TRUE;
-
-	for (tmp_list = group->items; tmp_list; tmp_list = tmp_list->next) {
-		EnumItem *item = tmp_list->data;
-
-		if (val == item->value)
-			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item->widget), TRUE);
-	}
-
-
-
-	in_change = FALSE;
+  gtk_widget_set_sensitive(WID("window_title_font"),
+                           !gconf_client_get_bool(client,
+                                                  WINDOW_TITLE_USES_SYSTEM_KEY,
+                                                  NULL));
 }
 
-static void
-enum_group_changed (GConfClient *client,
-		    guint        cnxn_id,
-		    GConfEntry  *entry,
-		    gpointer     user_data)
-{
-	enum_group_load (user_data);
-}
 
 static void
-enum_item_toggled (GtkToggleButton *toggle_button,
-		   EnumItem      *item)
+on_metacity_changed(GConfClient* client,
+                    guint        cnxn_id,
+                    GConfEntry*  entry,
+                    gpointer     user_data)
 {
-	EnumGroup *group = item->group;
-
-	if (!in_change) {
-		gconf_client_set_string (group->client, group->gconf_key,
-					 gconf_enum_to_string (group->enums, item->value),
-					 NULL);
-	}
-
-	/* Restore back to the previous state until we get notification
-	 */
-	enum_group_load (group);
+	if (strcmp(entry->key, WINDOW_TITLE_USES_SYSTEM_KEY) == 0)
+		metacity_titlebar_load_sensitivity(client, user_data);
 }
 
-static EnumGroup *
-enum_group_create (const gchar         *gconf_key,
-		   GConfEnumStringPair *enums,
-		   int                  default_value,
-		   GtkWidget           *first_widget,
-		   ...)
-{
-	EnumGroup *group;
-	GtkWidget *widget;
-	va_list args;
-
-	group = g_new (EnumGroup, 1);
-
-	group->client = gconf_client_get_default ();
-	group->gconf_key = g_strdup (gconf_key);
-	group->enums = enums;
-	group->default_value = default_value;
-	group->items = NULL;
-
-	va_start (args, first_widget);
-
-	widget = first_widget;
-	while (widget)
-	{
-		EnumItem *item;
-
-		item = g_new (EnumItem, 1);
-		item->group = group;
-		item->widget = widget;
-		item->value = va_arg (args, int);
 
-		g_signal_connect (item->widget, "toggled",
-				  G_CALLBACK (enum_item_toggled), item);
+/* Returns 0 if the font is safe, otherwise returns the size in points. */
+static gint
+new_font_dangerous(const char* new_font)
+{
+  PangoFontDescription* pfd    = NULL;
+  gboolean              retval = 0;
+  
+  pfd = pango_font_description_from_string(new_font);
+  if (pfd == NULL)
+    /* an invalid font was passed in.  This isn't our problem. */
+    return 0;
+  
+  if (pango_font_description_get_set_fields(pfd) & PANGO_FONT_MASK_SIZE
+    && pango_font_description_get_size(pfd) >= MAX_FONT_SIZE_WITHOUT_WARNING) {
+    retval = pango_font_description_get_size(pfd) / 1024;
+  }
+  pango_font_description_free (pfd);
+  
+  return retval;
+}
 
-		group->items = g_slist_prepend (group->items, item);
 
-		widget = va_arg (args, GtkWidget *);
+static GConfValue*
+application_font_to_gconf(GConfPropertyEditor* peditor, GConfValue* value)
+{
+  GConfValue* new_value   = NULL;
+  const char* new_font    = NULL;
+  GtkWidget*  font_picker = NULL;
+  GladeXML*   dialog      = NULL;
+  gint        danger_level;
+  
+	font_picker = (GtkWidget*)gconf_property_editor_get_ui_control(peditor);
+	g_assert(font_picker);
+
+	dialog    = glade_xml_new(GLADEFILE, "font_size_warning_dialog", NULL);
+	new_value = gconf_value_new(GCONF_VALUE_STRING);
+	new_font  = gconf_value_get_string(value);
+	if (new_font_dangerous(old_font)) {
+		/* If the old font was already too large, we don't warn again. */
+		gconf_value_set_string(new_value, new_font);
+		return new_value;
 	}
-
-	va_end (args);
-
-	enum_group_load (group);
-
-	gconf_client_notify_add (group->client, gconf_key,
-				 enum_group_changed,
-				 group, NULL, NULL);
-
- 	return group;
+  
+	danger_level = new_font_dangerous(new_font);
+	if (!danger_level) {
+		gconf_value_set_string(new_value, new_font);
+	  return new_value;
+  }
+  else {
+    GtkWidget* font_size_warning_dialog = WID("font_size_warning_dialog");
+    gchar*     text                     = _("Font may be too large");
+    gchar*     descr                    = NULL;
+    gchar*     markup                   = NULL;
+    
+    if (danger_level > MAX_FONT_POINT_WITHOUT_WARNING) {
+      /* Warning when the font is much larger than the maximum. */
+      descr = ngettext("The font selected is %d point large, and may make it "
+                       "difficult to effectively use the computer. It is "
+                       "recommended that you select a size smaller than %d.",
+                       "The font selected is %d points large, and may make it "
+                       "difficult to effectively use the computer. It is "
+                       "recommended that you select a size smaller than %d.",
+                       danger_level);
+      descr = g_strdup_printf(descr,
+                              danger_level,
+                              MAX_FONT_POINT_WITHOUT_WARNING);
+    } else {
+      descr = ngettext("The font selected is %d point large, and may make it "
+                       "difficult to effectively use the computer. It is "
+                       "recommended that you select a smaller sized font.",
+                       "The font selected is %d points large, and may make it "
+                       "difficult to effectively use the computer. It is "
+                       "recommended that you select a smaller sized font.",
+                       danger_level);
+      descr = g_strdup_printf(descr, danger_level);
+    }
+    
+    markup = g_strdup_printf("<span weight=\"bold\" size=\"larger\">%s</span>\n"
+                             "\n%s",
+                             text,
+                             descr);
+    
+    gtk_label_set_markup(GTK_LABEL(WID("font_size_warning_label")), markup);
+    g_free(descr);
+    g_free(markup);
+    
+    if (gtk_dialog_run(GTK_DIALOG(font_size_warning_dialog)) == 1) {
+      gconf_value_set_string(new_value, new_font);
+    } else {
+      gconf_value_set_string (new_value, old_font);
+      gnome_font_picker_set_font_name (GNOME_FONT_PICKER (font_picker), old_font);
+    }
+    gtk_widget_destroy(font_size_warning_dialog);
+  }
+  
+	return new_value;
 }
 
-/*
- * The font rendering details dialog
- */
-static void
-dpi_load (GConfClient   *client,
-	  GtkSpinButton *spinner)
-{
-	gdouble dpi = gconf_client_get_float (client, FONT_DPI_KEY, NULL);
-
-	if (dpi < 50.)
-		dpi = 50.;
-
-	in_change = TRUE;
-	gtk_spin_button_set_value (spinner, dpi);
-	in_change = FALSE;
-}
 
 static void
-dpi_changed (GConfClient *client,
-	     guint        cnxn_id,
-	     GConfEntry  *entry,
-	     gpointer     user_data)
+on_application_font_changed(GtkWidget* font_picker)
 {
-	dpi_load (client, user_data);
+	const gchar* font = NULL;
+	font = gnome_font_picker_get_font_name(GNOME_FONT_PICKER(font_picker));
+	g_free(old_font);
+	old_font = g_strdup(font);
 }
 
-static void
-dpi_value_changed (GtkSpinButton *spinner,
-		   GConfClient   *client)
-{
-	/* Like any time when using a spin button with GConf, there is
-	 * a race condition here. When we change, we send the new
-	 * value to GCOnf, then restore to the old value until
-	 * we get a response to emulate the proper model/view behavior.
-	 *
-	 * If the user changes the value faster than responses are
-	 * received from GConf, this may cause mild strange effects.
-	 */
-	gdouble new_dpi = gtk_spin_button_get_value (spinner);
-
-	gconf_client_set_float (client, FONT_DPI_KEY, new_dpi, NULL);
-
-	dpi_load (client, spinner);
-}
 
 static void
-cb_details_response (GtkDialog *dialog, gint response_id)
-{
-	if (response_id == GTK_RESPONSE_HELP)
-		capplet_help (GTK_WINDOW (dialog),
-			      "user-guide.xml",
-			      "goscustdesk-38");
-	else if (response_id == 1) {
-		/* "Go to font folder" was clicked */
-		g_spawn_command_line_async ("nautilus --no-desktop fonts:///", NULL);
-	} else
-		gtk_widget_hide (GTK_WIDGET (dialog));
+setup_dialog(GladeXML* dialog)
+{
+  GConfClient*   client      = gconf_client_get_default();
+  GtkWidget*     widget      = NULL;
+  GtkWidget*     dpi_spinner = NULL;
+  GObject*       peditor     = NULL;
+  GnomeVFSURI*   uri         = NULL;
+  GtkAdjustment* adjustment  = NULL;
+  int            dpi         = 0;
+  
+  gconf_client_add_dir(client,
+                       GTK_FONT_KEY_DIR,
+                       GCONF_CLIENT_PRELOAD_ONELEVEL,
+                       NULL);
+  gconf_client_add_dir(client,
+                       "/apps/nautilus/preferences",
+                       GCONF_CLIENT_PRELOAD_ONELEVEL,
+                       NULL);
+  gconf_client_add_dir(client,
+                       METACITY_DIR,
+                       GCONF_CLIENT_PRELOAD_ONELEVEL,
+                       NULL);
+#ifdef HAVE_XFT2
+  gconf_client_add_dir(client,
+                       FONT_RENDER_DIR,
+                       GCONF_CLIENT_PRELOAD_ONELEVEL,
+                       NULL);
+#endif  /* HAVE_XFT2 */
+  
+  g_object_set_data(G_OBJECT(WID("application_font")),
+                    PICKER_DIALOG_DATA_STRING,
+                    dialog);
+  peditor = gconf_peditor_new_font(NULL,
+                                   GTK_FONT_KEY,
+                                   WID("application_font"),
+                                   PEDITOR_FONT_COMBINED,
+                                   "conv-from-widget-cb",
+                                   application_font_to_gconf,
+                                   NULL);
+  peditor = gconf_peditor_new_font(NULL,
+                                   DESKTOP_FONT_KEY,
+                                   WID("desktop_font"),
+                                   PEDITOR_FONT_COMBINED,
+                                   NULL);
+  peditor = gconf_peditor_new_font(NULL,
+                                   WINDOW_TITLE_FONT_KEY,
+                                   WID("window_title_font"),
+                                   PEDITOR_FONT_COMBINED,
+                                   NULL);
+  peditor = gconf_peditor_new_font(NULL,
+                                   MONOSPACE_FONT_KEY,
+                                   WID("monospace_font"),
+                                   PEDITOR_FONT_COMBINED,
+                                   NULL);
+  
+  g_signal_connect_swapped(G_OBJECT(peditor),
+                           "value-changed",
+                           (GCallback)on_application_font_changed,
+                           WID("application_font"));
+  on_application_font_changed(WID("application_font"));
+  
+  gconf_client_notify_add(client,
+                          METACITY_DIR,
+                          on_metacity_changed,
+                          dialog, NULL, NULL);
+  
+  metacity_titlebar_load_sensitivity(client, dialog);
+  
+  widget = WID("font_dialog");
+  capplet_set_icon(widget, "gnome-settings-font");
+  
+#ifdef HAVE_XFT2
+  setup_font_pair(WID("monochrome_radio"),
+                  WID("monochrome_sample"),
+                  ANTIALIAS_NONE,
+                  HINT_FULL);
+  setup_font_pair(WID("best_shapes_radio"),
+                  WID("best_shapes_sample"),
+                  ANTIALIAS_GRAYSCALE,
+                  HINT_MEDIUM);
+  setup_font_pair(WID("best_contrast_radio"),
+                  WID("best_contrast_sample"),
+                  ANTIALIAS_GRAYSCALE,
+                  HINT_FULL);
+  setup_font_pair(WID("subpixel_radio"),
+                  WID("subpixel_sample"),
+                  ANTIALIAS_RGBA,
+                  HINT_FULL);
+  
+  font_render_load();
+  
+  gconf_client_notify_add(client,
+                          FONT_RENDER_DIR,
+                          on_gconf_font_render_changed,
+                          NULL, NULL, NULL);
+  
+#else /* !HAVE_XFT2 */
+  gtk_notebook_set_show_tabs(WID("notebook"), FALSE);
+#endif /* HAVE_XFT2 */
+  
+  /* Font folder button. */
+  uri = gnome_vfs_uri_new ("fonts:///");
+  if (!uri)
+    gtk_widget_hide(WID("go_to_font_button"));
+  else
+    gnome_vfs_uri_unref(uri);
+  
+  /* DPI spinbutton. */
+  dpi_spinner = WID("dpi_spinner");
+  dpi = floor((gdk_screen_width()  / gdk_screen_width_mm() +
+               gdk_screen_height() / gdk_screen_height_mm()) * 25.4 / 2. + .5);
+  if (dpi < 50)
+     dpi = 50; /* be extra careful */
+  
+  adjustment = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(dpi_spinner));
+  adjustment->upper = dpi * 3;
+  
+  dpi_load(client, GTK_SPIN_BUTTON(dpi_spinner));
+  g_signal_connect(dpi_spinner,
+                   "value_changed",
+                   G_CALLBACK(on_spinbutton_dpi_changed),
+                   client);
+  gconf_client_notify_add(client,
+                          FONT_DPI_KEY,
+                          on_gconf_dpi_changed,
+                          dpi_spinner, NULL, NULL);
+  
+  /* This dialog. */
+  g_signal_connect(G_OBJECT(widget),
+                   "response",
+                   G_CALLBACK(on_dialog_response),
+                   NULL);
+  
+  gtk_widget_show(widget);
+  g_object_unref(client);
 }
 
-static void
-cb_show_details (GtkWidget *button,
-		 GtkWindow *parent)
-{
-	static GtkWidget *details_dialog = NULL;
-
-	if (!details_dialog) {
-		GConfClient *client = gconf_client_get_default ();
-		GladeXML *dialog = glade_xml_new (GLADEDIR "/font-properties.glade", "render_details", NULL);
-		GtkWidget *dpi_spinner;
-		GnomeVFSURI *uri;
-		int dpi;
-		GtkAdjustment *adjustment;
-
-		details_dialog = WID ("render_details");
-		uri = gnome_vfs_uri_new ("fonts:///");
-		if (uri == NULL) {
-			gtk_widget_hide (WID ("go_to_font_button"));
-		} else {
-			gnome_vfs_uri_unref (uri);
-			gtk_widget_show (WID ("go_to_font_button"));
-		}
-
-		gtk_window_set_transient_for (GTK_WINDOW (details_dialog), parent);
-
-		dpi_spinner = WID ("dpi_spinner");
-
-		/* pick a sensible maximum dpi */
-		dpi = floor ((gdk_screen_width () / gdk_screen_width_mm () +
-			      gdk_screen_height () / gdk_screen_height_mm ()) * 25.4 / 2. + .5);
-		if (dpi < 50)
-			 dpi = 50; /* be extra careful */
-		adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (dpi_spinner));
-		adjustment->upper = dpi * 3;
-
-		dpi_load (client, GTK_SPIN_BUTTON (dpi_spinner));
-		g_signal_connect (dpi_spinner, "value_changed",
-				  G_CALLBACK (dpi_value_changed), client);
-
-		gconf_client_notify_add (client, FONT_DPI_KEY,
-					 dpi_changed,
-					 dpi_spinner, NULL, NULL);
-
-		setup_font_sample (WID ("antialias_none_sample"),      ANTIALIAS_NONE,      HINT_FULL);
-		setup_font_sample (WID ("antialias_grayscale_sample"), ANTIALIAS_GRAYSCALE, HINT_FULL);
-		setup_font_sample (WID ("antialias_subpixel_sample"),  ANTIALIAS_RGBA,      HINT_FULL);
-
-		enum_group_create (FONT_ANTIALIASING_KEY, antialias_enums, ANTIALIAS_GRAYSCALE,
-				     WID ("antialias_none_radio"), ANTIALIAS_NONE,
-				     WID ("antialias_grayscale_radio"), ANTIALIAS_GRAYSCALE,
-				     WID ("antialias_subpixel_radio"), ANTIALIAS_RGBA,
-				     NULL);
-
-		setup_font_sample (WID ("hint_none_sample"),    ANTIALIAS_GRAYSCALE, HINT_NONE);
-		setup_font_sample (WID ("hint_slight_sample"),  ANTIALIAS_GRAYSCALE, HINT_SLIGHT);
-		setup_font_sample (WID ("hint_medium_sample"),  ANTIALIAS_GRAYSCALE, HINT_MEDIUM);
-		setup_font_sample (WID ("hint_full_sample"),    ANTIALIAS_GRAYSCALE, HINT_FULL);
-
-		enum_group_create (FONT_HINTING_KEY, hint_enums, HINT_FULL,
-				   WID ("hint_none_radio"),   HINT_NONE,
-				   WID ("hint_slight_radio"), HINT_SLIGHT,
-				   WID ("hint_medium_radio"), HINT_MEDIUM,
-				   WID ("hint_full_radio"),   HINT_FULL,
-				   NULL);
-
-		gtk_image_set_from_file (GTK_IMAGE (WID ("subpixel_rgb_image")),
-					 PIXMAPDIR "/subpixel-rgb.png");
-		gtk_image_set_from_file (GTK_IMAGE (WID ("subpixel_bgr_image")),
-					 PIXMAPDIR "/subpixel-bgr.png");
-		gtk_image_set_from_file (GTK_IMAGE (WID ("subpixel_vrgb_image")),
-					 PIXMAPDIR "/subpixel-vrgb.png");
-		gtk_image_set_from_file (GTK_IMAGE (WID ("subpixel_vbgr_image")),
-					 PIXMAPDIR "/subpixel-vbgr.png");
-
-		enum_group_create (FONT_RGBA_ORDER_KEY, rgba_order_enums, RGBA_RGB,
-				   WID ("subpixel_rgb_radio"),  RGBA_RGB,
-				   WID ("subpixel_bgr_radio"),  RGBA_BGR,
-				   WID ("subpixel_vrgb_radio"), RGBA_VRGB,
-				   WID ("subpixel_vbgr_radio"), RGBA_VBGR,
-				   NULL);
-
-		g_signal_connect (G_OBJECT (details_dialog),
-				  "response",
-				  G_CALLBACK (cb_details_response), NULL);
-		g_signal_connect (G_OBJECT (details_dialog),
-				  "delete_event",
-				  G_CALLBACK (gtk_true), NULL);
-
-		g_object_unref (client);
-	}
-
-	gtk_window_present (GTK_WINDOW (details_dialog));
-}
-#endif /* HAVE_XFT2 */
 
 int
-main (int argc, char *argv[])
+main(int argc, char *argv[])
 {
-  GladeXML *dialog;
-
-  bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
-  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-  textdomain (GETTEXT_PACKAGE);
-
-  gnome_program_init ("gnome-font-properties", VERSION,
-		      LIBGNOMEUI_MODULE, argc, argv,
-		      GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR,
-		      NULL);
-
-  activate_settings_daemon ();
-
-  dialog = create_dialog ();
-  setup_dialog (dialog);
-
-  gtk_main ();
-
+  GladeXML* dialog = NULL;
+  
+  bindtextdomain(GETTEXT_PACKAGE, GNOMELOCALEDIR);
+  bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+  textdomain(GETTEXT_PACKAGE);
+  
+  gnome_program_init("gnome-font-properties",
+                     VERSION,
+                     LIBGNOMEUI_MODULE,
+                     argc, argv,
+                     GNOME_PARAM_APP_DATADIR,
+                     GNOMECC_DATA_DIR,
+                     NULL);
+  
+  activate_settings_daemon();
+  
+  dialog = create_dialog();
+  setup_dialog(dialog);
+  
+  gtk_main();
+  
   return 0;
 }
Index: capplets/font/xft2.c
===================================================================
RCS file: capplets/font/xft2.c
diff -N capplets/font/xft2.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ capplets/font/xft2.c	9 Apr 2005 08:42:58 -0000
@@ -0,0 +1,271 @@
+/* Code for displaying previews of font rendering with various Xft options.
+ * Written by Jonathan Blandford <jrb@gnome.org>. 
+ * Some random minor changes by Samuel Abels <spam debain org>.
+ */
+
+#ifdef HAVE_XFT2
+
+#include <gdk/gdkx.h>
+#include <X11/Xft/Xft.h>
+
+typedef enum {
+  ANTIALIAS_NONE,
+  ANTIALIAS_GRAYSCALE,
+  ANTIALIAS_RGBA
+} Antialiasing;
+
+typedef enum {
+  HINT_NONE,
+  HINT_SLIGHT,
+  HINT_MEDIUM,
+  HINT_FULL
+} Hinting;
+
+typedef enum {
+  RGBA_RGB,
+  RGBA_BGR,
+  RGBA_VRGB,
+  RGBA_VBGR
+} RgbaOrder;
+
+
+/*****************************************************************************
+ * Prototypes.
+ *****************************************************************************/
+void
+setup_font_sample(GtkWidget* darea, Antialiasing antialiasing, Hinting hinting);
+
+
+/*****************************************************************************
+ * Callbacks.
+ *****************************************************************************/
+static void
+on_sample_size_request(GtkWidget* darea, GtkRequisition* requisition)
+{
+	GdkPixbuf* pixbuf = g_object_get_data(G_OBJECT(darea), "sample-pixbuf");
+	requisition->width  = gdk_pixbuf_get_width(pixbuf)  + 2;
+	requisition->height = gdk_pixbuf_get_height(pixbuf) + 2;
+}
+
+
+static void
+on_sample_expose_event(GtkWidget* darea, GdkEventExpose* expose)
+{
+  GdkPixbuf* pixbuf = g_object_get_data(G_OBJECT(darea), "sample-pixbuf");
+  int width  = gdk_pixbuf_get_width(pixbuf);
+  int height = gdk_pixbuf_get_height(pixbuf);
+  int x      = (darea->allocation.width  - width)  / 2;
+  int y      = (darea->allocation.height - height) / 2;
+  
+  gdk_draw_rectangle(darea->window,
+                     darea->style->white_gc,
+                     TRUE,
+                     0, 0,
+                     darea->allocation.width, darea->allocation.height);
+  gdk_draw_rectangle(darea->window,
+                     darea->style->black_gc,
+                     FALSE,
+                     0, 0,
+                     darea->allocation.width - 1, darea->allocation.height - 1);
+  
+  gdk_pixbuf_render_to_drawable(pixbuf,
+                                darea->window,
+                                NULL,
+                                0, 0, x, y, width, height,
+                                GDK_RGB_DITHER_NORMAL, 0, 0);
+}
+
+
+/*****************************************************************************
+ * Statics.
+ *****************************************************************************/
+static XftFont*
+open_pattern(FcPattern* pattern, Antialiasing antialiasing, Hinting hinting)
+{
+#ifdef FC_HINT_STYLE
+	static const int hintstyles[] = {
+    FC_HINT_NONE,
+    FC_HINT_SLIGHT,
+    FC_HINT_MEDIUM,
+    FC_HINT_FULL
+  };
+#endif /* FC_HINT_STYLE */
+  
+  XftFont*   font        = NULL;
+  FcPattern* res_pattern = NULL;
+  FcResult   result;
+  Display*   xdisplay    = gdk_x11_get_default_xdisplay();
+  int        screen      = gdk_x11_get_default_screen();
+  
+  res_pattern = XftFontMatch(xdisplay, screen, pattern, &result);
+  if (res_pattern == NULL)
+    return NULL;
+  
+  FcPatternDel(res_pattern, FC_HINTING);
+  FcPatternAddBool(res_pattern, FC_HINTING, hinting != HINT_NONE);
+  
+#ifdef FC_HINT_STYLE
+  FcPatternDel(res_pattern, FC_HINT_STYLE);
+  FcPatternAddInteger(res_pattern, FC_HINT_STYLE, hintstyles[hinting]);
+#endif /* FC_HINT_STYLE */
+  
+  FcPatternDel(res_pattern, FC_ANTIALIAS);
+  FcPatternAddBool(res_pattern, FC_ANTIALIAS, antialiasing != ANTIALIAS_NONE);
+  
+  FcPatternDel(res_pattern, FC_RGBA);
+  FcPatternAddInteger(res_pattern,
+                      FC_RGBA,
+                      antialiasing == ANTIALIAS_RGBA ? FC_RGBA_RGB
+                                                     : FC_RGBA_NONE);
+  
+  FcPatternDel(res_pattern, FC_DPI);
+  FcPatternAddInteger(res_pattern, FC_DPI, 96);
+  
+  font = XftFontOpenPattern(xdisplay, res_pattern);
+  if (!font)
+    FcPatternDestroy(res_pattern);
+  
+  return font;
+}
+
+
+/*****************************************************************************
+ * Public API.
+ *****************************************************************************/
+void
+setup_font_sample(GtkWidget* darea, Antialiasing antialiasing, Hinting hinting)
+{
+  const char*  string1    = "abfgop AO ";
+  const char*  string2    = "abfgop";
+  Display*     xdisplay   = gdk_x11_get_default_xdisplay();
+  GdkColormap* colormap   = gdk_rgb_get_colormap();
+  Colormap     xcolormap  = GDK_COLORMAP_XCOLORMAP(colormap);
+  GdkVisual*   visual     = gdk_colormap_get_visual(colormap);
+  Visual*      xvisual    = GDK_VISUAL_XVISUAL(visual);
+  GdkPixbuf*   pixbuf     = NULL;
+  GdkPixbuf*   tmp_pixbuf = NULL;
+  GdkPixmap*   pixmap     = NULL;
+  FcPattern*   pattern    = NULL;
+  XftDraw*     draw       = NULL;
+  XftFont*     font1      = NULL;
+  XftFont*     font2      = NULL;
+  XGlyphInfo   extents1   = { 0 };
+  XGlyphInfo   extents2   = { 0 };
+  int          width      = 0;
+  int          height     = 0;
+  int          ascent     = 0;
+  int          descent    = 0;
+  XftColor     black;
+  XftColor     white;
+  XRenderColor rendcolor;
+  
+  pattern = FcPatternBuild(NULL,
+                           FC_FAMILY, FcTypeString,  "Serif",
+                           FC_SLANT,  FcTypeInteger, FC_SLANT_ROMAN,
+                           FC_SIZE,   FcTypeDouble,  18.,
+                           NULL);
+  font1 = open_pattern(pattern, antialiasing, hinting);
+  FcPatternDestroy(pattern);
+  
+  pattern = FcPatternBuild(NULL,
+                           FC_FAMILY, FcTypeString,  "Serif",
+                           FC_SLANT,  FcTypeInteger, FC_SLANT_ITALIC,
+                           FC_SIZE,   FcTypeDouble,  20.,
+                           NULL);
+  font2 = open_pattern(pattern, antialiasing, hinting);
+  FcPatternDestroy(pattern);
+  
+  ascent  = 0;
+  descent = 0;
+  if (font1) {
+    XftTextExtentsUtf8(xdisplay,
+                       font1,
+                       (char*)string1,
+                       strlen(string1),
+                       &extents1);
+    ascent  = MAX(ascent,  font1->ascent);
+    descent = MAX(descent, font1->descent);
+  }
+  if (font2) {
+    XftTextExtentsUtf8(xdisplay,
+                       font2,
+                       (char*)string2,
+                       strlen(string2),
+                       &extents2);
+    ascent  = MAX(ascent,  font2->ascent);
+    descent = MAX(descent, font2->descent);
+  }
+  
+  width  = extents1.xOff + extents2.xOff + 4;
+  height = ascent        + descent       + 2;
+  
+  pixmap = gdk_pixmap_new(NULL, width, height, visual->depth);
+  draw   = XftDrawCreate(xdisplay,
+                         GDK_DRAWABLE_XID(pixmap),
+                         xvisual,
+                         xcolormap);
+  
+  rendcolor.red   = 0;
+  rendcolor.green = 0;
+  rendcolor.blue  = 0;
+  rendcolor.alpha = 0xffff;
+  XftColorAllocValue(xdisplay, xvisual, xcolormap, &rendcolor, &black);
+  
+  rendcolor.red   = 0xffff;
+  rendcolor.green = 0xffff;
+  rendcolor.blue  = 0xffff;
+  rendcolor.alpha = 0xffff;
+  XftColorAllocValue(xdisplay, xvisual, xcolormap, &rendcolor, &white);
+  
+  XftDrawRect(draw, &white, 0, 0, width, height);
+  if (font1)
+    XftDrawStringUtf8(draw,
+                      &black,
+                      font1,
+                      2,
+                      2 + ascent,
+                      (char*)string1,
+                      strlen(string1));
+  if (font2)
+    XftDrawStringUtf8(draw,
+                      &black,
+                      font2,
+                      2 + extents1.xOff,
+                      2 + ascent,
+                      (char*)string2,
+                      strlen(string2));
+  
+  XftDrawDestroy(draw);
+  
+  if (font1)
+    XftFontClose(xdisplay, font1);
+  if (font2)
+    XftFontClose(xdisplay, font2);
+  
+  tmp_pixbuf = gdk_pixbuf_get_from_drawable(NULL,
+                                            pixmap,
+                                            colormap,
+                                            0, 0, 0, 0, width, height);
+  pixbuf     = gdk_pixbuf_scale_simple(tmp_pixbuf,
+                                       1 * width,
+                                       1 * height,
+                                       GDK_INTERP_TILES);
+  
+  g_object_unref(pixmap);
+  g_object_unref(tmp_pixbuf);
+  
+  g_object_set_data_full(G_OBJECT(darea),
+                         "sample-pixbuf",
+                         pixbuf,
+                         (GDestroyNotify)g_object_unref);
+  g_signal_connect(darea,
+                   "size_request",
+                   G_CALLBACK(on_sample_size_request),
+                   NULL);
+  g_signal_connect(darea,
+                   "expose_event",
+                   G_CALLBACK(on_sample_expose_event),
+                   NULL);
+}
+
+#endif /* HAVE_XFT2 */
