[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
some freetype2/demo patches
From: |
Just van Rossum |
Subject: |
some freetype2/demo patches |
Date: |
Wed, 1 Mar 2000 16:19:04 +0100 |
I've appended a set of patches to the freetype2/demo subdirectory. Most were
needed for getting it to work on the Mac, but there are also some comment typo
fixes. I paid great attention not to break anything.
This is just step 1 for contributing some Mac support, I'll hope to contribute
the rest soon.
Note: I had to change one occurance of #include <memory.h> to #include
<string.h>. This is needed since there exists a Mac header file called
Memory.h, and since MacOS has a case-insensitive file system this causes a
clash. I think it's ok for other platforms too to include <string.h> instead.
Just
cvs -z9 -q diff -c (in directory DevDev:PyPy:freetype2:demos:)
Index: graph/grinit.c
===================================================================
RCS file: /cvsroot/freetype2/demos/graph/grinit.c,v
retrieving revision 1.2
diff -c -r1.2 grinit.c
*** grinit.c 2000/01/17 11:04:55 1.2
--- grinit.c 2000/03/01 15:14:09
***************
*** 17,23 ****
--- 17,27 ----
#include "grwin32.h"
#endif
+ #ifdef macintosh
+ #include "grmac.h"
+ #endif
+
/**********************************************************************
*
* <Function>
***************
*** 52,58 ****
while (chain)
{
! /* initialie the device */
grDevice* device;
device = chain->device;
--- 56,62 ----
while (chain)
{
! /* initialize the device */
grDevice* device;
device = chain->device;
Index: graph/grobjs.c
===================================================================
RCS file: /cvsroot/freetype2/demos/graph/grobjs.c,v
retrieving revision 1.2
diff -c -r1.2 grobjs.c
*** grobjs.c 2000/01/17 11:04:55 1.2
--- grobjs.c 2000/03/01 15:14:09
***************
*** 1,6 ****
#include "grobjs.h"
#include <stdlib.h>
! #include <memory.h>
int grError = 0;
--- 1,6 ----
#include "grobjs.h"
#include <stdlib.h>
! #include <string.h>
int grError = 0;
Index: src/common.c
===================================================================
RCS file: /cvsroot/freetype2/demos/src/common.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 common.c
*** common.c 1999/12/16 23:11:37 1.1.1.1
--- common.c 2000/03/01 15:14:09
***************
*** 212,218 ****
--- 212,222 ----
while ( c )
{
+ #ifndef macintosh
if ( c == '/' || c == '\\' )
+ #else
+ if ( c == ':' )
+ #endif
base = current + 1;
current++;
Index: src/ftlint.c
===================================================================
RCS file: /cvsroot/freetype2/demos/src/ftlint.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 ftlint.c
*** ftlint.c 1999/12/16 23:11:37 1.1.1.1
--- ftlint.c 2000/03/01 15:14:10
***************
*** 97,113 ****
strncpy( filename, fname, 128 );
strncpy( alt_filename, fname, 128 );
if ( i >= 0 )
{
strncpy( filename + strlen( filename ), ".ttf", 4 );
strncpy( alt_filename + strlen( alt_filename ), ".ttc", 4 );
}
!
i = strlen( filename );
fname = filename;
while ( i >= 0 )
if ( filename[i] == '/' || filename[i] == '\\' )
{
fname = filename + i + 1;
i = -1;
--- 97,118 ----
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,130 ****
if (error)
{
if (error == FT_Err_Invalid_File_Format)
! printf( "unknow format\n" );
else
! printf( "could not find/open file\n" );
continue;
}
if (error) Panic( "Could not open file" );
--- 127,135 ----
if (error)
{
if (error == FT_Err_Invalid_File_Format)
! printf( "unknown format\n" );
else
! printf( "could not find/open file (error: %d)\n", error );
continue;
}
if (error) Panic( "Could not open file" );
Index: src/ftview.c
===================================================================
RCS file: /cvsroot/freetype2/demos/src/ftview.c,v
retrieving revision 1.4
diff -c -r1.4 ftview.c
*** ftview.c 2000/02/21 16:18:01 1.4
--- ftview.c 2000/03/01 15:14:11
***************
*** 38,44 ****
char Header[128];
char* new_header = 0;
! const unsigned char* Text =
"The quick brown fox jumped over the lazy dog 0123456789 \
ÍÓÙÎÔ¸ýÈËÁ &#~\"'(-`_^@)=+ ABCDEFGHIJKLMNOPQRSTUVWXYZ
$£^®*µ%!ß:/;.,?<>";
--- 38,44 ----
char Header[128];
char* new_header = 0;
! const unsigned char* Text = (unsigned char*)
"The quick brown fox jumped over the lazy dog 0123456789 \
ÍÓÙÎÔ¸ýÈËÁ &#~\"'(-`_^@)=+ ABCDEFGHIJKLMNOPQRSTUVWXYZ
$£^®*µ%!ß:/;.,?<>";
***************
*** 61,67 ****
int low_prec = 1; /* force low precision */
int Num; /* current first glyph index */
! int res = 96;
static grColor fore_color = { 127 };
--- 61,67 ----
int low_prec = 1; /* force low precision */
int Num; /* current first glyph index */
! int res = 72;
static grColor fore_color = { 127 };
***************
*** 586,598 ****
hinted = 1;
file_loaded = 0;
i = strlen( argv[file] );
while ( i > 0 && argv[file][i] != '\\' && argv[file][i] != '/' )
{
if ( argv[file][i] == '.' )
i = 0;
! i--;
}
filename[128] = '\0';
alt_filename[128] = '\0';
--- 586,600 ----
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--;
}
+ #endif
filename[128] = '\0';
alt_filename[128] = '\0';
***************
*** 600,610 ****
--- 602,614 ----
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 */
*****CVS exited normally with code 1*****
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- some freetype2/demo patches,
Just van Rossum <=