Commit 537e8606 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

sort of works now.

2003-03-26  Sven Neumann  <sven@gimp.org>

	* app/text/gimpfont.c (gimp_font_get_new_preview): sort of works now.
parent c2a22d5d
2003-03-26 Sven Neumann <sven@gimp.org>
* app/text/gimpfont.c (gimp_font_get_new_preview): sort of works now.
2003-03-25 Michael Natterer <mitch@gimp.org>
 
* app/text/gimpfontlist.[ch]: added gimp_font_list_restore()
......@@ -210,6 +210,7 @@ gimp_font_get_new_preview (GimpViewable *viewable,
GimpFont *font;
PangoFontDescription *font_desc;
PangoLayout *layout;
PangoRectangle logical;
const gchar *name;
TempBuf *temp_buf;
FT_Bitmap bitmap;
......@@ -228,9 +229,11 @@ gimp_font_get_new_preview (GimpViewable *viewable,
if (!font_desc)
return NULL;
pango_font_description_set_size (font_desc, PANGO_SCALE * height);
pango_font_description_set_size (font_desc,
PANGO_SCALE * height * 2.0 / 3.0);
layout = pango_layout_new (font->pango_context);
pango_layout_set_font_description (layout, font_desc);
pango_font_description_free (font_desc);
pango_layout_set_text (layout, "Aa", -1);
......@@ -242,7 +245,12 @@ gimp_font_get_new_preview (GimpViewable *viewable,
bitmap.pitch = temp_buf->width;
bitmap.buffer = temp_buf_data (temp_buf);
pango_ft2_render_layout (&bitmap, layout, 0, 0);
pango_layout_get_pixel_extents (layout, NULL, &logical);
pango_ft2_render_layout (&bitmap,
layout,
(bitmap.width - logical.width) / 2,
(bitmap.rows - logical.height) / 2);
g_object_unref (layout);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment