diff options
-rw-r--r-- | ChangeLog | 21 | ||||
-rw-r--r-- | ChangeLog.pre-1-0 | 21 | ||||
-rw-r--r-- | ChangeLog.pre-1-10 | 21 | ||||
-rw-r--r-- | ChangeLog.pre-1-2 | 21 | ||||
-rw-r--r-- | ChangeLog.pre-1-4 | 21 | ||||
-rw-r--r-- | ChangeLog.pre-1-6 | 21 | ||||
-rw-r--r-- | ChangeLog.pre-1-8 | 21 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | examples/viewer.c | 15 | ||||
-rw-r--r-- | modules/arabic/arabic-x.c | 4 | ||||
-rw-r--r-- | modules/arabic/arabic.c | 4 | ||||
-rw-r--r-- | modules/arabic/arconv.h | 2 | ||||
-rw-r--r-- | pango/glyphstring.c | 2 | ||||
-rw-r--r-- | pango/pango-attributes.c | 4 | ||||
-rw-r--r-- | pango/pango-context.c | 2 | ||||
-rw-r--r-- | pango/pango-layout.c | 14 | ||||
-rw-r--r-- | pango/pangox.c | 146 | ||||
-rw-r--r-- | pango/pangox.h | 23 |
18 files changed, 299 insertions, 66 deletions
@@ -1,3 +1,24 @@ +Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> + + * pango/glyphstring.c (pango_glyph_string_get_logical_widths): + Fix off-by-one error for RTL runs. + + * configure.in: Add -lglib to AC_CHECK_LIB(fribidi...) + (How did this work?) From Matt Wilson. + + * pango/pango-layout.c (pango_layout_check_lines): Correctly deal + with handling character offsets when breaking lines. + + * modules/arabic/arabic.c (arabic_engine_shape): Fix problem with + setting unknown glyph when no arabic-capable font found. + +Fri Mar 31 11:29:47 2000 Owen Taylor <otaylor@redhat.com> + + * pango/pangox.[ch] (pango_x_render_layout[_line]) examples/viewer.c: Add + capability to render foreground / background colors. The interfaces + here are possibly certainly not right, or convenient, but + they should be a start. + Thu Mar 30 17:06:39 2000 Owen Taylor <otaylor@redhat.com> * modules/arabic/*.[ch]: New version of Arabic module diff --git a/ChangeLog.pre-1-0 b/ChangeLog.pre-1-0 index 34bf6fd3..4b90b181 100644 --- a/ChangeLog.pre-1-0 +++ b/ChangeLog.pre-1-0 @@ -1,3 +1,24 @@ +Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> + + * pango/glyphstring.c (pango_glyph_string_get_logical_widths): + Fix off-by-one error for RTL runs. + + * configure.in: Add -lglib to AC_CHECK_LIB(fribidi...) + (How did this work?) From Matt Wilson. + + * pango/pango-layout.c (pango_layout_check_lines): Correctly deal + with handling character offsets when breaking lines. + + * modules/arabic/arabic.c (arabic_engine_shape): Fix problem with + setting unknown glyph when no arabic-capable font found. + +Fri Mar 31 11:29:47 2000 Owen Taylor <otaylor@redhat.com> + + * pango/pangox.[ch] (pango_x_render_layout[_line]) examples/viewer.c: Add + capability to render foreground / background colors. The interfaces + here are possibly certainly not right, or convenient, but + they should be a start. + Thu Mar 30 17:06:39 2000 Owen Taylor <otaylor@redhat.com> * modules/arabic/*.[ch]: New version of Arabic module diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 34bf6fd3..4b90b181 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,24 @@ +Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> + + * pango/glyphstring.c (pango_glyph_string_get_logical_widths): + Fix off-by-one error for RTL runs. + + * configure.in: Add -lglib to AC_CHECK_LIB(fribidi...) + (How did this work?) From Matt Wilson. + + * pango/pango-layout.c (pango_layout_check_lines): Correctly deal + with handling character offsets when breaking lines. + + * modules/arabic/arabic.c (arabic_engine_shape): Fix problem with + setting unknown glyph when no arabic-capable font found. + +Fri Mar 31 11:29:47 2000 Owen Taylor <otaylor@redhat.com> + + * pango/pangox.[ch] (pango_x_render_layout[_line]) examples/viewer.c: Add + capability to render foreground / background colors. The interfaces + here are possibly certainly not right, or convenient, but + they should be a start. + Thu Mar 30 17:06:39 2000 Owen Taylor <otaylor@redhat.com> * modules/arabic/*.[ch]: New version of Arabic module diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2 index 34bf6fd3..4b90b181 100644 --- a/ChangeLog.pre-1-2 +++ b/ChangeLog.pre-1-2 @@ -1,3 +1,24 @@ +Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> + + * pango/glyphstring.c (pango_glyph_string_get_logical_widths): + Fix off-by-one error for RTL runs. + + * configure.in: Add -lglib to AC_CHECK_LIB(fribidi...) + (How did this work?) From Matt Wilson. + + * pango/pango-layout.c (pango_layout_check_lines): Correctly deal + with handling character offsets when breaking lines. + + * modules/arabic/arabic.c (arabic_engine_shape): Fix problem with + setting unknown glyph when no arabic-capable font found. + +Fri Mar 31 11:29:47 2000 Owen Taylor <otaylor@redhat.com> + + * pango/pangox.[ch] (pango_x_render_layout[_line]) examples/viewer.c: Add + capability to render foreground / background colors. The interfaces + here are possibly certainly not right, or convenient, but + they should be a start. + Thu Mar 30 17:06:39 2000 Owen Taylor <otaylor@redhat.com> * modules/arabic/*.[ch]: New version of Arabic module diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4 index 34bf6fd3..4b90b181 100644 --- a/ChangeLog.pre-1-4 +++ b/ChangeLog.pre-1-4 @@ -1,3 +1,24 @@ +Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> + + * pango/glyphstring.c (pango_glyph_string_get_logical_widths): + Fix off-by-one error for RTL runs. + + * configure.in: Add -lglib to AC_CHECK_LIB(fribidi...) + (How did this work?) From Matt Wilson. + + * pango/pango-layout.c (pango_layout_check_lines): Correctly deal + with handling character offsets when breaking lines. + + * modules/arabic/arabic.c (arabic_engine_shape): Fix problem with + setting unknown glyph when no arabic-capable font found. + +Fri Mar 31 11:29:47 2000 Owen Taylor <otaylor@redhat.com> + + * pango/pangox.[ch] (pango_x_render_layout[_line]) examples/viewer.c: Add + capability to render foreground / background colors. The interfaces + here are possibly certainly not right, or convenient, but + they should be a start. + Thu Mar 30 17:06:39 2000 Owen Taylor <otaylor@redhat.com> * modules/arabic/*.[ch]: New version of Arabic module diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index 34bf6fd3..4b90b181 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,24 @@ +Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> + + * pango/glyphstring.c (pango_glyph_string_get_logical_widths): + Fix off-by-one error for RTL runs. + + * configure.in: Add -lglib to AC_CHECK_LIB(fribidi...) + (How did this work?) From Matt Wilson. + + * pango/pango-layout.c (pango_layout_check_lines): Correctly deal + with handling character offsets when breaking lines. + + * modules/arabic/arabic.c (arabic_engine_shape): Fix problem with + setting unknown glyph when no arabic-capable font found. + +Fri Mar 31 11:29:47 2000 Owen Taylor <otaylor@redhat.com> + + * pango/pangox.[ch] (pango_x_render_layout[_line]) examples/viewer.c: Add + capability to render foreground / background colors. The interfaces + here are possibly certainly not right, or convenient, but + they should be a start. + Thu Mar 30 17:06:39 2000 Owen Taylor <otaylor@redhat.com> * modules/arabic/*.[ch]: New version of Arabic module diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index 34bf6fd3..4b90b181 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,24 @@ +Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> + + * pango/glyphstring.c (pango_glyph_string_get_logical_widths): + Fix off-by-one error for RTL runs. + + * configure.in: Add -lglib to AC_CHECK_LIB(fribidi...) + (How did this work?) From Matt Wilson. + + * pango/pango-layout.c (pango_layout_check_lines): Correctly deal + with handling character offsets when breaking lines. + + * modules/arabic/arabic.c (arabic_engine_shape): Fix problem with + setting unknown glyph when no arabic-capable font found. + +Fri Mar 31 11:29:47 2000 Owen Taylor <otaylor@redhat.com> + + * pango/pangox.[ch] (pango_x_render_layout[_line]) examples/viewer.c: Add + capability to render foreground / background colors. The interfaces + here are possibly certainly not right, or convenient, but + they should be a start. + Thu Mar 30 17:06:39 2000 Owen Taylor <otaylor@redhat.com> * modules/arabic/*.[ch]: New version of Arabic module diff --git a/configure.in b/configure.in index 540ad8cb..d9eca28f 100644 --- a/configure.in +++ b/configure.in @@ -25,7 +25,7 @@ AM_PATH_GTK(1.2.0, AM_CONDITIONAL(BUILD_TESTS, test x$gtk_works = xyes) AC_CHECK_LIB(fribidi, fribidi_map_range, :, - AC_MSG_ERROR([*** libfribidi not found.])) + AC_MSG_ERROR([*** libfribidi not found.]), -lglib) # We run glib-config separately to get the gmodule cflags so we diff --git a/examples/viewer.c b/examples/viewer.c index ccff0b77..c966865f 100644 --- a/examples/viewer.c +++ b/examples/viewer.c @@ -289,6 +289,17 @@ size_allocate (GtkWidget *layout, GtkAllocation *allocation) gtk_adjustment_set_value (GTK_LAYOUT (layout)->vadjustment, height - allocation->height); } +GC +get_gc_func (PangoAttrColor *fg_color, void *data) +{ + return GDK_GC_XGC (data); +} + +void +free_gc_func (GC gc, void *data) +{ +} + /* Handle a draw/expose by finding the paragraphs that intersect * the region and reexposing them. */ @@ -315,8 +326,8 @@ draw (GtkWidget *layout, GdkRectangle *area) if (height + para->height >= GTK_LAYOUT (layout)->yoffset + area->y) pango_x_render_layout (GDK_DISPLAY(), GDK_WINDOW_XWINDOW (GTK_LAYOUT (layout)->bin_window), - GDK_GC_XGC (layout->style->text_gc[GTK_STATE_NORMAL]), - para->layout, 0, height - GTK_LAYOUT (layout)->yoffset); + para->layout, 0, height - GTK_LAYOUT (layout)->yoffset, + get_gc_func, free_gc_func, layout->style->text_gc[GTK_STATE_NORMAL]); height += para->height; } diff --git a/modules/arabic/arabic-x.c b/modules/arabic/arabic-x.c index 805c7bba..385ac217 100644 --- a/modules/arabic/arabic-x.c +++ b/modules/arabic/arabic-x.c @@ -236,8 +236,8 @@ arabic_engine_shape (PangoFont *font, p = text; for (i=0; i<n_chars; i++) { - set_glyph (glyphs, font, arfonts[0], i, - p - text, unknown_glyph); + set_glyph (glyphs, font, PANGO_X_GLYPH_SUBFONT (unknown_glyph), i, + p - text, PANGO_X_GLYPH_INDEX (unknown_glyph)); p = unicode_next_utf8 (p); } return; diff --git a/modules/arabic/arabic.c b/modules/arabic/arabic.c index 805c7bba..385ac217 100644 --- a/modules/arabic/arabic.c +++ b/modules/arabic/arabic.c @@ -236,8 +236,8 @@ arabic_engine_shape (PangoFont *font, p = text; for (i=0; i<n_chars; i++) { - set_glyph (glyphs, font, arfonts[0], i, - p - text, unknown_glyph); + set_glyph (glyphs, font, PANGO_X_GLYPH_SUBFONT (unknown_glyph), i, + p - text, PANGO_X_GLYPH_INDEX (unknown_glyph)); p = unicode_next_utf8 (p); } return; diff --git a/modules/arabic/arconv.h b/modules/arabic/arconv.h index 6a9d7233..d266b9d7 100644 --- a/modules/arabic/arconv.h +++ b/modules/arabic/arconv.h @@ -7,7 +7,7 @@ #ifndef __arconv_h_ #define __arconv_h_ -#include "../../libpango/utils.h" +#include "utils.h" /* * arabic_reshape: reshapes string ( ordered left-to right visual order ) diff --git a/pango/glyphstring.c b/pango/glyphstring.c index 476604ce..c2964704 100644 --- a/pango/glyphstring.c +++ b/pango/glyphstring.c @@ -214,7 +214,7 @@ pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs, { int next_cluster = last_cluster; - if (glyph_index < glyphs->num_glyphs) + if (glyph_index > 0 && glyph_index < glyphs->num_glyphs) { while (p < text + glyphs->log_clusters[glyph_index]) { diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c index 52a1cbaf..19f0e9fc 100644 --- a/pango/pango-attributes.c +++ b/pango/pango-attributes.c @@ -199,7 +199,7 @@ pango_attr_color_copy (const PangoAttribute *attr) const PangoAttrColor *color_attr = (PangoAttrColor *)attr; return pango_attr_color_new (attr->klass, - color_attr->red, color_attr->blue, color_attr->green); + color_attr->red, color_attr->green, color_attr->blue); } static void @@ -979,6 +979,8 @@ pango_attr_iterator_get_font (PangoAttrIterator *iterator, found = TRUE; break; } + + tmp_list2 = tmp_list2->next; } if (!found) diff --git a/pango/pango-context.c b/pango/pango-context.c index cfc778b5..5343ab27 100644 --- a/pango/pango-context.c +++ b/pango/pango-context.c @@ -673,7 +673,7 @@ add_engines (PangoContext *context, PangoSubmap *submap; PangoMapEntry *entry; - if (i == next_index) + if (pos - text == next_index) { char *next_lang; PangoFontDescription next_desc; diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 245aa906..ae499232 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -334,12 +334,10 @@ pango_layout_set_text (PangoLayout *layout, char *p = text; int i; - /* FIXME: Do better validation */ - for (i=0; i<n_chars; i++) { p = unicode_get_utf8 (p, &junk); - if (!p) + if (!p || !junk) { g_warning ("Invalid UTF8 string passed to pango_layout_set_text()"); return; @@ -1072,11 +1070,15 @@ pango_layout_check_lines (PangoLayout *layout) { PangoItem *item = tmp_list->data; gboolean fits; + int old_num_chars = item->num_chars; fits = process_item (line, item, start, layout->log_attrs + start_offset, &remaining_width); if (fits) - tmp_list = tmp_list->next; + { + tmp_list = tmp_list->next; + start_offset += old_num_chars; + } if (!fits) { @@ -1089,9 +1091,9 @@ pango_layout_check_lines (PangoLayout *layout) line = pango_layout_line_new (layout); remaining_width = (layout->indent >= 0) ? layout->width : layout->indent + layout->indent; - } - start_offset += item->num_chars; + start_offset += old_num_chars - item->num_chars; + } } line->runs = g_slist_reverse (line->runs); diff --git a/pango/pangox.c b/pango/pangox.c index d9b86618..64721c4c 100644 --- a/pango/pangox.c +++ b/pango/pangox.c @@ -202,17 +202,21 @@ static PangoFont *pango_x_load_font_with_size (Display *display, char *spec, int size); -static gboolean pango_x_is_xlfd_font_name (const char *fontname); -static char * pango_x_get_xlfd_field (const char *fontname, - FontField field_num, - char *buffer); -static char * pango_x_get_identifier (const char *fontname); -static gint pango_x_get_size (PangoXFontMap *fontmap, - const char *fontname); -static void pango_x_insert_font (PangoXFontMap *fontmap, - const char *fontname); +static gboolean pango_x_is_xlfd_font_name (const char *fontname); +static char * pango_x_get_xlfd_field (const char *fontname, + FontField field_num, + char *buffer); +static char * pango_x_get_identifier (const char *fontname); +static gint pango_x_get_size (PangoXFontMap *fontmap, + const char *fontname); +static void pango_x_insert_font (PangoXFontMap *fontmap, + const char *fontname); static void pango_x_get_item_properties (PangoItem *item, - PangoUnderline *uline); + PangoUnderline *uline, + PangoAttrColor *fg_color, + gboolean *fg_set, + PangoAttrColor *bg_color, + gboolean *bg_set); static GList *fontmaps; @@ -1949,7 +1953,7 @@ pango_x_find_glyph (PangoFont *font, cs = pango_x_get_per_char (font, subfont, char_index); - if (cs && (cs->lbearing != cs->rbearing)) + if (cs && (cs->lbearing != cs->rbearing || cs->width != 0)) { if (subfont_return) *subfont_return = subfont; @@ -2007,27 +2011,31 @@ pango_x_get_unknown_glyph (PangoFont *font) /** * pango_x_render_layout_line: - * @display: the X display - * @drawable: the drawable on which to draw string - * @gc: the graphics context - * @line: a #PangoLayoutLine - * @x: the x position of start of string (in pixels) - * @y: the y position of baseline (in pixels) + * @display: the X display + * @drawable: the drawable on which to draw string + * @line: a #PangoLayoutLine + * @x: the x position of start of string (in pixels) + * @y: the y position of baseline (in pixels) + * @get_gc: function to call to retrieve a GC for a particular color + * @free_gc: function to call to free a GC retrieved from get_gc + * @user_data: extra data to pass to get_gc and free_gc * * Render a #PangoLayoutLine onto an X drawable */ void pango_x_render_layout_line (Display *display, Drawable drawable, - GC gc, PangoLayoutLine *line, int x, - int y) + int y, + PangoGetGCFunc get_gc, + PangoFreeGCFunc free_gc, + gpointer user_data) { GSList *tmp_list = line->runs; PangoRectangle logical_rect; PangoRectangle ink_rect; - + int x_off = 0; pango_layout_line_get_extents (line,NULL, &logical_rect); @@ -2036,9 +2044,18 @@ pango_x_render_layout_line (Display *display, { PangoUnderline uline = PANGO_UNDERLINE_NONE; PangoLayoutRun *run = tmp_list->data; + PangoAttrColor fg_color, bg_color; + gboolean fg_set, bg_set; + GC fg_gc; + tmp_list = tmp_list->next; - pango_x_get_item_properties (run->item, &uline); + pango_x_get_item_properties (run->item, &uline, &fg_color, &fg_set, &bg_color, &bg_set); + + if (fg_set) + fg_gc = (*get_gc) (&fg_color, user_data); + else + fg_gc = (*get_gc) (NULL, user_data); if (uline == PANGO_UNDERLINE_NONE) pango_glyph_string_extents (run->glyphs, run->item->analysis.font, @@ -2047,7 +2064,20 @@ pango_x_render_layout_line (Display *display, pango_glyph_string_extents (run->glyphs, run->item->analysis.font, &ink_rect, &logical_rect); - pango_x_render (display, drawable, gc, run->item->analysis.font, run->glyphs, + if (bg_set) + { + GC bg_gc = (*get_gc) (&bg_color, user_data); + + XFillRectangle (display, drawable, bg_gc, + x + (x_off + logical_rect.x) / PANGO_SCALE, + y + logical_rect.y / PANGO_SCALE, + logical_rect.width / PANGO_SCALE, + logical_rect.height / PANGO_SCALE); + + (*free_gc) (bg_gc, user_data); + } + + pango_x_render (display, drawable, fg_gc, run->item->analysis.font, run->glyphs, x + x_off / PANGO_SCALE, y); switch (uline) @@ -2055,44 +2085,50 @@ pango_x_render_layout_line (Display *display, case PANGO_UNDERLINE_NONE: break; case PANGO_UNDERLINE_DOUBLE: - XDrawLine (display, drawable, gc, + XDrawLine (display, drawable, fg_gc, x + (x_off + ink_rect.x) / PANGO_SCALE - 1, y + 4, x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, y + 4); /* Fall through */ case PANGO_UNDERLINE_SINGLE: - XDrawLine (display, drawable, gc, + XDrawLine (display, drawable, fg_gc, x + (x_off + ink_rect.x) -1, y + 2, x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, y + 2); break; case PANGO_UNDERLINE_LOW: - XDrawLine (display, drawable, gc, + XDrawLine (display, drawable, fg_gc, x + (x_off + ink_rect.x) / PANGO_SCALE - 1, y + (ink_rect.y + ink_rect.height) / PANGO_SCALE + 2, x + (x_off + ink_rect.x + ink_rect.width) / PANGO_SCALE, y + (ink_rect.y + ink_rect.height) / PANGO_SCALE + 2); break; } - + + (*free_gc) (fg_gc, user_data); + x_off += logical_rect.width; } } /** * pango_x_render_layout: - * @display: the X display - * @drawable: the drawable on which to draw string - * @gc: the graphics context - * @layout: a #PangoLayout - * @x: the X position of the left of the layout (in pixels) - * @y: the Y position of the top of the layout (in pixels) + * @display: the X display + * @drawable: the drawable on which to draw string + * @layout: a #PangoLayout + * @x: the X position of the left of the layout (in pixels) + * @y: the Y position of the top of the layout (in pixels) + * @get_gc: function to call to retrieve a GC for a particular color + * @free_gc: function to call to free a GC retrieved from get_gc + * @user_data: extra data to pass to get_gc and free_gc * * Render a #PangoLayoutLine onto an X drawable */ void -pango_x_render_layout (Display *display, - Drawable drawable, - GC gc, - PangoLayout *layout, - int x, - int y) +pango_x_render_layout (Display *display, + Drawable drawable, + PangoLayout *layout, + int x, + int y, + PangoGetGCFunc get_gc, + PangoFreeGCFunc free_gc, + gpointer user_data) { PangoRectangle logical_rect; GSList *tmp_list; @@ -2154,8 +2190,9 @@ pango_x_render_layout (Display *display, } } - pango_x_render_layout_line (display, drawable, gc, - line, x + x_offset / PANGO_SCALE, y + (y_offset - logical_rect.y) / PANGO_SCALE); + pango_x_render_layout_line (display, drawable, + line, x + x_offset / PANGO_SCALE, y + (y_offset - logical_rect.y) / PANGO_SCALE, + get_gc, free_gc, user_data); y_offset += logical_rect.height; tmp_list = tmp_list->next; @@ -2167,10 +2204,20 @@ pango_x_render_layout (Display *display, */ static void pango_x_get_item_properties (PangoItem *item, - PangoUnderline *uline) + PangoUnderline *uline, + PangoAttrColor *fg_color, + gboolean *fg_set, + PangoAttrColor *bg_color, + gboolean *bg_set) { GSList *tmp_list = item->extra_attrs; + if (fg_set) + *fg_set = FALSE; + + if (bg_set) + *bg_set = FALSE; + while (tmp_list) { PangoAttribute *attr = tmp_list->data; @@ -2180,6 +2227,23 @@ pango_x_get_item_properties (PangoItem *item, case PANGO_ATTR_UNDERLINE: if (uline) *uline = ((PangoAttrInt *)attr)->value; + break; + + case PANGO_ATTR_FOREGROUND: + if (fg_color) + *fg_color = *((PangoAttrColor *)attr); + if (fg_set) + *fg_set = TRUE; + + break; + + case PANGO_ATTR_BACKGROUND: + if (bg_color) + *bg_color = *((PangoAttrColor *)attr); + if (bg_set) + *bg_set = TRUE; + + break; default: break; diff --git a/pango/pangox.h b/pango/pangox.h index 3c077a44..3460263d 100644 --- a/pango/pangox.h +++ b/pango/pangox.h @@ -33,6 +33,9 @@ extern "C" { #define PANGO_RENDER_TYPE_X "PangoRenderX" +typedef GC (*PangoGetGCFunc) (PangoAttrColor *color, void *user_data); +typedef void (*PangoFreeGCFunc) (GC gc, void *user_data); + /* Calls for applications */ PangoContext * pango_x_get_context (Display *display); @@ -47,16 +50,20 @@ void pango_x_render (Display *display, gint y); void pango_x_render_layout_line (Display *display, Drawable drawable, - GC gc, PangoLayoutLine *line, int x, - int y); -void pango_x_render_layout (Display *display, - Drawable drawable, - GC gc, - PangoLayout *layout, - int x, - int y); + int y, + PangoGetGCFunc get_gc, + PangoFreeGCFunc free_gc, + gpointer user_data); +void pango_x_render_layout (Display *display, + Drawable drawable, + PangoLayout *layout, + int x, + int y, + PangoGetGCFunc get_gc, + PangoFreeGCFunc free_gc, + gpointer user_data); /* API for rendering modules */ |