added cast to the string literal for Text to shut up my compiler. (btw. this literal contains non 7-bit characters!) 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
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
diff --git a/demos/src/ftview.c b/demos/src/ftview.c
index 54f2973..49f5521 100644
--- a/demos/src/ftview.c
+++ b/demos/src/ftview.c
@@ -38,7 +38,7 @@
char Header[128];
char* new_header = 0;
- const unsigned char* Text =
+ const unsigned char* Text = (unsigned char*)
"The quick brown fox jumped over the lazy dog 0123456789 \
âêîûôäëïöüÿàùéèç &#~\"'(-`_^@)=+° ABCDEFGHIJKLMNOPQRSTUVWXYZ $£^¨*µù%!§:/;.,?<>";
@@ -61,7 +61,7 @@
int low_prec = 1; /* force low precision */
int Num; /* current first glyph index */
- int res = 96;
+ int res = 72;
static grColor fore_color = { 127 };
@@ -586,13 +586,15 @@
hinted = 1;
file_loaded = 0;
+#ifndef macintosh
i = strlen( argv[file] );
while ( i > 0 && argv[file][i] != '\\' && argv[file][i] != '/' )
{
if ( argv[file][i] == '.' )
i = 0;
- i--;
+ i--;
}
+#endif
filename[128] = '\0';
alt_filename[128] = '\0';
@@ -600,11 +602,13 @@
strncpy( filename, argv[file], 128 );
strncpy( alt_filename, argv[file], 128 );
+#ifndef macintosh
if ( i >= 0 )
{
strncpy( filename + strlen( filename ), ".ttf", 4 );
strncpy( alt_filename + strlen( alt_filename ), ".ttc", 4 );
}
+#endif
/* Load face */