mirror of https://github.com/GNOME/gimp.git
app/text/gimptext-private.h app/text/gimptextlayout.c Fix text rendering
2007-07-17 Simon Budig <simon@gimp.org> * app/text/gimptext-private.h * app/text/gimptextlayout.c * app/text/gimptextlayout-render.c: Fix text rendering for xres != yres. svn path=/trunk/; revision=22943
This commit is contained in:
parent
83898a0cf8
commit
340cd2f8e6
|
@ -1,3 +1,9 @@
|
||||||
|
2007-07-17 Simon Budig <simon@gimp.org>
|
||||||
|
|
||||||
|
* app/text/gimptext-private.h
|
||||||
|
* app/text/gimptextlayout.c
|
||||||
|
* app/text/gimptextlayout-render.c: Fix text rendering for xres != yres.
|
||||||
|
|
||||||
2007-07-17 Sven Neumann <sven@gimp.org>
|
2007-07-17 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/widgets/gimpmenudock.c (gimp_menu_dock_new): unref the context.
|
* app/widgets/gimpmenudock.c (gimp_menu_dock_new): unref the context.
|
||||||
|
|
|
@ -32,6 +32,8 @@ struct _GimpTextLayout
|
||||||
GObject object;
|
GObject object;
|
||||||
|
|
||||||
GimpText *text;
|
GimpText *text;
|
||||||
|
gdouble xres;
|
||||||
|
gdouble yres;
|
||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
PangoRectangle extents;
|
PangoRectangle extents;
|
||||||
};
|
};
|
||||||
|
|
|
@ -198,8 +198,8 @@ gimp_text_layout_render_trafo (GimpTextLayout *layout,
|
||||||
{
|
{
|
||||||
GimpText *text = layout->text;
|
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->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;
|
trafo->yy = text->transformation.coeff[1][1] * 65536.0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,6 +125,8 @@ gimp_text_layout_new (GimpText *text,
|
||||||
layout = g_object_new (GIMP_TYPE_TEXT_LAYOUT, NULL);
|
layout = g_object_new (GIMP_TYPE_TEXT_LAYOUT, NULL);
|
||||||
layout->text = g_object_ref (text);
|
layout->text = g_object_ref (text);
|
||||||
layout->layout = pango_layout_new (context);
|
layout->layout = pango_layout_new (context);
|
||||||
|
layout->xres = xres;
|
||||||
|
layout->yres = yres;
|
||||||
|
|
||||||
g_object_unref (context);
|
g_object_unref (context);
|
||||||
|
|
||||||
|
@ -258,6 +260,9 @@ gimp_text_layout_position (GimpTextLayout *layout)
|
||||||
|
|
||||||
pango_layout_get_pixel_extents (layout->layout, &ink, &logical);
|
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
|
#ifdef VERBOSE
|
||||||
g_print ("ink rect: %d x %d @ %d, %d\n",
|
g_print ("ink rect: %d x %d @ %d, %d\n",
|
||||||
ink.width, ink.height, ink.x, ink.y);
|
ink.width, ink.height, ink.x, ink.y);
|
||||||
|
|
Loading…
Reference in New Issue