shithub: freetype+ttf2subf

Download patch

ref: 2a4f206f5fed13a22f600897a188d8415c400834
parent: 6f9a72d54e040bcc57c2b4928cbc722e8b779cf7
author: Just van Rossum <[email protected]>
date: Wed Mar 1 20:11:17 EST 2000

if compiled for MacOS
- use the Mac path separator to get the base file name
- don't append .ttf if no dot in the file name
(plus small typo fix and error message enhancement)

git/fs: mount .git/fs: mount/attach disallowed
--- a/demos/src/ftlint.c
+++ b/demos/src/ftlint.c
@@ -97,17 +97,22 @@
       strncpy( filename, fname, 128 );
       strncpy( alt_filename, fname, 128 );
 
+#ifndef macintosh
       if ( i >= 0 )
       {
         strncpy( filename + strlen( filename ), ".ttf", 4 );
         strncpy( alt_filename + strlen( alt_filename ), ".ttc", 4 );
       }
-
+#endif
       i     = strlen( filename );
       fname = filename;
 
       while ( i >= 0 )
+#ifndef macintosh
         if ( filename[i] == '/' || filename[i] == '\\' )
+#else
+        if ( filename[i] == ':' )
+#endif
         {
           fname = filename + i + 1;
           i = -1;
@@ -122,9 +127,9 @@
       if (error)
       {
         if (error == FT_Err_Invalid_File_Format)
-          printf( "unknow format\n" );
+          printf( "unknown format\n" );
         else
-          printf( "could not find/open file\n" );
+          printf( "could not find/open file (error: %d)\n", error );
         continue;
       }
       if (error) Panic( "Could not open file" );