diff options
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pango-markup.c | 2 | ||||
-rw-r--r-- | pango/pangowin32-fontmap.c | 22 | ||||
-rw-r--r-- | pango/shape.c | 12 |
3 files changed, 32 insertions, 4 deletions
diff --git a/pango/pango-markup.c b/pango/pango-markup.c index 00b16943..91def193 100644 --- a/pango/pango-markup.c +++ b/pango/pango-markup.c @@ -1671,7 +1671,7 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED, if (!span_parse_float ("line_height", line_height, &f, line_number, error)) goto error; - if (f > 1024.0 && strchr (line_height, ".") == 0) + if (f > 1024.0 && strchr (line_height, '.') == 0) add_attribute (tag, pango_attr_line_height_new_absolute ((int)f)); else add_attribute (tag, pango_attr_line_height_new (f)); diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c index b6341f52..200ea9ce 100644 --- a/pango/pangowin32-fontmap.c +++ b/pango/pangowin32-fontmap.c @@ -1037,19 +1037,35 @@ pango_win32_font_map_load_font (PangoFontMap *fontmap, win32family = g_hash_table_lookup (win32fontmap->families, families[i]); if (win32family) { + PangoFontDescription *new_desc; + PangoFontDescription *best_desc = NULL; + PING (("got win32family")); tmp_list = win32family->faces; + while (tmp_list) { PangoWin32Face *face = tmp_list->data; + new_desc = pango_font_face_describe (PANGO_FONT_FACE (face)); + pango_font_description_set_gravity (new_desc, + pango_font_description_get_gravity (description)); if (pango_font_description_better_match (description, - best_match ? best_match->description : NULL, - face->description)) - best_match = face; + best_desc, + new_desc)) + { + pango_font_description_free (best_desc); + best_desc = new_desc; + best_match = face; + } + else + pango_font_description_free (new_desc); tmp_list = tmp_list->next; } + + if (best_desc != NULL) + pango_font_description_free (best_desc); } } diff --git a/pango/shape.c b/pango/shape.c index f8ac3691..aed028b7 100644 --- a/pango/shape.c +++ b/pango/shape.c @@ -341,5 +341,17 @@ pango_shape_with_flags (const gchar *item_text, #undef HINT } } + else + { + for (i = 0; i < glyphs->num_glyphs; i++) + { + glyphs->glyphs[i].geometry.width = + PANGO_UNITS_ROUND (glyphs->glyphs[i].geometry.width); + glyphs->glyphs[i].geometry.x_offset = + PANGO_UNITS_ROUND (glyphs->glyphs[i].geometry.x_offset); + glyphs->glyphs[i].geometry.y_offset = + PANGO_UNITS_ROUND (glyphs->glyphs[i].geometry.y_offset); + } + } } } |