This patch adds FT_GetFile_From_Mac_ATS_Name() in src/base/ftmac.c,
which is an AppleTypeService based replacement of QuickDraw based
FT_GetFile_From_Mac_Name().
If "HAVE_QUICKDRAW" is set to false on the future Mac OS X system
without QuickDraw, FT_GetFile_From_Mac_Name() will be a function
that returns error always. If "HAVE_ATS" is set to false on old
system without ATS, FT_GetFile_From_Mac_ATS_Name() will be a function
that returns error always.

Also a patch for configure.ac is attached to set HAVE_QUICKDRAW
and HAVE_ATS.

Written by suzuki toshiya

diff -NBurb -x {arch} -x '.*' freetype2--mps-macos--0.1--patch-4/src/base/ftmac.c freetype2--mps-macos--0.1--patch-6/src/base/ftmac.c
--- freetype2--mps-macos--0.1--patch-4/src/base/ftmac.c	2005-09-16 17:59:14.000000000 +0900
+++ freetype2--mps-macos--0.1--patch-6/src/base/ftmac.c	2005-09-16 17:59:47.000000000 +0900
@@ -937,6 +937,15 @@
 
   /* documentation is in ftmac.h */
 
+#if !HAVE_QUICKDRAW  /* QuickDraw is deprecated since Mac OS X 10.4 */
+  FT_EXPORT_DEF( FT_Error )
+  FT_GetFile_From_Mac_Name( const char*  fontName,
+                            FSSpec*      pathSpec,
+                            FT_Long*     face_index )
+  {
+    return FT_Err_Unimplemented;
+  }
+#else
   FT_EXPORT_DEF( FT_Error )
   FT_GetFile_From_Mac_Name( const char*  fontName,
                             FSSpec*      pathSpec,
@@ -1019,6 +1028,58 @@
     else
       return FT_Err_Unknown_File_Format;
   }
+#endif
+
+
+#if !HAVE_ATS
+  FT_EXPORT_DEF( FT_Error )
+  FT_GetFile_From_Mac_ATS_Name( const char*  fontName,
+                                FSSpec*      pathSpec,
+                                FT_Long*     face_index )
+  {
+    return FT_Err_Unimplemented;
+  }
+#else
+  FT_EXPORT_DEF( FT_Error )
+  FT_GetFile_From_Mac_ATS_Name( const char*  fontName,
+                                FSSpec*      pathSpec,
+                                FT_Long*     face_index )
+  {
+    CFStringRef  cf_fontName;
+    ATSFontRef   ats_font_id;
+  
+    *face_index = 0;
+  
+    cf_fontName = CFStringCreateWithCString( NULL, fontName, kCFStringEncodingMacRoman );
+    ats_font_id = ATSFontFindFromName( cf_fontName, kATSOptionFlagsUnRestrictedScope );
+  
+    if ( ats_font_id == 0 || ats_font_id == 0xFFFFFFFF )
+      return FT_Err_Unknown_File_Format;
+  
+    if ( 0 != ATSFontGetFileSpecification( ats_font_id, pathSpec ))
+      return FT_Err_Unknown_File_Format;
+ 
+    /* face_index calculation by searching preceding fontIDs with same FSRef */
+    {
+      int     i;
+      FSSpec  f;
+  
+  
+      for ( i = 1; i < ats_font_id; i++ )
+      {
+        if ( 0 != ATSFontGetFileSpecification( ats_font_id - i, &f )   ||
+             f.vRefNum != pathSpec->vRefNum                            ||
+             f.parID   != pathSpec->parID                              ||
+             f.name[0] != pathSpec->name[0]                            ||
+             0 != strncmp( f.name + 1, pathSpec->name + 1, f.name[0] ) )
+          break;
+      }
+      *face_index = ( i - 1 );
+    }
+    return FT_Err_Ok;
+  }
+#endif
+
 
   /* Common function to load a new FT_Face from a resource file. */
 

diff -NBurb -x {arch} -x '.*' freetype2--mps-macos--0.1--patch-4/builds/unix/configure.ac freetype2--mps-macos--0.1--patch-6/builds/unix/configure.ac
--- freetype2--mps-macos--0.1--patch-4/builds/unix/configure.ac	2005-09-16 17:59:13.000000000 +0900
+++ freetype2--mps-macos--0.1--patch-6/builds/unix/configure.ac	2005-09-16 17:59:45.000000000 +0900
@@ -147,6 +147,75 @@
 fi
 
 
+# Whether to use QuickDraw FontManager which is deprecated since Mac OS X 10.4
+
+AC_ARG_WITH([quickdraw],
+  dnl don't quote AS_HELP_STRING!
+  AS_HELP_STRING([--with-quickdraw],
+                 [use QuickDraw FontManager, if available (default=yes)]))
+if test x$with_quickdraw = xno; then
+  CFLAGS="$CFLAGS -DHAVE_QUICKDRAW=0"
+elif test x$with_old_mac_fonts = xyes; then
+  AC_MSG_CHECKING([QuickDraw FontManager functions])
+  AC_TRY_LINK([
+#include <Carbon/Carbon.h>
+  ], [
+  FMFontFamilyIterator          famIter;
+  FMFontFamily                  family;
+  Str255                        famNameStr;
+  FMFontFamilyInstanceIterator  instIter;
+  FMFontStyle                   style;
+  FMFontSize                    size;
+  FMFont                        font;
+  FSSpec*                       pathSpec;
+
+
+  FMCreateFontFamilyIterator( NULL, NULL, kFMUseGlobalScopeOption, &famIter );
+  FMGetNextFontFamily( &famIter, &family );
+  FMGetFontFamilyName( family, famNameStr );
+  FMCreateFontFamilyInstanceIterator( family, &instIter );
+  FMGetNextFontFamilyInstance( &instIter, &font, &style, &size );
+  FMDisposeFontFamilyInstanceIterator( &instIter );
+  FMDisposeFontFamilyIterator( &famIter );
+  FMGetFontContainer( font, pathSpec );
+  ], [
+    AC_MSG_RESULT([ok])
+    CFLAGS="$CFLAGS -DHAVE_QUICKDRAW=1"
+  ], [
+    AC_MSG_RESULT([not found])
+    CFLAGS="$CFLAGS -DHAVE_QUICKDRAW=0"
+  ])
+fi
+
+
+# Whether to use AppleTypeService since CarbonLib 2.x
+AC_ARG_WITH([ats],
+  dnl don't quote AS_HELP_STRING!
+  AS_HELP_STRING([--with-ats],
+                 [use AppleTypeService, if available (default=yes)]))
+if test x$with_ats = xno; then
+  CFLAGS="$CFLAGS -DHAVE_ATS=0"
+elif test x$with_old_mac_fonts = xyes; then
+  AC_MSG_CHECKING([AppleTypeService functions])
+  AC_TRY_LINK([
+#include <Carbon/Carbon.h>
+  ], [
+  FSSpec*  pathSpec;
+
+
+  ATSFontFindFromName( NULL, kATSOptionFlagsUnRestrictedScope );
+  ATSFontGetFileSpecification( 0, pathSpec );
+  ], [
+    AC_MSG_RESULT([ok])
+    CFLAGS="$CFLAGS -DHAVE_ATS=1"
+  ], [
+    AC_MSG_RESULT([not found])
+    CFLAGS="$CFLAGS -DHAVE_ATS=0"
+  ])
+fi
+
+
+
 AC_SUBST([LIBZ])
 AC_SUBST([CFLAGS])
 AC_SUBST([LDFLAGS])
