summaryrefslogtreecommitdiff
path: root/pango/pangofc-font.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-02-21 11:41:12 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-02-21 11:41:12 +0000
commit9d9369dc05e7df4558fc8ba36b7ec2dd969ae64f (patch)
tree8bef9728db416599b8160666c7e30a233d089d77 /pango/pangofc-font.c
parente0babd9ed3f94843d2d8833592bd55895769c009 (diff)
downloadpango-9d9369dc05e7df4558fc8ba36b7ec2dd969ae64f.tar.gz
Bug 314239 – pangocairo crashes when font cannot be read
2006-02-21 Behdad Esfahbod <behdad@gnome.org> Bug 314239 – pangocairo crashes when font cannot be read * pango/pangocairo-fcfont.c, pango/pangocairo-font.c: Hack up to not crash if we cannot create cairo_scaled_font_t for PangoFont (font is not readable, removed, etc.)
Diffstat (limited to 'pango/pangofc-font.c')
-rw-r--r--pango/pangofc-font.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index 5bea0e81..d6e2d8fd 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -291,6 +291,17 @@ get_face_metrics (PangoFcFont *fcfont,
TT_OS2 *os2;
gboolean have_transform = FALSE;
+ if (!face)
+ {
+ metrics->descent = 0;
+ metrics->ascent = PANGO_SCALE * PANGO_UNKNOWN_GLYPH_HEIGHT;
+ metrics->underline_thickness = PANGO_SCALE;
+ metrics->underline_position = - PANGO_SCALE;
+ metrics->strikethrough_thickness = PANGO_SCALE;
+ metrics->strikethrough_position = PANGO_SCALE * (PANGO_UNKNOWN_GLYPH_HEIGHT/2);
+ return;
+ }
+
if (FcPatternGetMatrix (fcfont->font_pattern,
FC_MATRIX, 0, &fc_matrix) == FcResultMatch)
{