Re: XSetting for font



Hi Owen,

[...]
>> -  
>> -  style->font_desc = pango_font_description_from_string ("Sans 10");
>> +  GtkSettings *settings = gtk_settings_get_default ();
>> +  gchar *font_name;
>> +
>> +  g_object_get (settings, "gtk-font-name", &font_name, NULL);
>> +  style->font_desc = pango_font_description_from_string (font_name);
>> +  g_free (font_name);
>>  
>>    style->attach_count = 0;
>>    style->colormap = NULL;
>
>Using gtk_rc_context_get (gtk_settings_get_default ()) to call
>_gtk_rc_context_get_default_font_name() should be OK for now.
>
>For 2.2 (multihead) we'll have to do something different - I think the
>correct approach though is to add a ::font_desc GObject property,
>and then set a default style->font_desc in a constructor() method
>if it hasn't already been set. (A bug about this would be useful
>as well.)

What difference would it make from the actual code as the constructor()
as no way of figuring out what screen it is on ? 
The ::font_desc GObject on GtkSetting just would be a duplicate of
 gtk-font-name.

Am I missing something ?

Regards,
	Erwann

[ I speak for myself, not for my employer. ]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  Erwann Chénedé, Sun Microsystems Ireland
  Desktop Applications & Middleware Group
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]