From 9c2e592707b4290e72868136163f427da640b684 Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Sun, 2 Feb 2003 08:02:27 +0000 Subject: Use Pango to draw. (e_calendar_item_class_init): Add font_desc and 2003-02-02 Hans Petter Jansson * e-calendar-item.[ch]: Use Pango to draw. (e_calendar_item_class_init): Add font_desc and week_number_font_desc args. (e_calendar_item_get_arg): Ditto. (e_calendar_item_set_arg): Ditto. (e_calendar_item_draw_month): Use Pango. (e_calendar_item_draw_day_numbers): Ditto. * e-calendar.c: Use Pango to draw. Specify just the size of the small font to use, instead of all aspects of it. (e_calendar_init): Produce the small font description and pass it to the ECalendarItem. svn path=/trunk/; revision=19705 --- widgets/misc/e-calendar.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'widgets/misc/e-calendar.c') diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index 105afc555a..dce0e05771 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -41,6 +41,8 @@ #include #include +#define E_CALENDAR_SMALL_FONT_PTSIZE 6 + #define E_CALENDAR_SMALL_FONT \ "-adobe-utopia-regular-r-normal-*-*-100-*-*-p-*-iso8859-*" #define E_CALENDAR_SMALL_FONT_FALLBACK \ @@ -158,6 +160,7 @@ e_calendar_init (ECalendar *cal) { GnomeCanvasGroup *canvas_group; GdkFont *small_font; + PangoFontDescription *small_font_desc; GtkWidget *button, *pixmap; GdkColormap *colormap; GdkPixmap *gdk_pixmap; @@ -172,16 +175,23 @@ e_calendar_init (ECalendar *cal) if (!small_font) g_warning ("Couldn't load font"); + small_font_desc = + pango_font_description_copy (gtk_widget_get_style (GTK_WIDGET (cal))->font_desc); + pango_font_description_set_size (small_font_desc, + E_CALENDAR_SMALL_FONT_PTSIZE * PANGO_SCALE); + canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (cal)->root); cal->calitem = E_CALENDAR_ITEM (gnome_canvas_item_new (canvas_group, e_calendar_item_get_type (), "week_number_font", small_font, + "week_number_font_desc", small_font_desc, NULL)); if (small_font) gdk_font_unref (small_font); + pango_font_description_free (small_font_desc); /* Create the arrow buttons to move to the previous/next month. */ button = gtk_button_new (); -- cgit