summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--pango/pangowin32-fontmap.c14
2 files changed, 20 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 965e610f..d1728184 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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)
+
2007-01-31 Tor Lillqvist <tml@novell.com>
* pango/Makefile.am: Use pangocairo.def only on Win32, not
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;