Skip to content

Commit

Permalink
Merge with master. Remove Objective C from pyhook and enable C99 there.
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Schwartz committed Sep 6, 2012
2 parents 5a11aa4 + e29a41c commit 9d2198d
Show file tree
Hide file tree
Showing 26 changed files with 22,475 additions and 22,845 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ fontforge/fontforge
fontforge/fontimage
fontforge/fontlint
fontforge/libstamp.c
fontforge.pc
fontforge/sfddiff
fontforge/stamper
fontforge.pc
inc/config.h
libtool
Makefile
Expand Down
17 changes: 9 additions & 8 deletions Unicode/ArabicForms.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
/* This file was generated using the program 'makeutype' */

struct arabicforms ArabicForms[] = {
{ 0x0600, 0x0600, 0x0600, 0x0600, 0, 0, 0 },
/* initial, medial, final, isolated, isletter, joindual, required_lig_with_alef */
{ 0x0600, 0x0600, 0x0600, 0x0600, 0, 0, 0 }, /* 0x0600 */
{ 0x0601, 0x0601, 0x0601, 0x0601, 0, 0, 0 },
{ 0x0602, 0x0602, 0x0602, 0x0602, 0, 0, 0 },
{ 0x0603, 0x0603, 0x0603, 0x0603, 0, 0, 0 },
Expand Down Expand Up @@ -35,7 +36,7 @@ struct arabicforms ArabicForms[] = {
{ 0x0000, 0x0000, 0x0000, 0x0000, 0, 0, 0 },
{ 0x061e, 0x061e, 0x061e, 0x061e, 0, 0, 0 },
{ 0x061f, 0x061f, 0x061f, 0x061f, 0, 0, 0 },
{ 0x0620, 0x0620, 0x0620, 0x0620, 1, 0, 0 },
{ 0x0620, 0x0620, 0x0620, 0x0620, 1, 0, 0 }, /* 0x0620 */
{ 0x0621, 0x0621, 0x0621, 0xfe80, 1, 0, 0 },
{ 0x0622, 0x0622, 0xfe82, 0xfe81, 1, 0, 0 },
{ 0x0623, 0x0623, 0xfe84, 0xfe83, 1, 0, 0 },
Expand Down Expand Up @@ -67,7 +68,7 @@ struct arabicforms ArabicForms[] = {
{ 0x063d, 0x063d, 0x063d, 0x063d, 1, 0, 0 },
{ 0x063e, 0x063e, 0x063e, 0x063e, 1, 0, 0 },
{ 0x063f, 0x063f, 0x063f, 0x063f, 1, 0, 0 },
{ 0x0640, 0x0640, 0x0640, 0x0640, 0, 0, 0 },
{ 0x0640, 0x0640, 0x0640, 0x0640, 0, 0, 0 }, /* 0x0640 */
{ 0xfed3, 0xfed4, 0xfed2, 0xfed1, 1, 1, 0 },
{ 0xfed7, 0xfed8, 0xfed6, 0xfed5, 1, 1, 0 },
{ 0xfedb, 0xfedc, 0xfeda, 0xfed9, 1, 1, 0 },
Expand Down Expand Up @@ -99,7 +100,7 @@ struct arabicforms ArabicForms[] = {
{ 0x065d, 0x065d, 0x065d, 0x065d, 0, 0, 0 },
{ 0x065e, 0x065e, 0x065e, 0x065e, 0, 0, 0 },
{ 0x065f, 0x065f, 0x065f, 0x065f, 0, 0, 0 },
{ 0x0660, 0x0660, 0x0660, 0x0660, 0, 0, 0 },
{ 0x0660, 0x0660, 0x0660, 0x0660, 0, 0, 0 }, /* 0x0660 */
{ 0x0661, 0x0661, 0x0661, 0x0661, 0, 0, 0 },
{ 0x0662, 0x0662, 0x0662, 0x0662, 0, 0, 0 },
{ 0x0663, 0x0663, 0x0663, 0x0663, 0, 0, 0 },
Expand Down Expand Up @@ -131,7 +132,7 @@ struct arabicforms ArabicForms[] = {
{ 0x067d, 0x067d, 0x067d, 0x067d, 1, 0, 0 },
{ 0xfb58, 0xfb59, 0xfb57, 0xfb56, 1, 1, 0 },
{ 0xfb64, 0xfb65, 0xfb63, 0xfb62, 1, 1, 0 },
{ 0xfb5c, 0xfb5d, 0xfb5b, 0xfb5a, 1, 1, 0 },
{ 0xfb5c, 0xfb5d, 0xfb5b, 0xfb5a, 1, 1, 0 }, /* 0x0680 */
{ 0x0681, 0x0681, 0x0681, 0x0681, 1, 0, 0 },
{ 0x0682, 0x0682, 0x0682, 0x0682, 1, 0, 0 },
{ 0xfb78, 0xfb79, 0xfb77, 0xfb76, 1, 1, 0 },
Expand Down Expand Up @@ -163,7 +164,7 @@ struct arabicforms ArabicForms[] = {
{ 0x069d, 0x069d, 0x069d, 0x069d, 1, 0, 0 },
{ 0x069e, 0x069e, 0x069e, 0x069e, 1, 0, 0 },
{ 0x069f, 0x069f, 0x069f, 0x069f, 1, 0, 0 },
{ 0x06a0, 0x06a0, 0x06a0, 0x06a0, 1, 0, 0 },
{ 0x06a0, 0x06a0, 0x06a0, 0x06a0, 1, 0, 0 }, /* 0x06a0 */
{ 0x06a1, 0x06a1, 0x06a1, 0x06a1, 1, 0, 0 },
{ 0x06a2, 0x06a2, 0x06a2, 0x06a2, 1, 0, 0 },
{ 0x06a3, 0x06a3, 0x06a3, 0x06a3, 1, 0, 0 },
Expand Down Expand Up @@ -195,7 +196,7 @@ struct arabicforms ArabicForms[] = {
{ 0x06bd, 0x06bd, 0x06bd, 0x06bd, 1, 0, 0 },
{ 0xfbac, 0xfbad, 0xfbab, 0xfbaa, 1, 1, 0 },
{ 0x06bf, 0x06bf, 0x06bf, 0x06bf, 1, 0, 0 },
{ 0x06c0, 0x06c0, 0xfba5, 0xfba4, 1, 0, 0 },
{ 0x06c0, 0x06c0, 0xfba5, 0xfba4, 1, 0, 0 }, /* 0x06c0 */
{ 0xfba8, 0xfba9, 0xfba7, 0xfba6, 1, 1, 0 },
{ 0x06c2, 0x06c2, 0x06c2, 0x06c2, 1, 0, 0 },
{ 0x06c3, 0x06c3, 0x06c3, 0x06c3, 1, 0, 0 },
Expand Down Expand Up @@ -227,7 +228,7 @@ struct arabicforms ArabicForms[] = {
{ 0x06dd, 0x06dd, 0x06dd, 0x06dd, 0, 0, 0 },
{ 0x06de, 0x06de, 0x06de, 0x06de, 0, 0, 0 },
{ 0x06df, 0x06df, 0x06df, 0x06df, 0, 0, 0 },
{ 0x06e0, 0x06e0, 0x06e0, 0x06e0, 0, 0, 0 },
{ 0x06e0, 0x06e0, 0x06e0, 0x06e0, 0, 0, 0 }, /* 0x06e0 */
{ 0x06e1, 0x06e1, 0x06e1, 0x06e1, 0, 0, 0 },
{ 0x06e2, 0x06e2, 0x06e2, 0x06e2, 0, 0, 0 },
{ 0x06e3, 0x06e3, 0x06e3, 0x06e3, 0, 0, 0 },
Expand Down
6 changes: 0 additions & 6 deletions Unicode/gwwiconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,9 @@ gww_iconv_t gww_iconv_open(const char *toenc,const char *fromenc) {
if ( stuff.from==(enum encoding) -1 || stuff.to==(enum encoding) -1 ) {
/*fprintf( stderr, "Unknown encoding\n" );*/
return( (iconv_t)(-1) );
#ifdef UNICHAR_16
} else if ( stuff.from!=e_unicode && stuff.to!=e_unicode ) {
fprintf( stderr, "Bad call to gww_iconv_open, neither arg is UCS2\n" );
return( (iconv_t)(-1) );
#else
} else if ( stuff.from!=e_ucs4 && stuff.to!=e_ucs4 ) {
fprintf( stderr, "Bad call to gww_iconv_open, neither arg is UCS4\n" );
return( (iconv_t)(-1) );
#endif
}

ret = galloc(sizeof(struct gww_iconv_t));
Expand Down
81 changes: 60 additions & 21 deletions Unicode/makeutype.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,11 +621,18 @@ static void dumparabicdata(FILE *header) {
fprintf( data, GeneratedFileMessage );

fprintf( data, "struct arabicforms ArabicForms[] = {\n" );
fprintf( data, "\t/* initial, medial, final, isolated, isletter, joindual, required_lig_with_alef */\n");
for ( i=0; i<256; ++i ) {
fprintf( data, "\t{ 0x%04x, 0x%04x, 0x%04x, 0x%04x, %d, %d, %d }%s\n",
fprintf( data, "\t{ 0x%04x, 0x%04x, 0x%04x, 0x%04x, %d, %d, %d }",
forms[i].initial, forms[i].medial, forms[i].final, forms[i].isolated,
forms[i].isletter, forms[i].joindual, forms[i].required_lig_with_alef,
i==255?"":",");
forms[i].isletter, forms[i].joindual, forms[i].required_lig_with_alef);
if ( i==255 )
fprintf( data, "\n");
else
if ( (i & 31)==0 )
fprintf( data, ",\t/* 0x%04x */\n",0x600+i);
else
fprintf( data, ",\n");
}
fprintf( data, "};\n" );
fclose( data );
Expand Down Expand Up @@ -786,86 +793,118 @@ static void dump() {

fprintf( data, "#include \"utype.h\"\n" );
fprintf( data, GeneratedFileMessage );
fprintf( data, "const unsigned short ____tolower[]= { 0,\n " );
fprintf( data, "const unsigned short ____tolower[]= { 0,\n" );
for ( i=0; i<MAXC; i+=j ) {
fprintf( data, " " );
for ( j=0; j<8 && i+j<MAXC-1; ++j )
fprintf(data, " 0x%04x,", mytolower[i+j]);
if ( i+j==MAXC-1 ) {
fprintf(data, " 0x%04x\n};\n\n", mytolower[i+j]);
break;
} else
fprintf( data, "\n ");
if ( (i & 63)==0 )
fprintf( data, "\t/* 0x%04x */\n",i);
else
fprintf( data, "\n");
}
fprintf( data, "const unsigned short ____toupper[] = { 0,\n " );
fprintf( data, "const unsigned short ____toupper[] = { 0,\n" );
for ( i=0; i<MAXC; i+=j ) {
fprintf( data, " " );
for ( j=0; j<8 && i+j<MAXC-1; ++j )
fprintf(data, " 0x%04x,", mytoupper[i+j]);
if ( i+j==MAXC-1 ) {
fprintf(data, " 0x%04x\n};\n\n", mytoupper[i+j]);
break;
} else
fprintf( data, "\n ");
if ( (i & 63)==0 )
fprintf( data, "\t/* 0x%04x */\n",i);
else
fprintf( data, "\n");
}
fprintf( data, "const unsigned short ____totitle[] = { 0,\n " );
fprintf( data, "const unsigned short ____totitle[] = { 0,\n" );
for ( i=0; i<MAXC; i+=j ) {
fprintf( data, " " );
for ( j=0; j<8 && i+j<MAXC-1; ++j )
fprintf(data, " 0x%04x,", mytotitle[i+j]);
if ( i+j==MAXC-1 ) {
fprintf(data, " 0x%04x\n};\n\n", mytotitle[i+j]);
break;
} else
fprintf( data, "\n ");
if ( (i & 63)==0 )
fprintf( data, "\t/* 0x%04x */\n",i);
else
fprintf( data, "\n");
}
fprintf( data, "const unsigned short ____tomirror[] = { 0,\n " );
fprintf( data, "const unsigned short ____tomirror[] = { 0,\n" );
for ( i=0; i<MAXC; i+=j ) {
fprintf( data, " " );
for ( j=0; j<8 && i+j<MAXC-1; ++j )
fprintf(data, " 0x%04x,", mymirror[i+j]);
if ( i+j==MAXC-1 ) {
fprintf(data, " 0x%04x\n};\n\n", mymirror[i+j]);
break;
} else
fprintf( data, "\n ");
if ( (i & 63)==0 )
fprintf( data, "\t/* 0x%04x */\n",i);
else
fprintf( data, "\n");
}
fprintf( data, "const unsigned char ____digitval[] = { 0,\n " );
fprintf( data, "const unsigned char ____digitval[] = { 0,\n" );
for ( i=0; i<MAXC; i+=j ) {
fprintf( data, " " );
for ( j=0; j<8 && i+j<MAXC-1; ++j )
fprintf(data, " 0x%02x,", mynumericvalue[i+j]);
if ( i+j==MAXC-1 ) {
fprintf(data, " 0x%02x\n};\n\n", mynumericvalue[i+j]);
break;
} else
fprintf( data, "\n ");
if ( (i & 63)==0 )
fprintf( data, "\t/* 0x%04x */\n",i);
else
fprintf( data, "\n");
}
fprintf( data, "const unsigned int ____utype[] = { 0,\n " );
fprintf( data, "const unsigned int ____utype[] = { 0,\n" );
for ( i=0; i<MAXC; i+=j ) {
fprintf( data, " " );
for ( j=0; j<8 && i+j<MAXC-1; ++j )
fprintf(data, " 0x%08x,", flags[i+j]);
if ( i+j==MAXC-1 ) {
fprintf(data, " 0x%08x\n};\n\n", flags[i+j]);
break;
} else
fprintf( data, "\n ");
if ( (i & 63)==0 )
fprintf( data, "\t/* 0x%04x */\n",i);
else
fprintf( data, "\n");
}
fprintf( data, "const unsigned int ____utype2[] = { 0,\n " );
fprintf( data, "const unsigned int ____utype2[] = { 0,\n" );
for ( i=0; i<MAXC; i+=j ) {
fprintf( data, " " );
for ( j=0; j<8 && i+j<MAXC-1; ++j )
fprintf(data, " 0x%08x,", flags2[i+j]);
if ( i+j==MAXC-1 ) {
fprintf(data, " 0x%08x\n};\n\n", flags2[i+j]);
break;
} else
fprintf( data, "\n ");
if ( (i & 63)==0 )
fprintf( data, "\t/* 0x%04x */\n",i);
else
fprintf( data, "\n");
}

fprintf( data, "const unsigned int ____codepointassigned[] = {\n " );
fprintf( data, "const unsigned int ____codepointassigned[] = {\n" );
for ( i=0; i<0x120000/32; i+=j ) {
fprintf( data, " " );
for ( j=0; j<8 && i+j<0x120000/32-1; ++j )
fprintf(data, " 0x%08x,", assignedcodepoints[i+j]);
if ( i+j==0x120000/32-1 ) {
fprintf(data, " 0x%08x\n};\n\n", assignedcodepoints[i+j]);
break;
} else
fprintf( data, "\n ");
if ( (i & 63)==0 )
fprintf( data, "\t/* 0x%04x */\n",i);
else
fprintf( data, "\n");
}

fclose( data );
Expand Down Expand Up @@ -1782,8 +1821,8 @@ int main() {
/* so apply at a different level */
/* readcorpfile("ADOBE ", "AdobeCorporateuse.txt"); */
cheat(); /* over-ride with these mods after reading input files */
dump();
dump_alttable();
dump(); /* create utype.h, utype.c and ArabicForms.c */
dump_alttable(); /* create unialt.c */
FreeNamesMemorySpace(); /* cleanup alloc of memory */
return( 0 );
}
29 changes: 0 additions & 29 deletions Unicode/ucharmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,8 @@ return( u2encoding_strncpy(to,ufrom,n,e_iso8859_1));
} else if ( cs==e_unicode_backwards ) {
unichar_t *uto = (unichar_t *) to;
while ( *ufrom && n>sizeof(unichar_t)-1 ) {
#ifdef UNICHAR_16
unichar_t ch = (*ufrom>>8)|((*ufrom&0xff)<<8);
#else
unichar_t ch = (*ufrom>>24)|((*ufrom>>8)&0xff00)|
((*ufrom<<8)&0xff0000)|(*ufrom<<24);
#endif
*uto++ = ch;
++ufrom;
n-=sizeof(unichar_t);
Expand Down Expand Up @@ -396,30 +392,17 @@ return( to );
static char *old_local_name=NULL;
static iconv_t to_unicode=(iconv_t) (-1), from_unicode=(iconv_t) (-1);
static iconv_t to_utf8=(iconv_t) (-1), from_utf8=(iconv_t) (-1);
#ifdef UNICHAR_16
static char *names[] = { "UCS-2-INTERNAL", "UCS-2", "UCS2", "ISO-10646/UCS2", "UNICODE", NULL };
static char *namesle[] = { "UCS-2LE", "UNICODELITTLE", NULL };
static char *namesbe[] = { "UCS-2BE", "UNICODEBIG", NULL };
#else
static char *names[] = { "UCS-4-INTERNAL", "UCS-4", "UCS4", "ISO-10646-UCS-4", "UTF-32", NULL };
static char *namesle[] = { "UCS-4LE", "UTF-32LE", NULL };
static char *namesbe[] = { "UCS-4BE", "UTF-32BE", NULL };
#endif
static char *unicode_name = NULL;
static int byteswapped = false;

static int BytesNormal(iconv_t latin1_2_unicode) {
#ifdef UNICHAR_16
union {
short s;
char c[2];
} u[8];
#else
union {
int32 s;
char c[4];
} u[8];
#endif
char *from = "A", *to = &u[0].c[0];
size_t in_left = 1, out_left = sizeof(u);
memset(u,0,sizeof(u));
Expand Down Expand Up @@ -509,10 +492,8 @@ unichar_t *def2u_strncpy(unichar_t *uto, const char *from, int n) {
iconv(to_unicode, (iconv_arg2_t) &from, &in_left, &cto, &out_left);
if ( cto<((char *) uto)+2*n) *cto++ = '\0';
if ( cto<((char *) uto)+2*n) *cto++ = '\0';
#ifndef UNICHAR_16
if ( cto<((char *) uto)+4*n) *cto++ = '\0';
if ( cto<((char *) uto)+4*n) *cto++ = '\0';
#endif
return( uto );
}
#endif
Expand All @@ -527,10 +508,8 @@ char *u2def_strncpy(char *to, const unichar_t *ufrom, int n) {
iconv(from_unicode, (iconv_arg2_t) &cfrom, &in_left, &cto, &out_left);
if ( cto<to+n ) *cto++ = '\0';
if ( cto<to+n ) *cto++ = '\0';
#ifndef UNICHAR_16
if ( cto<to+n ) *cto++ = '\0';
if ( cto<to+n ) *cto++ = '\0';
#endif
return( to );
}
#endif
Expand All @@ -552,10 +531,8 @@ return( NULL );
iconv(to_unicode, (iconv_arg2_t) &from, &in_left, &cto, &out_left);
*cto++ = '\0';
*cto++ = '\0';
#ifndef UNICHAR_16
*cto++ = '\0';
*cto++ = '\0';
#endif
return( uto );
}
#endif
Expand All @@ -582,10 +559,8 @@ return( NULL );
iconv(from_unicode, (iconv_arg2_t) &cfrom, &in_left, &cto, &out_left);
*cto++ = '\0';
*cto++ = '\0';
#ifndef UNICHAR_16
*cto++ = '\0';
*cto++ = '\0';
#endif
return( to );
}
#endif
Expand Down Expand Up @@ -621,10 +596,8 @@ return( NULL );
iconv(to_utf8, (iconv_arg2_t) &from, &in_left, &cto, &out_left);
*cto++ = '\0';
*cto++ = '\0';
#ifndef UNICHAR_16
*cto++ = '\0';
*cto++ = '\0';
#endif
return( cret );
}
#endif
Expand Down Expand Up @@ -656,10 +629,8 @@ return( NULL );
iconv(from_utf8, (iconv_arg2_t) &cfrom, &in_left, &cto, &out_left);
*cto++ = '\0';
*cto++ = '\0';
#ifndef UNICHAR_16
*cto++ = '\0';
*cto++ = '\0';
#endif
return( to );
}
#endif
Expand Down
Loading

0 comments on commit 9d2198d

Please sign in to comment.