Commit 7e3d60135568f3e7a3178dc8e680e6df1ceb110e

Suzuki, Toshiya (鈴木俊哉) 2006-12-15T15:23:21

* Simplify src/base/ftmac.c for Mac OS X

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index 178e202..33d61c8 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -182,8 +182,23 @@ if test x$with_old_mac_fonts = xyes; then
   AC_MSG_CHECKING([CoreServices & ApplicationServices of Mac OS X])
   FT2_EXTRA_LIBS="-Wl,-framework,CoreServices,-framework,ApplicationServices"
   LDFLAGS="$LDFLAGS $FT2_EXTRA_LIBS"
-  AC_TRY_LINK([],
-    [],
+  AC_TRY_LINK([
+#if defined(__GNUC__) && defined(__APPLE_CC__)
+# include <Carbon/Carbon.h>
+# include <ApplicationServices/ApplicationServices.h>
+#else
+# include <ConditionalMacros.h>
+# include <Files.h>
+#endif
+    ],
+    [
+
+      short res = 0;
+
+
+      UseResFile( res );
+
+    ],
     [AC_MSG_RESULT([ok])],
     [AC_MSG_RESULT([not found])
      LDFLAGS="${orig_LDFLAGS}"
@@ -206,7 +221,7 @@ AC_ARG_WITH([fsspec],
                  [use obsolete FSSpec API of MacOS, if available (default=yes)]))
 if test x$with_fsspec = xno; then
   CFLAGS="$CFLAGS -DHAVE_FSSPEC=0"
-elif test x$with_old_mac_fonts = xyes; then
+elif test x$with_old_mac_fonts = xyes -a x$with_fsspec != x; then
   AC_MSG_CHECKING([FSSpec-based FileManager])
   AC_TRY_LINK([
 
@@ -252,7 +267,7 @@ if test x$with_fsref = xno; then
     data-fork fonts on MacOS, except of XXX.dfont.
     ])
   CFLAGS="$CFLAGS -DHAVE_FSREF=0"
-elif test x$with_old_mac_fonts = xyes; then
+elif test x$with_old_mac_fonts = xyes -a x$with_fsref != x; then
   AC_MSG_CHECKING([FSRef-based FileManager])
   AC_TRY_LINK([
 
@@ -310,7 +325,7 @@ AC_ARG_WITH([quickdraw-toolbox],
                  [use MacOS QuickDraw in ToolBox, if available (default=yes)]))
 if test x$with_quickdraw_toolbox = xno; then
   CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_TOOLBOX=0"
-elif test x$with_old_mac_fonts = xyes; then
+elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_toolbox != x; then
   AC_MSG_CHECKING([QuickDraw FontManager functions in ToolBox])
   AC_TRY_LINK([
 
@@ -350,7 +365,7 @@ AC_ARG_WITH([quickdraw-carbon],
                  [use MacOS QuickDraw in Carbon, if available (default=yes)]))
 if test x$with_quickdraw_carbon = xno; then
   CFLAGS="$CFLAGS -DHAVE_QUICKDRAW_CARBON=0"
-elif test x$with_old_mac_fonts = xyes; then
+elif test x$with_old_mac_fonts = xyes -a x$with_quickdraw_carbon != x; then
   AC_MSG_CHECKING([QuickDraw FontManager functions in Carbon])
   AC_TRY_LINK([
 
@@ -400,7 +415,7 @@ AC_ARG_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
+elif test x$with_old_mac_fonts = xyes -a x$with_ats != x ; then
   AC_MSG_CHECKING([AppleTypeService functions])
   AC_TRY_LINK([
 
@@ -422,6 +437,19 @@ elif test x$with_old_mac_fonts = xyes; then
      CFLAGS="$CFLAGS -DHAVE_ATS=0"])
 fi
 
+case "$CFLAGS" in
+  *HAVE_FSSPEC* | *HAVE_FSREF* | *HAVE_QUICKDRAW* | *HAVE_ATS* )
+    AC_MSG_WARN([
+*** WARNING
+    FSSpec/FSRef/QuickDraw/ATS options are explicitly given.
+    use legacy builds/mac/ftmac.c instead of src/base/ftmac.c
+    ])
+    CFLAGS="$CFLAGS "'-I$(TOP_DIR)/builds/mac/'
+    ;;
+  *)
+    ;;
+esac
+
 
 AC_SUBST([LIBZ])
 AC_SUBST([CFLAGS])
diff --git a/builds/unix/ftconfig.in b/builds/unix/ftconfig.in
index 8e379a8..28b2d8c 100644
--- a/builds/unix/ftconfig.in
+++ b/builds/unix/ftconfig.in
@@ -100,8 +100,12 @@ FT_BEGIN_HEADER
   /*                                                                       */
 #if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
     ( defined( __MWERKS__ ) && defined( macintosh )        )
+#if defined( __ppc64__ ) /* no Carbon for ppc64 */
+#define DARWIN_NO_CARBON 1
+#else
 #define FT_MACINTOSH 1
 #endif
+#endif
 
 
   /*************************************************************************/
diff --git a/src/base/ftmac.c b/src/base/ftmac.c
index e4a6187..c1d60fd 100644
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -4,6 +4,8 @@
 /*                                                                         */
 /*    Mac FOND support.  Written by just@letterror.com.                    */
 /*  Heavily Fixed by mpsuzuki, George Williams and Sean McBride            */
+/*  This file is for Mac OS X only, see builds/mac/ftoldmac.c for          */
+/*  classic platforms built by MPW.                                        */ 
 /*                                                                         */
 /*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */
 /*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */
@@ -66,69 +68,25 @@
 #include FT_FREETYPE_H
 #include FT_INTERNAL_STREAM_H
 
-#if defined( __GNUC__ ) || defined( __IBMC__ )
   /* This is for Mac OS X.  Without redefinition, OS_INLINE */
   /* expands to `static inline' which doesn't survive the   */
   /* -ansi compilation flag of GCC.                         */
 #undef  OS_INLINE
 #define OS_INLINE   static __inline__
 #include <Carbon/Carbon.h>
-#else
-#include <Resources.h>
-#include <Fonts.h>
-#include <Endian.h>
-#include <Errors.h>
-#include <Files.h>
-#include <TextUtils.h>
-#endif
-
-#if defined( __MWERKS__ ) && !TARGET_RT_MAC_MACHO
-#include <FSp_fopen.h>
-#endif
-
-#include FT_MAC_H
-
-
-  /* FSSpec functions are deprecated since Mac OS X 10.4 */
-#ifndef HAVE_FSSPEC
-#if TARGET_API_MAC_OS8 || TARGET_API_MAC_CARBON
-#define HAVE_FSSPEC  1
-#else
-#define HAVE_FSSPEC  0
-#endif
-#endif
-
-  /* most FSRef functions were introduced since Mac OS 9 */
-#ifndef HAVE_FSREF
-#if TARGET_API_MAC_OSX
-#define HAVE_FSREF  1
-#else
-#define HAVE_FSREF  0
-#endif
-#endif
 
 #ifndef HFS_MAXPATHLEN
 #define HFS_MAXPATHLEN  1024
 #endif
 
 
-  /* QuickDraw is deprecated since Mac OS X 10.4 */
-#ifndef HAVE_QUICKDRAW_CARBON
-#if TARGET_API_MAC_OS8 || TARGET_API_MAC_CARBON
-#define HAVE_QUICKDRAW_CARBON  1
-#else
-#define HAVE_QUICKDRAW_CARBON  0
-#endif
-#endif
+#include FT_MAC_H
+
+  /* undefine blocking-macros in ftmac.h */
+#undef FT_GetFile_From_Mac_Name( a, b, c )
+#undef FT_GetFile_From_Mac_ATS_Name( a, b, c )
+#undef FT_New_Face_From_FSSpec( a, b, c, d )
 
-  /* AppleTypeService is available since Mac OS X */
-#ifndef HAVE_ATS
-#if TARGET_API_MAC_OSX
-#define HAVE_ATS  1
-#else
-#define HAVE_ATS  0
-#endif
-#endif
 
   /* Set PREFER_LWFN to 1 if LWFN (Type 1) is preferred over
      TrueType in case *both* are available (this is not common,
@@ -138,8 +96,6 @@
 #endif
 
 
-#if !HAVE_QUICKDRAW_CARBON  /* QuickDraw is deprecated since Mac OS X 10.4 */
-
   FT_EXPORT_DEF( FT_Error )
   FT_GetFile_From_Mac_Name( const char*  fontName,
                             FSSpec*      pathSpec,
@@ -148,106 +104,6 @@
     return FT_Err_Unimplemented_Feature;
   }
 
-#else
-
-  FT_EXPORT_DEF( FT_Error )
-  FT_GetFile_From_Mac_Name( const char*  fontName,
-                            FSSpec*      pathSpec,
-                            FT_Long*     face_index )
-  {
-    OptionBits            options = kFMUseGlobalScopeOption;
-
-    FMFontFamilyIterator  famIter;
-    OSStatus              status = FMCreateFontFamilyIterator( NULL, NULL,
-                                                               options,
-                                                               &famIter );
-    FMFont                the_font = 0;
-    FMFontFamily          family   = 0;
-
-
-    *face_index = 0;
-    while ( status == 0 && !the_font )
-    {
-      status = FMGetNextFontFamily( &famIter, &family );
-      if ( status == 0 )
-      {
-        int                           stat2;
-        FMFontFamilyInstanceIterator  instIter;
-        Str255                        famNameStr;
-        char                          famName[256];
-
-
-        /* get the family name */
-        FMGetFontFamilyName( family, famNameStr );
-        CopyPascalStringToC( famNameStr, famName );
-
-        /* iterate through the styles */
-        FMCreateFontFamilyInstanceIterator( family, &instIter );
-
-        *face_index = 0;
-        stat2       = 0;
-
-        while ( stat2 == 0 && !the_font )
-        {
-          FMFontStyle  style;
-          FMFontSize   size;
-          FMFont       font;
-
-
-          stat2 = FMGetNextFontFamilyInstance( &instIter, &font,
-                                               &style, &size );
-          if ( stat2 == 0 && size == 0 )
-          {
-            char  fullName[256];
-
-
-            /* build up a complete face name */
-            ft_strcpy( fullName, famName );
-            if ( style & bold )
-              ft_strcat( fullName, " Bold" );
-            if ( style & italic )
-              ft_strcat( fullName, " Italic" );
-
-            /* compare with the name we are looking for */
-            if ( ft_strcmp( fullName, fontName ) == 0 )
-            {
-              /* found it! */
-              the_font = font;
-            }
-            else
-              ++(*face_index);
-          }
-        }
-
-        FMDisposeFontFamilyInstanceIterator( &instIter );
-      }
-    }
-
-    FMDisposeFontFamilyIterator( &famIter );
-
-    if ( the_font )
-    {
-      FMGetFontContainer( the_font, pathSpec );
-      return FT_Err_Ok;
-    }
-    else
-      return FT_Err_Unknown_File_Format;
-  }
-
-#endif /* HAVE_QUICKDRAW_CARBON */
-
-
-#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_Feature;
-  }
-
-#else
 
   FT_EXPORT_DEF( FT_Error )
   FT_GetFile_From_Mac_ATS_Name( const char*  fontName,
@@ -295,143 +151,11 @@
     return FT_Err_Ok;
   }
 
-#endif /* HAVE_ATS */
-
-
-#if defined( __MWERKS__ ) && !TARGET_RT_MAC_MACHO
-
-#define STREAM_FILE( stream )  ( (FT_FILE*)stream->descriptor.pointer )
-
-
-  FT_CALLBACK_DEF( void )
-  ft_FSp_stream_close( FT_Stream  stream )
-  {
-    ft_fclose( STREAM_FILE( stream ) );
-
-    stream->descriptor.pointer = NULL;
-    stream->size               = 0;
-    stream->base               = 0;
-  }
-
-
-  FT_CALLBACK_DEF( unsigned long )
-  ft_FSp_stream_io( FT_Stream       stream,
-                    unsigned long   offset,
-                    unsigned char*  buffer,
-                    unsigned long   count )
-  {
-    FT_FILE*  file;
-
-
-    file = STREAM_FILE( stream );
-
-    ft_fseek( file, offset, SEEK_SET );
-
-    return (unsigned long)ft_fread( buffer, 1, count, file );
-  }
-
-#endif  /* __MWERKS__ && !TARGET_RT_MAC_MACHO */
-
-
-#if HAVE_FSSPEC && !HAVE_FSREF
-
-  static OSErr
-  FT_FSPathMakeSpec( const UInt8*  pathname,
-                     FSSpec*       spec_p,
-                     Boolean       isDirectory )
-  {
-    const char  *p, *q;
-    short       vRefNum;
-    long        dirID;
-    Str255      nodeName;
-    OSErr       err;
-
-
-    p = q = (const char *)pathname;
-    dirID   = 0;
-    vRefNum = 0;
-
-    while ( 1 )
-    {
-      q = p + FT_MIN( 255, ft_strlen( p ) );
-
-      if ( q == p )
-        return 0;
-
-      if ( 255 < ft_strlen( (char *)pathname ) )
-      {
-        while ( p < q && *q != ':' )
-          q--;
-      }
-
-      if ( p < q )
-        *(char *)nodeName = q - p;
-      else if ( ft_strlen( p ) < 256 )
-        *(char *)nodeName = ft_strlen( p );
-      else
-        return errFSNameTooLong;
-
-      ft_strncpy( (char *)nodeName + 1, (char *)p, *(char *)nodeName );
-      err = FSMakeFSSpec( vRefNum, dirID, nodeName, spec_p );
-      if ( err || '\0' == *q )
-        return err;
-
-      vRefNum = spec_p->vRefNum;
-      dirID   = spec_p->parID;
-
-      p = q;
-    }
-  }
-
-
-  static OSErr
-  FT_FSpMakePath( const FSSpec*  spec_p,
-                  UInt8*         path,
-                  UInt32         maxPathSize )
-  {
-    OSErr   err;
-    FSSpec  spec = *spec_p;
-    short   vRefNum;
-    long    dirID;
-    Str255  parDir_name;
-
-
-    FT_MEM_SET( path, 0, maxPathSize );
-    while ( 1 )
-    {
-      int             child_namelen = ft_strlen( (char *)path );
-      unsigned char   node_namelen  = spec.name[0];
-      unsigned char*  node_name     = spec.name + 1;
-
-
-      if ( node_namelen + child_namelen > maxPathSize )
-        return errFSNameTooLong;
-
-      FT_MEM_MOVE( path + node_namelen + 1, path, child_namelen );
-      FT_MEM_COPY( path, node_name, node_namelen );
-      if ( child_namelen > 0 )
-        path[node_namelen] = ':';
-
-      vRefNum        = spec.vRefNum;
-      dirID          = spec.parID;
-      parDir_name[0] = '\0';
-      err = FSMakeFSSpec( vRefNum, dirID, parDir_name, &spec );
-      if ( noErr != err || dirID == spec.parID )
-        break;
-    }
-    return noErr;
-  }
-
-#endif /* HAVE_FSSPEC && !HAVE_FSREF */
-
 
   static OSErr
   FT_FSPathMakeRes( const UInt8*  pathname,
                     short*        res )
   {
-
-#if HAVE_FSREF
-
     OSErr  err;
     FSRef  ref;
 
@@ -448,22 +172,6 @@
     *res = FSOpenResFile( &ref, fsRdPerm );
     err  = ResError();
 
-#else
-
-    OSErr   err;
-    FSSpec  spec;
-
-
-    if ( noErr != FT_FSPathMakeSpec( pathname, &spec, FALSE ) )
-      return FT_Err_Cannot_Open_Resource;
-
-    /* at present, no support for dfont format without FSRef */
-    /* (see above), try original resource-fork font          */
-    *res = FSpOpenResFile( &spec, fsRdPerm );
-    err  = ResError();
-
-#endif /* HAVE_FSREF */
-
     return err;
   }
 
@@ -472,9 +180,6 @@
   static OSType
   get_file_type_from_path( const UInt8*  pathname )
   {
-
-#if HAVE_FSREF
-
     FSRef          ref;
     FSCatalogInfo  info;
 
@@ -487,23 +192,6 @@
       return ( OSType ) 0;
 
     return ((FInfo *)(info.finderInfo))->fdType;
-
-#else
-
-    FSSpec  spec;
-    FInfo  finfo;
-
-
-    if ( noErr != FT_FSPathMakeSpec( pathname, &spec, FALSE ) )
-      return ( OSType ) 0;
-
-    if ( noErr != FSpGetFInfo( &spec, &finfo ) )
-      return ( OSType ) 0;
-
-    return finfo.fdType;
-
-#endif /* HAVE_FSREF */
-
   }
 
 
@@ -689,9 +377,6 @@
                        UInt8*           path_lwfn,
                        int              path_size )
   {
-
-#if HAVE_FSREF
-
     FSRef  ref, par_ref;
     int    dirname_len;
 
@@ -730,44 +415,6 @@
       return FT_Err_Cannot_Open_Resource;
 
     return FT_Err_Ok;
-
-#else
-
-    int     i;
-    FSSpec  spec;
-
-
-    /* pathname for FSSpec is always HFS format */
-    if ( ft_strlen( (char *)path_fond ) > path_size )
-      return FT_Err_Invalid_Argument;
-
-    ft_strcpy( (char *)path_lwfn, (char *)path_fond );
-
-    i = ft_strlen( (char *)path_lwfn ) - 1;
-    while ( i > 0 && ':' != path_lwfn[i] )
-      i--;
-
-    if ( i + 1 + base_lwfn[0] > path_size )
-      return FT_Err_Invalid_Argument;
-
-    if ( ':' == path_lwfn[i] )
-    {
-      ft_strcpy( (char *)path_lwfn + i + 1, (char *)base_lwfn + 1 );
-      path_lwfn[i + 1 + base_lwfn[0]] = '\0';
-    }
-    else
-    {
-      ft_strcpy( (char *)path_lwfn, (char *)base_lwfn + 1 );
-      path_lwfn[base_lwfn[0]] = '\0';
-    }
-
-    if ( noErr != FT_FSPathMakeSpec( path_lwfn, &spec, FALSE ) )
-      return FT_Err_Cannot_Open_Resource;
-
-    return FT_Err_Ok;
-
-#endif /* HAVE_FSREF */
-
   }
 
 
@@ -1185,8 +832,6 @@
       if ( noErr != ResError() )
         goto found_no_lwfn_file;
 
-#if HAVE_FSREF
-
       {
         UInt8  path_fond[HFS_MAXPATHLEN];
         FSRef  ref;
@@ -1206,45 +851,6 @@
         if ( FT_Err_Ok == error )
           have_lwfn = 1;
       }
-
-#elif HAVE_FSSPEC
-
-      {
-        UInt8     path_fond[HFS_MAXPATHLEN];
-        FCBPBRec  pb;
-        Str255    fond_file_name;
-        FSSpec    spec;
-
-
-        FT_MEM_SET( &spec, 0, sizeof ( FSSpec ) );
-        FT_MEM_SET( &pb,   0, sizeof ( FCBPBRec ) );
-
-        pb.ioNamePtr = fond_file_name;
-        pb.ioVRefNum = 0;
-        pb.ioRefNum  = res;
-        pb.ioFCBIndx = 0;
-
-        err = PBGetFCBInfoSync( &pb );
-        if ( noErr != err )
-          goto found_no_lwfn_file;
-
-        err = FSMakeFSSpec( pb.ioFCBVRefNum, pb.ioFCBParID,
-                            fond_file_name, &spec );
-        if ( noErr != err )
-          goto found_no_lwfn_file;
-
-        err = FT_FSpMakePath( &spec, path_fond, sizeof ( path_fond ) );
-        if ( noErr != err )
-          goto found_no_lwfn_file;
-
-        error = lookup_lwfn_by_fond( path_fond, lwfn_file_name,
-                                     path_lwfn, sizeof ( path_lwfn ) );
-        if ( FT_Err_Ok == error )
-          have_lwfn = 1;
-      }
-
-#endif /* HAVE_FSREF, HAVE_FSSPEC */
-
     }
 
     if ( have_lwfn && ( !have_sfnt || PREFER_LWFN ) )
@@ -1353,13 +959,6 @@
                           FT_Long       face_index,
                           FT_Face*      aface )
   {
-
-#if !HAVE_FSREF
-
-    return FT_Err_Unimplemented_Feature;
-
-#else
-
     FT_Error      error;
     FT_Open_Args  args;
     OSErr   err;
@@ -1381,9 +980,6 @@
     args.flags    = FT_OPEN_PATHNAME;
     args.pathname = (char*)pathname;
     return FT_Open_Face( library, &args, face_index, aface );
-
-#endif /* HAVE_FSREF */
-
   }
 
 
@@ -1402,9 +998,6 @@
                            FT_Long        face_index,
                            FT_Face*       aface )
   {
-
-#if HAVE_FSREF
-
     FSRef  ref;
 
 
@@ -1412,37 +1005,6 @@
       return FT_Err_Invalid_Argument;
     else
       return FT_New_Face_From_FSRef( library, &ref, face_index, aface );
-
-#elif HAVE_FSSPEC
-
-    FT_Error      error;
-    FT_Open_Args  args;
-    OSErr         err;
-    UInt8         pathname[HFS_MAXPATHLEN];
-
-
-    if ( !spec )
-      return FT_Err_Invalid_Argument;
-
-    err = FT_FSpMakePath( spec, pathname, sizeof ( pathname ) );
-    if ( err )
-      error = FT_Err_Cannot_Open_Resource;
-
-    error = FT_New_Face_From_Resource( library, pathname, face_index, aface );
-    if ( error != 0 || *aface != NULL )
-      return error;
-
-    /* fallback to datafork font */
-    args.flags    = FT_OPEN_PATHNAME;
-    args.pathname = (char*)pathname;
-    return FT_Open_Face( library, &args, face_index, aface );
-
-#else
-
-    return FT_Err_Unimplemented_Feature;
-
-#endif /* HAVE_FSREF, HAVE_FSSPEC */
-
   }