Index: app/text/gimptext-private.h =================================================================== --- app/text/gimptext-private.h (revision 22941) +++ app/text/gimptext-private.h (working copy) @@ -32,6 +32,8 @@ struct _GimpTextLayout GObject object; GimpText *text; + gdouble xres; + gdouble yres; PangoLayout *layout; PangoRectangle extents; }; Index: app/text/gimptextlayout.c =================================================================== --- app/text/gimptextlayout.c (revision 22941) +++ app/text/gimptextlayout.c (working copy) @@ -125,6 +125,8 @@ gimp_text_layout_new (GimpText *text, layout = g_object_new (GIMP_TYPE_TEXT_LAYOUT, NULL); layout->text = g_object_ref (text); layout->layout = pango_layout_new (context); + layout->xres = xres; + layout->yres = yres; g_object_unref (context); @@ -258,6 +260,9 @@ gimp_text_layout_position (GimpTextLayou pango_layout_get_pixel_extents (layout->layout, &ink, &logical); + ink.width = ceil ((gdouble) ink.width * layout->xres / layout->yres); + logical.width = ceil ((gdouble) logical.width * layout->xres / layout->yres); + #ifdef VERBOSE g_print ("ink rect: %d x %d @ %d, %d\n", ink.width, ink.height, ink.x, ink.y); Index: app/text/gimptextlayout-render.c =================================================================== --- app/text/gimptextlayout-render.c (revision 22941) +++ app/text/gimptextlayout-render.c (working copy) @@ -198,8 +198,8 @@ gimp_text_layout_render_trafo (GimpTextL { GimpText *text = layout->text; - trafo->xx = text->transformation.coeff[0][0] * 65536.0; + trafo->xx = text->transformation.coeff[0][0] * 65536.0 / layout->yres * layout->xres; trafo->xy = text->transformation.coeff[0][1] * 65536.0; - trafo->yx = text->transformation.coeff[1][0] * 65536.0; + trafo->yx = text->transformation.coeff[1][0] * 65536.0 / layout->yres * layout->xres; trafo->yy = text->transformation.coeff[1][1] * 65536.0; }