Home | History | Annotate | Download | only in patches
      1 diff -up gnome-control-center-2.19.92/capplets/appearance/appearance-font.c.orig gnome-control-center-2.19.92/capplets/appearance/appearance-font.c
      2 --- gnome-control-center-2.19.92/capplets/appearance/appearance-font.c.orig	2007-09-03 09:45:26.000000000 +0100
      3 +++ gnome-control-center-2.19.92/capplets/appearance/appearance-font.c	2007-09-05 16:10:45.631990000 +0100
      4 @@ -346,6 +346,104 @@ typedef struct {
      5  
      6  static GSList *font_pairs = NULL;
      7  
      8 +#ifdef FT_CONFIG_ADD_FULL_HINTING
      9 +static gboolean 
     10 +display_full_hinting_dialog (GConfClient  *client,
     11 +                 GtkWidget *parent, 
     12 +			     FontPair *pair, 
     13 +			     const char *key, 
     14 +			     const char *value)
     15 +{
     16 +  gboolean display_dialog = FALSE;
     17 +  gboolean antialiasing_changed = FALSE;
     18 +
     19 +  if (pair && (pair->antialiasing != ANTIALIAS_NONE) && (pair->hinting == HINT_FULL))
     20 +    {
     21 +      display_dialog = TRUE;
     22 +      antialiasing_changed = TRUE;
     23 +    }
     24 +
     25 +  if (key && value)
     26 +    {
     27 +      Hinting hinting;
     28 +      Antialiasing antialiasing;
     29 +
     30 +      if ((strcmp (key, FONT_HINTING_KEY) == 0) && (strcmp (value, "full") == 0))
     31 +	{
     32 +      font_render_get_gconf (client, &antialiasing, &hinting);
     33 +	  if (antialiasing != ANTIALIAS_NONE)
     34 +	      display_dialog = TRUE;
     35 +	}
     36 +      if ((strcmp (key, FONT_ANTIALIASING_KEY) == 0) && (strcmp (value, "none") != 0))
     37 +	{  /* check if hinting is set to full  (monochrome case for example)*/
     38 +      font_render_get_gconf (client, &antialiasing, &hinting);
     39 +	  if (hinting == HINT_FULL && antialiasing == ANTIALIAS_NONE)
     40 +	    {
     41 +	      display_dialog = TRUE;
     42 +	      antialiasing_changed = TRUE;
     43 +	    }
     44 +	}
     45 +    }
     46 +
     47 +  if (display_dialog) 
     48 +    {
     49 +      gint result;
     50 +      Hinting hinting;
     51 +      Antialiasing antialiasing;
     52 +      GtkWidget *dialog;
     53 +      static gboolean displayed_and_rejected = FALSE;
     54 +  
     55 + 
     56 +      font_render_get_gconf (client, &antialiasing, &hinting);
     57 +
     58 +      /*if the hinting is already set to FULL don't ask again */
     59 +      if (hinting == HINT_FULL && 
     60 +	  ((antialiasing == ANTIALIAS_GRAYSCALE) || (antialiasing == ANTIALIAS_RGBA))) 
     61 +	  return TRUE;
     62 +      
     63 +      if (hinting == HINT_FULL && antialiasing == ANTIALIAS_NONE && !antialiasing_changed)
     64 +	  return TRUE;
     65 +
     66 +      dialog = gtk_message_dialog_new (GTK_WINDOW(gtk_widget_get_toplevel (parent)),
     67 +				       GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
     68 +				       GTK_MESSAGE_QUESTION,
     69 +				       GTK_BUTTONS_OK_CANCEL,
     70 +				       NULL);
     71 +
     72 +      gtk_window_set_title (GTK_WINDOW (dialog), "License Agreement");
     73 +
     74 +      gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog),
     75 +				     "Enabling full hinting may require "
     76 +				     "a license from Apple Computer. "
     77 +				     "If you have obtained such a license or "
     78 +				     "have determined that you do not need "
     79 +				     "one, click Ok to activate full hinting."
     80 +				     "\n\nFurther information available at :\n"
     81 +				     "http://freetype.sourceforge.net/"
     82 +				     "patents.html");
     83 +
     84 +
     85 +      result = gtk_dialog_run (GTK_DIALOG (dialog));
     86 +
     87 +      gtk_widget_destroy (dialog);
     88 +
     89 +      switch (result)
     90 +	{
     91 +	case GTK_RESPONSE_CANCEL:
     92 +	  displayed_and_rejected = TRUE;
     93 +	  return FALSE;
     94 +	  break;
     95 +	default:
     96 +	  break;
     97 +	}
     98 +    }
     99 +
    100 +  return TRUE;
    101 +}
    102 +#endif
    103 +
    104 +
    105 +
    106  static void
    107  font_render_load (GConfClient *client)
    108  {
    109 @@ -392,7 +490,12 @@ font_radio_toggled (GtkToggleButton *tog
    110  {
    111    GConfClient *client = gconf_client_get_default ();
    112  
    113 +#ifdef FT_CONFIG_ADD_FULL_HINTING  
    114 +  if (!in_change && 
    115 +	    display_full_hinting_dialog (client, GTK_WIDGET (toggle_button), pair, NULL, NULL)) {
    116 +#else
    117    if (!in_change) {
    118 +#endif	    
    119      gconf_client_set_string (client, FONT_ANTIALIASING_KEY,
    120  			     gconf_enum_to_string (antialias_enums, pair->antialiasing),
    121  			     NULL);
    122 @@ -632,7 +735,14 @@ enum_item_toggled (GtkToggleButton *togg
    123  {
    124    EnumGroup *group = item->group;
    125  
    126 -  if (!in_change) {
    127 +#ifdef FT_CONFIG_ADD_FULL_HINTING	
    128 +  if (!in_change && 
    129 +	  display_full_hinting_dialog (group->client, GTK_WIDGET(toggle_button), NULL,
    130 +					 group->gconf_key,
    131 +					 gconf_enum_to_string (group->enums, item->value))) {
    132 +#else
    133 +  if (!in_change) {  
    134 +#endif	  
    135      gconf_client_set_string (group->client, group->gconf_key,
    136  			     gconf_enum_to_string (group->enums, item->value),
    137  			     NULL);
    138 
    139