summaryrefslogtreecommitdiff
path: root/pango/pangowin32-fontmap.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2008-02-24 22:04:56 +0000
committerTor Lillqvist <tml@src.gnome.org>2008-02-24 22:04:56 +0000
commit086da399d3c16f0c9b75ae2c60e4afcb286bb052 (patch)
treee3323630c7f4756578fb15e4982a7f9dfc170799 /pango/pangowin32-fontmap.c
parentf7c14feedebe9dbea552a49d998dfeb56f1f797f (diff)
downloadpango-086da399d3c16f0c9b75ae2c60e4afcb286bb052.tar.gz
Bug 515484: Pango on Windows is missing Type 1 font support Patch from
2008-02-24 Tor Lillqvist <tml@novell.com> Bug 515484: Pango on Windows is missing Type 1 font support Patch from Adrian Johnson. * pango/pangowin32-private.h (PangoWin32Face): Add has_cmap field that tells whether the font has a cmap or not. A Type 1 font doesn't. * pango/pangowin32.c (pango_win32_font_get_type1_glyph_index): New static function. Uses GetGlyphIndicesW() to get the glyph indices for Type 1 fonts. Possibly also TrueType fonts that for some reason lack the cmap formats we understand. (pango_win32_font_calc_type1_coverage): New static function. Uses GetFontUnicodeRanges() to get the coverage for Type 1 fonts, and possibly TrueType fonts that lack the cmap formats we understand. (pango_win32_font_get_glyph_index): Set has_cmap to false if the font doesn't have a cmap. Call pango_win32_font_get_type1_glyph_index() in that case. (pango_win32_font_calc_coverage): Set has_cmap to false if the font doesn't have a cmap. Call pango_win32_font_calc_type1_coverage() in that case. * pango/pangowin32-fontmap.c (pango_win32_enum_proc): Accept also Type 1 fonts. (pango_win32_insert_font): Initialise has_cmap tentativaly to True. svn path=/trunk/; revision=2573
Diffstat (limited to 'pango/pangowin32-fontmap.c')
-rw-r--r--pango/pangowin32-fontmap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c
index da13443d..2216786e 100644
--- a/pango/pangowin32-fontmap.c
+++ b/pango/pangowin32-fontmap.c
@@ -57,6 +57,10 @@ struct _PangoWin32SizeInfo
# define NTM_PS_OPENTYPE 0x20000
#endif
+#if !defined(NTM_TYPE1)
+# define NTM_TYPE1 0x100000
+#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))
@@ -196,7 +200,7 @@ pango_win32_enum_proc (LOGFONTW *lfp,
if (fontType == TRUETYPE_FONTTYPE ||
(_pango_win32_os_version_info.dwMajorVersion >= 5 &&
- (metrics->ntmFlags & NTM_PS_OPENTYPE)))
+ ((metrics->ntmFlags & NTM_PS_OPENTYPE) || (metrics->ntmFlags & NTM_TYPE1))))
{
lf = *lfp;
@@ -1098,6 +1102,7 @@ pango_win32_insert_font (PangoWin32FontMap *win32fontmap,
win32face->is_synthetic = is_synthetic;
+ win32face->has_cmap = TRUE;
win32face->cmap_format = 0;
win32face->cmap = NULL;