Default settings for GtkTextAttributes



I noticed that the function gtk_text_attributes_new() which sets up a new GtkTextAttributes structure sets most 
of the values to 0 by default. This is not correct since setting 0 for the 
GtkTextAttributes->(PangoFontDescription)font->(PangoStretch)stretch corresponds to 
"PANGO_STRETCH_ULTRA_CONDENSED" in the PangoStretch enum. The default value should be 4 which corresponds to 
"PANGO_STRETCH_NORMAL". It is also incorrect to set 
GtkTextAttributes->(PangoFontDescription)font->(PangoWeight)weight to 0 which corresponds to 
"PANGO_WEIGHT_ULTRALIGHT". It should be "PANGO_WEIGHT_NORMAL".

Problems arise when using gtk_text_iter_get_attributes() which fills a GtkTextAttributes struct given as 
parameter. If I use a newly created GtkTextAttributes initialized with gtk_text_attributes_new() then any 
values which are not set by tags in the text remain as the default values... the wrong default values as 
mentioned above such as PANGO_STRETCH_ULTRA_CONDENSED when the text has no stretch attribute associated with 
it. The value should be PANGO_STRETCH_NORMAL.

I will send a patch soon for gtktexttag.c which sets a GtkTextAttributes struct to correct default values when 
initialized with gtk_text_attributes_new().


******************************************************
Oisin Boydell
Sun Microsystems Ireland
Phone: +353 (0)1 8199778
Mobile: +353 (0)86 3045117
******************************************************





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