Skip to content

Commit

Permalink
Unicode 9.0
Browse files Browse the repository at this point in the history
Update from unicode charts 6.3 to unicode charts 9.0
  • Loading branch information
JoesCat committed Sep 30, 2016
1 parent 4368ab2 commit d9aa90e
Show file tree
Hide file tree
Showing 12 changed files with 837 additions and 752 deletions.
4 changes: 2 additions & 2 deletions Unicode/ArabicForms.c
Expand Up @@ -2,7 +2,7 @@
/* License: BSD-3-clause */
/* Contributions: Khaled Hosny, Joe Da Silva */

/* This file was generated using the program 'makeutype' */
/* This file was generated using the program 'makeutype' for Unicode_version 9.0 */

#include <utype.h>

Expand All @@ -13,7 +13,7 @@ struct arabicforms ArabicForms[] = {
{ 0x0602, 0x0602, 0x0602, 0x0602, 0, 0, 0 },
{ 0x0603, 0x0603, 0x0603, 0x0603, 0, 0, 0 },
{ 0x0604, 0x0604, 0x0604, 0x0604, 0, 0, 0 },
{ 0x0000, 0x0000, 0x0000, 0x0000, 0, 0, 0 },
{ 0x0605, 0x0605, 0x0605, 0x0605, 0, 0, 0 },
{ 0x0606, 0x0606, 0x0606, 0x0606, 0, 0, 0 },
{ 0x0607, 0x0607, 0x0607, 0x0607, 0, 0, 0 },
{ 0x0608, 0x0608, 0x0608, 0x0608, 0, 0, 0 },
Expand Down
13 changes: 6 additions & 7 deletions Unicode/README.TXT
Expand Up @@ -8,7 +8,7 @@ wget http://unicode.org/Public/UNIDATA/LineBreak.txt
wget http://unicode.org/Public/UNIDATA/NamesList.txt
wget http://unicode.org/Public/UNIDATA/PropList.txt
wget http://unicode.org/Public/UNIDATA/UnicodeData.txt
make makeutype
gcc -s -I../inc -o makeutype makeutype.c
./makeutype
rm *.txt
mv utype.h ../inc/
Expand Down Expand Up @@ -38,18 +38,17 @@ wget http://unicode.org/Public/MAPPINGS/ISO8859/8859-14.TXT
wget http://unicode.org/Public/MAPPINGS/ISO8859/8859-15.TXT
wget http://unicode.org/Public/MAPPINGS/ISO8859/8859-16.TXT
wget http://unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT
mv KOI8-R.TXT koi8r.TXT
wget http://unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0201.TXT
mv JIS0201.TXT JIS0201.txt
wget http://unicode.org/Public/MAPPINGS/VENDORS/ADOBE/zdingbat.txt
mv zdingbat.txt zapfding.TXT
wget http://unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0212.TXT
wget http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/MAC/ROMAN.TXT
mv ROMAN.TXT MacRoman.TXT
wget http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/ROMAN.TXT
wget http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/SYMBOL.TXT
wget http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT
wget http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
wget http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/MAC/CYRILLIC.TXT
mv CYRILLIC.TXT MacCYRILLIC.TXT

gcc -s -o dump dump.c
gcc -s -I../inc -o dump dump.c
./dump
rm *.txt *.TXT

Expand Down
5 changes: 3 additions & 2 deletions Unicode/charset/generate.sh
Expand Up @@ -58,9 +58,10 @@ uni_maps=(
"$u/VENDORS/MICSFT/WINDOWS/CP950.TXT"
)

a="ftp://ftp.oreilly.de/pub/examples/english_examples/nutshell/cjkv/adobe"
#a="ftp://ftp.oreilly.de/pub/examples/english_examples/nutshell/cjkv/adobe"
a="ftp://ftp.netbsd.org/pub/pkgsrc/distfiles/adobe-cmaps-20060615/"
adobe_maps=(
# "$a/ac15.tar.Z" # Big5
"$a/ac15.tar.Z" # Big5
"$a/ag15.tar.Z" # GB2312
"$a/aj16.tar.Z" # JIS X 0208
"$a/aj20.tar.Z" # JIS X 0212
Expand Down
13 changes: 7 additions & 6 deletions Unicode/dump.c
Expand Up @@ -44,12 +44,13 @@
* wget http://unicode.org/Public/MAPPINGS/ISO8859/8859-15.TXT
* wget http://unicode.org/Public/MAPPINGS/ISO8859/8859-16.TXT
* wget http://unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT
* mv KOI8-R.TXT koi8r.TXT
* wget http://unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0201.TXT
* mv JIS0201.TXT JIS0201.txt
* wget http://unicode.org/Public/MAPPINGS/VENDORS/ADOBE/zdingbat.txt
* mv zdingbat.txt zapfding.TXT
* wget http://unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0212.TXT
* wget http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/ROMAN.TXT
* wget http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/SYMBOL.TXT
* wget http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT
* wget http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
*/

#include <fontforge-config.h>
Expand All @@ -64,8 +65,8 @@
char *alphabets[] = { "8859-1.TXT", "8859-2.TXT", "8859-3.TXT", "8859-4.TXT",
"8859-5.TXT", "8859-6.TXT", "8859-7.TXT", "8859-8.TXT", "8859-9.TXT",
"8859-10.TXT", "8859-11.TXT", "8859-13.TXT", "8859-14.TXT", "8859-15.TXT",
"8859-16.TXT", "koi8r.TXT", "JIS0201.txt", "WIN.TXT", "MacRoman.TXT",
"MacSYMBOL.TXT", "zapfding.TXT", /*"MacCYRILLIC.TXT",*/ NULL };
"8859-16.TXT", "KOI8-R.TXT", "JIS0201.TXT", "CP1252.TXT", "ROMAN.TXT",
"SYMBOL.TXT", "zdingbat.txt", /*"MacCYRILLIC.TXT",*/ NULL };
char *alnames[] = { "i8859_1", "i8859_2", "i8859_3", "i8859_4",
"i8859_5", "i8859_6", "i8859_7", "i8859_8", "i8859_9",
"i8859_10", "i8859_11", "i8859_13", "i8859_14", "i8859_15",
Expand All @@ -78,7 +79,7 @@ int almaps[] = { em_iso8859_1, em_iso8859_2, em_iso8859_3, em_iso8859_4,
-1 };


char *cjk[] = { "JIS0208.TXT", "JIS0212.TXT", "BIG5.TXT", "GB2312.TXT",
char *cjk[] = { "JIS0208.TXT", "JIS0212.TXT", "CP950.TXT", "GB2312.TXT",
"HANGUL.TXT", "Big5HKSCS.txt", NULL };
/* I'm only paying attention to Wansung encoding (in HANGUL.TXT) which is 94x94 */
/* I used to look at OLD5601, but that maps to Unicode 1.0, and Hangul's moved */
Expand Down
62 changes: 40 additions & 22 deletions Unicode/is_Ligature.c
Expand Up @@ -5,7 +5,7 @@ License: BSD-3-clause
Contributions:
*/

/* This file was generated using the program 'makeutype' */
/* This file was generated using the program 'makeutype' for Unicode_version 9.0 */

#include "utype.h"
#include <stdlib.h>
Expand Down Expand Up @@ -75,8 +75,12 @@ const uint16 ____ligature16[] = {
0xfdba, 0xfdbb, 0xfdbc, 0xfdbd, 0xfdbe, 0xfdbf, 0xfdc0, 0xfdc1,
0xfdc2, 0xfdc3, 0xfdc4, 0xfdc5, 0xfdc6, 0xfdc7, 0xfdf0, 0xfdf1,
0xfdf2, 0xfdf3, 0xfdf4, 0xfdf5, 0xfdf6, 0xfdf7, 0xfdf8, 0xfdf9,
0xfdfa, 0xfdfb, 0xfdfd, 0xfe20, 0xfe21, 0xfef5, 0xfef6, 0xfef7,
0xfef8, 0xfef9, 0xfefa, 0xfefb, 0xfefc};
0xfdfa, 0xfdfb, 0xfdfd, 0xfe20, 0xfe21, 0xfe27, 0xfe28, 0xfef5,
0xfef6, 0xfef7, 0xfef8, 0xfef9, 0xfefa, 0xfefb, 0xfefc};

const uint32 ____ligature32[] = {
0x00011176, 0x0001f670, 0x0001f671, 0x0001f672,
0x0001f673};

const uint16 ____vulgfrac16[] = {
0x00bc, 0x00bd, 0x00be, 0x2150, 0x2151, 0x2152, 0x2153, 0x2154,
Expand All @@ -85,11 +89,15 @@ const uint16 ____vulgfrac16[] = {

const uint16 ____fraction16[] = {
0x0b72, 0x0b73, 0x0b74, 0x0b75, 0x0b76, 0x0b77, 0x0c78, 0x0c79,
0x0c7a, 0x0c7b, 0x0c7c, 0x0c7d, 0x0c7e, 0x0d73, 0x0d74, 0x0d75,
0x2044, 0x215f, 0x2cfd, 0xa830, 0xa831, 0xa832, 0xa833, 0xa834,
0xa835};
0x0c7a, 0x0c7b, 0x0c7c, 0x0c7d, 0x0c7e, 0x0d58, 0x0d59, 0x0d5a,
0x0d5b, 0x0d5c, 0x0d5d, 0x0d5e, 0x0d73, 0x0d74, 0x0d75, 0x0d76,
0x0d77, 0x0d78, 0x2044, 0x215f, 0x2cfd, 0xa830, 0xa831, 0xa832,
0xa833, 0xa834, 0xa835};

const uint32 ____fraction32[] = {
0x000109bc, 0x000109bd, 0x000109f6, 0x000109f7,
0x000109f8, 0x000109f9, 0x000109fa, 0x000109fb,
0x000109fc, 0x000109fd, 0x000109fe, 0x000109ff,
0x00010e7b, 0x00010e7c, 0x00010e7d, 0x00010e7e};

static int compare_codepoints16(const void *uCode1, const void *uCode2) {
Expand All @@ -105,25 +113,28 @@ static int compare_codepoints32(const void *uCode1, const void *uCode2) {
}

int LigatureCount(void) {
return( 509 );
return( 516 );
}

int VulgarFractionCount(void) {
return( 19 );
}

int OtherFractionCount(void) {
return( 29 );
return( 51 );
}

int FractionCount(void) {
return( 48 );
return( 70 );
}

int32 Ligature_get_U(int n) {
if ( n<0 || n>=509 )
if ( n<0 || n>=516 )
return( -1 );
return( (int32)(____ligature16[n]) );
if ( n<511 )
return( (int32)(____ligature16[n]) );
else
return( (int32)(____ligature32[n-511]) );
}

int32 VulgFrac_get_U(int n) {
Expand All @@ -133,24 +144,31 @@ int32 VulgFrac_get_U(int n) {
}

int32 Fraction_get_U(int n) {
if ( n<0 || n>=29 )
if ( n<0 || n>=51 )
return( -1 );
if ( n<25 )
if ( n<35 )
return( (int32)(____fraction16[n]) );
else
return( (int32)(____fraction32[n-25]) );
return( (int32)(____fraction32[n-35]) );
}

int Ligature_find_N(uint32 uCode) {
uint16 uCode16, *p16;
uint32 *p32;
int n=-1;

if ( uCode<0x132 || uCode>0xfefc || isligorfrac(uCode)==0 )
if ( uCode<0x132 || uCode>0x1f673 || (uCode<65536 && isligorfrac(uCode)==0) )
return( -1 );
uCode16 = uCode;
p16 = (uint16 *)(bsearch(&uCode16, ____ligature16, 509, \
if ( uCode<0xfefc ) {
uCode16 = uCode;
p16 = (uint16 *)(bsearch(&uCode16, ____ligature16, 511, \
sizeof(uint16), compare_codepoints16));
if ( p16 ) n = p16 - ____ligature16;
if ( p16 ) n = p16 - ____ligature16;
} else {
p32 = (uint32 *)(bsearch(&uCode, ____ligature32, 5, \
sizeof(uint32), compare_codepoints32));
if ( p32 ) n = p32 - ____ligature32 + 511;
}
return( n );
}

Expand All @@ -174,15 +192,15 @@ int Fraction_find_N(uint32 uCode) {

if ( uCode<0xb72 || uCode>0x10e7e || (uCode<65536 && isligorfrac(uCode)==0) )
return( -1 );
if ( uCode<25 ) {
if ( uCode<0xa835 ) {
uCode16 = uCode;
p16 = (uint16 *)(bsearch(&uCode16, ____fraction16, 25, \
p16 = (uint16 *)(bsearch(&uCode16, ____fraction16, 35, \
sizeof(uint16), compare_codepoints16));
if ( p16 ) n = p16 - ____fraction16;
} else {
p32 = (uint32 *)(bsearch(&uCode, ____fraction32, 4, \
p32 = (uint32 *)(bsearch(&uCode, ____fraction32, 16, \
sizeof(uint32), compare_codepoints32));
if ( p32 ) n = p32 - ____fraction32 + 25;
if ( p32 ) n = p32 - ____fraction32 + 35;
}
return( n );
}
Expand Down
1 change: 1 addition & 0 deletions Unicode/makebuildtables.c
Expand Up @@ -30,6 +30,7 @@
#include <stdlib.h>
#include <string.h>
#include <utype.h>
#include "utype.c"

#define ACUTE 0x1
#define GRAVE 0x2
Expand Down
20 changes: 11 additions & 9 deletions Unicode/makeutype.c
Expand Up @@ -42,8 +42,8 @@
* Run "gcc -s -I../inc -o makeutype makeutype.c"
*
* Then run the executable binary "/makeutype".
* This will create 4 files in the same directory:
* ArabicForms.c, unialt.c, utype.c, utype.h
* This will create 5 files in the same directory:
* ArabicForms.c, is_Ligatures.c, unialt.c, utype.c, utype.h
* (please move utype.h into Fontforge's "../inc" subdirectory)
*
* When done building the updated files, you can clean-up by removing
Expand All @@ -52,6 +52,8 @@
*/
#include <fontforge-config.h>

#define UnicodeMajor 9
#define UnicodeMinor 0

/* Build a ctype array out of the UnicodeData.txt and PropList.txt files */
#include <stdio.h>
Expand Down Expand Up @@ -137,7 +139,7 @@ unsigned long ligature[LG_MAX];
unsigned long fraction[FR_MAX];
unsigned long vulgfrac[VF_MAX];

const char GeneratedFileMessage[] = "\n/* This file was generated using the program 'makeutype' */\n\n";
const char GeneratedFileMessage[] = "\n/* This file was generated using the program 'makeutype' for Unicode_version %d.%d */\n\n";
const char CantReadFile[] = "Can't find or read file %s\n"; /* exit(1) */
const char CantSaveFile[] = "Can't open or write to output file %s\n"; /* exit(2) */
const char NoMoreMemory[] = "Can't access more memory.\n"; /* exit(3) */
Expand Down Expand Up @@ -664,7 +666,7 @@ static void dumparabicdata(FILE *header) {
fprintf( data, "/* Copyright: 2001 George Williams */\n" );
fprintf( data, "/* License: BSD-3-clause */\n" );
fprintf( data, "/* Contributions: Khaled Hosny, Joe Da Silva */\n" );
fprintf( data, GeneratedFileMessage );
fprintf( data, GeneratedFileMessage, UnicodeMajor, UnicodeMinor );

fprintf( data, "#include <utype.h>\n\n" );

Expand Down Expand Up @@ -760,7 +762,7 @@ static void dumpbsearchfindN(FILE *data,long unsigned int *dt,int s,int m,char *
fprintf( data, "(uCode<%d && isligorfrac(uCode)==0) )\n", MAXC );
fprintf( data, "\treturn( -1 );\n " );
if ( s<m )
fprintf( data, "if ( uCode<%d ) {\n\tuCode16 = uCode;\n\t", s );
fprintf( data, "if ( uCode<0x%x ) {\n\tuCode16 = uCode;\n\t", dt[s-1] );
else
fprintf( data, "uCode16 = uCode;\n " );
fprintf( data, "p16 = (uint16 *)(bsearch(&uCode16, %s16, %d, \\\n", t, s );
Expand Down Expand Up @@ -824,7 +826,7 @@ static void dumpligaturesfractions(FILE *header) {
fprintf( data, "Copyright: 2016 Joe Da Silva\n" );
fprintf( data, "License: BSD-3-clause\n" );
fprintf( data, "Contributions:\n*/\n" );
fprintf( data, GeneratedFileMessage );
fprintf( data, GeneratedFileMessage, UnicodeMajor, UnicodeMinor );
fprintf( data, "#include \"utype.h\"\n" );
fprintf( data, "#include <stdlib.h>\n\n" );

Expand Down Expand Up @@ -901,7 +903,7 @@ static void dump() {
fprintf( header, "/* Copyright: 2001 George Williams */\n" );
fprintf( header, "/* License: BSD-3-clause */\n" );
fprintf( header, "/* Contributions: Joe Da Silva */\n" );
fprintf( header, GeneratedFileMessage );
fprintf( header, GeneratedFileMessage, UnicodeMajor, UnicodeMinor );

fprintf( header, "#include <ctype.h>\t/* Include here so we can control it. If a system header includes it later bad things happen */\n" );
fprintf( header, "#include <basics.h>\t/* Include here so we can use pre-defined int types to correctly size constant data arrays. */\n" );
Expand Down Expand Up @@ -1049,7 +1051,7 @@ static void dump() {
fprintf( data, "/* License: BSD-3-clause */\n" );
fprintf( data, "/* Contributions: Werner Lemberg, Khaled Hosny, Joe Da Silva */\n\n" );
fprintf( data, "#include \"utype.h\"\n" );
fprintf( data, GeneratedFileMessage );
fprintf( data, GeneratedFileMessage, UnicodeMajor, UnicodeMinor );
fprintf( data, "const unsigned short ____tolower[]= { 0,\n" );
for ( i=0; i<MAXC; i+=j ) {
fprintf( data, " " );
Expand Down Expand Up @@ -1197,7 +1199,7 @@ return;

fprintf(file, "#include <chardata.h>\n" );

fprintf(file, GeneratedFileMessage );
fprintf(file, GeneratedFileMessage, UnicodeMajor, UnicodeMinor );

for ( i=32; i<MAXC; ++i ) {
if ( alts[i][0]!=0 ) {
Expand Down

0 comments on commit d9aa90e

Please sign in to comment.