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

Alexandre Julliard julliard at wine.codeweavers.com
Thu Mar 22 10:11:07 CDT 2007


Module: wine
Branch: master
Commit: df605c0ac3a1294b71416cec5da213b956295e06
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=df605c0ac3a1294b71416cec5da213b956295e06

Author: Ken Thomases <ken at codeweavers.com>
Date:   Wed Mar 21 18:36:39 2007 -0500

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 files changed, 6 insertions(+), 6 deletions(-)

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 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;




More information about the wine-cvs mailing list