Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 9d2198d5ddadfe0001f7542871a52c87e64f0268 2 parents 5a11aa4 + e29a41c
Barry Schwartz authored
3  .gitignore
@@ -5,8 +5,9 @@ fontforge/fontforge
5 5 fontforge/fontimage
6 6 fontforge/fontlint
7 7 fontforge/libstamp.c
8   -fontforge.pc
9 8 fontforge/sfddiff
  9 +fontforge/stamper
  10 +fontforge.pc
10 11 inc/config.h
11 12 libtool
12 13 Makefile
17 Unicode/ArabicForms.c
@@ -3,7 +3,8 @@
3 3 /* This file was generated using the program 'makeutype' */
4 4
5 5 struct arabicforms ArabicForms[] = {
6   - { 0x0600, 0x0600, 0x0600, 0x0600, 0, 0, 0 },
  6 + /* initial, medial, final, isolated, isletter, joindual, required_lig_with_alef */
  7 + { 0x0600, 0x0600, 0x0600, 0x0600, 0, 0, 0 }, /* 0x0600 */
7 8 { 0x0601, 0x0601, 0x0601, 0x0601, 0, 0, 0 },
8 9 { 0x0602, 0x0602, 0x0602, 0x0602, 0, 0, 0 },
9 10 { 0x0603, 0x0603, 0x0603, 0x0603, 0, 0, 0 },
@@ -35,7 +36,7 @@ struct arabicforms ArabicForms[] = {
35 36 { 0x0000, 0x0000, 0x0000, 0x0000, 0, 0, 0 },
36 37 { 0x061e, 0x061e, 0x061e, 0x061e, 0, 0, 0 },
37 38 { 0x061f, 0x061f, 0x061f, 0x061f, 0, 0, 0 },
38   - { 0x0620, 0x0620, 0x0620, 0x0620, 1, 0, 0 },
  39 + { 0x0620, 0x0620, 0x0620, 0x0620, 1, 0, 0 }, /* 0x0620 */
39 40 { 0x0621, 0x0621, 0x0621, 0xfe80, 1, 0, 0 },
40 41 { 0x0622, 0x0622, 0xfe82, 0xfe81, 1, 0, 0 },
41 42 { 0x0623, 0x0623, 0xfe84, 0xfe83, 1, 0, 0 },
@@ -67,7 +68,7 @@ struct arabicforms ArabicForms[] = {
67 68 { 0x063d, 0x063d, 0x063d, 0x063d, 1, 0, 0 },
68 69 { 0x063e, 0x063e, 0x063e, 0x063e, 1, 0, 0 },
69 70 { 0x063f, 0x063f, 0x063f, 0x063f, 1, 0, 0 },
70   - { 0x0640, 0x0640, 0x0640, 0x0640, 0, 0, 0 },
  71 + { 0x0640, 0x0640, 0x0640, 0x0640, 0, 0, 0 }, /* 0x0640 */
71 72 { 0xfed3, 0xfed4, 0xfed2, 0xfed1, 1, 1, 0 },
72 73 { 0xfed7, 0xfed8, 0xfed6, 0xfed5, 1, 1, 0 },
73 74 { 0xfedb, 0xfedc, 0xfeda, 0xfed9, 1, 1, 0 },
@@ -99,7 +100,7 @@ struct arabicforms ArabicForms[] = {
99 100 { 0x065d, 0x065d, 0x065d, 0x065d, 0, 0, 0 },
100 101 { 0x065e, 0x065e, 0x065e, 0x065e, 0, 0, 0 },
101 102 { 0x065f, 0x065f, 0x065f, 0x065f, 0, 0, 0 },
102   - { 0x0660, 0x0660, 0x0660, 0x0660, 0, 0, 0 },
  103 + { 0x0660, 0x0660, 0x0660, 0x0660, 0, 0, 0 }, /* 0x0660 */
103 104 { 0x0661, 0x0661, 0x0661, 0x0661, 0, 0, 0 },
104 105 { 0x0662, 0x0662, 0x0662, 0x0662, 0, 0, 0 },
105 106 { 0x0663, 0x0663, 0x0663, 0x0663, 0, 0, 0 },
@@ -131,7 +132,7 @@ struct arabicforms ArabicForms[] = {
131 132 { 0x067d, 0x067d, 0x067d, 0x067d, 1, 0, 0 },
132 133 { 0xfb58, 0xfb59, 0xfb57, 0xfb56, 1, 1, 0 },
133 134 { 0xfb64, 0xfb65, 0xfb63, 0xfb62, 1, 1, 0 },
134   - { 0xfb5c, 0xfb5d, 0xfb5b, 0xfb5a, 1, 1, 0 },
  135 + { 0xfb5c, 0xfb5d, 0xfb5b, 0xfb5a, 1, 1, 0 }, /* 0x0680 */
135 136 { 0x0681, 0x0681, 0x0681, 0x0681, 1, 0, 0 },
136 137 { 0x0682, 0x0682, 0x0682, 0x0682, 1, 0, 0 },
137 138 { 0xfb78, 0xfb79, 0xfb77, 0xfb76, 1, 1, 0 },
@@ -163,7 +164,7 @@ struct arabicforms ArabicForms[] = {
163 164 { 0x069d, 0x069d, 0x069d, 0x069d, 1, 0, 0 },
164 165 { 0x069e, 0x069e, 0x069e, 0x069e, 1, 0, 0 },
165 166 { 0x069f, 0x069f, 0x069f, 0x069f, 1, 0, 0 },
166   - { 0x06a0, 0x06a0, 0x06a0, 0x06a0, 1, 0, 0 },
  167 + { 0x06a0, 0x06a0, 0x06a0, 0x06a0, 1, 0, 0 }, /* 0x06a0 */
167 168 { 0x06a1, 0x06a1, 0x06a1, 0x06a1, 1, 0, 0 },
168 169 { 0x06a2, 0x06a2, 0x06a2, 0x06a2, 1, 0, 0 },
169 170 { 0x06a3, 0x06a3, 0x06a3, 0x06a3, 1, 0, 0 },
@@ -195,7 +196,7 @@ struct arabicforms ArabicForms[] = {
195 196 { 0x06bd, 0x06bd, 0x06bd, 0x06bd, 1, 0, 0 },
196 197 { 0xfbac, 0xfbad, 0xfbab, 0xfbaa, 1, 1, 0 },
197 198 { 0x06bf, 0x06bf, 0x06bf, 0x06bf, 1, 0, 0 },
198   - { 0x06c0, 0x06c0, 0xfba5, 0xfba4, 1, 0, 0 },
  199 + { 0x06c0, 0x06c0, 0xfba5, 0xfba4, 1, 0, 0 }, /* 0x06c0 */
199 200 { 0xfba8, 0xfba9, 0xfba7, 0xfba6, 1, 1, 0 },
200 201 { 0x06c2, 0x06c2, 0x06c2, 0x06c2, 1, 0, 0 },
201 202 { 0x06c3, 0x06c3, 0x06c3, 0x06c3, 1, 0, 0 },
@@ -227,7 +228,7 @@ struct arabicforms ArabicForms[] = {
227 228 { 0x06dd, 0x06dd, 0x06dd, 0x06dd, 0, 0, 0 },
228 229 { 0x06de, 0x06de, 0x06de, 0x06de, 0, 0, 0 },
229 230 { 0x06df, 0x06df, 0x06df, 0x06df, 0, 0, 0 },
230   - { 0x06e0, 0x06e0, 0x06e0, 0x06e0, 0, 0, 0 },
  231 + { 0x06e0, 0x06e0, 0x06e0, 0x06e0, 0, 0, 0 }, /* 0x06e0 */
231 232 { 0x06e1, 0x06e1, 0x06e1, 0x06e1, 0, 0, 0 },
232 233 { 0x06e2, 0x06e2, 0x06e2, 0x06e2, 0, 0, 0 },
233 234 { 0x06e3, 0x06e3, 0x06e3, 0x06e3, 0, 0, 0 },
6 Unicode/gwwiconv.c
@@ -143,15 +143,9 @@ gww_iconv_t gww_iconv_open(const char *toenc,const char *fromenc) {
143 143 if ( stuff.from==(enum encoding) -1 || stuff.to==(enum encoding) -1 ) {
144 144 /*fprintf( stderr, "Unknown encoding\n" );*/
145 145 return( (iconv_t)(-1) );
146   -#ifdef UNICHAR_16
147   - } else if ( stuff.from!=e_unicode && stuff.to!=e_unicode ) {
148   - fprintf( stderr, "Bad call to gww_iconv_open, neither arg is UCS2\n" );
149   -return( (iconv_t)(-1) );
150   -#else
151 146 } else if ( stuff.from!=e_ucs4 && stuff.to!=e_ucs4 ) {
152 147 fprintf( stderr, "Bad call to gww_iconv_open, neither arg is UCS4\n" );
153 148 return( (iconv_t)(-1) );
154   -#endif
155 149 }
156 150
157 151 ret = galloc(sizeof(struct gww_iconv_t));
81 Unicode/makeutype.c
@@ -621,11 +621,18 @@ static void dumparabicdata(FILE *header) {
621 621 fprintf( data, GeneratedFileMessage );
622 622
623 623 fprintf( data, "struct arabicforms ArabicForms[] = {\n" );
  624 + fprintf( data, "\t/* initial, medial, final, isolated, isletter, joindual, required_lig_with_alef */\n");
624 625 for ( i=0; i<256; ++i ) {
625   - fprintf( data, "\t{ 0x%04x, 0x%04x, 0x%04x, 0x%04x, %d, %d, %d }%s\n",
  626 + fprintf( data, "\t{ 0x%04x, 0x%04x, 0x%04x, 0x%04x, %d, %d, %d }",
626 627 forms[i].initial, forms[i].medial, forms[i].final, forms[i].isolated,
627   - forms[i].isletter, forms[i].joindual, forms[i].required_lig_with_alef,
628   - i==255?"":",");
  628 + forms[i].isletter, forms[i].joindual, forms[i].required_lig_with_alef);
  629 + if ( i==255 )
  630 + fprintf( data, "\n");
  631 + else
  632 + if ( (i & 31)==0 )
  633 + fprintf( data, ",\t/* 0x%04x */\n",0x600+i);
  634 + else
  635 + fprintf( data, ",\n");
629 636 }
630 637 fprintf( data, "};\n" );
631 638 fclose( data );
@@ -786,86 +793,118 @@ static void dump() {
786 793
787 794 fprintf( data, "#include \"utype.h\"\n" );
788 795 fprintf( data, GeneratedFileMessage );
789   - fprintf( data, "const unsigned short ____tolower[]= { 0,\n " );
  796 + fprintf( data, "const unsigned short ____tolower[]= { 0,\n" );
790 797 for ( i=0; i<MAXC; i+=j ) {
  798 + fprintf( data, " " );
791 799 for ( j=0; j<8 && i+j<MAXC-1; ++j )
792 800 fprintf(data, " 0x%04x,", mytolower[i+j]);
793 801 if ( i+j==MAXC-1 ) {
794 802 fprintf(data, " 0x%04x\n};\n\n", mytolower[i+j]);
795 803 break;
796 804 } else
797   - fprintf( data, "\n ");
  805 + if ( (i & 63)==0 )
  806 + fprintf( data, "\t/* 0x%04x */\n",i);
  807 + else
  808 + fprintf( data, "\n");
798 809 }
799   - fprintf( data, "const unsigned short ____toupper[] = { 0,\n " );
  810 + fprintf( data, "const unsigned short ____toupper[] = { 0,\n" );
800 811 for ( i=0; i<MAXC; i+=j ) {
  812 + fprintf( data, " " );
801 813 for ( j=0; j<8 && i+j<MAXC-1; ++j )
802 814 fprintf(data, " 0x%04x,", mytoupper[i+j]);
803 815 if ( i+j==MAXC-1 ) {
804 816 fprintf(data, " 0x%04x\n};\n\n", mytoupper[i+j]);
805 817 break;
806 818 } else
807   - fprintf( data, "\n ");
  819 + if ( (i & 63)==0 )
  820 + fprintf( data, "\t/* 0x%04x */\n",i);
  821 + else
  822 + fprintf( data, "\n");
808 823 }
809   - fprintf( data, "const unsigned short ____totitle[] = { 0,\n " );
  824 + fprintf( data, "const unsigned short ____totitle[] = { 0,\n" );
810 825 for ( i=0; i<MAXC; i+=j ) {
  826 + fprintf( data, " " );
811 827 for ( j=0; j<8 && i+j<MAXC-1; ++j )
812 828 fprintf(data, " 0x%04x,", mytotitle[i+j]);
813 829 if ( i+j==MAXC-1 ) {
814 830 fprintf(data, " 0x%04x\n};\n\n", mytotitle[i+j]);
815 831 break;
816 832 } else
817   - fprintf( data, "\n ");
  833 + if ( (i & 63)==0 )
  834 + fprintf( data, "\t/* 0x%04x */\n",i);
  835 + else
  836 + fprintf( data, "\n");
818 837 }
819   - fprintf( data, "const unsigned short ____tomirror[] = { 0,\n " );
  838 + fprintf( data, "const unsigned short ____tomirror[] = { 0,\n" );
820 839 for ( i=0; i<MAXC; i+=j ) {
  840 + fprintf( data, " " );
821 841 for ( j=0; j<8 && i+j<MAXC-1; ++j )
822 842 fprintf(data, " 0x%04x,", mymirror[i+j]);
823 843 if ( i+j==MAXC-1 ) {
824 844 fprintf(data, " 0x%04x\n};\n\n", mymirror[i+j]);
825 845 break;
826 846 } else
827   - fprintf( data, "\n ");
  847 + if ( (i & 63)==0 )
  848 + fprintf( data, "\t/* 0x%04x */\n",i);
  849 + else
  850 + fprintf( data, "\n");
828 851 }
829   - fprintf( data, "const unsigned char ____digitval[] = { 0,\n " );
  852 + fprintf( data, "const unsigned char ____digitval[] = { 0,\n" );
830 853 for ( i=0; i<MAXC; i+=j ) {
  854 + fprintf( data, " " );
831 855 for ( j=0; j<8 && i+j<MAXC-1; ++j )
832 856 fprintf(data, " 0x%02x,", mynumericvalue[i+j]);
833 857 if ( i+j==MAXC-1 ) {
834 858 fprintf(data, " 0x%02x\n};\n\n", mynumericvalue[i+j]);
835 859 break;
836 860 } else
837   - fprintf( data, "\n ");
  861 + if ( (i & 63)==0 )
  862 + fprintf( data, "\t/* 0x%04x */\n",i);
  863 + else
  864 + fprintf( data, "\n");
838 865 }
839   - fprintf( data, "const unsigned int ____utype[] = { 0,\n " );
  866 + fprintf( data, "const unsigned int ____utype[] = { 0,\n" );
840 867 for ( i=0; i<MAXC; i+=j ) {
  868 + fprintf( data, " " );
841 869 for ( j=0; j<8 && i+j<MAXC-1; ++j )
842 870 fprintf(data, " 0x%08x,", flags[i+j]);
843 871 if ( i+j==MAXC-1 ) {
844 872 fprintf(data, " 0x%08x\n};\n\n", flags[i+j]);
845 873 break;
846 874 } else
847   - fprintf( data, "\n ");
  875 + if ( (i & 63)==0 )
  876 + fprintf( data, "\t/* 0x%04x */\n",i);
  877 + else
  878 + fprintf( data, "\n");
848 879 }
849   - fprintf( data, "const unsigned int ____utype2[] = { 0,\n " );
  880 + fprintf( data, "const unsigned int ____utype2[] = { 0,\n" );
850 881 for ( i=0; i<MAXC; i+=j ) {
  882 + fprintf( data, " " );
851 883 for ( j=0; j<8 && i+j<MAXC-1; ++j )
852 884 fprintf(data, " 0x%08x,", flags2[i+j]);
853 885 if ( i+j==MAXC-1 ) {
854 886 fprintf(data, " 0x%08x\n};\n\n", flags2[i+j]);
855 887 break;
856 888 } else
857   - fprintf( data, "\n ");
  889 + if ( (i & 63)==0 )
  890 + fprintf( data, "\t/* 0x%04x */\n",i);
  891 + else
  892 + fprintf( data, "\n");
858 893 }
859 894
860   - fprintf( data, "const unsigned int ____codepointassigned[] = {\n " );
  895 + fprintf( data, "const unsigned int ____codepointassigned[] = {\n" );
861 896 for ( i=0; i<0x120000/32; i+=j ) {
  897 + fprintf( data, " " );
862 898 for ( j=0; j<8 && i+j<0x120000/32-1; ++j )
863 899 fprintf(data, " 0x%08x,", assignedcodepoints[i+j]);
864 900 if ( i+j==0x120000/32-1 ) {
865 901 fprintf(data, " 0x%08x\n};\n\n", assignedcodepoints[i+j]);
866 902 break;
867 903 } else
868   - fprintf( data, "\n ");
  904 + if ( (i & 63)==0 )
  905 + fprintf( data, "\t/* 0x%04x */\n",i);
  906 + else
  907 + fprintf( data, "\n");
869 908 }
870 909
871 910 fclose( data );
@@ -1782,8 +1821,8 @@ int main() {
1782 1821 /* so apply at a different level */
1783 1822 /* readcorpfile("ADOBE ", "AdobeCorporateuse.txt"); */
1784 1823 cheat(); /* over-ride with these mods after reading input files */
1785   - dump();
1786   - dump_alttable();
  1824 + dump(); /* create utype.h, utype.c and ArabicForms.c */
  1825 + dump_alttable(); /* create unialt.c */
1787 1826 FreeNamesMemorySpace(); /* cleanup alloc of memory */
1788 1827 return( 0 );
1789 1828 }
29 Unicode/ucharmap.c
@@ -336,12 +336,8 @@ return( u2encoding_strncpy(to,ufrom,n,e_iso8859_1));
336 336 } else if ( cs==e_unicode_backwards ) {
337 337 unichar_t *uto = (unichar_t *) to;
338 338 while ( *ufrom && n>sizeof(unichar_t)-1 ) {
339   -#ifdef UNICHAR_16
340   - unichar_t ch = (*ufrom>>8)|((*ufrom&0xff)<<8);
341   -#else
342 339 unichar_t ch = (*ufrom>>24)|((*ufrom>>8)&0xff00)|
343 340 ((*ufrom<<8)&0xff0000)|(*ufrom<<24);
344   -#endif
345 341 *uto++ = ch;
346 342 ++ufrom;
347 343 n-=sizeof(unichar_t);
@@ -396,30 +392,17 @@ return( to );
396 392 static char *old_local_name=NULL;
397 393 static iconv_t to_unicode=(iconv_t) (-1), from_unicode=(iconv_t) (-1);
398 394 static iconv_t to_utf8=(iconv_t) (-1), from_utf8=(iconv_t) (-1);
399   -#ifdef UNICHAR_16
400   -static char *names[] = { "UCS-2-INTERNAL", "UCS-2", "UCS2", "ISO-10646/UCS2", "UNICODE", NULL };
401   -static char *namesle[] = { "UCS-2LE", "UNICODELITTLE", NULL };
402   -static char *namesbe[] = { "UCS-2BE", "UNICODEBIG", NULL };
403   -#else
404 395 static char *names[] = { "UCS-4-INTERNAL", "UCS-4", "UCS4", "ISO-10646-UCS-4", "UTF-32", NULL };
405 396 static char *namesle[] = { "UCS-4LE", "UTF-32LE", NULL };
406 397 static char *namesbe[] = { "UCS-4BE", "UTF-32BE", NULL };
407   -#endif
408 398 static char *unicode_name = NULL;
409 399 static int byteswapped = false;
410 400
411 401 static int BytesNormal(iconv_t latin1_2_unicode) {
412   -#ifdef UNICHAR_16
413   - union {
414   - short s;
415   - char c[2];
416   - } u[8];
417   -#else
418 402 union {
419 403 int32 s;
420 404 char c[4];
421 405 } u[8];
422   -#endif
423 406 char *from = "A", *to = &u[0].c[0];
424 407 size_t in_left = 1, out_left = sizeof(u);
425 408 memset(u,0,sizeof(u));
@@ -509,10 +492,8 @@ unichar_t *def2u_strncpy(unichar_t *uto, const char *from, int n) {
509 492 iconv(to_unicode, (iconv_arg2_t) &from, &in_left, &cto, &out_left);
510 493 if ( cto<((char *) uto)+2*n) *cto++ = '\0';
511 494 if ( cto<((char *) uto)+2*n) *cto++ = '\0';
512   -#ifndef UNICHAR_16
513 495 if ( cto<((char *) uto)+4*n) *cto++ = '\0';
514 496 if ( cto<((char *) uto)+4*n) *cto++ = '\0';
515   -#endif
516 497 return( uto );
517 498 }
518 499 #endif
@@ -527,10 +508,8 @@ char *u2def_strncpy(char *to, const unichar_t *ufrom, int n) {
527 508 iconv(from_unicode, (iconv_arg2_t) &cfrom, &in_left, &cto, &out_left);
528 509 if ( cto<to+n ) *cto++ = '\0';
529 510 if ( cto<to+n ) *cto++ = '\0';
530   -#ifndef UNICHAR_16
531 511 if ( cto<to+n ) *cto++ = '\0';
532 512 if ( cto<to+n ) *cto++ = '\0';
533   -#endif
534 513 return( to );
535 514 }
536 515 #endif
@@ -552,10 +531,8 @@ return( NULL );
552 531 iconv(to_unicode, (iconv_arg2_t) &from, &in_left, &cto, &out_left);
553 532 *cto++ = '\0';
554 533 *cto++ = '\0';
555   -#ifndef UNICHAR_16
556 534 *cto++ = '\0';
557 535 *cto++ = '\0';
558   -#endif
559 536 return( uto );
560 537 }
561 538 #endif
@@ -582,10 +559,8 @@ return( NULL );
582 559 iconv(from_unicode, (iconv_arg2_t) &cfrom, &in_left, &cto, &out_left);
583 560 *cto++ = '\0';
584 561 *cto++ = '\0';
585   -#ifndef UNICHAR_16
586 562 *cto++ = '\0';
587 563 *cto++ = '\0';
588   -#endif
589 564 return( to );
590 565 }
591 566 #endif
@@ -621,10 +596,8 @@ return( NULL );
621 596 iconv(to_utf8, (iconv_arg2_t) &from, &in_left, &cto, &out_left);
622 597 *cto++ = '\0';
623 598 *cto++ = '\0';
624   -#ifndef UNICHAR_16
625 599 *cto++ = '\0';
626 600 *cto++ = '\0';
627   -#endif
628 601 return( cret );
629 602 }
630 603 #endif
@@ -656,10 +629,8 @@ return( NULL );
656 629 iconv(from_utf8, (iconv_arg2_t) &cfrom, &in_left, &cto, &out_left);
657 630 *cto++ = '\0';
658 631 *cto++ = '\0';
659   -#ifndef UNICHAR_16
660 632 *cto++ = '\0';
661 633 *cto++ = '\0';
662   -#endif
663 634 return( to );
664 635 }
665 636 #endif
119 Unicode/ustring.c
@@ -487,24 +487,12 @@ unichar_t *utf82u_strncpy(unichar_t *ubuf,const char *utf8buf,int len) {
487 487 } else if ( *pt<=0xef ) {
488 488 *upt = ((*pt&0xf)<<12) | ((pt[1]&0x3f)<<6) | (pt[2]&0x3f);
489 489 pt += 3;
490   -#ifdef UNICHAR_16
491   - } else if ( upt+1<uend ) {
492   - /* Um... I don't support surrogates */
493   - w = ( ((*pt&0x7)<<2) | ((pt[1]&0x30)>>4) )-1;
494   - *upt++ = 0xd800 | (w<<6) | ((pt[1]&0xf)<<2) | ((pt[2]&0x30)>>4);
495   - *upt = 0xdc00 | ((pt[2]&0xf)<<6) | (pt[3]&0x3f);
496   - pt += 4;
497   - } else {
498   - /* no space for surrogate */
499   - pt += 4;
500   -#else
501 490 } else {
502 491 w = ( ((*pt&0x7)<<2) | ((pt[1]&0x30)>>4) )-1;
503 492 w = (w<<6) | ((pt[1]&0xf)<<2) | ((pt[2]&0x30)>>4);
504 493 w2 = ((pt[2]&0xf)<<6) | (pt[3]&0x3f);
505 494 *upt = w*0x400 + w2 + 0x10000;
506 495 pt += 4;
507   -#endif
508 496 }
509 497 ++upt;
510 498 }
@@ -516,86 +504,6 @@ unichar_t *utf82u_strcpy(unichar_t *ubuf,const char *utf8buf) {
516 504 return( utf82u_strncpy(ubuf,utf8buf,strlen(utf8buf)+1));
517 505 }
518 506
519   -# ifdef UNICHAR_16
520   -uint32 *utf82u32_strncpy(uint32 *ubuf,const char *utf8buf,int len) {
521   - uint32 *upt=ubuf, *uend=ubuf+len-1;
522   - const uint8 *pt = (const uint8 *) utf8buf;
523   - int w, w2;
524   -
525   - while ( *pt!='\0' && upt<uend ) {
526   - if ( *pt<=127 )
527   - *upt = *pt++;
528   - else if ( *pt<=0xdf ) {
529   - *upt = ((*pt&0x1f)<<6) | (pt[1]&0x3f);
530   - pt += 2;
531   - } else if ( *pt<=0xef ) {
532   - *upt = ((*pt&0xf)<<12) | ((pt[1]&0x3f)<<6) | (pt[2]&0x3f);
533   - pt += 3;
534   - } else {
535   - w = ( ((*pt&0x7)<<2) | ((pt[1]&0x30)>>4) )-1;
536   - w = (w<<6) | ((pt[1]&0xf)<<2) | ((pt[2]&0x30)>>4);
537   - w2 = ((pt[2]&0xf)<<6) | (pt[3]&0x3f);
538   - *upt = w*0x400 + w2 + 0x10000;
539   - pt += 4;
540   - }
541   - ++upt;
542   - }
543   - *upt = '\0';
544   -return( ubuf );
545   -}
546   -
547   -char *u322utf8_strncpy(char *utf8buf, const uint32 *ubuf,int len) {
548   - uint8 *pt=(uint8 *) utf8buf, *end=(uint8 *) utf8buf+len-1;
549   - const uint32 *upt = ubuf;
550   -
551   - while ( *upt!='\0' && pt<end ) {
552   - if ( *upt<=127 )
553   - *pt++ = *upt;
554   - else if ( *upt<=0x7ff ) {
555   - if ( pt+1>=end )
556   - break;
557   - *pt++ = 0xc0 | (*upt>>6);
558   - *pt++ = 0x80 | (*upt&0x3f);
559   - } else if ( *upt<=0xffff ) {
560   - if ( pt+2>=end )
561   - break;
562   - *pt++ = 0xe0 | (*upt>>12);
563   - *pt++ = 0x80 | ((*upt>>6)&0x3f);
564   - *pt++ = 0x80 | (*upt&0x3f);
565   - } else {
566   - uint32 val = *upt-0x10000;
567   - int u = ((val&0xf0000)>>16)+1, z=(val&0x0f000)>>12, y=(val&0x00fc0)>>6, x=val&0x0003f;
568   - if ( pt+3>=end )
569   - break;
570   - *pt++ = 0xf0 | (u>>2);
571   - *pt++ = 0x80 | ((u&3)<<4) | z;
572   - *pt++ = 0x80 | y;
573   - *pt++ = 0x80 | x;
574   - }
575   - ++upt;
576   - }
577   - *pt = '\0';
578   -return( utf8buf );
579   -}
580   -
581   -char *u322utf8_copy(const uint32 *ubuf) {
582   - int i, len;
583   - char *buf;
584   -
585   - for ( i=len=0; ubuf[i]!=0; ++i )
586   - if ( ubuf[i]<0x80 )
587   - ++len;
588   - else if ( ubuf[i]<0x800 )
589   - len += 2;
590   - else if ( ubuf[i]<0x10000 )
591   - len += 3;
592   - else
593   - len += 4;
594   - buf = (char *) galloc(len+1);
595   -return( u322utf8_strncpy(buf,ubuf,len+1));
596   -}
597   -#endif
598   -
599 507 unichar_t *utf82u_copyn(const char *utf8buf,int len) {
600 508 unichar_t *ubuf = (unichar_t *) galloc((len+1)*sizeof(unichar_t));
601 509 return( utf82u_strncpy(ubuf,utf8buf,len+1));
@@ -617,20 +525,6 @@ void utf82u_strcat(unichar_t *to,const char *from) {
617 525 utf82u_strcpy(to+u_strlen(to),from);
618 526 }
619 527
620   -#ifdef UNICHAR_16
621   -uint32 *utf82u32_copy(const char *utf8buf) {
622   - int len;
623   - uint32 *ubuf;
624   -
625   - if ( utf8buf==NULL )
626   -return( NULL );
627   -
628   - len = strlen(utf8buf);
629   - ubuf = (uint32 *) galloc((len+1)*sizeof(uint32));
630   -return( utf82u32_strncpy(ubuf,utf8buf,len+1));
631   -}
632   -#endif
633   -
634 528 char *u2utf8_strcpy(char *utf8buf,const unichar_t *ubuf) {
635 529 char *pt = utf8buf;
636 530
@@ -640,18 +534,6 @@ char *u2utf8_strcpy(char *utf8buf,const unichar_t *ubuf) {
640 534 else if ( *ubuf<0x800 ) {
641 535 *pt++ = 0xc0 | (*ubuf>>6);
642 536 *pt++ = 0x80 | (*ubuf&0x3f);
643   -#ifdef UNICHAR_16
644   - } else if ( *ubuf>=0xd800 && *ubuf<0xdc00 && ubuf[1]>=0xdc00 && ubuf[1]<0xe000 ) {
645   - int u = ((*ubuf>>6)&0xf)+1, y = ((*ubuf&3)<<4) | ((ubuf[1]>>6)&0xf);
646   - *pt++ = 0xf0 | (u>>2);
647   - *pt++ = 0x80 | ((u&3)<<4) | ((*ubuf>>2)&0xf);
648   - *pt++ = 0x80 | y;
649   - *pt++ = 0x80 | (ubuf[1]&0x3f);
650   - } else {
651   - *pt++ = 0xe0 | (*ubuf>>12);
652   - *pt++ = 0x80 | ((*ubuf>>6)&0x3f);
653   - *pt++ = 0x80 | (*ubuf&0x3f);
654   -#else
655 537 } else if ( *ubuf < 0x10000 ) {
656 538 *pt++ = 0xe0 | (*ubuf>>12);
657 539 *pt++ = 0x80 | ((*ubuf>>6)&0x3f);
@@ -663,7 +545,6 @@ char *u2utf8_strcpy(char *utf8buf,const unichar_t *ubuf) {
663 545 *pt++ = 0x80 | ((u&3)<<4) | z;
664 546 *pt++ = 0x80 | y;
665 547 *pt++ = 0x80 | x;
666   -#endif
667 548 }
668 549 ++ubuf;
669 550 }
44,652 Unicode/utype.c
22,326 additions, 22,326 deletions not shown
4 fontforge/GNUmakefile.in
@@ -30,6 +30,10 @@
30 30
31 31 include Makefile
32 32
  33 +#######################################################################
  34 +# The maintainer tools such as "stamper" are built if you configure #
  35 +# with --enable-maintainer-tools #
  36 +#######################################################################
33 37 ifeq (@MAINTAINER_TOOLS@,yes)
34 38
35 39 # You need to build the "fontforge" program to do the stamps for
26 fontforge/encoding.c
@@ -129,15 +129,9 @@ const char *FindUnicharName(void) {
129 129 /* ordering and under libiconv it means big-endian */
130 130 iconv_t test;
131 131 static char *goodname = NULL;
132   -#ifdef UNICHAR_16
133   - static char *names[] = { "UCS-2-INTERNAL", "UCS-2", "UCS2", "ISO-10646/UCS2", "UNICODE", NULL };
134   - static char *namesle[] = { "UCS-2LE", "UNICODELITTLE", NULL };
135   - static char *namesbe[] = { "UCS-2BE", "UNICODEBIG", NULL };
136   -#else
137 132 static char *names[] = { "UCS-4-INTERNAL", "UCS-4", "UCS4", "ISO-10646-UCS-4", "UTF-32", NULL };
138 133 static char *namesle[] = { "UCS-4LE", "UTF-32LE", NULL };
139 134 static char *namesbe[] = { "UCS-4BE", "UTF-32BE", NULL };
140   -#endif
141 135 char **testnames;
142 136 int i;
143 137 union {
@@ -175,11 +169,7 @@ return( goodname );
175 169 }
176 170
177 171 if ( goodname==NULL ) {
178   -#ifdef UNICHAR_16
179   - 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.");
180   -#else
181 172 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.");
182   -#endif
183 173 exit( 1 );
184 174 }
185 175
@@ -2456,10 +2446,6 @@ return( -1 );
2456 2446 }
2457 2447 if ( tpt-(char *) to == sizeof(unichar_t) )
2458 2448 return( to[0] );
2459   -#ifdef UNICHAR_16
2460   - else if ( tpt-(char *) to == 4 && to[0]>=0xd800 && to[0]<0xdc00 && to[1]>=0xdc00 )
2461   -return( ((to[0]-0xd800)<<10) + (to[1]-0xdc00) + 0x10000 );
2462   -#endif
2463 2449 } else if ( encname->tounicode_func!=NULL ) {
2464 2450 return( (encname->tounicode_func)(enc) );
2465 2451 }
@@ -2488,20 +2474,8 @@ return( -1 );
2488 2474 } else if ( enc->fromunicode!=NULL ) {
2489 2475 /* I don't see how there can be any state to reset in this direction */
2490 2476 /* So I don't reset it */
2491   -#ifdef UNICHAR_16
2492   - if ( uni<0x10000 ) {
2493   - from[0] = uni;
2494   - fromlen = sizeof(unichar_t);
2495   - } else {
2496   - uni -= 0x10000;
2497   - from[0] = 0xd800 + (uni>>10);
2498   - from[1] = 0xdc00 + (uni&0x3ff);
2499   - fromlen = 2*sizeof(unichar_t);
2500   - }
2501   -#else
2502 2477 from[0] = uni;
2503 2478 fromlen = sizeof(unichar_t);
2504   -#endif
2505 2479 fpt = (char *) from; tpt = (char *) to; tolen = sizeof(to);
2506 2480 iconv(enc->fromunicode,NULL,NULL,NULL,NULL); /* reset shift in/out, etc. */
2507 2481 if ( iconv(enc->fromunicode,&fpt,&fromlen,&tpt,&tolen)==(size_t) -1 )
9 fontforge/libffstamp.h
... ... @@ -1,3 +1,6 @@
1   -#define LibFF_ModTime 1346784630L /* Seconds since 1970 (standard unix time) */
2   -#define LibFF_ModTime_Str "18:50 GMT 4-Sep-2012"
3   -#define LibFF_VersionDate 20120904 /* Year, month, day */
  1 +/* This file was generated using stamper.c to create the next version release. */
  2 +/* If you need to update this to the next release version, see fontforge/GNUmakefile.in */
  3 +
  4 +#define LibFF_ModTime 1346896085L /* Seconds since 1970 (standard unix time) */
  5 +#define LibFF_ModTime_Str "01:48 GMT 6-Sep-2012"
  6 +#define LibFF_VersionDate 20120906 /* Year, month, day */
5 fontforge/macbinary.c
@@ -1481,10 +1481,6 @@ return( false );
1481 1481 ((FInfo *) (info.finderInfo))->fdCreator = mb->creator;
1482 1482 pt = strrchr(fname,'/');
1483 1483 filename = def2u_copy(pt==NULL?fname:pt+1);
1484   -#ifdef UNICHAR_16
1485   - ret = FSCreateFileUnicode(&parentref,u_strlen(filename), (UniChar *) filename,
1486   - kFSCatInfoFinderInfo, &info, &ref, NULL);
1487   -#else
1488 1484 { UniChar *ucs2fn = galloc((u_strlen(filename)+1) * sizeof(UniChar));
1489 1485 int i;
1490 1486 for ( i=0; filename[i]!=0; ++i )
@@ -1494,7 +1490,6 @@ return( false );
1494 1490 kFSCatInfoFinderInfo, &info, &ref, NULL);
1495 1491 free(ucs2fn);
1496 1492 }
1497   -#endif
1498 1493 free(filename);
1499 1494 if ( ret==dupFNErr ) {
1500 1495 /* File already exists, create failed, didn't get an FSRef */
2  fontforge/macenc.c
@@ -1194,9 +1194,7 @@ return( NULL );
1194 1194 out = ret = galloc(outlen+sizeof(unichar_t));
1195 1195 iconv(fromutf8,&in,&inlen,&out,&outlen);
1196 1196 out[0] = out[1] = '\0';
1197   -#ifndef UNICHAR_16
1198 1197 out[2] = out[3] = '\0';
1199   -#endif
1200 1198 iconv_close(fromutf8);
1201 1199 return( ret );
1202 1200 }
25 fontforge/metricsview.c
@@ -1419,10 +1419,6 @@ static void MVVScroll(MetricsView *mv,struct sbevent *sb) {
1419 1419 }
1420 1420 }
1421 1421
1422   -#ifdef UNICHAR_16
1423   -# define MVFakeUnicodeOfSc(mv,sc) 0xfffd
1424   -# define MVOddMatch(mv,uni,sc) (uni==0xfffd && sc->unicodeenc==-1)
1425   -#else
1426 1422 static int MVFakeUnicodeOfSc(MetricsView *mv, SplineChar *sc) {
1427 1423
1428 1424 if ( sc->unicodeenc!=-1 )
@@ -1493,7 +1489,6 @@ return( uni==0xfffd );
1493 1489 else
1494 1490 return( uni>=mv->fake_unicode_base && sc->orig_pos == uni-mv->fake_unicode_base );
1495 1491 }
1496   -#endif
1497 1492
1498 1493 void MVSetSCs(MetricsView *mv, SplineChar **scs) {
1499 1494 /* set the list of characters being displayed to those in scs */
@@ -1508,11 +1503,7 @@ void MVSetSCs(MetricsView *mv, SplineChar **scs) {
1508 1503
1509 1504 ustr = galloc((len+1)*sizeof(unichar_t));
1510 1505 for ( len=0; scs[len]!=NULL; ++len )
1511   -#ifdef UNICHAR_16
1512   - if ( scs[len]->unicodeenc>0 && scs[len]->unicodeenc<0x10000 )
1513   -#else
1514 1506 if ( scs[len]->unicodeenc>0 )
1515   -#endif
1516 1507 ustr[len] = scs[len]->unicodeenc;
1517 1508 else
1518 1509 ustr[len] = MVFakeUnicodeOfSc(mv,scs[len]);
@@ -1641,11 +1632,7 @@ static void MVFigureGlyphNames(MetricsView *mv,const unichar_t *names) {
1641 1632 }
1642 1633 newtext = galloc((cnt+1)*sizeof(unichar_t));
1643 1634 for ( i=0; i<cnt; ++i ) {
1644   -#ifdef UNICHAR_16
1645   - newtext[i] = founds[i]->unicodeenc==-1 || founds[i]->unicodeenc>=0x10000?
1646   -#else
1647 1635 newtext[i] = founds[i]->unicodeenc==-1 ?
1648   -#endif
1649 1636 MVFakeUnicodeOfSc(mv,founds[i]) :
1650 1637 founds[i]->unicodeenc;
1651 1638 mv->chars[i] = founds[i];
@@ -2539,11 +2526,7 @@ static void MVResetText(MetricsView *mv) {
2539 2526
2540 2527 new = galloc((mv->clen+1)*sizeof(unichar_t));
2541 2528 for ( pt=new, i=0; i<mv->clen; ++i ) {
2542   -#ifdef UNICHAR_16
2543   - if ( mv->chars[i]->unicodeenc==-1 || mv->chars[i]->unicodeenc>=0x10000 )
2544   -#else
2545 2529 if ( mv->chars[i]->unicodeenc==-1 )
2546   -#endif
2547 2530 *pt++ = MVFakeUnicodeOfSc(mv,mv->chars[i]);
2548 2531 else
2549 2532 *pt++ = mv->chars[i]->unicodeenc;
@@ -4435,11 +4418,7 @@ return;
4435 4418 }
4436 4419 for ( i=within; i<within+cnt; ++i ) {
4437 4420 mv->chars[i] = founds[i-within];
4438   -#ifdef UNICHAR_16
4439   - newtext[i] = (founds[i-within]->unicodeenc>=0 && founds[i-within]->unicodeenc<0x10000)?
4440   -#else
4441 4421 newtext[i] = founds[i-within]->unicodeenc>=0 ?
4442   -#endif
4443 4422 founds[i-within]->unicodeenc : MVFakeUnicodeOfSc(mv,founds[i-within]);
4444 4423 }
4445 4424 mv->clen += cnt;
@@ -4774,11 +4753,7 @@ MetricsView *MetricsViewCreate(FontView *fv,SplineChar *sc,BDFFont *bdf) {
4774 4753
4775 4754 for ( cnt=0; cnt<mv->clen; ++cnt )
4776 4755 pt = utf8_idpb(pt,
4777   -#ifdef UNICHAR_16
4778   - mv->chars[cnt]->unicodeenc==-1 || mv->chars[cnt]->unicodeenc>=0x10000?
4779   -#else
4780 4756 mv->chars[cnt]->unicodeenc==-1?
4781   -#endif
4782 4757 MVFakeUnicodeOfSc(mv,mv->chars[cnt]): mv->chars[cnt]->unicodeenc);
4783 4758 *pt = '\0';
4784 4759
2  fontforge/parsettf.c
@@ -475,9 +475,7 @@ return( NULL );
475 475 out = (char *) str;
476 476 iconv(enc->tounicode,&in,&inlen,&out,&outlen);
477 477 out[0] = '\0'; out[1] = '\0';
478   -#ifndef UNICHAR_16
479 478 out[2] = '\0'; out[3] = '\0';
480   -#endif
481 479 free(cstr);
482 480 } else {
483 481 str = uc_copy("");
88 fontforge/python.c
@@ -385,14 +385,6 @@ void PyFF_Glyph_Set_Layer(SplineChar *sc,int layer) {
385 385 ((PyFF_Glyph *) pysc)->layer = layer;
386 386 }
387 387
388   -/* We use this for read-only properties of exported Python objects.
389   - * Signature must be compatible with Python.h::setter - hence unused parameters.
390   - */
391   -static int PyFF_cant_set(PyFF_Font *UNUSED(self), PyObject *UNUSED(value), void *UNUSED(closure)) {
392   - PyErr_Format(PyExc_TypeError, "Cannot set this member");
393   -return( 0 );
394   -}
395   -
396 388 static uint32 StrToTag(char *tag_name, int *was_mac) {
397 389 uint8 foo[4];
398 390 int feat, set;
@@ -6779,7 +6771,7 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
6779 6771 (getter)PyFF_Glyph_get_altuni, (setter)PyFF_Glyph_set_altuni,
6780 6772 "Alternate unicode encodings (and variation selectors) for this glyph", NULL},
6781 6773 {"encoding",
6782   - (getter)PyFF_Glyph_get_encoding, (setter)PyFF_cant_set,
  6774 + (getter)PyFF_Glyph_get_encoding, NULL,
6783 6775 "Returns the glyph's encoding in the current font (readonly)", NULL},
6784 6776 {"foreground",
6785 6777 (getter)PyFF_Glyph_get_foreground, (setter)PyFF_Glyph_set_foreground,
@@ -6788,16 +6780,16 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
6788 6780 (getter)PyFF_Glyph_get_background, (setter)PyFF_Glyph_set_background,
6789 6781 "Returns the background layer of the glyph", NULL},
6790 6782 {"layers",
6791   - (getter)PyFF_Glyph_get_layers, (setter)PyFF_cant_set,
  6783 + (getter)PyFF_Glyph_get_layers, NULL,
6792 6784 "Returns an array of layers", NULL},
6793 6785 {"references",
6794 6786 (getter)PyFF_Glyph_get_references, (setter)PyFF_Glyph_set_references,
6795 6787 "A tuple of all references in the glyph", NULL},
6796 6788 {"layerrefs",
6797   - (getter)PyFF_Glyph_get_layerrefs, (setter)PyFF_cant_set,
  6789 + (getter)PyFF_Glyph_get_layerrefs, NULL,
6798 6790 "Returns an array of layer references", NULL},
6799 6791 {"layer_cnt",
6800   - (getter)PyFF_Glyph_get_layer_cnt, (setter)PyFF_cant_set,
  6792 + (getter)PyFF_Glyph_get_layer_cnt, NULL,
6801 6793 "Returns the number of layers in the glyph", NULL},
6802 6794 {"color",
6803 6795 (getter)PyFF_Glyph_get_color, (setter)PyFF_Glyph_set_color,
@@ -6815,7 +6807,7 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
6815 6807 (getter)PyFF_Glyph_get_isextendedshape, (setter)PyFF_Glyph_set_isextendedshape,
6816 6808 "Math \"is extended shape\" field", NULL},
6817 6809 {"script",
6818   - (getter)PyFF_Glyph_get_script, (setter)PyFF_cant_set,
  6810 + (getter)PyFF_Glyph_get_script, NULL,
6819 6811 "The OpenType script containing this glyph (readonly)", NULL},
6820 6812 {"texheight",
6821 6813 (getter)PyFF_Glyph_get_texheight, (setter)PyFF_Glyph_set_texheight,
@@ -6836,7 +6828,7 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
6836 6828 (getter)PyFF_Glyph_get_changed, (setter)PyFF_Glyph_set_changed,
6837 6829 "Flag indicating whether this glyph has changed", NULL},
6838 6830 {"originalgid",
6839   - (getter)PyFF_Glyph_get_originalgid, (setter)PyFF_cant_set,
  6831 + (getter)PyFF_Glyph_get_originalgid, NULL,
6840 6832 "Original GID (readonly)", NULL},
6841 6833 {"width",
6842 6834 (getter)PyFF_Glyph_get_width, (setter)PyFF_Glyph_set_width,
@@ -6851,7 +6843,7 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
6851 6843 (getter)PyFF_Glyph_get_vwidth, (setter)PyFF_Glyph_set_vwidth,
6852 6844 "Glyph's vertical advance width", NULL},
6853 6845 {"font",
6854   - (getter)PyFF_Glyph_get_font, (setter)PyFF_cant_set,
  6846 + (getter)PyFF_Glyph_get_font, NULL,
6855 6847 "Font containing the glyph (readonly)", NULL},
6856 6848 {"hhints",
6857 6849 (getter)PyFF_Glyph_get_hhints, (setter)PyFF_Glyph_set_hhints,
@@ -6869,7 +6861,7 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
6869 6861 (getter)PyFF_Glyph_get_lcarets, (setter)PyFF_Glyph_set_lcarets,
6870 6862 "The ligature caret locations, defined for this glyph, as a tuple.", NULL},
6871 6863 {"validation_state",
6872   - (getter)PyFF_Glyph_get_validation_state, (setter)PyFF_cant_set,
  6864 + (getter)PyFF_Glyph_get_validation_state, NULL,
6873 6865 "glyph's validation state (readonly)", NULL},
6874 6866 {"horizontalVariants",
6875 6867 (getter)PyFF_Glyph_get_horizontalVariants, (setter)PyFF_Glyph_set_horizontalVariants,
@@ -6890,7 +6882,7 @@ static PyGetSetDef PyFF_Glyph_getset[] = {
6890 6882 (getter)PyFF_Glyph_get_verticalCIC, (setter)PyFF_Glyph_set_verticalCIC,
6891 6883 "The italic correction for any composite glyph made with the verticalComponents.", NULL},
6892 6884 {"mathKern",
6893   - (getter)PyFF_Glyph_get_mathKern, (setter)PyFF_cant_set,
  6885 + (getter)PyFF_Glyph_get_mathKern, NULL,
6894 6886 "math kerning information for the glyph.", NULL},
6895 6887 PYGETSETDEF_EMPTY /* Sentinel */
6896 6888 };
@@ -8879,7 +8871,7 @@ static PyMethodDef PyFFSelection_methods[] = {
8879 8871
8880 8872 static PyGetSetDef PyFFSelection_getset[] = {
8881 8873 {"byGlyphs",
8882   - (getter)PyFFSelection_ByGlyphs, (setter)PyFF_cant_set,
  8874 + (getter)PyFFSelection_ByGlyphs, NULL,
8883 8875 "returns a selection object whose iterator will return glyph objects (rather than encoding indices)", NULL},
8884 8876 PYGETSETDEF_EMPTY /* Sentinel */
8885 8877 };
@@ -12221,10 +12213,10 @@ static PyGetSetDef PyFF_Font_getset[] = {
12221 12213 (getter)PyFF_Font_get_bitmapSizes, (setter)PyFF_Font_set_bitmapSizes,
12222 12214 "A tuple of sizes of all bitmaps associated with the font", NULL},
12223 12215 {"gpos_lookups",
12224   - (getter)PyFF_Font_get_gpos_lookups, (setter)PyFF_cant_set,
  12216 + (getter)PyFF_Font_get_gpos_lookups, NULL,
12225 12217 "The names of all lookups in the font's GPOS table (readonly)", NULL},
12226 12218 {"gsub_lookups",
12227   - (getter)PyFF_Font_get_gsub_lookups, (setter)PyFF_cant_set,
  12219 + (getter)PyFF_Font_get_gsub_lookups, NULL,
12228 12220 "The names of all lookups in the font's GSUB table (readonly)", NULL},
12229 12221 {"horizontalBaseline",
12230 12222 (getter)PyFF_Font_get_horizontal_baseline, (setter)PyFF_Font_set_horizontal_baseline,
@@ -12233,22 +12225,22 @@ static PyGetSetDef PyFF_Font_getset[] = {
12233 12225 (getter)PyFF_Font_get_vertical_baseline, (setter)PyFF_Font_set_vertical_baseline,
12234 12226 "Vertical baseline data, if any", NULL},
12235 12227 {"private",
12236   - (getter)PyFF_Font_get_private, (setter)PyFF_cant_set,
  12228 + (getter)PyFF_Font_get_private, NULL,
12237 12229 "The font's PostScript private dictionary (You may not set this field, but you may set things in it)", NULL},
12238 12230 {"math",
12239   - (getter)PyFF_Font_get_math, (setter)PyFF_cant_set,
  12231 + (getter)PyFF_Font_get_math, NULL,
12240 12232 "The font's math constants (You may not set this field, but you may set things in it)", NULL},
12241 12233 {"texparameters",
12242   - (getter)PyFF_Font_get_texparams, (setter)PyFF_cant_set,
  12234 + (getter)PyFF_Font_get_texparams, NULL,
12243 12235 "The font's TeX font parameters", NULL},
12244 12236 {"cvt",
12245 12237 (getter)PyFF_Font_get_cvt, (setter)PyFF_Font_set_cvt,
12246 12238 "The font's TrueType cvt table", NULL},
12247 12239 {"path",
12248   - (getter)PyFF_Font_get_path, (setter)PyFF_cant_set,
  12240 + (getter)PyFF_Font_get_path, NULL,
12249 12241 "filename of the original font file loaded (readonly)", NULL},
12250 12242 {"sfd_path",
12251   - (getter)PyFF_Font_get_sfd_path, (setter)PyFF_cant_set,
  12243 + (getter)PyFF_Font_get_sfd_path, NULL,
12252 12244 "filename of the sfd file containing this font (if any) (readonly)", NULL},
12253 12245 {"default_base_filename",
12254 12246 (getter)PyFF_Font_get_defbasefilename, (setter)PyFF_Font_set_defbasefilename,
@@ -12296,10 +12288,10 @@ static PyGetSetDef PyFF_Font_getset[] = {
12296 12288 (getter)PyFF_Font_get_cidsubfont, (setter)PyFF_Font_set_cidsubfont,
12297 12289 "Returns the index of the current subfont of a cid-keyed font (or -1), and allows you to change the subfont.", NULL},
12298 12290 {"cidsubfontcnt",
12299   - (getter)PyFF_Font_get_cidsubfontcnt, (setter)PyFF_cant_set,
  12291 + (getter)PyFF_Font_get_cidsubfontcnt, NULL,
12300 12292 "The number of sub fonts that make up a CID keyed font (readonly)", NULL},
12301 12293 {"cidsubfontnames",
12302   - (getter)PyFF_Font_get_cidsubfontnames, (setter)PyFF_cant_set,
  12294 + (getter)PyFF_Font_get_cidsubfontnames, NULL,
12303 12295 "The names of all the sub fonts that make up a CID keyed font (readonly)", NULL},
12304 12296 {"cidfontname",
12305 12297 (getter)PyFF_Font_get_cidfontname, (setter)PyFF_Font_set_cidfontname,
@@ -12320,10 +12312,10 @@ static PyGetSetDef PyFF_Font_getset[] = {
12320 12312 (getter)PyFF_Font_get_cidversion, (setter)PyFF_Font_set_cidversion,
12321 12313 "CID Version", NULL},
12322 12314 {"iscid", /* This should be is_cid, but due to an early misprint I now include both */
12323   - (getter)PyFF_Font_get_is_cid, (setter)PyFF_cant_set,
  12315 + (getter)PyFF_Font_get_is_cid, NULL,
12324 12316 "Whether the font is a cid-keyed font. (readonly)", NULL},
12325 12317 {"is_cid",
12326   - (getter)PyFF_Font_get_is_cid, (setter)PyFF_cant_set,
  12318 + (getter)PyFF_Font_get_is_cid, NULL,
12327 12319 "Whether the font is a cid-keyed font. (readonly)", NULL},
12328 12320 {"italicangle",
12329 12321 (getter)PyFF_Font_get_italicangle, (setter)PyFF_Font_set_italicangle,
@@ -12344,10 +12336,10 @@ static PyGetSetDef PyFF_Font_getset[] = {
12344 12336 (getter)PyFF_Font_get_descent, (setter)PyFF_Font_set_descent,
12345 12337 "Font Descent", NULL},
12346 12338 {"xHeight",
12347   - (getter)PyFF_Font_get_xHeight, (setter)PyFF_cant_set,
  12339 + (getter)PyFF_Font_get_xHeight, NULL,
12348 12340 "X Height of font (negative number means could not be computed (ie. no lowercase glyphs))", NULL},
12349 12341 {"capHeight",
12350   - (getter)PyFF_Font_get_capHeight, (setter)PyFF_cant_set,
  12342 + (getter)PyFF_Font_get_capHeight, NULL,
12351 12343 "Cap Height of font (negative number means could not be computed (ie. no uppercase glyphs))", NULL},
12352 12344 {"em",
12353 12345 (getter)PyFF_Font_get_em, (setter)PyFF_Font_set_em,
@@ -12371,16 +12363,16 @@ static PyGetSetDef PyFF_Font_getset[] = {
12371 12363 (getter)PyFF_Font_get_uniqueid, (setter)PyFF_Font_set_uniqueid,
12372 12364 "PostScript Unique ID", NULL},
12373 12365 {"layer_cnt",
12374   - (getter)PyFF_Font_get_layer_cnt, (setter)PyFF_cant_set,
  12366 + (getter)PyFF_Font_get_layer_cnt, NULL,
12375 12367 "Returns the number of layers in the font (readonly)", NULL},
12376 12368 {"layers",
12377   - (getter)PyFF_Font_get_layers, (setter)PyFF_cant_set,
  12369 + (getter)PyFF_Font_get_layers, NULL,
12378 12370 "Returns a dictionary like object with information on the layers of the font", NULL},
12379 12371 {"loadState",
12380   - (getter)PyFF_Font_get_loadvalidation_state, (setter)PyFF_cant_set,
  12372 + (getter)PyFF_Font_get_loadvalidation_state, NULL,
12381 12373 "A bitmask indicating non-fatal errors found when loading the font (readonly)", NULL},
12382 12374 {"privateState",
12383   - (getter)PyFF_Font_get_privatevalidation_state, (setter)PyFF_cant_set,
  12375 + (getter)PyFF_Font_get_privatevalidation_state, NULL,
12384 12376 "A bitmask indicating errors in the (PostScript) Private dictionary", NULL},
12385 12377 {"macstyle",
12386 12378 (getter)PyFF_Font_get_macstyle, (setter)PyFF_Font_set_macstyle,
@@ -12530,7 +12522,7 @@ static PyGetSetDef PyFF_Font_getset[] = {
12530 12522 (getter)PyFF_Font_get_changed, (setter)PyFF_Font_set_changed,
12531 12523 "Flag indicating whether the font has been changed since it was loaded (read only)", NULL},
12532 12524 {"isnew",
12533   - (getter)PyFF_Font_get_new, (setter)PyFF_cant_set,
  12525 + (getter)PyFF_Font_get_new, NULL,
12534 12526 "Flag indicating whether the font is new (read only)", NULL},
12535 12527 {"hasvmetrics",
12536 12528 (getter)PyFF_Font_get_hasvmetrics, (setter)PyFF_Font_set_hasvmetrics,
@@ -12545,7 +12537,7 @@ static PyGetSetDef PyFF_Font_getset[] = {
12545 12537 (getter)PyFF_Font_get_is_quadratic, (setter)PyFF_Font_set_is_quadratic,
12546 12538 "Flag indicating whether the font contains quadratic splines (truetype) or cubic (postscript)", NULL},
12547 12539 {"multilayer",
12548   - (getter)PyFF_Font_get_multilayer, (setter)PyFF_cant_set,
  12540 + (getter)PyFF_Font_get_multilayer, NULL,
12549 12541 "Flag indicating whether the font is multilayered (type3) or not (readonly)", NULL},
12550 12542 {"strokedfont",
12551 12543 (getter)PyFF_Font_get_strokedfont, (setter)PyFF_Font_set_strokedfont,
@@ -16271,22 +16263,22 @@ return( self->right );
16271 16263
16272 16264 static PyGetSetDef PyFF_AWGlyph_getset[] = {
16273 16265 {"glyph",
16274   - (getter)PyFF_AWGlyph_getGlyph, (setter)PyFF_cant_set,
  16266 + (getter)PyFF_AWGlyph_getGlyph, NULL,
16275 16267 "The underlying glyph which this object describes", NULL},
16276 16268 {"boundingbox",
16277   - (getter)PyFF_AWGlyph_getBB, (setter)PyFF_cant_set,
  16269 + (getter)PyFF_AWGlyph_getBB, NULL,
16278 16270 "The bounding box of the underlying glyph", NULL},
16279 16271 {"iminY",
16280   - (getter)PyFF_AWGlyph_getIminY, (setter)PyFF_cant_set,
  16272 + (getter)PyFF_AWGlyph_getIminY, NULL,
16281 16273 "floor(bb.min_y/decimation_height)", NULL},
16282 16274 {"imaxY",
16283   - (getter)PyFF_AWGlyph_getImaxY, (setter)PyFF_cant_set,
  16275 + (getter)PyFF_AWGlyph_getImaxY, NULL,
16284 16276 "ceil(bb.max_y/decimation_height)", NULL},
16285 16277 {"left",
16286   - (getter)PyFF_AWGlyph_getLeft, (setter)PyFF_cant_set,
  16278 + (getter)PyFF_AWGlyph_getLeft, NULL,
16287 16279 "array with left edge offsets from bounding box", NULL},
16288 16280 {"right",
16289   - (getter)PyFF_AWGlyph_getRight, (setter)PyFF_cant_set,
  16281 + (getter)PyFF_AWGlyph_getRight, NULL,
16290 16282 "array with left edge offsets from bounding box", NULL},
16291 16283 PYGETSETDEF_EMPTY /* Sentinel */
16292 16284 };
@@ -16400,19 +16392,19 @@ return( self->denom );
16400 16392
16401 16393 static PyGetSetDef PyFF_AWContext_getset[] = {
16402 16394 {"font",
16403   - (getter)PyFF_AWContext_getFont, (setter)PyFF_cant_set,
  16395 + (getter)PyFF_AWContext_getFont, NULL,
16404 16396 "The underlying font which this object describes", NULL},
16405 16397 {"emSize",
16406   - (getter)PyFF_AWContext_getEmSize, (setter)PyFF_cant_set,
  16398 + (getter)PyFF_AWContext_getEmSize, NULL,
16407 16399 "Font's em-size", NULL},
16408 16400 {"layer",
16409   - (getter)PyFF_AWContext_getLayer, (setter)PyFF_cant_set,
  16401 + (getter)PyFF_AWContext_getLayer, NULL,
16410 16402 "active layer during the current operation", NULL},
16411 16403 {"regionHeight",
16412   - (getter)PyFF_AWContext_getRegionHeight, (setter)PyFF_cant_set,
  16404 + (getter)PyFF_AWContext_getRegionHeight, NULL,
16413 16405 "The y coordinate line is subdivided into regions, and this is the height of each region", NULL},
16414 16406 {"denom",
16415   - (getter)PyFF_AWContext_getDenom, (setter)PyFF_cant_set,
  16407 + (getter)PyFF_AWContext_getDenom, NULL,
16416 16408 "A useful small number which varies with the emsize", NULL},
16417 16409 PYGETSETDEF_EMPTY /* Sentinel */
16418 16410 };
8 fontforge/scripting.c
@@ -1107,11 +1107,7 @@ static void bUtf8(Context *c) {
1107 1107 ScriptError( c, "Bad value for argument" );
1108 1108 buf[0] = c->a.vals[1].u.ival; buf[1] = 0;
1109 1109 c->return_val.type = v_str;
1110   -#ifdef UNICHAR_16
1111   - c->return_val.u.sval = u322utf8_copy(buf);
1112   -#else
1113 1110 c->return_val.u.sval = u2utf8_copy(buf);
1114   -#endif
1115 1111 } else if ( c->a.vals[1].type==v_arr || c->a.vals[1].type==v_arrfree ) {
1116 1112 Array *arr = c->a.vals[1].u.aval;
1117 1113 temp = galloc((arr->argc+1)*sizeof(int32));
@@ -1124,11 +1120,7 @@ static void bUtf8(Context *c) {
1124 1120 }
1125 1121 temp[i] = 0;
1126 1122 c->return_val.type = v_str;
1127   -#ifdef UNICHAR_16
1128   - c->return_val.u.sval = u322utf8_copy(temp);
1129   -#else
1130 1123 c->return_val.u.sval = u2utf8_copy(temp);
1131   -#endif
1132 1124 free(temp);
1133 1125 } else
1134 1126 ScriptError( c, "Bad type for argument" );
34 fontforge/sftextfield.c
@@ -388,15 +388,9 @@ static void SFTextAreaGrabPrimarySelection(SFTextArea *st) {
388 388
389 389 GDrawGrabSelection(st->g.base,sn_primary);
390 390 st->sel_start = ss; st->sel_end = se;
391   -#ifdef UNICHAR_16
392   - GDrawAddSelectionType(st->g.base,sn_primary,"text/plain;charset=ISO-10646-UCS-2",st,st->sel_end-st->sel_start,
393   - sizeof(unichar_t),
394   - genunicodedata,noop);
395   -#else
396 391 GDrawAddSelectionType(st->g.base,sn_primary,"text/plain;charset=ISO-10646-UCS-4",st,st->sel_end-st->sel_start,
397 392 sizeof(unichar_t),
398 393 genunicodedata,noop);
399   -#endif
400 394 GDrawAddSelectionType(st->g.base,sn_primary,"UTF8_STRING",st,3*(st->sel_end-st->sel_start),
401 395 sizeof(unichar_t),
402 396 genutf8data,noop);
@@ -407,15 +401,9 @@ static void SFTextAreaGrabPrimarySelection(SFTextArea *st) {
407 401 static void SFTextAreaGrabDDSelection(SFTextArea *st) {
408 402
409 403 GDrawGrabSelection(st->g.base,sn_drag_and_drop);
410   -#ifdef UNICHAR_16
411   - GDrawAddSelectionType(st->g.base,sn_drag_and_drop,"text/plain;charset=ISO-10646-UCS-2",st,st->sel_end-st->sel_start,
412   - sizeof(unichar_t),
413   - ddgenunicodedata,noop);
414   -#else
415 404 GDrawAddSelectionType(st->g.base,sn_drag_and_drop,"text/plain;charset=ISO-10646-UCS-4",st,st->sel_end-st->sel_start,
416 405 sizeof(unichar_t),
417 406 ddgenunicodedata,noop);
418   -#endif
419 407 GDrawAddSelectionType(st->g.base,sn_drag_and_drop,"STRING",st,st->sel_end-st->sel_start,sizeof(char),
420 408 ddgenlocaldata,noop);
421 409 }
@@ -425,21 +413,14 @@ static void SFTextAreaGrabSelection(SFTextArea *st, enum selnames sel ) {
425 413 if ( st->sel_start!=st->sel_end ) {
426 414 unichar_t *temp;
427 415 char *ctemp;
428   -#ifndef UNICHAR_16
429 416 int i;
430 417 uint16 *u2temp;
431   -#endif
432 418
433 419 GDrawGrabSelection(st->g.base,sel);
434 420 temp = galloc((st->sel_end-st->sel_start + 2)*sizeof(unichar_t));
435 421 temp[0] = 0xfeff; /* KDE expects a byte order flag */
436 422 u_strncpy(temp+1,st->li.text+st->sel_start,st->sel_end-st->sel_start);
437 423 ctemp = u2utf8_copy(temp);
438   -#ifdef UNICHAR_16
439   - GDrawAddSelectionType(st->g.base,sel,"text/plain;charset=ISO-10646-UCS-2",temp,u_strlen(temp),
440   - sizeof(unichar_t),
441   - NULL,NULL);
442   -#else
443 424 GDrawAddSelectionType(st->g.base,sel,"text/plain;charset=ISO-10646-UCS-4",temp,u_strlen(temp),
444 425 sizeof(unichar_t),
445 426 NULL,NULL);
@@ -450,7 +431,6 @@ static void SFTextAreaGrabSelection(SFTextArea *st, enum selnames sel ) {
450 431 GDrawAddSelectionType(st->g.base,sel,"text/plain;charset=ISO-10646-UCS-2",u2temp,u_strlen(temp),
451 432 2,
452 433 NULL,NULL);
453   -#endif
454 434 GDrawAddSelectionType(st->g.base,sel,"UTF8_STRING",ctemp,strlen(ctemp),sizeof(char),
455 435 NULL,NULL);
456 436 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) {
545 525 SFTextArea_Replace(st,temp);
546 526 free(ctemp); free(temp);
547 527 }
548   -#ifdef UNICHAR_16
549   - } else if ( GDrawSelectionHasType(st->g.base,sel,"Unicode") ||
550   - GDrawSelectionHasType(st->g.base,sel,"text/plain;charset=ISO-10646-UCS-2")) {
551   - unichar_t *temp;
552   - int32 len;
553   - temp = GDrawRequestSelection(st->g.base,sel,"Unicode",&len);
554   - if ( temp==NULL || len==0 )
555   - temp = GDrawRequestSelection(st->g.base,sel,"text/plain;charset=ISO-10646-UCS-2",&len);
556   - /* Bug! I don't handle byte reversed selections. But I don't think there should be any anyway... */
557   - if ( temp!=NULL )
558   - SFTextArea_Replace(st,temp[0]==0xfeff?temp+1:temp);
559   - free(temp);
560   -#else
561 528 } else if ( GDrawSelectionHasType(st->g.base,sel,"text/plain;charset=ISO-10646-UCS-4")) {
562 529 unichar_t *temp;
563 530 int32 len;
@@ -584,7 +551,6 @@ static void SFTextAreaPaste(SFTextArea *st,enum selnames sel) {
584 551 free(temp);
585 552 }
586 553 free(temp2);
587   -#endif
588 554 } else if ( GDrawSelectionHasType(st->g.base,sel,"STRING")) {
589 555 unichar_t *temp; char *ctemp;
590 556 int32 len;
9 fontforge/stamp.c
... ... @@ -1,5 +1,8 @@
  1 +/* This file was generated using stamper.c to create the next version release. */
  2 +/* If you need to update this to the next release version, see fontforge/GNUmakefile.in */
  3 +
1 4 #include <time.h>
2 5
3   -const time_t source_modtime = 1346784630L;
4   -const char *source_modtime_str = "18:50 GMT 4-Sep-2012";
5   -const char *source_version_str = "20120904";