summaryrefslogtreecommitdiff
path: root/pango/pangowin32-fontmap.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2008-02-13 23:29:12 +0000
committerTor Lillqvist <tml@src.gnome.org>2008-02-13 23:29:12 +0000
commitfada06c4c9b26b78307dbaa7b7f25732f1faaab1 (patch)
tree555405e79b1b70d9fd4e448e2edc2c564ed2449b /pango/pangowin32-fontmap.c
parent238f3bd7af69a1e40d1e5b64a1b61f54a16910f3 (diff)
downloadpango-fada06c4c9b26b78307dbaa7b7f25732f1faaab1.tar.gz
Bug 515484: Pango on Windows is missing non-TrueType font support Patch
2008-02-14 Tor Lillqvist <tml@novell.com> Bug 515484: Pango on Windows is missing non-TrueType font support Patch from Adrian Johnson. * pango/pangowin32-fontmap.c (pango_win32_enum_proc): Accept also OpenType/PS fonts. Interpret the metrics parameter as a NEWTEXTMETRICW struct and check the ntmFlags field. svn path=/trunk/; revision=2566
Diffstat (limited to 'pango/pangowin32-fontmap.c')
-rw-r--r--pango/pangowin32-fontmap.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c
index 1df24751..da13443d 100644
--- a/pango/pangowin32-fontmap.c
+++ b/pango/pangowin32-fontmap.c
@@ -53,6 +53,10 @@ struct _PangoWin32SizeInfo
GSList *logfontws;
};
+#if !defined(NTM_PS_OPENTYPE)
+# define NTM_PS_OPENTYPE 0x20000
+#endif
+
#define PANGO_WIN32_TYPE_FAMILY (pango_win32_family_get_type ())
#define PANGO_WIN32_FAMILY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_WIN32_TYPE_FAMILY, PangoWin32Family))
#define PANGO_WIN32_IS_FAMILY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_WIN32_TYPE_FAMILY))
@@ -181,23 +185,25 @@ pango_win32_inner_enum_proc (LOGFONTW *lfp,
}
static int CALLBACK
-pango_win32_enum_proc (LOGFONTW *lfp,
- TEXTMETRICW *metrics,
- DWORD fontType,
- LPARAM lParam)
+pango_win32_enum_proc (LOGFONTW *lfp,
+ NEWTEXTMETRICW *metrics,
+ DWORD fontType,
+ LPARAM lParam)
{
LOGFONTW lf;
- PING(("%S", lfp->lfFaceName));
-
- if (fontType != TRUETYPE_FONTTYPE)
- return 1;
+ PING(("%S: %lu %lx", lfp->lfFaceName, fontType, metrics->ntmFlags));
- lf = *lfp;
+ if (fontType == TRUETYPE_FONTTYPE ||
+ (_pango_win32_os_version_info.dwMajorVersion >= 5 &&
+ (metrics->ntmFlags & NTM_PS_OPENTYPE)))
+ {
+ lf = *lfp;
- EnumFontFamiliesExW (_pango_win32_hdc, &lf,
- (FONTENUMPROCW) pango_win32_inner_enum_proc,
- lParam, 0);
+ EnumFontFamiliesExW (_pango_win32_hdc, &lf,
+ (FONTENUMPROCW) pango_win32_inner_enum_proc,
+ lParam, 0);
+ }
return 1;
}