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)
This commit is contained in:
parent
6f9a72d54e
commit
2a4f206f5f
@ -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" );
|
||||
|
Loading…
Reference in New Issue
Block a user