From 313ef397cdf642f9d708f3def99f2ee7ce80a0f7 Mon Sep 17 00:00:00 2001 From: Massimo Valentini Date: Thu, 21 Jun 2012 19:04:31 +0200 Subject: [PATCH] Bug 677040: PDF export does not appear to handle font size... ...correctly unless image flattened Font size was wrong unless in pixels and gimp_drawable_type returns a GimpImageType --- plug-ins/common/file-pdf-save.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plug-ins/common/file-pdf-save.c b/plug-ins/common/file-pdf-save.c index f21b27e6af..6296845f32 100644 --- a/plug-ins/common/file-pdf-save.c +++ b/plug-ins/common/file-pdf-save.c @@ -1409,7 +1409,7 @@ drawText (GimpDrawable *text_layer, gdouble y_res) { gint32 text_id = text_layer->drawable_id; - GimpImageBaseType type = gimp_drawable_type (text_id); + GimpImageType type = gimp_drawable_type (text_id); gchar *text = gimp_text_layer_get_text (text_id); gchar *markup = gimp_text_layer_get_markup (text_id); @@ -1456,7 +1456,7 @@ drawText (GimpDrawable *text_layer, /* Color */ /* When dealing with a gray/indexed image, the viewed color of the text layer * can be different than the one kept in the memory */ - if (type == GIMP_RGB) + if (type == GIMP_RGBA_IMAGE) gimp_text_layer_get_color (text_id, &color); else gimp_image_pick_color (gimp_item_get_image (text_id), text_id, x, y, FALSE, FALSE, 0, &color); @@ -1518,8 +1518,7 @@ drawText (GimpDrawable *text_layer, /* Font Size */ size = gimp_text_layer_get_font_size (text_id, &unit); - if (! g_strcmp0 (gimp_unit_get_abbreviation (unit), "px") == 0) - size *= 1.0 / gimp_unit_get_factor (unit) * x_res / y_res; + size = gimp_units_to_pixels (size, unit, y_res); pango_font_description_set_absolute_size (font_description, size * PANGO_SCALE); pango_layout_set_font_description (layout, font_description);