[PD-cvs] SF.net SVN: pure-data: [9941] branches/pd-extended/v0-40/externals/pidip/ modules

eighthave at users.sourceforge.net eighthave at users.sourceforge.net
Thu May 29 14:14:03 CEST 2008


Revision: 9941
          http://pure-data.svn.sourceforge.net/pure-data/?rev=9941&view=rev
Author:   eighthave
Date:     2008-05-29 05:14:02 -0700 (Thu, 29 May 2008)

Log Message:
-----------
fixed font loading problem on Mac OS X, imlib seems to only like .tff, not .dfont; also cleaned up error messages a little

Modified Paths:
--------------
    branches/pd-extended/v0-40/externals/pidip/modules/pdp_qtext.c
    branches/pd-extended/v0-40/externals/pidip/modules/pdp_text.c

Modified: branches/pd-extended/v0-40/externals/pidip/modules/pdp_qtext.c
===================================================================
--- branches/pd-extended/v0-40/externals/pidip/modules/pdp_qtext.c	2008-05-29 11:43:16 UTC (rev 9940)
+++ branches/pd-extended/v0-40/externals/pidip/modules/pdp_qtext.c	2008-05-29 12:14:02 UTC (rev 9941)
@@ -38,11 +38,7 @@
 
 #define DEFAULT_CAPACITY 10
 
-#ifdef __APPLE__
-# define DEFAULT_FONT "Monaco/16"
-#else
-# define DEFAULT_FONT "Vera/16"
-#endif
+#define DEFAULT_FONT "Vera/16"
 
 #define PIDIP_TEXT_MODE_STATIC 0
 #define PIDIP_TEXT_MODE_SCROLL 1
@@ -662,7 +658,8 @@
     font = imlib_load_font(sfont->s_name);
     if ( !font )
     {
-       post( "pdp_qtext : could not load font : >%s<", sfont->s_name );
+       pd_error( x, "[%s] error: could not load font: '%s'", 
+                 class_getname(*(t_pd *)x), sfont->s_name );
        return;
     }
     imlib_context_set_font( font );
@@ -674,8 +671,9 @@
    x->x_image = imlib_create_image( x->x_vwidth, x->x_vheight );
    if ( x->x_image == NULL )
    {
-      post( "pdp_qtext : severe error : could not allocate image !!" );
-      return;
+       pd_error( x, "[%s] error: could not allocate image!!", 
+                 class_getname(*(t_pd *)x) );
+       return;
    }
    imlib_context_set_image(x->x_image);
 }
@@ -1088,8 +1086,8 @@
     font = imlib_load_font(DEFAULT_FONT);
     if ( !font )
     {
-       post( "pdp_qtext : severe error : could not load default font : no rendering !!!" );
-	   post( "\ttry installing Bitstream Vera (http://www.gnome.org/fonts/)" );
+        error( "[pdp_qtext] error: could not load default font, no text rendering!" );
+        post( "\tinstall Bitstream Vera, it's free! (http://www.gnome.org/fonts/)" );
     }
     imlib_context_set_font( font );
 }

Modified: branches/pd-extended/v0-40/externals/pidip/modules/pdp_text.c
===================================================================
--- branches/pd-extended/v0-40/externals/pidip/modules/pdp_text.c	2008-05-29 11:43:16 UTC (rev 9940)
+++ branches/pd-extended/v0-40/externals/pidip/modules/pdp_text.c	2008-05-29 12:14:02 UTC (rev 9941)
@@ -35,11 +35,7 @@
 
 #define DEFAULT_CAPACITY 10
 
-#ifdef __APPLE__
-# define DEFAULT_FONT "Monaco/16"
-#else
-# define DEFAULT_FONT "Vera/16"
-#endif
+#define DEFAULT_FONT "Vera/16"
 
 static char   *pdp_text_version = "pdp_text: version 0.2 : text rendering object written by ydegoyon at free.fr";
 
@@ -385,7 +381,8 @@
     font = imlib_load_font(sfont->s_name);
     if ( !font )
     {
-       post( "pdp_text : could not load font : >%s<", sfont->s_name );
+       pd_error( x, "[%s] error: could not load font: '%s'", 
+                 class_getname(*(t_pd *)x), sfont->s_name );
        return;
     }
     imlib_context_set_font( font );
@@ -397,8 +394,9 @@
    x->x_image = imlib_create_image( x->x_vwidth, x->x_vheight );
    if ( x->x_image == NULL )
    {
-      post( "pdp_text : severe error : could not allocate image !!" );
-      return;
+       pd_error( x, "[%s] error: could not allocate image!!", 
+                 class_getname(*(t_pd *)x) );
+       return;
    }
    imlib_context_set_image(x->x_image);
 }
@@ -652,8 +650,8 @@
     font = imlib_load_font(DEFAULT_FONT);
     if ( !font )
     {
-       post( "pdp_text : severe error : could not load default font : no rendering !!!" );
-	   post( "\ttry installing Bitstream Vera (http://www.gnome.org/fonts/)" );
+        error( "[pdp_text] error: could not load default font, no text rendering!" );
+        post( "\tinstall Bitstream Vera, it's free! (http://www.gnome.org/fonts/)" );
     }
     imlib_context_set_font( font );
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Pd-cvs mailing list