-static void
-draw_glyphs (GdkGCWin32 *gcwin32,
- HDC hdc,
- gint x_offset,
- gint y_offset,
- va_list args)
-{
- PangoFont *font;
- gint x;
- gint y;
- PangoGlyphString *glyphs;
-
- font = va_arg (args, PangoFont *);
- x = va_arg (args, gint);
- y = va_arg (args, gint);
- glyphs = va_arg (args, PangoGlyphString *);
-
- x -= x_offset;
- y -= y_offset;
-
- pango_win32_render (hdc, font, glyphs, x, y);
-}
-
-static void
-draw_glyphs_transformed (GdkGCWin32 *gcwin32,
- HDC hdc,
- gint x_offset,
- gint y_offset,
- va_list args)
-{
- PangoFont *font;
- gint x;
- gint y;
- PangoGlyphString *glyphs;
- PangoMatrix *matrix;
-
- matrix = va_arg(args, PangoMatrix *);
- font = va_arg (args, PangoFont *);
- x = va_arg (args, gint);
- y = va_arg (args, gint);
- glyphs = va_arg (args, PangoGlyphString *);
-
- x -= x_offset;
- y -= y_offset;
-
- pango_win32_render_transformed (hdc, matrix, font, glyphs, x, y);
-}
-
-static void
-gdk_win32_draw_glyphs (GdkDrawable *drawable,
- GdkGC *gc,
- PangoFont *font,
- gint x,
- gint y,
- PangoGlyphString *glyphs)
-{
- GdkRectangle bounds;
- GdkRegion *region;
- PangoRectangle ink_rect;
-
- pango_glyph_string_extents (glyphs, font, &ink_rect, NULL);
-
- bounds.x = x + PANGO_PIXELS (ink_rect.x) - 1;
- bounds.y = y + PANGO_PIXELS (ink_rect.y) - 1;
- bounds.width = PANGO_PIXELS (ink_rect.width) + 2;
- bounds.height = PANGO_PIXELS (ink_rect.height) + 2;
- region = gdk_region_rectangle (&bounds);
-
- generic_draw (drawable, gc, GDK_GC_FOREGROUND|GDK_GC_FONT,
- draw_glyphs, region, font, x, y, glyphs);
-
- gdk_region_destroy (region);
-}
-
-static void
-gdk_win32_draw_glyphs_transformed (GdkDrawable *drawable,
- GdkGC *gc,
- PangoMatrix *matrix,
- PangoFont *font,
- gint x,
- gint y,
- PangoGlyphString *glyphs)
-{
- GdkRectangle bounds;
- GdkRegion *region;
- PangoRectangle ink_rect;
-
- pango_glyph_string_extents (glyphs, font, &ink_rect, NULL);
-
- bounds.x = x + PANGO_PIXELS (ink_rect.x) - 1;
- bounds.y = y + PANGO_PIXELS (ink_rect.y) - 1;
- bounds.width = PANGO_PIXELS (ink_rect.width) + 2;
- bounds.height = PANGO_PIXELS (ink_rect.height) + 2;
- region = gdk_region_rectangle (&bounds);
-
- if (matrix)
- {
- /* transform region */
- bounds.x = bounds.x * matrix->xx + bounds.y * matrix->xy + matrix->x0;
- bounds.y = bounds.x * matrix->yx + bounds.y * matrix->yy + matrix->x0;
- bounds.width = bounds.width * matrix->xx + bounds.height * matrix->xy;
- bounds.height = bounds.height * matrix->yx + bounds.width * matrix->xy;
-
- generic_draw (drawable, gc, GDK_GC_FOREGROUND|GDK_GC_FONT,
- draw_glyphs_transformed, region, matrix, font, x, y, glyphs);
- }
- else
- {
- generic_draw (drawable, gc, GDK_GC_FOREGROUND|GDK_GC_FONT,
- draw_glyphs, region, font, x/PANGO_SCALE, y/PANGO_SCALE, glyphs);
- }
-
- gdk_region_destroy (region);
-}
-