summaryrefslogtreecommitdiff
path: root/pango/pangowin32.c
diff options
context:
space:
mode:
authorHans Breuer <hans@breuer.org>2004-11-21 20:30:35 +0000
committerHans Breuer <hans@src.gnome.org>2004-11-21 20:30:35 +0000
commit878588edfd26a03c2765024cc38de6f4f16d7e8f (patch)
treebf6be4328bd1570f4008c6272486d91243eb0e3d /pango/pangowin32.c
parent422236540a62ce8817f9befe4dd981a9b76d8fda (diff)
downloadpango-878588edfd26a03c2765024cc38de6f4f16d7e8f.tar.gz
updated
2004-11-21 Hans Breuer <hans@breuer.org> * pango/makefile.msc : updated * pango/pangowin32.[ch] pango/pangowin32.def : implement pango_win32_render_transformed() by using the transformation capabilities of GDI (not available on win9x)
Diffstat (limited to 'pango/pangowin32.c')
-rw-r--r--pango/pangowin32.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/pango/pangowin32.c b/pango/pangowin32.c
index e3f62a10..b63767e2 100644
--- a/pango/pangowin32.c
+++ b/pango/pangowin32.c
@@ -396,6 +396,41 @@ pango_win32_render (HDC hdc,
g_free (dX);
}
+void
+pango_win32_render_transformed (HDC hdc,
+ const PangoMatrix *matrix,
+ PangoFont *font,
+ PangoGlyphString *glyphs,
+ int x,
+ int y)
+{
+ XFORM xForm;
+ XFORM xFormPrev = {1.0, 0.0, 0.0, 1.0, 0.0, 0.0};
+ int mode = GetGraphicsMode (hdc);
+
+ if (!SetGraphicsMode (hdc, GM_ADVANCED))
+ g_warning ("SetGraphicsMode() failed");
+ else if (!GetWorldTransform (hdc, &xFormPrev))
+ g_warning ("GetWorldTransform() failed");
+ else if (matrix)
+ {
+ xForm.eM11 = matrix->xx;
+ xForm.eM12 = matrix->xy;
+ xForm.eM21 = matrix->yx;
+ xForm.eM22 = matrix->yy;
+ xForm.eDx = matrix->x0;
+ xForm.eDy = matrix->y0;
+ if (!SetWorldTransform (hdc, &xForm))
+ g_warning ("GetWorldTransform() failed");
+ }
+
+ pango_win32_render (hdc, font, glyphs, x/PANGO_SCALE, y/PANGO_SCALE);
+
+ /* restore */
+ SetWorldTransform (hdc, &xFormPrev);
+ SetGraphicsMode (hdc, mode);
+}
+
static void
pango_win32_font_get_glyph_extents (PangoFont *font,
PangoGlyph glyph,