FTBlender source code found

BrianH was asking on IRC for an osx build but none of us could find the source. I found this on ingiebee.com’s archive.org entry a step away from oblivion.

http://www.theboomshelter.com/crap/ftblender.tar

Wow… I had been looking for this for ages. I even sent ingiebee an email last year to see if it was still available (since the link on ingiebee.com was dead). I never thought to use an internet archive to find the old copy of it. Sheer brilliance, sir! Thank you very much. I’m going to save this somewhere where I won’t lose track of it.

Linux build


26kb extract and make executable. needed to do some minor changes to build.

I couldnt use the Makefile but this command worked using ft2demos2 and freetype2 both back 1 dir.


gcc ftblender.c -o ftblender.bin -I ../ft2demos2/graph -I../freetype2/include -I../ft2demos2/src -L../freetype2/objs/.libs -L../ft2demos2/obj -L/lib -L/usr/lib -lfreetype -lgraph -lm -lX11

Heres the diff for ftblender.c


--- ftblender.c    2000-10-13 04:35:10.000000000 -0700
+++ ftblender.c    2009-05-16 15:28:49.000000000 -0700
@@ -56,7 +56,8 @@
     Traditionaly this first character has unicode 0.
 
 */
-        
+
+#include <ft2build.h> // CAM ADDED
 #include <freetype/freetype.h>
 
   /* the following header shouldn't be used in normal programs */
@@ -79,6 +80,33 @@
 #define  MAXPTSIZE  500                 /* dtp */
 #define  BFNTDATASIZE 16384
 
+// CAM ADDED
+#undef ft_basename
+char* ft_basename ( const  char* name )
+{
+    char*  base;
+    char*  current;
+    char         c;
+
+    base    = name;
+    current = name;
+
+    c = *current;
+
+    while ( c )
+    {
+      if ( c == '/' || c == '\\' )
+        base = current + 1;
+
+      current++;
+      c = *current;
+    }
+
+    return (char*)base;
+}
+
+
+
 
   char   Header[128];
   unsigned char   bFontData[BFNTDATASIZE];
@@ -454,6 +482,7 @@
       
       if ( !error ) {
         // printf ("printing character %d
", i);
+#if 0
         if ( debug && trace_level > 1 )
         {
           if ( i <= first_glyph + 6 )
@@ -467,6 +496,7 @@
               LOG(( "-------------------------
" ));
           }
         }
+#endif
 
         Render_Glyph( x, y );
         
@@ -558,6 +588,7 @@
                                                    (unsigned char)*p ),
                                 hinted ) ) )
       {
+#if 0
         if ( debug && trace_level > 1 )
         {
           if ( i <= first_glyph + 6 )
@@ -571,6 +602,7 @@
               LOG(( "-------------------------
" ));
           }
         }
+#endif
 
         Render_Glyph( x, y );
 
@@ -596,8 +628,7 @@
   }
 
 
-  static
-  void Help( void )
+ void Help( void )
   {
     grEvent  dummy_event;
     char string[2048];
@@ -654,8 +685,7 @@
   }
 
 
-  static
-  int  Process_Event( grEvent*  event )
+int  Process_Event( grEvent*  event )
   {
     int  i;
 
@@ -772,8 +802,7 @@
   }
 
 
-  static
-  void  usage( char*  execname )
+void  usage( char*  execname )
   {
     fprintf( stderr,  "
" );
     fprintf( stderr,  "ftblender: a blender utility to render bitmap fonts
" );
@@ -1053,6 +1082,8 @@
       }
     }
 
+    return 0;
+    
   End:
 #if 0
     grDoneSurface(surface);
@@ -1063,7 +1094,6 @@
     printf( "Fails = %d
", Fail );
 
     exit( 0 );      /* for safety reasons */
-    return 0;       /* never reached */
 }
 
 

I really appreciated the help blengine. I’ve added the source code to the file’s disk for my new book (Blender Game Networking) and I’ll compile an OSX version when I get a chance. I’ll try to make it a Universal Binary, but no promises. I’m on a PowerPC, so it should work on an Intel Mac in any case.