diff options
author | Owen Taylor <otaylor@redhat.com> | 2007-02-13 00:56:25 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2007-02-13 00:56:25 +0000 |
commit | df973c68990a45c67b0ab7bfe9a7d538fc00363c (patch) | |
tree | bbaf75318f6089f5b912af196030de16b4353028 /pango/pangowin32-fontmap.c | |
parent | 0cd2563446cc689a28fd45d599f772d7d8490abc (diff) | |
download | pango-df973c68990a45c67b0ab7bfe9a7d538fc00363c.tar.gz |
If something has gone wrong in setting the family of the font description,
2007-02-13 Owen Taylor <otaylor@redhat.com>
* pango/pangowin32-fontmap.c (pango_win32_insert_font): If
something has gone wrong in setting the family of the font
description, don't bother with the font as it isn't usable and
will cause crashes later anyway. (#404295)
svn path=/trunk/; revision=2194
Diffstat (limited to 'pango/pangowin32-fontmap.c')
-rw-r--r-- | pango/pangowin32-fontmap.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c index 05a51468..facaf25e 100644 --- a/pango/pangowin32-fontmap.c +++ b/pango/pangowin32-fontmap.c @@ -774,6 +774,7 @@ pango_win32_insert_font (PangoWin32FontMap *win32fontmap, LOGFONT *lfp) { LOGFONT *lfp2 = NULL; + PangoFontDescription *description; PangoWin32Family *font_family; PangoWin32Face *win32face; PangoWin32SizeInfo *size_info; @@ -839,8 +840,19 @@ pango_win32_insert_font (PangoWin32FontMap *win32fontmap, PING(("g_slist_length(size_info->logfonts)=%d", g_slist_length(size_info->logfonts))); + description = pango_win32_font_description_from_logfont (lfp2); + + /* In some cases, extracting a name for a font can fail; such fonts + * aren't usable for us + */ + if (!pango_font_description_get_family (description)) + { + pango_font_description_free (description); + return; + } + win32face = g_object_new (PANGO_WIN32_TYPE_FACE, NULL); - win32face->description = pango_win32_font_description_from_logfont (lfp2); + win32face->description = description; win32face->cached_fonts = NULL; |