From ee6d562880652864aa8da959ad4b127786a3fa3a Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Thu, 20 Jul 2006 08:24:31 +0000 Subject: Added cairo font rendering to ECell and EText. svn path=/trunk/; revision=32359 --- widgets/table/e-cell-text.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'widgets/table/e-cell-text.c') diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 7ea8a54c98..fee7d04cfb 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -142,7 +142,6 @@ typedef struct { int xofs, yofs; /* This gets added to the x and y for the cell text. */ double ellipsis_width[2]; /* The width of the ellipsis. */ - } ECellTextView; struct _CellEdit { @@ -439,6 +438,7 @@ ect_unrealize (ECellView *ecv) if (parent_class->unrealize) (* parent_class->unrealize) (ecv); + } static void @@ -570,6 +570,8 @@ build_layout (ECellTextView *text_view, int row, const char *text, gint width) ECellText *ect = E_CELL_TEXT (ecell_view->ecell); PangoAttrList *attrs ; PangoLayout *layout; + PangoContext *context; + cairo_font_options_t *font_options; layout = gtk_widget_create_pango_layout (GTK_WIDGET (((GnomeCanvasItem *)ecell_view->e_table_item_view)->canvas), text); @@ -581,6 +583,13 @@ build_layout (ECellTextView *text_view, int row, const char *text, gint width) if (text_view->edit || width <= 0) return layout; + context = pango_layout_get_context (layout); + + font_options = get_font_options(); + pango_cairo_context_set_font_options (context, font_options); + cairo_font_options_destroy (font_options); + pango_layout_context_changed (layout); + if (ect->font_name) { PangoFontDescription *desc = NULL, *fixed_desc = NULL; @@ -632,7 +641,7 @@ build_layout (ECellTextView *text_view, int row, const char *text, gint width) default: break; } - + return layout; } @@ -733,10 +742,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, selected = flags & E_CELL_SELECTED; if (selected) { - if (flags & E_CELL_FOCUSED) foreground = &canvas->style->fg [GTK_STATE_SELECTED]; - else - foreground = &canvas->style->fg [GTK_STATE_ACTIVE]; } else { foreground = &canvas->style->text [GTK_STATE_NORMAL]; -- cgit v1.2.3