Skip to content
Browse files

Merge with master. Remove Objective C from pyhook and enable C99 there.

  • Loading branch information...
2 parents 5a11aa4 + e29a41c commit 9d2198d5ddadfe0001f7542871a52c87e64f0268 Barry Schwartz committed Sep 5, 2012
View
3 .gitignore
@@ -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
View
17 Unicode/ArabicForms.c
@@ -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 },
@@ -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 },
@@ -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 },
@@ -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 },
@@ -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 },
@@ -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 },
@@ -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 },
@@ -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 },
View
6 Unicode/gwwiconv.c
@@ -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));
View
81 Unicode/makeutype.c
@@ -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 );
@@ -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 );
@@ -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 );
}
View
29 Unicode/ucharmap.c
@@ -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);
@@ -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));
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
View
119 Unicode/ustring.c
@@ -487,24 +487,12 @@ unichar_t *utf82u_strncpy(unichar_t *ubuf,const char *utf8buf,int len) {
} else if ( *pt<=0xef ) {
*upt = ((*pt&0xf)<<12) | ((pt[1]&0x3f)<<6) | (pt[2]&0x3f);
pt += 3;
-#ifdef UNICHAR_16
- } else if ( upt+1<uend ) {
- /* Um... I don't support surrogates */
- w = ( ((*pt&0x7)<<2) | ((pt[1]&0x30)>>4) )-1;
- *upt++ = 0xd800 | (w<<6) | ((pt[1]&0xf)<<2) | ((pt[2]&0x30)>>4);
- *upt = 0xdc00 | ((pt[2]&0xf)<<6) | (pt[3]&0x3f);
- pt += 4;
- } else {
- /* no space for surrogate */
- pt += 4;
-#else
} else {
w = ( ((*pt&0x7)<<2) | ((pt[1]&0x30)>>4) )-1;
w = (w<<6) | ((pt[1]&0xf)<<2) | ((pt[2]&0x30)>>4);
w2 = ((pt[2]&0xf)<<6) | (pt[3]&0x3f);
*upt = w*0x400 + w2 + 0x10000;
pt += 4;
-#endif
}
++upt;
}
@@ -516,86 +504,6 @@ unichar_t *utf82u_strcpy(unichar_t *ubuf,const char *utf8buf) {
return( utf82u_strncpy(ubuf,utf8buf,strlen(utf8buf)+1));
}
-# ifdef UNICHAR_16
-uint32 *utf82u32_strncpy(uint32 *ubuf,const char *utf8buf,int len) {
- uint32 *upt=ubuf, *uend=ubuf+len-1;
- const uint8 *pt = (const uint8 *) utf8buf;
- int w, w2;
-
- while ( *pt!='\0' && upt<uend ) {
- if ( *pt<=127 )
- *upt = *pt++;
- else if ( *pt<=0xdf ) {
- *upt = ((*pt&0x1f)<<6) | (pt[1]&0x3f);
- pt += 2;
- } else if ( *pt<=0xef ) {
- *upt = ((*pt&0xf)<<12) | ((pt[1]&0x3f)<<6) | (pt[2]&0x3f);
- pt += 3;
- } else {
- w = ( ((*pt&0x7)<<2) | ((pt[1]&0x30)>>4) )-1;
- w = (w<<6) | ((pt[1]&0xf)<<2) | ((pt[2]&0x30)>>4);
- w2 = ((pt[2]&0xf)<<6) | (pt[3]&0x3f);
- *upt = w*0x400 + w2 + 0x10000;
- pt += 4;
- }
- ++upt;
- }
- *upt = '\0';
-return( ubuf );
-}
-
-char *u322utf8_strncpy(char *utf8buf, const uint32 *ubuf,int len) {
- uint8 *pt=(uint8 *) utf8buf, *end=(uint8 *) utf8buf+len-1;
- const uint32 *upt = ubuf;
-
- while ( *upt!='\0' && pt<end ) {
- if ( *upt<=127 )
- *pt++ = *upt;
- else if ( *upt<=0x7ff ) {
- if ( pt+1>=end )
- break;
- *pt++ = 0xc0 | (*upt>>6);
- *pt++ = 0x80 | (*upt&0x3f);
- } else if ( *upt<=0xffff ) {
- if ( pt+2>=end )
- break;
- *pt++ = 0xe0 | (*upt>>12);
- *pt++ = 0x80 | ((*upt>>6)&0x3f);
- *pt++ = 0x80 | (*upt&0x3f);
- } else {
- uint32 val = *upt-0x10000;
- int u = ((val&0xf0000)>>16)+1, z=(val&0x0f000)>>12, y=(val&0x00fc0)>>6, x=val&0x0003f;
- if ( pt+3>=end )
- break;
- *pt++ = 0xf0 | (u>>2);
- *pt++ = 0x80 | ((u&3)<<4) | z;
- *pt++ = 0x80 | y;
- *pt++ = 0x80 | x;
- }
- ++upt;
- }
- *pt = '\0';
-return( utf8buf );
-}
-
-char *u322utf8_copy(const uint32 *ubuf) {
- int i, len;
- char *buf;
-
- for ( i=len=0; ubuf[i]!=0; ++i )
- if ( ubuf[i]<0x80 )
- ++len;
- else if ( ubuf[i]<0x800 )
- len += 2;
- else if ( ubuf[i]<0x10000 )
- len += 3;
- else
- len += 4;
- buf = (char *) galloc(len+1);
-return( u322utf8_strncpy(buf,ubuf,len+1));
-}
-#endif
-
unichar_t *utf82u_copyn(const char *utf8buf,int len) {
unichar_t *ubuf = (unichar_t *) galloc((len+1)*sizeof(unichar_t));
return( utf82u_strncpy(ubuf,utf8buf,len+1));
@@ -617,20 +525,6 @@ void utf82u_strcat(unichar_t *to,const char *from) {
utf82u_strcpy(to+u_strlen(to),from);
}
-#ifdef UNICHAR_16
-uint32 *utf82u32_copy(const char *utf8buf) {
- int len;
- uint32 *ubuf;
-
- if ( utf8buf==NULL )
-return( NULL );
-
- len = strlen(utf8buf);
- ubuf = (uint32 *) galloc((len+1)*sizeof(uint32));
-return( utf82u32_strncpy(ubuf,utf8buf,len+1));
-}
-#endif
-
char *u2utf8_strcpy(char *utf8buf,const unichar_t *ubuf) {
char *pt = utf8buf;
@@ -640,18 +534,6 @@ char *u2utf8_strcpy(char *utf8buf,const unichar_t *ubuf) {
else if ( *ubuf<0x800 ) {
*pt++ = 0xc0 | (*ubuf>>6);
*pt++ = 0x80 | (*ubuf&0x3f);
-#ifdef UNICHAR_16
- } else if ( *ubuf>=0xd800 && *ubuf<0xdc00 && ubuf[1]>=0xdc00 && ubuf[1]<0xe000 ) {
- int u = ((*ubuf>>6)&0xf)+1, y = ((*ubuf&3)<<4) | ((ubuf[1]>>6)&0xf);
- *pt++ = 0xf0 | (u>>2);
- *pt++ = 0x80 | ((u&3)<<4) | ((*ubuf>>2)&0xf);
- *pt++ = 0x80 | y;
- *pt++ = 0x80 | (ubuf[1]&0x3f);
- } else {
- *pt++ = 0xe0 | (*ubuf>>12);
- *pt++ = 0x80 | ((*ubuf>>6)&0x3f);
- *pt++ = 0x80 | (*ubuf&0x3f);
-#else
} else if ( *ubuf < 0x10000 ) {
*pt++ = 0xe0 | (*ubuf>>12);
*pt++ = 0x80 | ((*ubuf>>6)&0x3f);
@@ -663,7 +545,6 @@ char *u2utf8_strcpy(char *utf8buf,const unichar_t *ubuf) {
*pt++ = 0x80 | ((u&3)<<4) | z;
*pt++ = 0x80 | y;
*pt++ = 0x80 | x;
-#endif
}
++ubuf;
}
View
44,652 Unicode/utype.c
22,326 additions, 22,326 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
4 fontforge/GNUmakefile.in
@@ -30,6 +30,10 @@
include Makefile
+#######################################################################
+# The maintainer tools such as "stamper" are built if you configure #
+# with --enable-maintainer-tools #
+#######################################################################
ifeq (@MAINTAINER_TOOLS@,yes)
# You need to build the "fontforge" program to do the stamps for
View
26 fontforge/encoding.c
@@ -129,15 +129,9 @@ const char *FindUnicharName(void) {
/* ordering and under libiconv it means big-endian */
iconv_t test;
static char *goodname = NULL;
-#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
char **testnames;
int i;
union {
@@ -175,11 +169,7 @@ return( goodname );
}
if ( goodname==NULL ) {
-#ifdef UNICHAR_16
- IError( "I can't figure out your version of iconv(). I need a name for the UCS-2 encoding and I can't find one. Reconfigure --without-iconv. Bye.");
-#else
IError( "I can't figure out your version of iconv(). I need a name for the UCS-4 encoding and I can't find one. Reconfigure --without-iconv. Bye.");
-#endif
exit( 1 );
}
@@ -2456,10 +2446,6 @@ return( -1 );
}
if ( tpt-(char *) to == sizeof(unichar_t) )
return( to[0] );
-#ifdef UNICHAR_16
- else if ( tpt-(char *) to == 4 && to[0]>=0xd800 && to[0]<0xdc00 && to[1]>=0xdc00 )
-return( ((to[0]-0xd800)<<10) + (to[1]-0xdc00) + 0x10000 );
-#endif
} else if ( encname->tounicode_func!=NULL ) {
return( (encname->tounicode_func)(enc) );
}
@@ -2488,20 +2474,8 @@ return( -1 );
} else if ( enc->fromunicode!=NULL ) {
/* I don't see how there can be any state to reset in this direction */
/* So I don't reset it */
-#ifdef UNICHAR_16
- if ( uni<0x10000 ) {
- from[0] = uni;
- fromlen = sizeof(unichar_t);
- } else {
- uni -= 0x10000;
- from[0] = 0xd800 + (uni>>10);
- from[1] = 0xdc00 + (uni&0x3ff);
- fromlen = 2*sizeof(unichar_t);
- }
-#else
from[0] = uni;
fromlen = sizeof(unichar_t);
-#endif
fpt = (char *) from; tpt = (char *) to; tolen = sizeof(to);
iconv(enc->fromunicode,NULL,NULL,NULL,NULL); /* reset shift in/out, etc. */
if ( iconv(enc->fromunicode,&fpt,&fromlen,&tpt,&tolen)==(size_t) -1 )
View
9 fontforge/libffstamp.h
@@ -1,3 +1,6 @@
-#define LibFF_ModTime 1346784630L /* Seconds since 1970 (standard unix time) */
-#define LibFF_ModTime_Str "18:50 GMT 4-Sep-2012"
-#define LibFF_VersionDate 20120904 /* Year, month, day */
+/* This file was generated using stamper.c to create the next version release. */
+/* If you need to update this to the next release version, see fontforge/GNUmakefile.in */
+
+#define LibFF_ModTime 1346896085L /* Seconds since 1970 (standard unix time) */
+#define LibFF_ModTime_Str "01:48 GMT 6-Sep-2012"
+#define LibFF_VersionDate 20120906 /* Year, month, day */
View
5 fontforge/macbinary.c
@@ -1481,10 +1481,6 @@ return( false );
((FInfo *) (info.finderInfo))->fdCreator = mb->creator;
pt = strrchr(fname,'/');
filename = def2u_copy(pt==NULL?fname:pt+1);
-#ifdef UNICHAR_16
- ret = FSCreateFileUnicode(&parentref,u_strlen(filename), (UniChar *) filename,
- kFSCatInfoFinderInfo, &info, &ref, NULL);
-#else
{ UniChar *ucs2fn = galloc((u_strlen(filename)+1) * sizeof(UniChar));
int i;
for ( i=0; filename[i]!=0; ++i )
@@ -1494,7 +1490,6 @@ return( false );
kFSCatInfoFinderInfo, &info, &ref, NULL);
free(ucs2fn);
}
-#endif
free(filename);
if ( ret==dupFNErr ) {
/* File already exists, create failed, didn't get an FSRef */
View
2 fontforge/macenc.c
@@ -1194,9 +1194,7 @@ return( NULL );
out = ret = galloc(outlen+sizeof(unichar_t));
iconv(fromutf8,&in,&inlen,&out,&outlen);
out[0] = out[1] = '\0';
-#ifndef UNICHAR_16
out[2] = out[3] = '\0';
-#endif
iconv_close(fromutf8);
return( ret );
}
View
25 fontforge/metricsview.c
@@ -1419,10 +1419,6 @@ static void MVVScroll(MetricsView *mv,struct sbevent *sb) {
}
}
-#ifdef UNICHAR_16
-# define MVFakeUnicodeOfSc(mv,sc) 0xfffd
-# define MVOddMatch(mv,uni,sc) (uni==0xfffd && sc->unicodeenc==-1)
-#else
static int MVFakeUnicodeOfSc(MetricsView *mv, SplineChar *sc) {
if ( sc->unicodeenc!=-1 )
@@ -1493,7 +1489,6 @@ return( uni==0xfffd );
else
return( uni>=mv->fake_unicode_base && sc->orig_pos == uni-mv->fake_unicode_base );
}
-#endif
void MVSetSCs(MetricsView *mv, SplineChar **scs) {
/* set the list of characters being displayed to those in scs */
@@ -1508,11 +1503,7 @@ void MVSetSCs(MetricsView *mv, SplineChar **scs) {
ustr = galloc((len+1)*sizeof(unichar_t));
for ( len=0; scs[len]!=NULL; ++len )
-#ifdef UNICHAR_16
- if ( scs[len]->unicodeenc>0 && scs[len]->unicodeenc<0x10000 )
-#else
if ( scs[len]->unicodeenc>0 )
-#endif
ustr[len] = scs[len]->unicodeenc;
else
ustr[len] = MVFakeUnicodeOfSc(mv,scs[len]);
@@ -1641,11 +1632,7 @@ static void MVFigureGlyphNames(MetricsView *mv,const unichar_t *names) {
}
newtext = galloc((cnt+1)*sizeof(unichar_t));
for ( i=0; i<cnt; ++i ) {
-#ifdef UNICHAR_16
- newtext[i] = founds[i]->unicodeenc==-1 || founds[i]->unicodeenc>=0x10000?
-#else
newtext[i] = founds[i]->unicodeenc==-1 ?
-#endif
MVFakeUnicodeOfSc(mv,founds[i]) :
founds[i]->unicodeenc;
mv->chars[i] = founds[i];
@@ -2539,11 +2526,7 @@ static void MVResetText(MetricsView *mv) {
new = galloc((mv->clen+1)*sizeof(unichar_t));
for ( pt=new, i=0; i<mv->clen; ++i ) {
-#ifdef UNICHAR_16
- if ( mv->chars[i]->unicodeenc==-1 || mv->chars[i]->unicodeenc>=0x10000 )
-#else
if ( mv->chars[i]->unicodeenc==-1 )
-#endif
*pt++ = MVFakeUnicodeOfSc(mv,mv->chars[i]);
else
*pt++ = mv->chars[i]->unicodeenc;
@@ -4435,11 +4418,7 @@ return;
}
for ( i=within; i<within+cnt; ++i ) {
mv->chars[i] = founds[i-within];
-#ifdef UNICHAR_16
- newtext[i] = (founds[i-within]->unicodeenc>=0 && founds[i-within]->unicodeenc<0x10000)?
-#else
newtext[i] = founds[i-within]->unicodeenc>=0 ?
-#endif
founds[i-within]->unicodeenc : MVFakeUnicodeOfSc(mv,founds[i-within]);
}
mv->clen += cnt;
@@ -4774,11 +4753,7 @@ MetricsView *MetricsViewCreate(FontView *fv,SplineChar *sc,BDFFont *bdf) {
for ( cnt=0; cnt<mv->clen; ++cnt )
pt = utf8_idpb(pt,
-#ifdef UNICHAR_16
- mv->chars[cnt]->unicodeenc==-1 || mv->chars[cnt]->unicodeenc>=0x10000?
-#else
mv->chars[cnt]->unicodeenc==-1?
-#endif
MVFakeUnicodeOfSc(mv,mv->chars[cnt]): mv->chars[cnt]->unicodeenc);
*pt = '\0';
View
2 fontforge/parsettf.c
@@ -475,9 +475,7 @@ return( NULL );
out = (char *) str;
iconv(enc->tounicode,&in,&inlen,&out,&outlen);
out[0] = '\0'; out[1] = '\0';
-#ifndef UNICHAR_16
out[2] = '\0'; out[3] = '\0';
-#endif
free(cstr);
} else {
str = uc_copy("");
View
88 fontforge/python.c
@@ -385,14 +385,6 @@ void PyFF_Glyph_Set_Layer(SplineChar *sc,int layer) {
((PyFF_Glyph *) pysc)->layer = layer;
}
-/* We use this for read-only properties of exported Python objects.
- * Signature must be compatible with Python.h::setter - hence unused parameters.
- */
-static int PyFF_cant_set(PyFF_Font *UNUSED(self), PyObject *UNUSED(value), void *UNUSED(closure)) {
- PyErr_Format(PyExc_TypeError, "Cannot set this member");
-return( 0 );
-}
-
static uint32 StrToTag(char *tag_name, int *was_mac) {
uint8 foo[4];
int feat, set;
@@ -6779,7 +6771,7 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
(getter)PyFF_Glyph_get_altuni, (setter)PyFF_Glyph_set_altuni,
"Alternate unicode encodings (and variation selectors) for this glyph", NULL},
{"encoding",
- (getter)PyFF_Glyph_get_encoding, (setter)PyFF_cant_set,
+ (getter)PyFF_Glyph_get_encoding, NULL,
"Returns the glyph's encoding in the current font (readonly)", NULL},
{"foreground",
(getter)PyFF_Glyph_get_foreground, (setter)PyFF_Glyph_set_foreground,
@@ -6788,16 +6780,16 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
(getter)PyFF_Glyph_get_background, (setter)PyFF_Glyph_set_background,
"Returns the background layer of the glyph", NULL},
{"layers",
- (getter)PyFF_Glyph_get_layers, (setter)PyFF_cant_set,
+ (getter)PyFF_Glyph_get_layers, NULL,
"Returns an array of layers", NULL},
{"references",
(getter)PyFF_Glyph_get_references, (setter)PyFF_Glyph_set_references,
"A tuple of all references in the glyph", NULL},
{"layerrefs",
- (getter)PyFF_Glyph_get_layerrefs, (setter)PyFF_cant_set,
+ (getter)PyFF_Glyph_get_layerrefs, NULL,
"Returns an array of layer references", NULL},
{"layer_cnt",
- (getter)PyFF_Glyph_get_layer_cnt, (setter)PyFF_cant_set,
+ (getter)PyFF_Glyph_get_layer_cnt, NULL,
"Returns the number of layers in the glyph", NULL},
{"color",
(getter)PyFF_Glyph_get_color, (setter)PyFF_Glyph_set_color,
@@ -6815,7 +6807,7 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
(getter)PyFF_Glyph_get_isextendedshape, (setter)PyFF_Glyph_set_isextendedshape,
"Math \"is extended shape\" field", NULL},
{"script",
- (getter)PyFF_Glyph_get_script, (setter)PyFF_cant_set,
+ (getter)PyFF_Glyph_get_script, NULL,
"The OpenType script containing this glyph (readonly)", NULL},
{"texheight",
(getter)PyFF_Glyph_get_texheight, (setter)PyFF_Glyph_set_texheight,
@@ -6836,7 +6828,7 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
(getter)PyFF_Glyph_get_changed, (setter)PyFF_Glyph_set_changed,
"Flag indicating whether this glyph has changed", NULL},
{"originalgid",
- (getter)PyFF_Glyph_get_originalgid, (setter)PyFF_cant_set,
+ (getter)PyFF_Glyph_get_originalgid, NULL,
"Original GID (readonly)", NULL},
{"width",
(getter)PyFF_Glyph_get_width, (setter)PyFF_Glyph_set_width,
@@ -6851,7 +6843,7 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
(getter)PyFF_Glyph_get_vwidth, (setter)PyFF_Glyph_set_vwidth,
"Glyph's vertical advance width", NULL},
{"font",
- (getter)PyFF_Glyph_get_font, (setter)PyFF_cant_set,
+ (getter)PyFF_Glyph_get_font, NULL,
"Font containing the glyph (readonly)", NULL},
{"hhints",
(getter)PyFF_Glyph_get_hhints, (setter)PyFF_Glyph_set_hhints,
@@ -6869,7 +6861,7 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
(getter)PyFF_Glyph_get_lcarets, (setter)PyFF_Glyph_set_lcarets,
"The ligature caret locations, defined for this glyph, as a tuple.", NULL},
{"validation_state",
- (getter)PyFF_Glyph_get_validation_state, (setter)PyFF_cant_set,
+ (getter)PyFF_Glyph_get_validation_state, NULL,
"glyph's validation state (readonly)", NULL},
{"horizontalVariants",
(getter)PyFF_Glyph_get_horizontalVariants, (setter)PyFF_Glyph_set_horizontalVariants,
@@ -6890,7 +6882,7 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
(getter)PyFF_Glyph_get_verticalCIC, (setter)PyFF_Glyph_set_verticalCIC,
"The italic correction for any composite glyph made with the verticalComponents.", NULL},
{"mathKern",
- (getter)PyFF_Glyph_get_mathKern, (setter)PyFF_cant_set,
+ (getter)PyFF_Glyph_get_mathKern, NULL,
"math kerning information for the glyph.", NULL},
PYGETSETDEF_EMPTY /* Sentinel */
};
@@ -8879,7 +8871,7 @@ static PyMethodDef PyFFSelection_methods[] = {
static PyGetSetDef PyFFSelection_getset[] = {
{"byGlyphs",
- (getter)PyFFSelection_ByGlyphs, (setter)PyFF_cant_set,
+ (getter)PyFFSelection_ByGlyphs, NULL,
"returns a selection object whose iterator will return glyph objects (rather than encoding indices)", NULL},
PYGETSETDEF_EMPTY /* Sentinel */
};
@@ -12221,10 +12213,10 @@ static PyGetSetDef PyFF_Font_getset[] = {
(getter)PyFF_Font_get_bitmapSizes, (setter)PyFF_Font_set_bitmapSizes,
"A tuple of sizes of all bitmaps associated with the font", NULL},
{"gpos_lookups",
- (getter)PyFF_Font_get_gpos_lookups, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_gpos_lookups, NULL,
"The names of all lookups in the font's GPOS table (readonly)", NULL},
{"gsub_lookups",
- (getter)PyFF_Font_get_gsub_lookups, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_gsub_lookups, NULL,
"The names of all lookups in the font's GSUB table (readonly)", NULL},
{"horizontalBaseline",
(getter)PyFF_Font_get_horizontal_baseline, (setter)PyFF_Font_set_horizontal_baseline,
@@ -12233,22 +12225,22 @@ static PyGetSetDef PyFF_Font_getset[] = {
(getter)PyFF_Font_get_vertical_baseline, (setter)PyFF_Font_set_vertical_baseline,
"Vertical baseline data, if any", NULL},
{"private",
- (getter)PyFF_Font_get_private, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_private, NULL,
"The font's PostScript private dictionary (You may not set this field, but you may set things in it)", NULL},
{"math",
- (getter)PyFF_Font_get_math, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_math, NULL,
"The font's math constants (You may not set this field, but you may set things in it)", NULL},
{"texparameters",
- (getter)PyFF_Font_get_texparams, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_texparams, NULL,
"The font's TeX font parameters", NULL},
{"cvt",
(getter)PyFF_Font_get_cvt, (setter)PyFF_Font_set_cvt,
"The font's TrueType cvt table", NULL},
{"path",
- (getter)PyFF_Font_get_path, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_path, NULL,
"filename of the original font file loaded (readonly)", NULL},
{"sfd_path",
- (getter)PyFF_Font_get_sfd_path, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_sfd_path, NULL,
"filename of the sfd file containing this font (if any) (readonly)", NULL},
{"default_base_filename",
(getter)PyFF_Font_get_defbasefilename, (setter)PyFF_Font_set_defbasefilename,
@@ -12296,10 +12288,10 @@ static PyGetSetDef PyFF_Font_getset[] = {
(getter)PyFF_Font_get_cidsubfont, (setter)PyFF_Font_set_cidsubfont,
"Returns the index of the current subfont of a cid-keyed font (or -1), and allows you to change the subfont.", NULL},
{"cidsubfontcnt",
- (getter)PyFF_Font_get_cidsubfontcnt, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_cidsubfontcnt, NULL,
"The number of sub fonts that make up a CID keyed font (readonly)", NULL},
{"cidsubfontnames",
- (getter)PyFF_Font_get_cidsubfontnames, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_cidsubfontnames, NULL,
"The names of all the sub fonts that make up a CID keyed font (readonly)", NULL},
{"cidfontname",
(getter)PyFF_Font_get_cidfontname, (setter)PyFF_Font_set_cidfontname,
@@ -12320,10 +12312,10 @@ static PyGetSetDef PyFF_Font_getset[] = {
(getter)PyFF_Font_get_cidversion, (setter)PyFF_Font_set_cidversion,
"CID Version", NULL},
{"iscid", /* This should be is_cid, but due to an early misprint I now include both */
- (getter)PyFF_Font_get_is_cid, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_is_cid, NULL,
"Whether the font is a cid-keyed font. (readonly)", NULL},
{"is_cid",
- (getter)PyFF_Font_get_is_cid, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_is_cid, NULL,
"Whether the font is a cid-keyed font. (readonly)", NULL},
{"italicangle",
(getter)PyFF_Font_get_italicangle, (setter)PyFF_Font_set_italicangle,
@@ -12344,10 +12336,10 @@ static PyGetSetDef PyFF_Font_getset[] = {
(getter)PyFF_Font_get_descent, (setter)PyFF_Font_set_descent,
"Font Descent", NULL},
{"xHeight",
- (getter)PyFF_Font_get_xHeight, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_xHeight, NULL,
"X Height of font (negative number means could not be computed (ie. no lowercase glyphs))", NULL},
{"capHeight",
- (getter)PyFF_Font_get_capHeight, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_capHeight, NULL,
"Cap Height of font (negative number means could not be computed (ie. no uppercase glyphs))", NULL},
{"em",
(getter)PyFF_Font_get_em, (setter)PyFF_Font_set_em,
@@ -12371,16 +12363,16 @@ static PyGetSetDef PyFF_Font_getset[] = {
(getter)PyFF_Font_get_uniqueid, (setter)PyFF_Font_set_uniqueid,
"PostScript Unique ID", NULL},
{"layer_cnt",
- (getter)PyFF_Font_get_layer_cnt, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_layer_cnt, NULL,
"Returns the number of layers in the font (readonly)", NULL},
{"layers",
- (getter)PyFF_Font_get_layers, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_layers, NULL,
"Returns a dictionary like object with information on the layers of the font", NULL},
{"loadState",
- (getter)PyFF_Font_get_loadvalidation_state, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_loadvalidation_state, NULL,
"A bitmask indicating non-fatal errors found when loading the font (readonly)", NULL},
{"privateState",
- (getter)PyFF_Font_get_privatevalidation_state, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_privatevalidation_state, NULL,
"A bitmask indicating errors in the (PostScript) Private dictionary", NULL},
{"macstyle",
(getter)PyFF_Font_get_macstyle, (setter)PyFF_Font_set_macstyle,
@@ -12530,7 +12522,7 @@ static PyGetSetDef PyFF_Font_getset[] = {
(getter)PyFF_Font_get_changed, (setter)PyFF_Font_set_changed,
"Flag indicating whether the font has been changed since it was loaded (read only)", NULL},
{"isnew",
- (getter)PyFF_Font_get_new, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_new, NULL,
"Flag indicating whether the font is new (read only)", NULL},
{"hasvmetrics",
(getter)PyFF_Font_get_hasvmetrics, (setter)PyFF_Font_set_hasvmetrics,
@@ -12545,7 +12537,7 @@ static PyGetSetDef PyFF_Font_getset[] = {
(getter)PyFF_Font_get_is_quadratic, (setter)PyFF_Font_set_is_quadratic,
"Flag indicating whether the font contains quadratic splines (truetype) or cubic (postscript)", NULL},
{"multilayer",
- (getter)PyFF_Font_get_multilayer, (setter)PyFF_cant_set,
+ (getter)PyFF_Font_get_multilayer, NULL,
"Flag indicating whether the font is multilayered (type3) or not (readonly)", NULL},
{"strokedfont",
(getter)PyFF_Font_get_strokedfont, (setter)PyFF_Font_set_strokedfont,
@@ -16271,22 +16263,22 @@ return( self->right );
static PyGetSetDef PyFF_AWGlyph_getset[] = {
{"glyph",
- (getter)PyFF_AWGlyph_getGlyph, (setter)PyFF_cant_set,
+ (getter)PyFF_AWGlyph_getGlyph, NULL,
"The underlying glyph which this object describes", NULL},
{"boundingbox",
- (getter)PyFF_AWGlyph_getBB, (setter)PyFF_cant_set,
+ (getter)PyFF_AWGlyph_getBB, NULL,
"The bounding box of the underlying glyph", NULL},
{"iminY",
- (getter)PyFF_AWGlyph_getIminY, (setter)PyFF_cant_set,
+ (getter)PyFF_AWGlyph_getIminY, NULL,
"floor(bb.min_y/decimation_height)", NULL},
{"imaxY",
- (getter)PyFF_AWGlyph_getImaxY, (setter)PyFF_cant_set,
+ (getter)PyFF_AWGlyph_getImaxY, NULL,
"ceil(bb.max_y/decimation_height)", NULL},
{"left",
- (getter)PyFF_AWGlyph_getLeft, (setter)PyFF_cant_set,
+ (getter)PyFF_AWGlyph_getLeft, NULL,
"array with left edge offsets from bounding box", NULL},
{"right",
- (getter)PyFF_AWGlyph_getRight, (setter)PyFF_cant_set,
+ (getter)PyFF_AWGlyph_getRight, NULL,
"array with left edge offsets from bounding box", NULL},
PYGETSETDEF_EMPTY /* Sentinel */
};
@@ -16400,19 +16392,19 @@ return( self->denom );
static PyGetSetDef PyFF_AWContext_getset[] = {
{"font",
- (getter)PyFF_AWContext_getFont, (setter)PyFF_cant_set,
+ (getter)PyFF_AWContext_getFont, NULL,
"The underlying font which this object describes", NULL},
{"emSize",
- (getter)PyFF_AWContext_getEmSize, (setter)PyFF_cant_set,
+ (getter)PyFF_AWContext_getEmSize, NULL,
"Font's em-size", NULL},
{"layer",
- (getter)PyFF_AWContext_getLayer, (setter)PyFF_cant_set,
+ (getter)PyFF_AWContext_getLayer, NULL,
"active layer during the current operation", NULL},
{"regionHeight",
- (getter)PyFF_AWContext_getRegionHeight, (setter)PyFF_cant_set,
+ (getter)PyFF_AWContext_getRegionHeight, NULL,
"The y coordinate line is subdivided into regions, and this is the height of each region", NULL},
{"denom",
- (getter)PyFF_AWContext_getDenom, (setter)PyFF_cant_set,
+ (getter)PyFF_AWContext_getDenom, NULL,
"A useful small number which varies with the emsize", NULL},
PYGETSETDEF_EMPTY /* Sentinel */
};
View
8 fontforge/scripting.c
@@ -1107,11 +1107,7 @@ static void bUtf8(Context *c) {
ScriptError( c, "Bad value for argument" );
buf[0] = c->a.vals[1].u.ival; buf[1] = 0;
c->return_val.type = v_str;
-#ifdef UNICHAR_16
- c->return_val.u.sval = u322utf8_copy(buf);
-#else
c->return_val.u.sval = u2utf8_copy(buf);
-#endif
} else if ( c->a.vals[1].type==v_arr || c->a.vals[1].type==v_arrfree ) {
Array *arr = c->a.vals[1].u.aval;
temp = galloc((arr->argc+1)*sizeof(int32));
@@ -1124,11 +1120,7 @@ static void bUtf8(Context *c) {
}
temp[i] = 0;
c->return_val.type = v_str;
-#ifdef UNICHAR_16
- c->return_val.u.sval = u322utf8_copy(temp);
-#else
c->return_val.u.sval = u2utf8_copy(temp);
-#endif
free(temp);
} else
ScriptError( c, "Bad type for argument" );
View
34 fontforge/sftextfield.c
@@ -388,15 +388,9 @@ static void SFTextAreaGrabPrimarySelection(SFTextArea *st) {
GDrawGrabSelection(st->g.base,sn_primary);
st->sel_start = ss; st->sel_end = se;
-#ifdef UNICHAR_16
- GDrawAddSelectionType(st->g.base,sn_primary,"text/plain;charset=ISO-10646-UCS-2",st,st->sel_end-st->sel_start,
- sizeof(unichar_t),
- genunicodedata,noop);
-#else
GDrawAddSelectionType(st->g.base,sn_primary,"text/plain;charset=ISO-10646-UCS-4",st,st->sel_end-st->sel_start,
sizeof(unichar_t),
genunicodedata,noop);
-#endif
GDrawAddSelectionType(st->g.base,sn_primary,"UTF8_STRING",st,3*(st->sel_end-st->sel_start),
sizeof(unichar_t),
genutf8data,noop);
@@ -407,15 +401,9 @@ static void SFTextAreaGrabPrimarySelection(SFTextArea *st) {
static void SFTextAreaGrabDDSelection(SFTextArea *st) {
GDrawGrabSelection(st->g.base,sn_drag_and_drop);
-#ifdef UNICHAR_16
- GDrawAddSelectionType(st->g.base,sn_drag_and_drop,"text/plain;charset=ISO-10646-UCS-2",st,st->sel_end-st->sel_start,
- sizeof(unichar_t),
- ddgenunicodedata,noop);
-#else
GDrawAddSelectionType(st->g.base,sn_drag_and_drop,"text/plain;charset=ISO-10646-UCS-4",st,st->sel_end-st->sel_start,
sizeof(unichar_t),
ddgenunicodedata,noop);
-#endif
GDrawAddSelectionType(st->g.base,sn_drag_and_drop,"STRING",st,st->sel_end-st->sel_start,sizeof(char),
ddgenlocaldata,noop);
}
@@ -425,21 +413,14 @@ static void SFTextAreaGrabSelection(SFTextArea *st, enum selnames sel ) {
if ( st->sel_start!=st->sel_end ) {
unichar_t *temp;
char *ctemp;
-#ifndef UNICHAR_16
int i;
uint16 *u2temp;
-#endif
GDrawGrabSelection(st->g.base,sel);
temp = galloc((st->sel_end-st->sel_start + 2)*sizeof(unichar_t));
temp[0] = 0xfeff; /* KDE expects a byte order flag */
u_strncpy(temp+1,st->li.text+st->sel_start,st->sel_end-st->sel_start);
ctemp = u2utf8_copy(temp);
-#ifdef UNICHAR_16
- GDrawAddSelectionType(st->g.base,sel,"text/plain;charset=ISO-10646-UCS-2",temp,u_strlen(temp),
- sizeof(unichar_t),
- NULL,NULL);
-#else
GDrawAddSelectionType(st->g.base,sel,"text/plain;charset=ISO-10646-UCS-4",temp,u_strlen(temp),
sizeof(unichar_t),
NULL,NULL);
@@ -450,7 +431,6 @@ static void SFTextAreaGrabSelection(SFTextArea *st, enum selnames sel ) {
GDrawAddSelectionType(st->g.base,sel,"text/plain;charset=ISO-10646-UCS-2",u2temp,u_strlen(temp),
2,
NULL,NULL);
-#endif
GDrawAddSelectionType(st->g.base,sel,"UTF8_STRING",ctemp,strlen(ctemp),sizeof(char),
NULL,NULL);
GDrawAddSelectionType(st->g.base,sel,"STRING",u2def_copy(temp),u_strlen(temp),sizeof(char),
@@ -545,19 +525,6 @@ static void SFTextAreaPaste(SFTextArea *st,enum selnames sel) {
SFTextArea_Replace(st,temp);
free(ctemp); free(temp);
}
-#ifdef UNICHAR_16
- } else if ( GDrawSelectionHasType(st->g.base,sel,"Unicode") ||
- GDrawSelectionHasType(st->g.base,sel,"text/plain;charset=ISO-10646-UCS-2")) {
- unichar_t *temp;
- int32 len;
- temp = GDrawRequestSelection(st->g.base,sel,"Unicode",&len);
- if ( temp==NULL || len==0 )
- temp = GDrawRequestSelection(st->g.base,sel,"text/plain;charset=ISO-10646-UCS-2",&len);
- /* Bug! I don't handle byte reversed selections. But I don't think there should be any anyway... */
- if ( temp!=NULL )
- SFTextArea_Replace(st,temp[0]==0xfeff?temp+1:temp);
- free(temp);
-#else
} else if ( GDrawSelectionHasType(st->g.base,sel,"text/plain;charset=ISO-10646-UCS-4")) {
unichar_t *temp;
int32 len;
@@ -584,7 +551,6 @@ static void SFTextAreaPaste(SFTextArea *st,enum selnames sel) {
free(temp);
}
free(temp2);
-#endif
} else if ( GDrawSelectionHasType(st->g.base,sel,"STRING")) {
unichar_t *temp; char *ctemp;
int32 len;
View
9 fontforge/stamp.c
@@ -1,5 +1,8 @@
+/* This file was generated using stamper.c to create the next version release. */
+/* If you need to update this to the next release version, see fontforge/GNUmakefile.in */
+
#include <time.h>
-const time_t source_modtime = 1346784630L;
-const char *source_modtime_str = "18:50 GMT 4-Sep-2012";
-const char *source_version_str = "20120904";
+const time_t source_modtime = 1346896085L; /* Seconds since 1970 (standard unix time) */
+const char *source_modtime_str = "01:48 GMT 6-Sep-2012";
+const char *source_version_str = "20120906"; /* Year, month, day */
View
14 fontforge/stamper.c
@@ -1,23 +1,33 @@
+/*
+ * This program is used to create a 'release date' time stamp when it is time for the
+ * next fontforge release build. See fontforge/GNUmakefile.in
+ */
#include <stdio.h>
#include <time.h>
static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
"Aug", "Sep", "Oct", "Nov", "Dec", NULL };
+
int main( int argc, char **argv ) {
time_t now;
struct tm *tm;
time(&now);
tm = gmtime(&now);
+ /* Let the user or developer know that this resulting output is generated rather than edited */
+ printf( "/* This file was generated using stamper.c to create the next version release. */\n" );
+ printf( "/* If you need to update this to the next release version, see fontforge/GNUmakefile.in */\n\n" );
if ( argc==1 ) {
+ /* Generate a *.c type output if there is some variable on the command line */
printf( "#include <time.h>\n\n" );
- printf( "const time_t source_modtime = %ldL;\n", now);
+ printf( "const time_t source_modtime = %ldL;\t/* Seconds since 1970 (standard unix time) */\n", now);
printf( "const char *source_modtime_str = \"%02d:%02d GMT %d-%s-%d\";\n",
tm->tm_hour, tm->tm_min,
tm->tm_mday, months[tm->tm_mon], tm->tm_year+1900 );
- printf( "const char *source_version_str = \"%04d%02d%02d\";\n",
+ printf( "const char *source_version_str = \"%04d%02d%02d\";\t/* Year, month, day */\n",
tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday );
} else {
+ /* Generate a #define type output if there is no argument on the command line */
printf( "#define LibFF_ModTime\t\t%ldL\t/* Seconds since 1970 (standard unix time) */\n", now);
printf( "#define LibFF_ModTime_Str\t\"%02d:%02d GMT %d-%s-%d\"\n",
tm->tm_hour, tm->tm_min,
View
12 fontforge/svg.c
@@ -3042,11 +3042,7 @@ static SplineChar *SVGParseGlyphArgs(xmlNodePtr glyph,int defh, int defv,
orientation = _xmlGetProp(glyph,(xmlChar *) "orientation");
if ( unicode!=NULL ) {
-#ifdef UNICHAR_16
- u = utf82u32_copy((char *) unicode);
-#else
u = utf82u_copy((char *) unicode);
-#endif
_xmlFree(unicode);
if ( u[1]=='\0' ) {
sc->unicodeenc = u[0];
@@ -3116,11 +3112,7 @@ static void SVGLigatureFixupCheck(SplineChar *sc,xmlNodePtr glyph) {
unicode = _xmlGetProp(glyph,(xmlChar *) "unicode");
if ( unicode!=NULL ) {
-#ifdef UNICHAR_16
- u = utf82u32_copy((char *) unicode);
-#else
u = utf82u_copy((char *) unicode);
-#endif
_xmlFree(unicode);
if ( u[1]!='\0' && u[2]=='\0' &&
((u[1]>=0x180B && u[1]<=0x180D) || /* Mongolian VS */
@@ -3202,11 +3194,7 @@ static char *SVGGetNames(SplineFont *sf,xmlChar *g,xmlChar *utf8,SplineChar **sc
*sc = NULL;
len = 0;
if ( utf8!=NULL ) {
-#ifdef UNICHAR_16
- u = utf82u32_copy((char *) utf8);
-#else
u = utf82u_copy((char *) utf8);
-#endif
for ( i=0; u[i]!=0; ++i ) {
temp = SFGetChar(sf,u[i],NULL);
if ( temp!=NULL ) {
View
123 gdraw/gdrawtxt.c
@@ -1962,7 +1962,6 @@ return( _GXCDraw_DoText(gw,x,y,text,cnt,mods,col,drawit,arg));
#endif
while ( text<end ) {
-#ifndef UNICHAR_16
if ( *text>=0x1f0000 ) {
/* Not a valid Unicode character */
++text;
@@ -2002,7 +2001,6 @@ return( dist );
return( dist );
continue;
}
-#endif
if ( mods->has_charset ) {
enc = mods->charset;
next = end;
@@ -2085,65 +2083,31 @@ return( dist );
int32 GDrawDrawText(GWindow gw, int32 x, int32 y,
const unichar_t *text, int32 cnt, FontMods *mods, Color col) {
- struct tf_arg arg;
- memset(&arg,'\0',sizeof(arg));
-return( _GDraw_DoText(gw,x,y,(unichar_t *) text,cnt,mods,col,tf_drawit,&arg));
+return( GDrawDrawBiText(gw, x, y, text, cnt, mods, col) );
}
int32 GDrawGetTextWidth(GWindow gw,const unichar_t *text, int32 cnt, FontMods *mods) {
- struct tf_arg arg;
- memset(&arg,'\0',sizeof(arg));
-return( _GDraw_DoText(gw,0,0,(unichar_t *) text,cnt,mods,0,tf_width,&arg));
+return( GDrawGetBiTextWidth(gw, text, cnt, cnt, mods) );
}
int32 GDrawGetTextBounds(GWindow gw,const unichar_t *text, int32 cnt, FontMods *mods,
GTextBounds *size) {
- struct tf_arg arg;
- int width;
- memset(&arg,'\0',sizeof(arg));
- arg.first = true;
- width = _GDraw_DoText(gw,0,0,(unichar_t *) text,cnt,mods,0,tf_rect,&arg);
- *size = arg.size;
-return( width );
+return( GDrawGetBiTextBounds(gw, text, cnt, mods, size) );
}
int32 GDrawGetTextPtFromPos(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods,
int32 maxwidth, unichar_t **end) {
- struct tf_arg arg;
- int width;
- memset(&arg,'\0',sizeof(arg));
- arg.maxwidth = maxwidth;
- width = _GDraw_DoText(gw,0,0,(unichar_t *) text,cnt,mods,0,tf_stopat,&arg);
- if ( arg.last==NULL )
- arg.last = text + (cnt==-1?u_strlen(text):cnt);
- *end = arg.last;
-return( width );
+return( GDrawGetBiTextPtFromPos(gw, text, cnt, mods, maxwidth, end) );
}
int32 GDrawGetTextPtBeforePos(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods,
int32 maxwidth, unichar_t **end) {
- struct tf_arg arg;
- int width;
- memset(&arg,'\0',sizeof(arg));
- arg.maxwidth = maxwidth;
- width = _GDraw_DoText(gw,0,0,(unichar_t *) text,cnt,mods,0,tf_stopbefore,&arg);
- if ( arg.last==NULL )
- arg.last = text + (cnt==-1?u_strlen(text):cnt);
- *end = arg.last;
-return( width );
+return( GDrawGetBiTextPtBeforePos(gw, text, cnt, mods, maxwidth, end) );
}
int32 GDrawGetTextPtAfterPos(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods,
int32 maxwidth, unichar_t **end) {
- struct tf_arg arg;
- int width;
- memset(&arg,'\0',sizeof(arg));
- arg.maxwidth = maxwidth;
- width = _GDraw_DoText(gw,0,0,(unichar_t *) text,cnt,mods,0,tf_stopafter,&arg);
- if ( arg.last==NULL )
- arg.last = text + (cnt==-1?u_strlen(text):cnt);
- *end = arg.last;
-return( width );
+return( GDrawGetBiTextPtAfterPos(gw, text, cnt, mods, maxwidth, end) );
}
/* UTF8 routines */
@@ -2154,12 +2118,6 @@ static int32 _GDraw_DoText8(GWindow gw, int32 x, int32 y,
const char *end = text+(cnt<0?strlen(text):cnt);
int32 dist = 0;
const char *start;
-#ifdef UNICHAR_16
- const char *last;
- struct font_data *fd;
- GDisplay *disp = gw->display;
- int enc;
-#endif
int i;
struct font_instance *fi = gw->ggc->fi;
unichar_t ubuffer[200], *upt;
@@ -2175,58 +2133,6 @@ return( 0 );
return( _GXCDraw_DoText8(gw,x,y,text,cnt,mods,col,drawit,arg));
#endif
-#ifdef UNICHAR_16
- forever {
- if ( text>=end )
- break;
- start = text;
- last = text;
- val = utf8_ildb(&text);
- if ( val<=0xffff ) {
- upt = ubuffer;
- while ( val<=0xffff && text<=end &&
- upt<ubuffer+sizeof(ubuffer)/sizeof(ubuffer[0])) {
- *upt++ = val;
- last = text;
- val = utf8_ildb(&text);
- }
- text = last;
- dist += _GDraw_DoText(gw,x+dist,y,ubuffer,upt-ubuffer,mods,col,drawit,arg);
- } else if ( val!=(uint32) -1 ) {
- int plane = (val>>16);
- upt = ubuffer;
- while ( (val>>16)==plane && text<=end &&
- upt<ubuffer+sizeof(ubuffer)/sizeof(ubuffer[0])) {
- *upt++ = val&0xffff;
- last = text;
- val = utf8_ildb(&text);
- }
- text = last;
- /* the "encoding" we want to use is "unicodeplane-plane" which is */
- /* em_uplane+plane */
- enc = em_uplane0 + plane;
- fd = fi->fonts[enc];
-
- if ( fd!=NULL && fd->info==NULL )
- _loadFontMetrics(disp,fd,fi);
- if ( fd!=NULL )
- dist += _GDraw_Transform(gw,fd,NULL,enc,x+dist,y,ubuffer,upt,mods,col,drawit,arg);
- if ( drawit==tf_rect ) {
- arg->size.rbearing += dist;
- arg->size.width = dist;
- }
- }
- if ( drawit>=tf_stopat && arg->width>=arg->maxwidth ) {
- if ( arg->last!=upt ) {
- text = start;
- for ( i = arg->last-ubuffer; i>0 ; --i )
- utf8_ildb(&text);
- }
- arg->utf8_last = (char *) text;
-return( dist );
- }
- }
-#else
forever {
if ( text>=end )
break;
@@ -2250,32 +2156,21 @@ return( dist );
return( dist );
}
}
-#endif
return( dist );
}
int32 GDrawDrawText8(GWindow gw, int32 x, int32 y,
const char *text, int32 cnt, FontMods *mods, Color col) {
- struct tf_arg arg;
- memset(&arg,'\0',sizeof(arg));
-return( _GDraw_DoText8(gw,x,y,text,cnt,mods,col,tf_drawit,&arg));
+return( GDrawDrawBiText8(gw, x, y, text, cnt, mods, col) );
}
int32 GDrawGetText8Width(GWindow gw,const char *text, int32 cnt, FontMods *mods) {
- struct tf_arg arg;
- memset(&arg,'\0',sizeof(arg));
-return( _GDraw_DoText8(gw,0,0, text,cnt,mods,0,tf_width,&arg));
+return( GDrawGetBiText8Width(gw, text, cnt, cnt, mods) );
}
int32 GDrawGetText8Bounds(GWindow gw,char *text, int32 cnt, FontMods *mods,
GTextBounds *size) {
- struct tf_arg arg;
- int width;
- memset(&arg,'\0',sizeof(arg));
- arg.first = true;
- width = _GDraw_DoText8(gw,0,0,text,cnt,mods,0,tf_rect,&arg);
- *size = arg.size;
-return( width );
+return( GDrawGetBiText8Bounds(gw, text, cnt, mods, size) );
}
int32 GDrawGetText8PtFromPos(GWindow gw,char *text, int32 cnt, FontMods *mods,
View
34 gdraw/gtextfield.c
@@ -735,15 +735,9 @@ static void GTextFieldGrabPrimarySelection(GTextField *gt) {
GDrawGrabSelection(gt->g.base,sn_primary);
gt->sel_start = ss; gt->sel_end = se;
-#ifdef UNICHAR_16
- GDrawAddSelectionType(gt->g.base,sn_primary,"text/plain;charset=ISO-10646-UCS-2",gt,gt->sel_end-gt->sel_start,
- sizeof(unichar_t),
- genunicodedata,noop);
-#else
GDrawAddSelectionType(gt->g.base,sn_primary,"text/plain;charset=ISO-10646-UCS-4",gt,gt->sel_end-gt->sel_start,
sizeof(unichar_t),
genunicodedata,noop);
-#endif
GDrawAddSelectionType(gt->g.base,sn_primary,"UTF8_STRING",gt,gt->sel_end-gt->sel_start,
sizeof(char),
genutf8data,noop);
@@ -758,15 +752,9 @@ static void GTextFieldGrabPrimarySelection(GTextField *gt) {
static void GTextFieldGrabDDSelection(GTextField *gt) {
GDrawGrabSelection(gt->g.base,sn_drag_and_drop);
-#ifdef UNICHAR_16
- GDrawAddSelectionType(gt->g.base,sn_drag_and_drop,"text/plain;charset=ISO-10646-UCS-2",gt,gt->sel_end-gt->sel_start,
- sizeof(unichar_t),
- ddgenunicodedata,noop);
-#else
GDrawAddSelectionType(gt->g.base,sn_drag_and_drop,"text/plain;charset=ISO-10646-UCS-4",gt,gt->sel_end-gt->sel_start,
sizeof(unichar_t),
ddgenunicodedata,noop);
-#endif
GDrawAddSelectionType(gt->g.base,sn_drag_and_drop,"STRING",gt,gt->sel_end-gt->sel_start,sizeof(char),
ddgenlocaldata,noop);
}
@@ -776,22 +764,15 @@ static void GTextFieldGrabSelection(GTextField *gt, enum selnames sel ) {
if ( gt->sel_start!=gt->sel_end ) {
unichar_t *temp;
char *ctemp, *ctemp2;
-#ifndef UNICHAR_16
int i;
uint16 *u2temp;
-#endif
GDrawGrabSelection(gt->g.base,sel);
temp = galloc((gt->sel_end-gt->sel_start + 2)*sizeof(unichar_t));
temp[0] = 0xfeff; /* KDE expects a byte order flag */
u_strncpy(temp+1,gt->text+gt->sel_start,gt->sel_end-gt->sel_start);
ctemp = u2utf8_copy(temp+1);
ctemp2 = u2def_copy(temp+1);
-#ifdef UNICHAR_16
- GDrawAddSelectionType(gt->g.base,sel,"text/plain;charset=ISO-10646-UCS-2",temp,u_strlen(temp),
- sizeof(unichar_t),
- NULL,NULL);
-#else
GDrawAddSelectionType(gt->g.base,sel,"text/plain;charset=ISO-10646-UCS-4",temp,u_strlen(temp),
sizeof(unichar_t),
NULL,NULL);
@@ -802,7 +783,6 @@ static void GTextFieldGrabSelection(GTextField *gt, enum selnames sel ) {
GDrawAddSelectionType(gt->g.base,sel,"text/plain;charset=ISO-10646-UCS-2",u2temp,u_strlen(temp),
2,
NULL,NULL);
-#endif
GDrawAddSelectionType(gt->g.base,sel,"UTF8_STRING",copy(ctemp),strlen(ctemp),
sizeof(char),
NULL,NULL);
@@ -915,19 +895,6 @@ static void GTextFieldPaste(GTextField *gt,enum selnames sel) {
GTextField_Replace(gt,temp);
free(ctemp); free(temp);
}
-#ifdef UNICHAR_16
- } else if ( GDrawSelectionHasType(gt->g.base,sel,"Unicode") ||
- GDrawSelectionHasType(gt->g.base,sel,"text/plain;charset=ISO-10646-UCS-2")) {
- unichar_t *temp;
- int32 len;
- temp = GDrawRequestSelection(gt->g.base,sel,"Unicode",&len);
- if ( temp==NULL || len==0 )
- temp = GDrawRequestSelection(gt->g.base,sel,"text/plain;charset=ISO-10646-UCS-2",&len);
- /* Bug! I don't handle byte reversed selections. But I don't think there should be any anyway... */
- if ( temp!=NULL )
- GTextField_Replace(gt,temp[0]==0xfeff?temp+1:temp);
- free(temp);
-#else
/* Bug in the xorg library on 64 bit machines and 32 bit transfers don't work */
/* so avoid them, by looking for utf8 first */
} else if ( GDrawSelectionHasType(gt->g.base,sel,"text/plain;charset=ISO-10646-UCS-4")) {
@@ -956,7 +923,6 @@ static void GTextFieldPaste(GTextField *gt,enum selnames sel) {
free(temp);
}
free(temp2);
-#endif
} else if ( GDrawSelectionHasType(gt->g.base,sel,"STRING")) {
unichar_t *temp; char *ctemp;
int32 len;
View
4 gdraw/gxdraw.c
@@ -4644,10 +4644,8 @@ static void *GXDrawRequestSelection(GWindow w,enum selnames sn, char *typename,
memcpy(temp,sd->data,bytelen);
temp[bytelen] = '\0';
temp[bytelen+1] = '\0';
-#ifndef UNICHAR_16
temp[bytelen+2] = '\0';
temp[bytelen+3] = '\0';
-#endif
*len = bytelen;
}
return( temp );
@@ -4677,10 +4675,8 @@ return( NULL );
memcpy(temp,prop,bytelen);
temp[bytelen]='\0';
temp[bytelen+1]='\0'; /* Nul terminate unicode strings too */
-#ifndef UNICHAR_16
temp[bytelen+2] = '\0';
temp[bytelen+3] = '\0';
-#endif
if ( len!=NULL )
*len = bytelen;
XFree(prop);
View
4 inc/basics.h
@@ -55,11 +55,7 @@ typedef uint8_t uint8;
/* An integral type which can hold a pointer */
typedef intptr_t intpt;
-#ifdef UNICHAR_16
-typedef uint16 unichar_t;
-#else
typedef uint32 unichar_t;
-#endif
/* A macro to mark unused function parameters with. We often
* have such parameters, because of extensive use of callbacks.
View
8 inc/ustring.h
@@ -85,15 +85,7 @@ extern char *strstartmatch(const char *initial,const char *full);
extern unichar_t *u_strstartmatch(const unichar_t *initial, const unichar_t *full);
extern unichar_t *cu_strstartmatch(const char *initial, const unichar_t *full);
-#ifdef UNICHAR_16
-extern uint32 *utf82u32_strncpy(int32 *ubuf,const char *utf8buf,int len);
-extern uint32 *utf82u32_copy(const char *utf8buf);
-extern char *u322utf8_copy(const uint32 *ubuf);
-extern char *u322utf8_strncpy(char *utf8buf, const uint32 *ubuf,int len);
-#else
-/* Make sure we have different entry points in the library */
#define utf82u_strncpy utf82U_strncpy
-#endif
extern int32 utf8_ildb(const char **utf8_text);
extern char *utf8_idpb(char *utf8_text,uint32 ch);
extern char *utf8_db(char *utf8_text);
View
2 pyhook/configure.ac
@@ -50,10 +50,10 @@ LT_INIT([dlopen])
# Checks for programs.
AC_PROG_AWK
AC_PROG_CC
+AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_CXX
-AC_PROG_OBJC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET

0 comments on commit 9d2198d

Please sign in to comment.
Something went wrong with that request. Please try again.