Re: [gdm-list] gdm graphical greeter not setting default font size ?



Le lundi 04 juin 2007 à 18:41 +0800, Brian Cameron a écrit :
> Frederic:
> 
> >>> while investigating Mandriva bug
> >>> http://qa.mandriva.com/show_bug.cgi?id=29870 and reading gdm code, it
> >>> seems font size is never set in graphical greeter when not specified in
> >>> theme, since it defaults to "Sans", see greeter_parser.c:1435 and
> >>> according to pango_font_description_from_string API documentation,
> >>> resulting information will give a font size of 0. And when
> >>> do_font_size_reduction is called after, it still sets font size to 0.
> >>>
> >>> Shouldn't we enforce a default font size ? 10 or 12 maybe ?
> >> Out of curiousity, do you have a valid value set in the GDM 
> >> configuration for GtkRC.  If this is set to a valid value, it might
> >> affect how fonts look.  The problem may be you have it set to an
> >> invalid file?
> > 
> > I've asked original reporter for more informations about this bug and
> > problem has been fixed, so it may have been caused by a incorrect
> > GtkTheme key.
> > 
> > I tried to duplicate but I couldn't.
> 
> I'm a bit uncomfortable trying to fix a bug that can't be replicated.
> 
> >> If that doesn't fix the problem, I'd be happy to accept a patch to
> >> default to a reasonable fontsize.
> > 
> > I've discussed with Bedhad about this and he suggested to use gtkwidget
> > default font description and merge the property from the theme using
> > pango_font_description_merge.
> > 
> > WDYT ?
> 
> I'd be agreeable to accepting a patch to set the default font/font size.
> Perhaps it would make sense to make such a thing configurable rather
> than hardcoding it in the c-code.

What do you think about the attached patch ? It only makes sure size is
obtained from gtk default size for widgets. I don't think it is worth
adding yet another configuration key just for this.

-- 
Frederic Crozat <fcrozat mandriva com>
Mandriva
Index: gui/greeter/greeter_parser.c
===================================================================
--- gui/greeter/greeter_parser.c	(révision 4965)
+++ gui/greeter/greeter_parser.c	(copie de travail)
@@ -1444,8 +1444,11 @@
       info->data.text.colors[i] = (info->data.text.colors[i] << 8) | (guint) info->data.text.alphas[i];
     }
   
-  if (info->data.text.fonts[GREETER_ITEM_STATE_NORMAL] == NULL)
-    info->data.text.fonts[GREETER_ITEM_STATE_NORMAL] = pango_font_description_from_string ("Sans");
+  if (info->data.text.fonts[GREETER_ITEM_STATE_NORMAL] == NULL) {
+	  info->data.text.fonts[GREETER_ITEM_STATE_NORMAL] = pango_font_description_from_string ("Sans");
+	  if (gtk_widget_get_default_style()->font_desc)
+		pango_font_description_merge (info->data.text.fonts[GREETER_ITEM_STATE_NORMAL], gtk_widget_get_default_style()->font_desc, FALSE);
+  }
 
   do_font_size_reduction (info);
 
Index: ChangeLog
===================================================================
--- ChangeLog	(révision 4965)
+++ ChangeLog	(copie de travail)
@@ -1,3 +1,9 @@
+2007-06-04  Frederic Crozat  <fcrozat mandriva com>
+
+	* gui/greeter/greeter_parser.c: (parse_label):
+	Ensure a non null size is set by default for
+	pango font description.
+
 2007-06-04  Brian Cameron  <brian cameron sun com>
 
 	* docs/C/gdm.xml: While reviewing bug #440498, I updated the


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