From df605c0ac3a1294b71416cec5da213b956295e06 Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Wed, 21 Mar 2007 18:36:39 -0500 Subject: [PATCH] Revert "gdi32: Disable the freetype mmap sharing on Mac OS.". This reverts ae9f68dec91cd6ac66a99dc62d69dc53eaf910d0 commit. Because of commit 4e6860433e72714ed1e500eb523710656e71ba02 which extracts the constituent fonts from Mac suitcase fonts, we can use mmap on font files on the Mac. --- dlls/gdi32/freetype.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 31b342948b2..f7b1220a2b1 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -2205,7 +2205,6 @@ static LONG calc_ppem_for_height(FT_Face ft_face, LONG height) static struct font_mapping *map_font( const char *name ) { -#ifndef __APPLE__ /* Mac OS fonts use resource forks, we can't simply mmap them */ struct font_mapping *mapping; struct stat st; int fd; @@ -2242,7 +2241,6 @@ static struct font_mapping *map_font( const char *name ) error: close( fd ); -#endif return NULL; } @@ -2265,11 +2263,13 @@ static FT_Face OpenFontFile(GdiFont *font, char *file, FT_Long face_index, LONG TRACE("%s, %ld, %d x %d\n", debugstr_a(file), face_index, width, height); - if ((font->mapping = map_font( file ))) - err = pFT_New_Memory_Face(library, font->mapping->data, font->mapping->size, face_index, &ft_face); - else - err = pFT_New_Face(library, file, face_index, &ft_face); + if (!(font->mapping = map_font( file ))) + { + WARN("failed to map %s\n", debugstr_a(file)); + return 0; + } + err = pFT_New_Memory_Face(library, font->mapping->data, font->mapping->size, face_index, &ft_face); if(err) { ERR("FT_New_Face rets %d\n", err); return 0; -- 2.11.4.GIT