Properly propagate font size in pango_core_text_font_map_load_font
authorKristian Rietveld <kris@gtk.org>
Wed, 17 Mar 2010 21:56:48 +0000 (22:56 +0100)
committerKristian Rietveld <kris@gtk.org>
Thu, 14 Apr 2011 10:30:03 +0000 (12:30 +0200)
pango/pangocoretext-fontmap.c

index ce55a5b..a507307 100644 (file)
@@ -833,11 +833,14 @@ pango_core_text_font_map_load_font (PangoFontMap               *fontmap,
   const gchar *family;
   gchar *name;
   gint size;
+  gboolean is_absolute;
 
   size = pango_font_description_get_size (description);
   if (size < 0)
     return NULL;
 
+  is_absolute = pango_font_description_get_size_is_absolute (description);
+
   family = pango_font_description_get_family (description);
   family = family ? family : "";
   name = g_utf8_casefold (family, -1);
@@ -856,7 +859,10 @@ pango_core_text_font_map_load_font (PangoFontMap               *fontmap,
       if (!find_best_match (font_family, description, &best_description, &best_face))
        return NULL;
       
-      pango_font_description_set_size (best_description, size);
+      if (is_absolute)
+        pango_font_description_set_absolute_size (best_description, size);
+      else
+        pango_font_description_set_size (best_description, size);
 
       best_font = pango_core_text_font_map_lookup (ctfontmap,
                                                    context,