Huw Davies : gdi32: Don't load Wine's bitmap-only TrueType fonts.
Alexandre Julliard
julliard at winehq.org
Mon Oct 15 11:27:47 CDT 2007
Module: wine
Branch: master
Commit: e5df622ff3d44d097ef287811d6f6a1c914b1f9e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e5df622ff3d44d097ef287811d6f6a1c914b1f9e
Author: Huw Davies <huw at codeweavers.com>
Date: Fri Oct 12 14:35:44 2007 +0100
gdi32: Don't load Wine's bitmap-only TrueType fonts.
---
dlls/gdi32/freetype.c | 34 ++++++++++++++++++++++++++--------
1 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index b9bc82a..8d48e66 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -1071,14 +1071,32 @@ static INT AddFontToList(const char *file, void *font_data_ptr, DWORD font_data_
return 0;
}
- if(FT_IS_SFNT(ft_face) && (!pFT_Get_Sfnt_Table(ft_face, ft_sfnt_os2) ||
- !pFT_Get_Sfnt_Table(ft_face, ft_sfnt_hhea) ||
- !(pHeader = pFT_Get_Sfnt_Table(ft_face, ft_sfnt_head)))) {
- TRACE("Font %s/%p lacks either an OS2, HHEA or HEAD table.\n"
- "Skipping this font.\n", debugstr_a(file), font_data_ptr);
- pFT_Done_Face(ft_face);
- return 0;
- }
+ if(FT_IS_SFNT(ft_face))
+ {
+ if(!(pOS2 = pFT_Get_Sfnt_Table(ft_face, ft_sfnt_os2)) ||
+ !pFT_Get_Sfnt_Table(ft_face, ft_sfnt_hhea) ||
+ !(pHeader = pFT_Get_Sfnt_Table(ft_face, ft_sfnt_head)))
+ {
+ TRACE("Font %s/%p lacks either an OS2, HHEA or HEAD table.\n"
+ "Skipping this font.\n", debugstr_a(file), font_data_ptr);
+ pFT_Done_Face(ft_face);
+ return 0;
+ }
+
+ /* Wine uses ttfs as an intermediate step in building its bitmap fonts;
+ we don't want to load these. */
+ if(!memcmp(pOS2->achVendID, "Wine", sizeof(pOS2->achVendID)))
+ {
+ FT_ULong len = 0;
+
+ if(!load_sfnt_table(ft_face, FT_MAKE_TAG('E','B','S','C'), 0, NULL, &len))
+ {
+ TRACE("Skipping Wine bitmap-only TrueType font %s\n", debugstr_a(file));
+ pFT_Done_Face(ft_face);
+ return 0;
+ }
+ }
+ }
if(!ft_face->family_name || !ft_face->style_name) {
TRACE("Font %s/%p lacks either a family or style name\n", debugstr_a(file), font_data_ptr);
More information about the wine-cvs
mailing list