summaryrefslogtreecommitdiff
path: root/pango/pangocairo-font.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-06-05 02:04:56 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-06-05 02:04:56 +0000
commit78059d83ba56f36c874cdf71dcb07a6724bf355f (patch)
treed9026b55a0a3a5a6478fd66f9cca8357ce52316b /pango/pangocairo-font.c
parent9df621b3fa0a1e49c75eac8fc239138f8991b536 (diff)
downloadpango-78059d83ba56f36c874cdf71dcb07a6724bf355f.tar.gz
Zero glyphs->num_glyphs before calling into shape engine.
2007-06-04 Behdad Esfahbod <behdad@gnome.org> * pango/shape.c (pango_shape): Zero glyphs->num_glyphs before calling into shape engine. * pango/pango-engine.c (fallback_engine_shape): Improve, to support clusters and what not. * pango/pangocairo-font.c (_pango_cairo_font_get_hex_box_info): Use "pango_script_get_sample_language (PANGO_SCRIPT_LATIN)" instead of hardcoding "en". Handle cairo_scaled_font_extents() failure. svn path=/trunk/; revision=2332
Diffstat (limited to 'pango/pangocairo-font.c')
-rw-r--r--pango/pangocairo-font.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c
index a8d011f2..2595c0ef 100644
--- a/pango/pangocairo-font.c
+++ b/pango/pangocairo-font.c
@@ -241,7 +241,7 @@ _pango_cairo_font_get_hex_box_info (PangoCairoFont *cfont)
context = pango_cairo_font_map_create_context ((PangoCairoFontMap *) (fontmap));
pango_context_set_matrix (context, &pango_ctm);
- pango_context_set_language (context, pango_language_from_string ("en"));
+ pango_context_set_language (context, pango_script_get_sample_language (PANGO_SCRIPT_LATIN));
pango_cairo_context_set_font_options (context, font_options);
mini_font = pango_font_map_load_font (fontmap, context, desc);
@@ -265,6 +265,12 @@ _pango_cairo_font_get_hex_box_info (PangoCairoFont *cfont)
}
cairo_scaled_font_extents (scaled_font, &font_extents);
+ if (font_extents.ascent + font_extents.descent <= 0)
+ {
+ font_extents.ascent = PANGO_UNKNOWN_GLYPH_HEIGHT;
+ font_extents.descent = 0;
+ }
+
pad = (font_extents.ascent + font_extents.descent) / 43;
pad = MIN (pad, mini_size);