Revert "gdi32: Disable the freetype mmap sharing on Mac OS."

Ken Thomases ken at codeweavers.com
Wed Mar 21 18:36:39 CDT 2007


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 files changed, 6 insertions(+), 6 deletions(-)
-------------- next part --------------
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 31b3429..f7b1220 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -2205,7 +2205,6 @@ static LONG calc_ppem_for_height(FT_Face
 
 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 @@ #ifndef __APPLE__  /* Mac OS fonts use r
 
 error:
     close( fd );
-#endif
     return NULL;
 }
 
@@ -2265,11 +2263,13 @@ static FT_Face OpenFontFile(GdiFont *fon
 
     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;


More information about the wine-patches mailing list