From e8714be5ef4c64a54bec8389ab3858dd8eaa8fa6 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Mon, 11 Mar 2019 11:33:02 +0800 Subject: [PATCH] rename macros --- src/font/charset.c | 36 +-- src/font/unicode-arabic-misc-table.inc | 8 +- src/font/unicode-arabic-shaping-table.inc | 12 +- src/font/unicode-bidi-brackets-table.inc | 10 +- src/font/unicode-bidi-brackets-type-table.inc | 8 +- src/font/unicode-bidi-mirroring-table.inc | 10 +- src/font/unicode-bidi-tables.h | 240 +++++++++--------- src/font/unicode-bidi-type-table.inc | 8 +- src/font/unicode-bidi-types-list.inc | 106 ++++---- src/font/unicode-bidi.h | 4 +- src/font/unicode-joining-type-table.inc | 8 +- src/font/unicode-joining-types-list.inc | 18 +- src/font/utils/Makefile | 1 + src/font/utils/gen-arabic-shaping-tab.c | 20 +- src/font/utils/gen-bidi-type-tab.c | 36 +-- src/font/utils/gen-brackets-tab.c | 20 +- src/font/utils/gen-brackets-type-tab.c | 12 +- src/font/utils/gen-joining-type-tab.c | 24 +- src/font/utils/gen-mirroring-tab.c | 12 +- src/font/utils/gen-unicode-version.c | 8 +- 20 files changed, 301 insertions(+), 300 deletions(-) diff --git a/src/font/charset.c b/src/font/charset.c index e1a32995..88621c28 100644 --- a/src/font/charset.c +++ b/src/font/charset.c @@ -3577,42 +3577,42 @@ static unsigned int unicode_char_type (Achar32 chv) return (break_type << 24) | (basic_type << 16) | mchar_type; } -#define _USE_MGBIDI +#define _USE_UNIBIDI -#ifdef _USE_MGBIDI +#ifdef _USE_UNIBIDI enum _BidiCharTypeLinearEnum { -#define _MGBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE, +#define _UNIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE, #include "unicode-bidi-types-list.inc" -#undef _MGBIDI_ADD_TYPE - _MGBIDI_NUM_TYPES +#undef _UNIBIDI_ADD_TYPE + _UNIBIDI_NUM_TYPES }; #include "unicode-bidi-type-table.inc" /* Map _BidiCharTypeLinearEnum to BidiType. */ static const BidiType linear_enum_to_bidi_type[] = { -#define _MGBIDI_ADD_TYPE(TYPE,SYMBOL) BIDI_TYPE_##TYPE, +#define _UNIBIDI_ADD_TYPE(TYPE,SYMBOL) BIDI_TYPE_##TYPE, #include "unicode-bidi-types-list.inc" -#undef _MGBIDI_ADD_TYPE +#undef _UNIBIDI_ADD_TYPE }; static BidiType unicode_bidi_char_type(Achar32 ch) { ch = REAL_ACHAR(ch); - return linear_enum_to_bidi_type[MGBIDI_GET_BIDI_TYPE(ch)]; + return linear_enum_to_bidi_type[UNIBIDI_GET_BIDI_TYPE(ch)]; } BidiType GUIAPI UCharGetBidiType(Uchar32 uc) { - return linear_enum_to_bidi_type[MGBIDI_GET_BIDI_TYPE(uc)]; + return linear_enum_to_bidi_type[UNIBIDI_GET_BIDI_TYPE(uc)]; } void UCharGetBidiTypes(const Uchar32 *str, int len, BidiType *btypes) { register int i = len; for (; i; i--) { - *btypes++ = linear_enum_to_bidi_type[MGBIDI_GET_BIDI_TYPE(*str)]; + *btypes++ = linear_enum_to_bidi_type[UNIBIDI_GET_BIDI_TYPE(*str)]; str++; } } @@ -3620,12 +3620,12 @@ void UCharGetBidiTypes(const Uchar32 *str, int len, BidiType *btypes) #include "unicode-bidi-brackets-table.inc" #include "unicode-bidi-brackets-type-table.inc" -#define MGBIDI_TYPE_BRACKET_OPEN 2 +#define UNIBIDI_TYPE_BRACKET_OPEN 2 BidiBracketType UCharGetBracketType(Uchar32 ch) { BidiBracketType bracket_type; - register Uint8 char_type = MGBIDI_GET_BRACKET_TYPE (ch); + register Uint8 char_type = UNIBIDI_GET_BRACKET_TYPE (ch); /* The bracket type from the table may be: 0 - Not a bracket @@ -3640,8 +3640,8 @@ BidiBracketType UCharGetBracketType(Uchar32 ch) if (char_type == 0) bracket_type = BIDI_BRACKET_NONE; else { - is_open = (char_type & MGBIDI_TYPE_BRACKET_OPEN) != 0; - bracket_type = MGBIDI_GET_BRACKETS (ch) & BIDI_BRACKET_CHAR_MASK; + is_open = (char_type & UNIBIDI_TYPE_BRACKET_OPEN) != 0; + bracket_type = UNIBIDI_GET_BRACKETS (ch) & BIDI_BRACKET_CHAR_MASK; } if (is_open) @@ -3676,7 +3676,7 @@ static BOOL unicode_bidi_mirror_char(Achar32 ch, Achar32* mirrored_ch) mbc_mask = ch & ACHAR_MBC_FLAG; ch = REAL_ACHAR(ch); - result = MGBIDI_GET_MIRRORING(ch); + result = UNIBIDI_GET_MIRRORING(ch); if (mirrored_ch) *mirrored_ch = result; result |= mbc_mask; @@ -3688,7 +3688,7 @@ BOOL GUIAPI UCharGetMirror(Uchar32 ch, Uchar32* mirrored_ch) { register Achar32 result; - result = MGBIDI_GET_MIRRORING(ch); + result = UNIBIDI_GET_MIRRORING(ch); if (mirrored_ch) *mirrored_ch = result; return ch != result ? TRUE : FALSE; @@ -3767,7 +3767,7 @@ found: bracket_type = __mg_unicode_bracket_table[mid].chv + __mg_unicode_bracket_table[mid].bracket_off; bracket_type &= BIDI_BRACKET_CHAR_MASK; - if (__mg_unicode_bracket_table[mid].type == MGBIDI_BRACKET_OPEN) + if (__mg_unicode_bracket_table[mid].type == UNIBIDI_BRACKET_OPEN) bracket_type |= BIDI_BRACKET_OPEN_MASK; return bracket_type; @@ -3788,7 +3788,7 @@ BOOL GUIAPI UCharGetMirror(Uchar32 uc, Uchar32* mirrored) return unicode_bidi_mirror_char (uc, mirrored); } -#endif /* !_USE_MGBIDI */ +#endif /* !_USE_UNIBIDI */ static int utf8_nr_chars_in_str (const unsigned char* mstr, int mstrlen) { diff --git a/src/font/unicode-arabic-misc-table.inc b/src/font/unicode-arabic-misc-table.inc index 5b49755b..874989ce 100644 --- a/src/font/unicode-arabic-misc-table.inc +++ b/src/font/unicode-arabic-misc-table.inc @@ -82,11 +82,11 @@ static const Uchar32 NSMShap[][4] = { {0xFE7E, 0xFE7F, 0xFE7E, 0xFE7F,}, }; -#ifndef MGBIDI_ACCESS_SHAPE_TABLE -# define MGBIDI_ACCESS_SHAPE_TABLE(table,min,max,x,shape) \ +#ifndef UNIBIDI_ACCESS_SHAPE_TABLE +# define UNIBIDI_ACCESS_SHAPE_TABLE(table,min,max,x,shape) \ (((x)<(min)||(x)>(max))?(x):(table)[(x)-(min)][(shape)]) #endif -#define MGBIDI_GET_ARABIC_SHAPE_NSM(x,shape) \ - MGBIDI_ACCESS_SHAPE_TABLE(NSMShap, 0x064B, 0x0652, (x), (shape)) +#define UNIBIDI_GET_ARABIC_SHAPE_NSM(x,shape) \ + UNIBIDI_ACCESS_SHAPE_TABLE(NSMShap, 0x064B, 0x0652, (x), (shape)) diff --git a/src/font/unicode-arabic-shaping-table.inc b/src/font/unicode-arabic-shaping-table.inc index 136091f2..81ddad79 100644 --- a/src/font/unicode-arabic-shaping-table.inc +++ b/src/font/unicode-arabic-shaping-table.inc @@ -1,9 +1,9 @@ -/* mgbidi-arabic-shaping-table.h +/* unicode-arabic-shaping-table.inc * generated by gen-arabic-shaping-tab * from the files UnicodeData.txt, (null) of Unicode version 12.0.0. */ /* - use MGBIDI_GET_ARABIC_SHAPE_PRES(key,shape) to access your table + use UNIBIDI_GET_ARABIC_SHAPE_PRES(key,shape) to access your table required memory: 2864 */ @@ -195,11 +195,11 @@ static const Uchar32 ArShap[179][4] = { /* *INDENT-ON* */ -#ifndef MGBIDI_ACCESS_SHAPE_TABLE -# define MGBIDI_ACCESS_SHAPE_TABLE(table,min,max,x,shape) \ +#ifndef UNIBIDI_ACCESS_SHAPE_TABLE +# define UNIBIDI_ACCESS_SHAPE_TABLE(table,min,max,x,shape) \ (((x)<(min)||(x)>(max))?(x):(table)[(x)-(min)][(shape)]) #endif -#define MGBIDI_GET_ARABIC_SHAPE_PRES(x,shape) MGBIDI_ACCESS_SHAPE_TABLE(ArShap, 0x0621, 0x06d3, (x), (shape)) +#define UNIBIDI_GET_ARABIC_SHAPE_PRES(x,shape) UNIBIDI_ACCESS_SHAPE_TABLE(ArShap, 0x0621, 0x06d3, (x), (shape)) -/* End of generated mgbidi-arabic-shaping-table.h */ +/* End of generated unicode-arabic-shaping-table.inc */ diff --git a/src/font/unicode-bidi-brackets-table.inc b/src/font/unicode-bidi-brackets-table.inc index bf482002..0cf8d018 100644 --- a/src/font/unicode-bidi-brackets-table.inc +++ b/src/font/unicode-bidi-brackets-table.inc @@ -1,4 +1,4 @@ -/* mgbidi-brackets-table.h +/* unicode-bidi-brackets-table.inc * generated by gen-brackets-tab * from the file BidiBrackets.txt of Unicode version 12.0.0. */ @@ -9,7 +9,7 @@ /* generated by packtab.c version 3 - use MGBIDI_GET_BRACKETS_DELTA(key) to access your table + use UNIBIDI_GET_BRACKETS_DELTA(key) to access your table assumed sizeof(Sint32): 4 required memory: 6400 @@ -1099,7 +1099,7 @@ static const PACKTAB_UINT16 BrkLev0[1024*1] = { BrkLev1_0080, /* FFC0..FFFF */ }; -#define MGBIDI_GET_BRACKETS_DELTA(x) \ +#define UNIBIDI_GET_BRACKETS_DELTA(x) \ ((x) >= 0x10000 ? 0 : \ BrkLev1[((x) & 0x3f) + \ BrkLev0[((x) >> 6)]]) @@ -1108,6 +1108,6 @@ static const PACKTAB_UINT16 BrkLev0[1024*1] = { #undef PACKTAB_UINT16 #undef PACKTAB_UINT32 -#define MGBIDI_GET_BRACKETS(x) ((x) + MGBIDI_GET_BRACKETS_DELTA(x)) +#define UNIBIDI_GET_BRACKETS(x) ((x) + UNIBIDI_GET_BRACKETS_DELTA(x)) -/* End of generated mgbidi-brackets-table.h */ +/* End of generated unicode-bidi-brackets-table.inc */ diff --git a/src/font/unicode-bidi-brackets-type-table.inc b/src/font/unicode-bidi-brackets-type-table.inc index e2759265..38c7f023 100644 --- a/src/font/unicode-bidi-brackets-type-table.inc +++ b/src/font/unicode-bidi-brackets-type-table.inc @@ -1,4 +1,4 @@ -/* mgbidi-brackets-type-tablel.h +/* unicode-bidi-brackets-type-table.inc * generated by gen-brackets-type-tab * from the file BidiBrackets.txt of Unicode version 12.0.0. */ @@ -9,7 +9,7 @@ /* generated by packtab.c version 3 - use MGBIDI_GET_BRACKET_TYPE(key) to access your table + use UNIBIDI_GET_BRACKET_TYPE(key) to access your table assumed sizeof(Sint8): 1 required memory: 2816 @@ -606,7 +606,7 @@ static const PACKTAB_UINT16 BrtLev0[512*1] = { BrtLev1_0080, /* FF80..FFFF */ }; -#define MGBIDI_GET_BRACKET_TYPE(x) \ +#define UNIBIDI_GET_BRACKET_TYPE(x) \ ((x) >= 0x10000 ? 0 : \ BrtLev1[((x) & 0x7f) + \ BrtLev0[((x) >> 7)]]) @@ -615,4 +615,4 @@ static const PACKTAB_UINT16 BrtLev0[512*1] = { #undef PACKTAB_UINT16 #undef PACKTAB_UINT32 -/* End of generated mgbidi-brackets-type-tablel.h */ +/* End of generated unicode-bidi-brackets-type-table.inc */ diff --git a/src/font/unicode-bidi-mirroring-table.inc b/src/font/unicode-bidi-mirroring-table.inc index e23eddf2..d0bdfdd4 100644 --- a/src/font/unicode-bidi-mirroring-table.inc +++ b/src/font/unicode-bidi-mirroring-table.inc @@ -1,4 +1,4 @@ -/* mgbidi-mirroring-table.h +/* unicode-bidi-mirroring-table.inc * generated by gen-mirroring-tab * from the file BidiMirroring.txt of Unicode version 12.0.0. */ @@ -9,7 +9,7 @@ /* generated by packtab.c version 3 - use MGBIDI_GET_MIRRORING_DELTA(key) to access your table + use UNIBIDI_GET_MIRRORING_DELTA(key) to access your table assumed sizeof(Sint16): 2 required memory: 5632 @@ -1132,7 +1132,7 @@ static const PACKTAB_UINT16 MirLev0[1024*1] = { MirLev1_00C0, /* FFC0..FFFF */ }; -#define MGBIDI_GET_MIRRORING_DELTA(x) \ +#define UNIBIDI_GET_MIRRORING_DELTA(x) \ ((x) >= 0x10000 ? 0 : \ MirLev1[((x) & 0x3f) + \ MirLev0[((x) >> 6)]]) @@ -1141,6 +1141,6 @@ static const PACKTAB_UINT16 MirLev0[1024*1] = { #undef PACKTAB_UINT16 #undef PACKTAB_UINT32 -#define MGBIDI_GET_MIRRORING(x) ((x) + MGBIDI_GET_MIRRORING_DELTA(x)) +#define UNIBIDI_GET_MIRRORING(x) ((x) + UNIBIDI_GET_MIRRORING_DELTA(x)) -/* End of generated mgbidi-mirroring-table.h */ +/* End of generated unicode-bidi-mirroring-table.inc */ diff --git a/src/font/unicode-bidi-tables.h b/src/font/unicode-bidi-tables.h index 6ba897a9..9724899a 100644 --- a/src/font/unicode-bidi-tables.h +++ b/src/font/unicode-bidi-tables.h @@ -1159,126 +1159,126 @@ static const BIDICHAR_TYPE_MAP __mg_unicode_bidi_char_type_map[] = static const BIDICHAR_BRACKET __mg_unicode_bracket_table[] = { - { 0x000028, 1, MGBIDI_BRACKET_OPEN }, - { 0x000029, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00005B, 2, MGBIDI_BRACKET_OPEN }, - { 0x00005D, -2, MGBIDI_BRACKET_CLOSE }, - { 0x00007B, 2, MGBIDI_BRACKET_OPEN }, - { 0x00007D, -2, MGBIDI_BRACKET_CLOSE }, - { 0x000F3A, 1, MGBIDI_BRACKET_OPEN }, - { 0x000F3B, -1, MGBIDI_BRACKET_CLOSE }, - { 0x000F3C, 1, MGBIDI_BRACKET_OPEN }, - { 0x000F3D, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00169B, 1, MGBIDI_BRACKET_OPEN }, - { 0x00169C, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002045, 1, MGBIDI_BRACKET_OPEN }, - { 0x002046, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00207D, 1, MGBIDI_BRACKET_OPEN }, - { 0x00207E, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00208D, 1, MGBIDI_BRACKET_OPEN }, - { 0x00208E, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002308, 1, MGBIDI_BRACKET_OPEN }, - { 0x002309, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00230A, 1, MGBIDI_BRACKET_OPEN }, - { 0x00230B, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002329, 1, MGBIDI_BRACKET_OPEN }, - { 0x00232A, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002768, 1, MGBIDI_BRACKET_OPEN }, - { 0x002769, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00276A, 1, MGBIDI_BRACKET_OPEN }, - { 0x00276B, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00276C, 1, MGBIDI_BRACKET_OPEN }, - { 0x00276D, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00276E, 1, MGBIDI_BRACKET_OPEN }, - { 0x00276F, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002770, 1, MGBIDI_BRACKET_OPEN }, - { 0x002771, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002772, 1, MGBIDI_BRACKET_OPEN }, - { 0x002773, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002774, 1, MGBIDI_BRACKET_OPEN }, - { 0x002775, -1, MGBIDI_BRACKET_CLOSE }, - { 0x0027C5, 1, MGBIDI_BRACKET_OPEN }, - { 0x0027C6, -1, MGBIDI_BRACKET_CLOSE }, - { 0x0027E6, 1, MGBIDI_BRACKET_OPEN }, - { 0x0027E7, -1, MGBIDI_BRACKET_CLOSE }, - { 0x0027E8, 1, MGBIDI_BRACKET_OPEN }, - { 0x0027E9, -1, MGBIDI_BRACKET_CLOSE }, - { 0x0027EA, 1, MGBIDI_BRACKET_OPEN }, - { 0x0027EB, -1, MGBIDI_BRACKET_CLOSE }, - { 0x0027EC, 1, MGBIDI_BRACKET_OPEN }, - { 0x0027ED, -1, MGBIDI_BRACKET_CLOSE }, - { 0x0027EE, 1, MGBIDI_BRACKET_OPEN }, - { 0x0027EF, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002983, 1, MGBIDI_BRACKET_OPEN }, - { 0x002984, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002985, 1, MGBIDI_BRACKET_OPEN }, - { 0x002986, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002987, 1, MGBIDI_BRACKET_OPEN }, - { 0x002988, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002989, 1, MGBIDI_BRACKET_OPEN }, - { 0x00298A, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00298B, 1, MGBIDI_BRACKET_OPEN }, - { 0x00298C, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00298D, 3, MGBIDI_BRACKET_OPEN }, - { 0x00298E, 1, MGBIDI_BRACKET_CLOSE }, - { 0x00298F, -1, MGBIDI_BRACKET_OPEN }, - { 0x002990, -3, MGBIDI_BRACKET_CLOSE }, - { 0x002991, 1, MGBIDI_BRACKET_OPEN }, - { 0x002992, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002993, 1, MGBIDI_BRACKET_OPEN }, - { 0x002994, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002995, 1, MGBIDI_BRACKET_OPEN }, - { 0x002996, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002997, 1, MGBIDI_BRACKET_OPEN }, - { 0x002998, -1, MGBIDI_BRACKET_CLOSE }, - { 0x0029D8, 1, MGBIDI_BRACKET_OPEN }, - { 0x0029D9, -1, MGBIDI_BRACKET_CLOSE }, - { 0x0029DA, 1, MGBIDI_BRACKET_OPEN }, - { 0x0029DB, -1, MGBIDI_BRACKET_CLOSE }, - { 0x0029FC, 1, MGBIDI_BRACKET_OPEN }, - { 0x0029FD, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002E22, 1, MGBIDI_BRACKET_OPEN }, - { 0x002E23, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002E24, 1, MGBIDI_BRACKET_OPEN }, - { 0x002E25, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002E26, 1, MGBIDI_BRACKET_OPEN }, - { 0x002E27, -1, MGBIDI_BRACKET_CLOSE }, - { 0x002E28, 1, MGBIDI_BRACKET_OPEN }, - { 0x002E29, -1, MGBIDI_BRACKET_CLOSE }, - { 0x003008, 1, MGBIDI_BRACKET_OPEN }, - { 0x003009, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00300A, 1, MGBIDI_BRACKET_OPEN }, - { 0x00300B, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00300C, 1, MGBIDI_BRACKET_OPEN }, - { 0x00300D, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00300E, 1, MGBIDI_BRACKET_OPEN }, - { 0x00300F, -1, MGBIDI_BRACKET_CLOSE }, - { 0x003010, 1, MGBIDI_BRACKET_OPEN }, - { 0x003011, -1, MGBIDI_BRACKET_CLOSE }, - { 0x003014, 1, MGBIDI_BRACKET_OPEN }, - { 0x003015, -1, MGBIDI_BRACKET_CLOSE }, - { 0x003016, 1, MGBIDI_BRACKET_OPEN }, - { 0x003017, -1, MGBIDI_BRACKET_CLOSE }, - { 0x003018, 1, MGBIDI_BRACKET_OPEN }, - { 0x003019, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00301A, 1, MGBIDI_BRACKET_OPEN }, - { 0x00301B, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00FE59, 1, MGBIDI_BRACKET_OPEN }, - { 0x00FE5A, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00FE5B, 1, MGBIDI_BRACKET_OPEN }, - { 0x00FE5C, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00FE5D, 1, MGBIDI_BRACKET_OPEN }, - { 0x00FE5E, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00FF08, 1, MGBIDI_BRACKET_OPEN }, - { 0x00FF09, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00FF3B, 2, MGBIDI_BRACKET_OPEN }, - { 0x00FF3D, -2, MGBIDI_BRACKET_CLOSE }, - { 0x00FF5B, 2, MGBIDI_BRACKET_OPEN }, - { 0x00FF5D, -2, MGBIDI_BRACKET_CLOSE }, - { 0x00FF5F, 1, MGBIDI_BRACKET_OPEN }, - { 0x00FF60, -1, MGBIDI_BRACKET_CLOSE }, - { 0x00FF62, 1, MGBIDI_BRACKET_OPEN }, - { 0x00FF63, -1, MGBIDI_BRACKET_CLOSE }, + { 0x000028, 1, UNIBIDI_BRACKET_OPEN }, + { 0x000029, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00005B, 2, UNIBIDI_BRACKET_OPEN }, + { 0x00005D, -2, UNIBIDI_BRACKET_CLOSE }, + { 0x00007B, 2, UNIBIDI_BRACKET_OPEN }, + { 0x00007D, -2, UNIBIDI_BRACKET_CLOSE }, + { 0x000F3A, 1, UNIBIDI_BRACKET_OPEN }, + { 0x000F3B, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x000F3C, 1, UNIBIDI_BRACKET_OPEN }, + { 0x000F3D, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00169B, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00169C, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002045, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002046, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00207D, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00207E, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00208D, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00208E, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002308, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002309, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00230A, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00230B, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002329, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00232A, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002768, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002769, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00276A, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00276B, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00276C, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00276D, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00276E, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00276F, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002770, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002771, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002772, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002773, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002774, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002775, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x0027C5, 1, UNIBIDI_BRACKET_OPEN }, + { 0x0027C6, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x0027E6, 1, UNIBIDI_BRACKET_OPEN }, + { 0x0027E7, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x0027E8, 1, UNIBIDI_BRACKET_OPEN }, + { 0x0027E9, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x0027EA, 1, UNIBIDI_BRACKET_OPEN }, + { 0x0027EB, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x0027EC, 1, UNIBIDI_BRACKET_OPEN }, + { 0x0027ED, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x0027EE, 1, UNIBIDI_BRACKET_OPEN }, + { 0x0027EF, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002983, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002984, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002985, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002986, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002987, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002988, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002989, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00298A, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00298B, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00298C, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00298D, 3, UNIBIDI_BRACKET_OPEN }, + { 0x00298E, 1, UNIBIDI_BRACKET_CLOSE }, + { 0x00298F, -1, UNIBIDI_BRACKET_OPEN }, + { 0x002990, -3, UNIBIDI_BRACKET_CLOSE }, + { 0x002991, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002992, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002993, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002994, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002995, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002996, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002997, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002998, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x0029D8, 1, UNIBIDI_BRACKET_OPEN }, + { 0x0029D9, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x0029DA, 1, UNIBIDI_BRACKET_OPEN }, + { 0x0029DB, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x0029FC, 1, UNIBIDI_BRACKET_OPEN }, + { 0x0029FD, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002E22, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002E23, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002E24, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002E25, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002E26, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002E27, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x002E28, 1, UNIBIDI_BRACKET_OPEN }, + { 0x002E29, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x003008, 1, UNIBIDI_BRACKET_OPEN }, + { 0x003009, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00300A, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00300B, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00300C, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00300D, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00300E, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00300F, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x003010, 1, UNIBIDI_BRACKET_OPEN }, + { 0x003011, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x003014, 1, UNIBIDI_BRACKET_OPEN }, + { 0x003015, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x003016, 1, UNIBIDI_BRACKET_OPEN }, + { 0x003017, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x003018, 1, UNIBIDI_BRACKET_OPEN }, + { 0x003019, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00301A, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00301B, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00FE59, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00FE5A, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00FE5B, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00FE5C, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00FE5D, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00FE5E, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00FF08, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00FF09, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00FF3B, 2, UNIBIDI_BRACKET_OPEN }, + { 0x00FF3D, -2, UNIBIDI_BRACKET_CLOSE }, + { 0x00FF5B, 2, UNIBIDI_BRACKET_OPEN }, + { 0x00FF5D, -2, UNIBIDI_BRACKET_CLOSE }, + { 0x00FF5F, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00FF60, -1, UNIBIDI_BRACKET_CLOSE }, + { 0x00FF62, 1, UNIBIDI_BRACKET_OPEN }, + { 0x00FF63, -1, UNIBIDI_BRACKET_CLOSE }, }; static const BIDICHAR_MIRROR_MAP __mg_unicode_mirror_table[] = diff --git a/src/font/unicode-bidi-type-table.inc b/src/font/unicode-bidi-type-table.inc index d8dc8673..91b50837 100644 --- a/src/font/unicode-bidi-type-table.inc +++ b/src/font/unicode-bidi-type-table.inc @@ -1,4 +1,4 @@ -/* mgbidi-bidi-type-table.h +/* unicode-bidi-type-table.h * generated by gen-bidi-type-tab * from the file UnicodeData.txt of Unicode version 12.0.0. */ @@ -9,7 +9,7 @@ /* generated by packtab.c version 3 - use MGBIDI_GET_BIDI_TYPE(key) to access your table + use UNIBIDI_GET_BIDI_TYPE(key) to access your table assumed sizeof(Uint8): 1 required memory: 36864 @@ -6246,7 +6246,7 @@ static const PACKTAB_UINT16 BidLev0[4352*1] = { BidLev1_1FF00, /* 10FF00..10FFFF */ }; -#define MGBIDI_GET_BIDI_TYPE(x) \ +#define UNIBIDI_GET_BIDI_TYPE(x) \ ((x) >= 0x110000 ? LTR : \ BidLev1[((x) & 0xff) + \ BidLev0[((x) >> 8)]]) @@ -6255,4 +6255,4 @@ static const PACKTAB_UINT16 BidLev0[4352*1] = { #undef PACKTAB_UINT16 #undef PACKTAB_UINT32 -/* End of generated mgbidi-bidi-type-table.h */ +/* End of generated unicode-bidi-type-table.h */ diff --git a/src/font/unicode-bidi-types-list.inc b/src/font/unicode-bidi-types-list.inc index 4e942f42..c5907224 100644 --- a/src/font/unicode-bidi-types-list.inc +++ b/src/font/unicode-bidi-types-list.inc @@ -52,67 +52,67 @@ ** Copyright (C) 1999,2000,2017 Dov Grobgeld */ -#ifndef _MGBIDI_ADD_TYPE -# define _MGBIDI_ADD_TYPE(x,y) +#ifndef _UNIBIDI_ADD_TYPE +# define _UNIBIDI_ADD_TYPE(x,y) #endif -#ifndef _MGBIDI_ADD_ALIAS -# define _MGBIDI_ADD_ALIAS(x1,x2) +#ifndef _UNIBIDI_ADD_ALIAS +# define _UNIBIDI_ADD_ALIAS(x1,x2) #endif -#if !defined(_MGBIDI_PAR_TYPES) || defined(_MGBIDI_ALL_TYPES) +#if !defined(_UNIBIDI_PAR_TYPES) || defined(_UNIBIDI_ALL_TYPES) -_MGBIDI_ADD_TYPE (LTR, 'L') /* Left-To-Right letter */ -_MGBIDI_ADD_TYPE (RTL, 'R') /* Right-To-Left letter */ -_MGBIDI_ADD_TYPE (AL, 'A') /* Arabic Letter */ -_MGBIDI_ADD_TYPE (EN, '1') /* European Numeral */ -_MGBIDI_ADD_TYPE (AN, '9') /* Arabic Numeral */ -_MGBIDI_ADD_TYPE (ES, 'w') /* European number Separator */ -_MGBIDI_ADD_TYPE (ET, 'w') /* European number Terminator */ -_MGBIDI_ADD_TYPE (CS, 'w') /* Common Separator */ -_MGBIDI_ADD_TYPE (NSM, '`') /* Non Spacing Mark */ -_MGBIDI_ADD_TYPE (BN, 'b') /* Boundary Neutral */ -_MGBIDI_ADD_TYPE (BS, 'B') /* Block Separator */ -_MGBIDI_ADD_TYPE (SS, 'S') /* Segment Separator */ -_MGBIDI_ADD_TYPE (WS, '_') /* WhiteSpace */ -_MGBIDI_ADD_TYPE (ON, 'n') /* Other Neutral */ -_MGBIDI_ADD_TYPE (LRE, '+') /* Left-to-Right Embedding */ -_MGBIDI_ADD_TYPE (RLE, '+') /* Right-to-Left Embedding */ -_MGBIDI_ADD_TYPE (LRO, '+') /* Left-to-Right Override */ -_MGBIDI_ADD_TYPE (RLO, '+') /* Right-to-Left Override */ -_MGBIDI_ADD_TYPE (PDF, '-') /* Pop Directional Flag */ -_MGBIDI_ADD_TYPE (LRI, '+') /* Left-to-Right Isolate */ -_MGBIDI_ADD_TYPE (RLI, '+') /* Right-to-Left Isolate */ -_MGBIDI_ADD_TYPE (FSI, '+') /* First-Strong Isolate */ -_MGBIDI_ADD_TYPE (PDI, '-') /* Pop Directional Isolate */ +_UNIBIDI_ADD_TYPE (LTR, 'L') /* Left-To-Right letter */ +_UNIBIDI_ADD_TYPE (RTL, 'R') /* Right-To-Left letter */ +_UNIBIDI_ADD_TYPE (AL, 'A') /* Arabic Letter */ +_UNIBIDI_ADD_TYPE (EN, '1') /* European Numeral */ +_UNIBIDI_ADD_TYPE (AN, '9') /* Arabic Numeral */ +_UNIBIDI_ADD_TYPE (ES, 'w') /* European number Separator */ +_UNIBIDI_ADD_TYPE (ET, 'w') /* European number Terminator */ +_UNIBIDI_ADD_TYPE (CS, 'w') /* Common Separator */ +_UNIBIDI_ADD_TYPE (NSM, '`') /* Non Spacing Mark */ +_UNIBIDI_ADD_TYPE (BN, 'b') /* Boundary Neutral */ +_UNIBIDI_ADD_TYPE (BS, 'B') /* Block Separator */ +_UNIBIDI_ADD_TYPE (SS, 'S') /* Segment Separator */ +_UNIBIDI_ADD_TYPE (WS, '_') /* WhiteSpace */ +_UNIBIDI_ADD_TYPE (ON, 'n') /* Other Neutral */ +_UNIBIDI_ADD_TYPE (LRE, '+') /* Left-to-Right Embedding */ +_UNIBIDI_ADD_TYPE (RLE, '+') /* Right-to-Left Embedding */ +_UNIBIDI_ADD_TYPE (LRO, '+') /* Left-to-Right Override */ +_UNIBIDI_ADD_TYPE (RLO, '+') /* Right-to-Left Override */ +_UNIBIDI_ADD_TYPE (PDF, '-') /* Pop Directional Flag */ +_UNIBIDI_ADD_TYPE (LRI, '+') /* Left-to-Right Isolate */ +_UNIBIDI_ADD_TYPE (RLI, '+') /* Right-to-Left Isolate */ +_UNIBIDI_ADD_TYPE (FSI, '+') /* First-Strong Isolate */ +_UNIBIDI_ADD_TYPE (PDI, '-') /* Pop Directional Isolate */ -#if defined(_MGBIDI_ADD_ALIAS) -_MGBIDI_ADD_ALIAS (L, LTR) -_MGBIDI_ADD_ALIAS (R, RTL) -_MGBIDI_ADD_ALIAS (B, BS) -_MGBIDI_ADD_ALIAS (S, SS) -#endif /* _MGBIDI_ADD_ALIAS */ +#if defined(_UNIBIDI_ADD_ALIAS) +_UNIBIDI_ADD_ALIAS (L, LTR) +_UNIBIDI_ADD_ALIAS (R, RTL) +_UNIBIDI_ADD_ALIAS (B, BS) +_UNIBIDI_ADD_ALIAS (S, SS) +#endif /* _UNIBIDI_ADD_ALIAS */ -#if defined(_MGBIDI_SENTINEL_TYPE) || defined(_MGBIDI_ALL_TYPES) -_MGBIDI_ADD_TYPE (SENTINEL, '$') /* SENTINEL */ -#endif /* _MGBIDI_SENTINEL_TYPES || _MGBIDI_ALL_TYPES*/ -#endif /* !_MGBIDI_PAR_TYPES || _MGBIDI_ALL_TYPES */ +#if defined(_UNIBIDI_SENTINEL_TYPE) || defined(_UNIBIDI_ALL_TYPES) +_UNIBIDI_ADD_TYPE (SENTINEL, '$') /* SENTINEL */ +#endif /* _UNIBIDI_SENTINEL_TYPES || _UNIBIDI_ALL_TYPES*/ +#endif /* !_UNIBIDI_PAR_TYPES || _UNIBIDI_ALL_TYPES */ -#if defined(_MGBIDI_PAR_TYPES) || defined(_MGBIDI_ALL_TYPES) -# if !defined(_MGBIDI_ALL_TYPES) -_MGBIDI_ADD_TYPE (LTR, 'L') /* Left-To-Right paragraph */ -_MGBIDI_ADD_TYPE (RTL, 'R') /* Right-To-Left paragraph */ -_MGBIDI_ADD_TYPE (ON, 'n') /* directiOn-Neutral paragraph */ -# endif /* !_MGBIDI_ALL_TYPES */ -_MGBIDI_ADD_TYPE (WLTR, 'l') /* Weak Left To Right paragraph */ -_MGBIDI_ADD_TYPE (WRTL, 'r') /* Weak Right To Left paragraph */ -#endif /* _MGBIDI_PAR_TYPES || _MGBIDI_ALL_TYPES*/ +#if defined(_UNIBIDI_PAR_TYPES) || defined(_UNIBIDI_ALL_TYPES) +# if !defined(_UNIBIDI_ALL_TYPES) +_UNIBIDI_ADD_TYPE (LTR, 'L') /* Left-To-Right paragraph */ +_UNIBIDI_ADD_TYPE (RTL, 'R') /* Right-To-Left paragraph */ +_UNIBIDI_ADD_TYPE (ON, 'n') /* directiOn-Neutral paragraph */ +# endif /* !_UNIBIDI_ALL_TYPES */ +_UNIBIDI_ADD_TYPE (WLTR, 'l') /* Weak Left To Right paragraph */ +_UNIBIDI_ADD_TYPE (WRTL, 'r') /* Weak Right To Left paragraph */ +#endif /* _UNIBIDI_PAR_TYPES || _UNIBIDI_ALL_TYPES*/ -#if defined(_MGBIDI_ENUM_TYPES) +#if defined(_UNIBIDI_ENUM_TYPES) typedef enum { -# define _MGBIDI_ADD_TYPE _MGBIDI_ENUM_ADD_TYPE +# define _UNIBIDI_ADD_TYPE _UNIBIDI_ENUM_ADD_TYPE # include "mgbidi-bidi-types-list.h" -# undef _MGBIDI_ADD_TYPE - _MGBIDI_TYPES_MAX -} _MGBIDI_ENUM_TYPES -#endif /* _MGBIDI_ENUM_TYPES */ +# undef _UNIBIDI_ADD_TYPE + _UNIBIDI_TYPES_MAX +} _UNIBIDI_ENUM_TYPES +#endif /* _UNIBIDI_ENUM_TYPES */ diff --git a/src/font/unicode-bidi.h b/src/font/unicode-bidi.h index 40896993..bfe95c9c 100644 --- a/src/font/unicode-bidi.h +++ b/src/font/unicode-bidi.h @@ -50,9 +50,9 @@ #define _MGFONT_UNICODE_BIDI_H #ifdef _MGCHARSET_UNICODE_FULL -#define MGBIDI_UNICODE_CHARS 0x110000 +#define UNIBIDI_UNICODE_CHARS 0x110000 #else -#define MGBIDI_UNICODE_CHARS 0xFFFE +#define UNIBIDI_UNICODE_CHARS 0xFFFE #endif /* some general macros */ diff --git a/src/font/unicode-joining-type-table.inc b/src/font/unicode-joining-type-table.inc index 337dc20d..3b79cc43 100644 --- a/src/font/unicode-joining-type-table.inc +++ b/src/font/unicode-joining-type-table.inc @@ -1,4 +1,4 @@ -/* mgbidi-joining-type-table.h +/* unicode-joining-type-table.h * generated by gen-joining-type-tab * from the files UnicodeData.txt, ArabicShaping.txt of Unicode version 12.0.0. */ @@ -9,7 +9,7 @@ /* generated by packtab.c version 3 - use MGBIDI_GET_JOINING_TYPE(key) to access your table + use UNIBIDI_GET_JOINING_TYPE(key) to access your table assumed sizeof(Uint8): 1 required memory: 26368 @@ -4759,7 +4759,7 @@ static const PACKTAB_UINT16 JoiLev0[4096*1] = { JoiLev1_00100, /* FFF00..FFFFF */ }; -#define MGBIDI_GET_JOINING_TYPE(x) \ +#define UNIBIDI_GET_JOINING_TYPE(x) \ ((x) >= 0x100000 ? U : \ JoiLev1[((x) & 0xff) + \ JoiLev0[((x) >> 8)]]) @@ -4768,4 +4768,4 @@ static const PACKTAB_UINT16 JoiLev0[4096*1] = { #undef PACKTAB_UINT16 #undef PACKTAB_UINT32 -/* End of generated mgbidi-joining-type-table.h */ +/* End of generated unicode-joining-type-table.h */ diff --git a/src/font/unicode-joining-types-list.inc b/src/font/unicode-joining-types-list.inc index 92d37d09..60a1ae2f 100644 --- a/src/font/unicode-joining-types-list.inc +++ b/src/font/unicode-joining-types-list.inc @@ -44,14 +44,14 @@ ** https://github.com/fribidi/fribidi */ -#ifndef _MGBIDI_ADD_TYPE -# define _MGBIDI_ADD_TYPE(x,y) +#ifndef _UNIBIDI_ADD_TYPE +# define _UNIBIDI_ADD_TYPE(x,y) #endif -_MGBIDI_ADD_TYPE (U, '|') /* nUn-joining, e.g. Full Stop */ -_MGBIDI_ADD_TYPE (R, '<') /* Right-joining, e.g. Arabic Letter Dal */ -_MGBIDI_ADD_TYPE (D, '+') /* Dual-joining, e.g. Arabic Letter Ain */ -_MGBIDI_ADD_TYPE (C, '-') /* join-Causing, e.g. Tatweel, ZWJ */ -_MGBIDI_ADD_TYPE (T, '^') /* Transparent, e.g. Arabic Fatha */ -_MGBIDI_ADD_TYPE (L, '>') /* Left-joining, i.e. fictional */ -_MGBIDI_ADD_TYPE (G, '~') /* iGnored, e.g. LRE, RLE, ZWNBSP */ +_UNIBIDI_ADD_TYPE (U, '|') /* nUn-joining, e.g. Full Stop */ +_UNIBIDI_ADD_TYPE (R, '<') /* Right-joining, e.g. Arabic Letter Dal */ +_UNIBIDI_ADD_TYPE (D, '+') /* Dual-joining, e.g. Arabic Letter Ain */ +_UNIBIDI_ADD_TYPE (C, '-') /* join-Causing, e.g. Tatweel, ZWJ */ +_UNIBIDI_ADD_TYPE (T, '^') /* Transparent, e.g. Arabic Fatha */ +_UNIBIDI_ADD_TYPE (L, '>') /* Left-joining, i.e. fictional */ +_UNIBIDI_ADD_TYPE (G, '~') /* iGnored, e.g. LRE, RLE, ZWNBSP */ diff --git a/src/font/utils/Makefile b/src/font/utils/Makefile index f8c05723..24d0c6ab 100644 --- a/src/font/utils/Makefile +++ b/src/font/utils/Makefile @@ -61,6 +61,7 @@ unicode-joining-type-table.inc: \ unicode-arabic-shaping-table.inc: \ ucd/UnicodeData.txt \ + ucd/ArabicShaping.txt \ unicode-version.h \ gen-arabic-shaping-tab ./gen-arabic-shaping-tab $(COMPRESSION) $^ > $@ diff --git a/src/font/utils/gen-arabic-shaping-tab.c b/src/font/utils/gen-arabic-shaping-tab.c index ff5aa12c..9bbc1458 100644 --- a/src/font/utils/gen-arabic-shaping-tab.c +++ b/src/font/utils/gen-arabic-shaping-tab.c @@ -114,12 +114,12 @@ shape_is ( } #define table_name "ArShap" -#define macro_name "MGBIDI_GET_ARABIC_SHAPE_PRES" +#define macro_name "UNIBIDI_GET_ARABIC_SHAPE_PRES" #define START_CHAR 0x600 #define END_CHAR 0x700 -static Uchar32 table[MGBIDI_UNICODE_CHARS][4]; +static Uchar32 table[UNIBIDI_UNICODE_CHARS][4]; static char buf[4000]; static char tag[sizeof (buf)], buf2[sizeof (buf)]; static Uchar32 minshaped, maxshaped; @@ -132,7 +132,7 @@ clear_tab ( register Uchar32 c; register int shape; - for (c = 0; c < MGBIDI_UNICODE_CHARS; c++) + for (c = 0; c < UNIBIDI_UNICODE_CHARS; c++) for (shape = 0; shape < 4; shape++) table[c][shape] = c; } @@ -142,7 +142,7 @@ init ( void ) { - minshaped = MGBIDI_UNICODE_CHARS; + minshaped = UNIBIDI_UNICODE_CHARS; maxshaped = 0; clear_tab (); @@ -174,11 +174,11 @@ read_unicode_data_txt ( if (i != 3) continue; - if (i != 3 || c >= MGBIDI_UNICODE_CHARS || unshaped >= MGBIDI_UNICODE_CHARS) + if (i != 3 || c >= UNIBIDI_UNICODE_CHARS || unshaped >= UNIBIDI_UNICODE_CHARS) #if 0 die3l ("UnicodeData.txt: invalid input at line %ld: %s", l, s); #else - fprintf (stderr, "UnicodeData.txt: skip character larger than MGBIDI_UNICODE_CHARS at line %ld: %s", l, s); + fprintf (stderr, "UnicodeData.txt: skip character larger than UNIBIDI_UNICODE_CHARS at line %ld: %s", l, s); #endif shape = shape_is (tag, arabic_shaping_tags); @@ -231,7 +231,7 @@ gen_arabic_shaping_tab ( printf ("/* " outputname "\n * generated by " appname "\n" " * from the files %s, %s of Unicode version " - MGBIDI_UNICODE_VERSION ". */\n\n", data_file_type[0], + UNIBIDI_UNICODE_VERSION ". */\n\n", data_file_type[0], data_file_type[1]); printf ("/*\n" @@ -256,12 +256,12 @@ gen_arabic_shaping_tab ( printf ("/* *IND" "ENT-ON* */\n\n"); - printf ("#ifndef MGBIDI_ACCESS_SHAPE_TABLE\n" - "# define MGBIDI_ACCESS_SHAPE_TABLE(table,min,max,x,shape) \\\n" + printf ("#ifndef UNIBIDI_ACCESS_SHAPE_TABLE\n" + "# define UNIBIDI_ACCESS_SHAPE_TABLE(table,min,max,x,shape) \\\n" " (((x)<(min)||(x)>(max))?(x):(table)[(x)-(min)][(shape)])\n" "#endif\n\n"); printf ("#define %s(x,shape) " - "MGBIDI_ACCESS_SHAPE_TABLE(%s, 0x%04lx, 0x%04lx, (x), (shape))\n\n", + "UNIBIDI_ACCESS_SHAPE_TABLE(%s, 0x%04lx, 0x%04lx, (x), (shape))\n\n", macro_name, table_name, (unsigned long)minshaped, (unsigned long)maxshaped); printf ("/* End of generated " outputname " */\n"); diff --git a/src/font/utils/gen-bidi-type-tab.c b/src/font/utils/gen-bidi-type-tab.c index 2c811e98..73a831cd 100644 --- a/src/font/utils/gen-bidi-type-tab.c +++ b/src/font/utils/gen-bidi-type-tab.c @@ -79,11 +79,11 @@ die3 ( enum Char32TypeLinearEnumOffsetOne { -# define _MGBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE, -# define _MGBIDI_ADD_ALIAS(TYPE1,TYPE2) TYPE1 = TYPE2, +# define _UNIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE, +# define _UNIBIDI_ADD_ALIAS(TYPE1,TYPE2) TYPE1 = TYPE2, # include "../unicode-bidi-types-list.inc" -# undef _MGBIDI_ADD_ALIAS -# undef _MGBIDI_ADD_TYPE +# undef _UNIBIDI_ADD_ALIAS +# undef _UNIBIDI_ADD_TYPE NUM_TYPES }; @@ -94,11 +94,11 @@ struct } type_names[] = { -# define _MGBIDI_ADD_TYPE(TYPE,SYMBOL) {STRINGIZE(TYPE), TYPE}, -# define _MGBIDI_ADD_ALIAS(TYPE1,TYPE2) _MGBIDI_ADD_TYPE(TYPE1, SYMBOL) +# define _UNIBIDI_ADD_TYPE(TYPE,SYMBOL) {STRINGIZE(TYPE), TYPE}, +# define _UNIBIDI_ADD_ALIAS(TYPE1,TYPE2) _UNIBIDI_ADD_TYPE(TYPE1, SYMBOL) # include "../unicode-bidi-types-list.inc" -# undef _MGBIDI_ADD_ALIAS -# undef _MGBIDI_ADD_TYPE +# undef _UNIBIDI_ADD_ALIAS +# undef _UNIBIDI_ADD_TYPE }; #define type_names_count (sizeof (type_names) / sizeof (type_names[0])) @@ -120,9 +120,9 @@ get_type ( } #define table_name "Bid" -#define macro_name "MGBIDI_GET_BIDI_TYPE" +#define macro_name "UNIBIDI_GET_BIDI_TYPE" -static signed int table[MGBIDI_UNICODE_CHARS]; +static signed int table[UNIBIDI_UNICODE_CHARS]; static char buf[4000]; static char tp[sizeof (buf)]; @@ -146,7 +146,7 @@ clear_tab ( { register Uchar32 c; - for (c = 0; c < MGBIDI_UNICODE_CHARS; c++) + for (c = 0; c < UNIBIDI_UNICODE_CHARS; c++) table[c] = LTR; } @@ -183,10 +183,10 @@ init_tab_unicode_data_txt ( table[c] = BN; for (c = 0xFFF0; c < 0xFFF9; c++) table[c] = BN; - for (c = 0xFFFF; c < MGBIDI_UNICODE_CHARS; c += 0x10000) + for (c = 0xFFFF; c < UNIBIDI_UNICODE_CHARS; c += 0x10000) table[c - 1] = table[c] = BN; - if (MGBIDI_UNICODE_CHARS > 0x10000) + if (UNIBIDI_UNICODE_CHARS > 0x10000) { #if 0 for (c = 0x10800; c < 0x11000; c++) @@ -252,11 +252,11 @@ read_unicode_data_txt ( continue; i = sscanf (s, "%lx;%*[^;];%*[^;];%*[^;];%[^; ]", &c, tp); - if (i != 2 || c >= MGBIDI_UNICODE_CHARS) + if (i != 2 || c >= UNIBIDI_UNICODE_CHARS) #if 0 die3 ("invalid input at line %ld: %s", l, s); #else - fprintf (stderr, "skip character larger than MGBIDI_UNICODE_CHARS at line %ld: %s", l, s); + fprintf (stderr, "skip character larger than UNIBIDI_UNICODE_CHARS at line %ld: %s", l, s); #endif /* FIXME: We don't handle First..Last parts of UnicodeData.txt, @@ -295,7 +295,7 @@ read_derived_bidi_class_txt ( else i = sscanf (s, "%lx..%lx ; %[^; ]", &c, &c2, tp) - 1; - if (i != 2 || c > c2 || c2 >= MGBIDI_UNICODE_CHARS) + if (i != 2 || c > c2 || c2 >= UNIBIDI_UNICODE_CHARS) die3 ("invalid input at line %ld: %s", l, s); typ = get_type (tp); @@ -333,14 +333,14 @@ gen_bidi_type_tab ( { printf ("/* " outputname "\n * generated by " appname "\n" " * from the file %s of Unicode version " - MGBIDI_UNICODE_VERSION ". */\n\n", data_file_type); + UNIBIDI_UNICODE_VERSION ". */\n\n", data_file_type); printf ("#define PACKTAB_UINT8 Uint8\n" "#define PACKTAB_UINT16 Uint16\n" "#define PACKTAB_UINT32 Uint32\n\n"); if (!pack_table - (table, MGBIDI_UNICODE_CHARS, 1, LTR, max_depth, 3, names, + (table, UNIBIDI_UNICODE_CHARS, 1, LTR, max_depth, 3, names, "Uint8", table_name, macro_name, stdout)) die ("error: insufficient memory, decrease max_depth"); diff --git a/src/font/utils/gen-brackets-tab.c b/src/font/utils/gen-brackets-tab.c index 9e07b853..7722f90b 100644 --- a/src/font/utils/gen-brackets-tab.c +++ b/src/font/utils/gen-brackets-tab.c @@ -95,10 +95,10 @@ die4 ( } #define table_name "Brk" -#define macro_name "MGBIDI_GET_BRACKETS" +#define macro_name "UNIBIDI_GET_BRACKETS" -static signed int table[MGBIDI_UNICODE_CHARS]; -static signed int equiv_table[MGBIDI_UNICODE_CHARS]; +static signed int table[UNIBIDI_UNICODE_CHARS]; +static signed int equiv_table[UNIBIDI_UNICODE_CHARS]; static char buf[4000]; static signed long max_dist; @@ -117,14 +117,14 @@ clear_tabs ( { register Uchar32 c; - for (c = 0; c < MGBIDI_UNICODE_CHARS; c++) + for (c = 0; c < UNIBIDI_UNICODE_CHARS; c++) { table[c] = 0; equiv_table[c] = 0; } } -static signed int table[MGBIDI_UNICODE_CHARS]; +static signed int table[UNIBIDI_UNICODE_CHARS]; static char buf[4000]; /* Read the canonical mapping of unicode characters and store them in the @@ -154,13 +154,13 @@ read_unicode_data_txt_equivalence ( continue; /* Field: 0 ; 1 ; 2 ; 3 ; 4 ; 5 */ i = sscanf (s, "%lx;%*[^;];%*[^;];%*[^;];%*[^;];%[^;]", &c, ce_string); - if (c >= MGBIDI_UNICODE_CHARS) + if (c >= UNIBIDI_UNICODE_CHARS) { #if 0 fprintf (stderr, "invalid input at line %ld: %s", l, s); exit(1); #else - fprintf (stderr, "skip character larger than MGBIDI_UNICODE_CHARS at line %ld: %s", l, s); + fprintf (stderr, "skip character larger than UNIBIDI_UNICODE_CHARS at line %ld: %s", l, s); continue; #endif } @@ -219,7 +219,7 @@ read_bidi_brackets_txt ( continue; k = sscanf (s, "%lx; %lx; %c", &i, &j, &open_close); - if (k != 3 || i >= MGBIDI_UNICODE_CHARS || j >= MGBIDI_UNICODE_CHARS) + if (k != 3 || i >= UNIBIDI_UNICODE_CHARS || j >= UNIBIDI_UNICODE_CHARS) die4 ("invalid pair in input at line %ld: %04lX, %04lX", l, i, j); /* Open braces map to themself */ @@ -285,7 +285,7 @@ gen_brackets_tab ( printf ("/* " outputname "\n * generated by " appname "\n" " * from the file %s of Unicode version " - MGBIDI_UNICODE_VERSION ". */\n\n", data_file_type); + UNIBIDI_UNICODE_VERSION ". */\n\n", data_file_type); printf ("#define PACKTAB_UINT8 Uint8\n" "#define PACKTAB_UINT16 Uint16\n" @@ -296,7 +296,7 @@ gen_brackets_tab ( "Sint16" : "Sint32"; if (!pack_table - (table, MGBIDI_UNICODE_CHARS, key_bytes, 0, max_depth, 1, NULL, + (table, UNIBIDI_UNICODE_CHARS, key_bytes, 0, max_depth, 1, NULL, key_type, table_name, macro_name "_DELTA", stdout)) die ("error: insufficient memory, decrease max_depth"); diff --git a/src/font/utils/gen-brackets-type-tab.c b/src/font/utils/gen-brackets-type-tab.c index 457ad013..116544a3 100644 --- a/src/font/utils/gen-brackets-type-tab.c +++ b/src/font/utils/gen-brackets-type-tab.c @@ -81,9 +81,9 @@ die4 ( } #define table_name "Brt" -#define macro_name "MGBIDI_GET_BRACKET_TYPE" +#define macro_name "UNIBIDI_GET_BRACKET_TYPE" -static signed int table[MGBIDI_UNICODE_CHARS]; +static signed int table[UNIBIDI_UNICODE_CHARS]; static char buf[4000]; static signed long max_dist; @@ -102,7 +102,7 @@ clear_tab ( { register Uchar32 c; - for (c = 0; c < MGBIDI_UNICODE_CHARS; c++) + for (c = 0; c < UNIBIDI_UNICODE_CHARS; c++) table[c] = 0; } @@ -140,7 +140,7 @@ read_bidi_brackets_type_txt ( continue; k = sscanf (s, "%lx; %lx; %c", &i, &j, &open_close); - if (k != 3 || i >= MGBIDI_UNICODE_CHARS || j >= MGBIDI_UNICODE_CHARS) + if (k != 3 || i >= UNIBIDI_UNICODE_CHARS || j >= UNIBIDI_UNICODE_CHARS) die4 ("invalid pair in input at line %ld: %04lX, %04lX", l, i, j); table[i] = 1 + (0x2 * (open_close=='o')); } @@ -176,7 +176,7 @@ gen_brackets_tab ( printf ("/* " outputname "\n * generated by " appname "\n" " * from the file %s of Unicode version " - MGBIDI_UNICODE_VERSION ". */\n\n", data_file_type); + UNIBIDI_UNICODE_VERSION ". */\n\n", data_file_type); printf ("#define PACKTAB_UINT8 Uint8\n" "#define PACKTAB_UINT16 Uint16\n" @@ -187,7 +187,7 @@ gen_brackets_tab ( "Sint16" : "Sint32"; if (!pack_table - (table, MGBIDI_UNICODE_CHARS, key_bytes, 0, max_depth, 1, NULL, + (table, UNIBIDI_UNICODE_CHARS, key_bytes, 0, max_depth, 1, NULL, key_type, table_name, macro_name, stdout)) die ("error: insufficient memory, decrease max_depth"); diff --git a/src/font/utils/gen-joining-type-tab.c b/src/font/utils/gen-joining-type-tab.c index 10e82b13..7091fe1c 100644 --- a/src/font/utils/gen-joining-type-tab.c +++ b/src/font/utils/gen-joining-type-tab.c @@ -92,9 +92,9 @@ die3l ( enum FriBidiJoiningLinearEnumOffsetOne { -# define _MGBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE, +# define _UNIBIDI_ADD_TYPE(TYPE,SYMBOL) TYPE, # include "../unicode-joining-types-list.inc" -# undef _MGBIDI_ADD_TYPE +# undef _UNIBIDI_ADD_TYPE NUM_TYPES }; @@ -105,9 +105,9 @@ struct } type_names[] = { -# define _MGBIDI_ADD_TYPE(TYPE,SYMBOL) {STRINGIZE(TYPE), TYPE}, +# define _UNIBIDI_ADD_TYPE(TYPE,SYMBOL) {STRINGIZE(TYPE), TYPE}, # include "../unicode-joining-types-list.inc" -# undef _MGBIDI_ADD_TYPE +# undef _UNIBIDI_ADD_TYPE }; #define type_names_count (sizeof (type_names) / sizeof (type_names[0])) @@ -162,9 +162,9 @@ type_is ( } #define table_name "Joi" -#define macro_name "MGBIDI_GET_JOINING_TYPE" +#define macro_name "UNIBIDI_GET_JOINING_TYPE" -static signed int table[MGBIDI_UNICODE_CHARS]; +static signed int table[UNIBIDI_UNICODE_CHARS]; static char buf[4000]; static char tp[sizeof (buf)], tp_gen[sizeof (buf)], tp_bidi[sizeof (buf)]; @@ -175,7 +175,7 @@ clear_tab ( { register Uchar32 c; - for (c = 0; c < MGBIDI_UNICODE_CHARS; c++) + for (c = 0; c < UNIBIDI_UNICODE_CHARS; c++) table[c] = U; } @@ -216,11 +216,11 @@ read_unicode_data_txt ( continue; i = sscanf (s, "%lx;%*[^;];%[^; ];%*[^;];%[^; ]", &c, tp_gen, tp_bidi); - if (i != 3 || c >= MGBIDI_UNICODE_CHARS) + if (i != 3 || c >= UNIBIDI_UNICODE_CHARS) #if 0 die3l ("UnicodeData.txt: invalid input at line %ld: %s", l, s); #else - fprintf (stderr, "skip character larger than MGBIDI_UNICODE_CHARS at line %ld: %s", l, s); + fprintf (stderr, "skip character larger than UNIBIDI_UNICODE_CHARS at line %ld: %s", l, s); #endif if (type_is (tp_bidi, ignored_bidi_types)) @@ -258,7 +258,7 @@ read_arabic_shaping_txt ( else i = sscanf (s, "%lx..%lx ; %*[^;]; %[^; ]", &c, &c2, tp) - 1; - if (i != 2 || c > c2 || c2 >= MGBIDI_UNICODE_CHARS) + if (i != 2 || c > c2 || c2 >= UNIBIDI_UNICODE_CHARS) die3l ("ArabicShaping.txt: invalid input at line %ld: %s", l, s); typ = get_type (tp); @@ -301,7 +301,7 @@ gen_joining_type_tab ( { printf ("/* " outputname "\n * generated by " appname "\n" " * from the files %s, %s of Unicode version " - MGBIDI_UNICODE_VERSION ". */\n\n", data_file_type[0], + UNIBIDI_UNICODE_VERSION ". */\n\n", data_file_type[0], data_file_type[1]); printf ("#define PACKTAB_UINT8 Uint8\n" @@ -309,7 +309,7 @@ gen_joining_type_tab ( "#define PACKTAB_UINT32 Uint32\n\n"); if (!pack_table - (table, MGBIDI_UNICODE_CHARS, 1, U, max_depth, 1, names, + (table, UNIBIDI_UNICODE_CHARS, 1, U, max_depth, 1, names, "Uint8", table_name, macro_name, stdout)) die ("error: insufficient memory, decrease max_depth"); diff --git a/src/font/utils/gen-mirroring-tab.c b/src/font/utils/gen-mirroring-tab.c index a45b18fc..0b731edc 100644 --- a/src/font/utils/gen-mirroring-tab.c +++ b/src/font/utils/gen-mirroring-tab.c @@ -79,9 +79,9 @@ die4 ( } #define table_name "Mir" -#define macro_name "MGBIDI_GET_MIRRORING" +#define macro_name "UNIBIDI_GET_MIRRORING" -static signed int table[MGBIDI_UNICODE_CHARS]; +static signed int table[UNIBIDI_UNICODE_CHARS]; static char buf[4000]; static signed long max_dist; @@ -100,7 +100,7 @@ clear_tab ( { register Uchar32 c; - for (c = 0; c < MGBIDI_UNICODE_CHARS; c++) + for (c = 0; c < UNIBIDI_UNICODE_CHARS; c++) table[c] = 0; } @@ -138,7 +138,7 @@ read_bidi_mirroring_txt ( continue; k = sscanf (s, "%lx; %lx", &i, &j); - if (k != 2 || i >= MGBIDI_UNICODE_CHARS || j >= MGBIDI_UNICODE_CHARS) + if (k != 2 || i >= UNIBIDI_UNICODE_CHARS || j >= UNIBIDI_UNICODE_CHARS) die4 ("invalid pair in input at line %ld: %04lX, %04lX", l, i, j); dist = ((signed long) j - (signed long) i); table[i] = dist; @@ -179,7 +179,7 @@ gen_mirroring_tab ( printf ("/* " outputname "\n * generated by " appname "\n" " * from the file %s of Unicode version " - MGBIDI_UNICODE_VERSION ". */\n\n", data_file_type); + UNIBIDI_UNICODE_VERSION ". */\n\n", data_file_type); printf ("#define PACKTAB_UINT8 Uint8\n" "#define PACKTAB_UINT16 Uint16\n" @@ -190,7 +190,7 @@ gen_mirroring_tab ( "Sint16" : "Sint32"; if (!pack_table - (table, MGBIDI_UNICODE_CHARS, key_bytes, 0, max_depth, 1, NULL, + (table, UNIBIDI_UNICODE_CHARS, key_bytes, 0, max_depth, 1, NULL, key_type, table_name, macro_name "_DELTA", stdout)) die ("error: insufficient memory, decrease max_depth"); diff --git a/src/font/utils/gen-unicode-version.c b/src/font/utils/gen-unicode-version.c index addc553c..42a22eac 100644 --- a/src/font/utils/gen-unicode-version.c +++ b/src/font/utils/gen-unicode-version.c @@ -133,10 +133,10 @@ gen_unicode_version ( { printf ("/* " outputname "\n * generated by " appname "\n" " * from the file %s */\n\n", data_file_type); - printf ("#define MGBIDI_UNICODE_VERSION \"%s\"\n" - "#define MGBIDI_UNICODE_MAJOR_VERSION %d\n" - "#define MGBIDI_UNICODE_MINOR_VERSION %d\n" - "#define MGBIDI_UNICODE_MICRO_VERSION %d\n" + printf ("#define UNIBIDI_UNICODE_VERSION \"%s\"\n" + "#define UNIBIDI_UNICODE_MAJOR_VERSION %d\n" + "#define UNIBIDI_UNICODE_MINOR_VERSION %d\n" + "#define UNIBIDI_UNICODE_MICRO_VERSION %d\n" "\n", unicode_version, version_major, version_minor, version_micro);