mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-24 09:14:09 +08:00
Update Unicode data to 11.0.0
This commit is contained in:
@@ -15,7 +15,8 @@ SRC_FILES = charset.c charset-arabic.c charset-bidi.c \
|
||||
|
||||
HDR_FILES = charset.h rawbitmap.h varbitmap.h freetype2.h qpf.h se_minigui.h \
|
||||
upf.h bitmapfont.h unicode-bidi-tables.h \
|
||||
unicode-tables.h unicode-break.h unicode-decomp.h unicode-comp.h \
|
||||
unicode-tables.h unicode-break-tables.h unicode-script-table.h \
|
||||
unicode-decomp.h unicode-comp.h \
|
||||
unicode-emoji-tables.h unicode-arabic-shaping-tables.h
|
||||
|
||||
EXTRA_DIST = convgbmap.c jisunimap.c $(SRC_FILES) $(HDR_FILES) \
|
||||
|
||||
+23
-23
@@ -3465,29 +3465,29 @@ static Achar32 utf8_get_char_value (const unsigned char* pre_mchar, int pre_len,
|
||||
}
|
||||
|
||||
#include "unicode-tables.h"
|
||||
#include "unicode-break.h"
|
||||
#include "unicode-break-tables.h"
|
||||
|
||||
#define ATTR_TABLE(Page) (((Page) <= UCHAR_CATEGORY_LAST_PAGE_PART1) \
|
||||
#define ATTR_TABLE(Page) (((Page) <= UCHAR_LAST_PAGE_PART1) \
|
||||
? attr_table_part1[Page] \
|
||||
: attr_table_part2[(Page) - 0xe00])
|
||||
|
||||
#define ATTTABLE(Page, Char) \
|
||||
((ATTR_TABLE(Page) == UCHAR_CATEGORY_MAX_TABLE_INDEX) ? 0 : (attr_data[ATTR_TABLE(Page)][Char]))
|
||||
((ATTR_TABLE(Page) == UCHAR_MAX_TABLE_INDEX) ? 0 : (attr_data[ATTR_TABLE(Page)][Char]))
|
||||
|
||||
#define TTYPE_PART1(Page, Char) \
|
||||
((type_table_part1[Page] >= UCHAR_CATEGORY_MAX_TABLE_INDEX) \
|
||||
? (type_table_part1[Page] - UCHAR_CATEGORY_MAX_TABLE_INDEX) \
|
||||
((type_table_part1[Page] >= UCHAR_MAX_TABLE_INDEX) \
|
||||
? (type_table_part1[Page] - UCHAR_MAX_TABLE_INDEX) \
|
||||
: (type_data[type_table_part1[Page]][Char]))
|
||||
|
||||
#define TTYPE_PART2(Page, Char) \
|
||||
((type_table_part2[Page] >= UCHAR_CATEGORY_MAX_TABLE_INDEX) \
|
||||
? (type_table_part2[Page] - UCHAR_CATEGORY_MAX_TABLE_INDEX) \
|
||||
((type_table_part2[Page] >= UCHAR_MAX_TABLE_INDEX) \
|
||||
? (type_table_part2[Page] - UCHAR_MAX_TABLE_INDEX) \
|
||||
: (type_data[type_table_part2[Page]][Char]))
|
||||
|
||||
#define TYPE(Char) \
|
||||
(((Char) <= UCHAR_CATEGORY_LAST_CHAR_PART1) \
|
||||
(((Char) <= UCHAR_LAST_CHAR_PART1) \
|
||||
? TTYPE_PART1 ((Char) >> 8, (Char) & 0xff) \
|
||||
: (((Char) >= 0xe0000 && (Char) <= UCHAR_CATEGORY_LAST_CHAR) \
|
||||
: (((Char) >= 0xe0000 && (Char) <= UCHAR_LAST_CHAR) \
|
||||
? TTYPE_PART2 (((Char) - 0xe0000) >> 8, (Char) & 0xff) \
|
||||
: UCHAR_CATEGORY_UNASSIGNED))
|
||||
|
||||
@@ -3522,19 +3522,19 @@ static Achar32 utf8_get_char_value (const unsigned char* pre_mchar, int pre_len,
|
||||
OR (UCHAR_CATEGORY_FORMAT, 0))))
|
||||
|
||||
#define TPROP_PART1(Page, Char) \
|
||||
((break_property_table_part1[Page] >= UCHAR_CATEGORY_MAX_TABLE_INDEX) \
|
||||
? (break_property_table_part1[Page] - UCHAR_CATEGORY_MAX_TABLE_INDEX) \
|
||||
((break_property_table_part1[Page] >= UCHAR_MAX_TABLE_INDEX) \
|
||||
? (break_property_table_part1[Page] - UCHAR_MAX_TABLE_INDEX) \
|
||||
: (break_property_data[break_property_table_part1[Page]][Char]))
|
||||
|
||||
#define TPROP_PART2(Page, Char) \
|
||||
((break_property_table_part2[Page] >= UCHAR_CATEGORY_MAX_TABLE_INDEX) \
|
||||
? (break_property_table_part2[Page] - UCHAR_CATEGORY_MAX_TABLE_INDEX) \
|
||||
((break_property_table_part2[Page] >= UCHAR_MAX_TABLE_INDEX) \
|
||||
? (break_property_table_part2[Page] - UCHAR_MAX_TABLE_INDEX) \
|
||||
: (break_property_data[break_property_table_part2[Page]][Char]))
|
||||
|
||||
#define PROP(Char) \
|
||||
(((Char) <= UCHAR_CATEGORY_LAST_CHAR_PART1) \
|
||||
(((Char) <= UCHAR_LAST_CHAR_PART1) \
|
||||
? TPROP_PART1 ((Char) >> 8, (Char) & 0xff) \
|
||||
: (((Char) >= 0xe0000 && (Char) <= UCHAR_CATEGORY_LAST_CHAR) \
|
||||
: (((Char) >= 0xe0000 && (Char) <= UCHAR_LAST_CHAR) \
|
||||
? TPROP_PART2 (((Char) - 0xe0000) >> 8, (Char) & 0xff) \
|
||||
: UCHAR_BREAK_UNKNOWN))
|
||||
|
||||
@@ -4551,13 +4551,13 @@ BOOL GUIAPI IsUCharZeroWidth(Uchar32 uc)
|
||||
static inline BOOL g_unichar_iswide_bsearch (Uchar32 ch)
|
||||
{
|
||||
unsigned int lower = 0;
|
||||
unsigned int upper = TABLESIZE (g_unicode_width_table_wide) - 1;
|
||||
int mid = TABLESIZE (g_unicode_width_table_wide) / 2;
|
||||
unsigned int upper = TABLESIZE (unicode_width_table_wide) - 1;
|
||||
int mid = TABLESIZE (unicode_width_table_wide) / 2;
|
||||
|
||||
do {
|
||||
if (ch < g_unicode_width_table_wide[mid].start)
|
||||
if (ch < unicode_width_table_wide[mid].start)
|
||||
upper = mid - 1;
|
||||
else if (ch > g_unicode_width_table_wide[mid].end)
|
||||
else if (ch > unicode_width_table_wide[mid].end)
|
||||
lower = mid + 1;
|
||||
else
|
||||
return TRUE;
|
||||
@@ -4571,7 +4571,7 @@ static inline BOOL g_unichar_iswide_bsearch (Uchar32 ch)
|
||||
|
||||
BOOL GUIAPI IsUCharWide(Uchar32 uc)
|
||||
{
|
||||
if (uc < g_unicode_width_table_wide[0].start)
|
||||
if (uc < unicode_width_table_wide[0].start)
|
||||
return FALSE;
|
||||
else
|
||||
return g_unichar_iswide_bsearch (uc);
|
||||
@@ -4601,9 +4601,9 @@ BOOL GUIAPI IsUCharWideCJK (Uchar32 uc)
|
||||
return FALSE;
|
||||
|
||||
if (bsearch((void*)((intptr_t)uc),
|
||||
g_unicode_width_table_ambiguous,
|
||||
TABLESIZE (g_unicode_width_table_ambiguous),
|
||||
sizeof g_unicode_width_table_ambiguous[0],
|
||||
unicode_width_table_ambiguous,
|
||||
TABLESIZE (unicode_width_table_ambiguous),
|
||||
sizeof unicode_width_table_ambiguous[0],
|
||||
interval_compare))
|
||||
return TRUE;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,13 @@
|
||||
/*
|
||||
* This file is copied from LGPL'd glib 2.59.
|
||||
* It is automatically generated by gen-unicode-tables.pl
|
||||
*/
|
||||
/* This file is automatically generated. DO NOT EDIT!
|
||||
Instead, edit gen-unicode-tables.pl and re-run. */
|
||||
|
||||
#ifndef SCRIPTTABLES_H
|
||||
#define SCRIPTTABLES_H
|
||||
#ifndef _MGFONT_UNICODE_SCRIPT_TABLE_H
|
||||
#define _MGFONT_UNICODE_SCRIPT_TABLE_H
|
||||
|
||||
#define G_EASY_SCRIPTS_RANGE 8192
|
||||
#define EASY_SCRIPTS_RANGE 8192
|
||||
|
||||
static const Uint8 unicode_script_easy_table[8192] = {
|
||||
|
||||
static const unsigned char g_script_easy_table[8192] = {
|
||||
UCHAR_SCRIPT_COMMON, UCHAR_SCRIPT_COMMON, UCHAR_SCRIPT_COMMON,
|
||||
UCHAR_SCRIPT_COMMON, UCHAR_SCRIPT_COMMON, UCHAR_SCRIPT_COMMON,
|
||||
UCHAR_SCRIPT_COMMON, UCHAR_SCRIPT_COMMON, UCHAR_SCRIPT_COMMON,
|
||||
@@ -2743,10 +2742,10 @@ static const unsigned char g_script_easy_table[8192] = {
|
||||
};
|
||||
|
||||
static const struct {
|
||||
unsigned int start;
|
||||
unsigned short chars;
|
||||
unsigned short script;
|
||||
} g_script_table[] = {
|
||||
Uchar32 start;
|
||||
Uint16 chars;
|
||||
Uint16 script;
|
||||
} unicode_script_table[] = {
|
||||
{ 0x2000, 12, UCHAR_SCRIPT_COMMON },
|
||||
{ 0x200c, 2, UCHAR_SCRIPT_INHERITED },
|
||||
{ 0x200e, 87, UCHAR_SCRIPT_COMMON },
|
||||
@@ -3269,4 +3268,4 @@ static const struct {
|
||||
{ 0xe0100, 240, UCHAR_SCRIPT_INHERITED },
|
||||
};
|
||||
|
||||
#endif /* SCRIPTTABLES_H */
|
||||
#endif /* _MGFONT_UNICODE_SCRIPT_TABLE_H */
|
||||
+11
-11
@@ -43,24 +43,24 @@
|
||||
|
||||
#ifdef _MGCHARSET_UNICODE
|
||||
|
||||
#include "unicode-scripttable.h"
|
||||
#include "unicode-script-table.h"
|
||||
|
||||
#define G_SCRIPT_TABLE_MIDPOINT (TABLESIZE (g_script_table) / 2)
|
||||
#define SCRIPT_TABLE_MIDPOINT (TABLESIZE (unicode_script_table) / 2)
|
||||
|
||||
static inline int g_unichar_get_script_bsearch (Uchar32 ch)
|
||||
static inline int unichar_get_script_bsearch (Uchar32 ch)
|
||||
{
|
||||
int lower = 0;
|
||||
int upper = (int)TABLESIZE (g_script_table) - 1;
|
||||
static int saved_mid = G_SCRIPT_TABLE_MIDPOINT;
|
||||
int upper = (int)TABLESIZE (unicode_script_table) - 1;
|
||||
static int saved_mid = SCRIPT_TABLE_MIDPOINT;
|
||||
int mid = saved_mid;
|
||||
|
||||
do {
|
||||
if (ch < g_script_table[mid].start)
|
||||
if (ch < unicode_script_table[mid].start)
|
||||
upper = mid - 1;
|
||||
else if (ch >= g_script_table[mid].start + g_script_table[mid].chars)
|
||||
else if (ch >= unicode_script_table[mid].start + unicode_script_table[mid].chars)
|
||||
lower = mid + 1;
|
||||
else
|
||||
return g_script_table[saved_mid = mid].script;
|
||||
return unicode_script_table[saved_mid = mid].script;
|
||||
|
||||
mid = (lower + upper) / 2;
|
||||
|
||||
@@ -71,10 +71,10 @@ static inline int g_unichar_get_script_bsearch (Uchar32 ch)
|
||||
|
||||
int GUIAPI UCharGetScriptType (Uchar32 ch)
|
||||
{
|
||||
if (ch < G_EASY_SCRIPTS_RANGE)
|
||||
return g_script_easy_table[ch];
|
||||
if (ch < EASY_SCRIPTS_RANGE)
|
||||
return unicode_script_easy_table[ch];
|
||||
else
|
||||
return g_unichar_get_script_bsearch (ch);
|
||||
return unichar_get_script_bsearch (ch);
|
||||
}
|
||||
|
||||
/* http://unicode.org/iso15924/ */
|
||||
|
||||
+18195
-13152
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
url='https://www.unicode.org/Public/11.0.0/ucd/'
|
||||
files='Scripts.txt UnicodeData.txt IndicPositionalCategory.txt IndicSyllabicCategory.txt ArabicShaping.txt BidiBrackets.txt BidiMirroring.txt Blocks.txt'
|
||||
files='Scripts.txt UnicodeData.txt LineBreak.txt SpecialCasing.txt CaseFolding.txt CompositionExclusions.txt IndicPositionalCategory.txt IndicSyllabicCategory.txt ArabicShaping.txt BidiBrackets.txt BidiMirroring.txt Blocks.txt extracted/DerivedEastAsianWidth.txt'
|
||||
|
||||
if test ! -d ucd; then
|
||||
mkdir ucd
|
||||
if test ! -d ucd/extracted; then
|
||||
mkdir -p ucd/extracted
|
||||
fi
|
||||
|
||||
cd ucd/
|
||||
@@ -15,6 +15,6 @@ do
|
||||
echo "$file exists, skipping"
|
||||
else
|
||||
echo "Fetching $url$file"
|
||||
wget $url$file
|
||||
wget -O $file $url$file
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -627,7 +627,7 @@ sub process_one
|
||||
sub print_tables
|
||||
{
|
||||
my ($last) = @_;
|
||||
my ($outfile) = "unsigned inttables.h";
|
||||
my ($outfile) = "unicode-tables.h";
|
||||
|
||||
local ($bytes_out) = 0;
|
||||
|
||||
@@ -638,12 +638,12 @@ sub print_tables
|
||||
print OUT "/* This file is automatically generated. DO NOT EDIT!\n";
|
||||
print OUT " Instead, edit gen-unicode-tables.pl and re-run. */\n\n";
|
||||
|
||||
print OUT "#ifndef CHARTABLES_H\n";
|
||||
print OUT "#define CHARTABLES_H\n\n";
|
||||
print OUT "#ifndef _MGFONT_UNICODE_TABLES_H\n";
|
||||
print OUT "#define _MGFONT_UNICODE_TABLES_H\n\n";
|
||||
|
||||
print OUT "#define UCHAR_DATA_VERSION \"$ARGV[0]\"\n\n";
|
||||
|
||||
printf OUT "#define UCHAR_LAST_CHAR 0x%04x\n\n", $last;
|
||||
printf OUT "#define UCHAR_LAST_CHAR 0x%04X\n\n", $last;
|
||||
|
||||
printf OUT "#define UCHAR_MAX_TABLE_INDEX 10000\n\n";
|
||||
|
||||
@@ -652,7 +652,7 @@ sub print_tables
|
||||
printf OUT "#define UCHAR_LAST_PAGE_PART1 %d\n\n", $pages_before_e0000 - 1;
|
||||
|
||||
$table_index = 0;
|
||||
printf OUT "static const char type_data[][256] = {\n";
|
||||
printf OUT "static const Uint8 type_data[][256] = {\n";
|
||||
for ($count = 0; $count <= $last; $count += 256)
|
||||
{
|
||||
$row[$count / 256] = &print_row ($count, 1, \&fetch_type);
|
||||
@@ -660,7 +660,7 @@ sub print_tables
|
||||
printf OUT "\n};\n\n";
|
||||
|
||||
printf OUT "/* U+0000 through U+%04X */\n", $last_part1;
|
||||
print OUT "static const gint16 type_table_part1[$pages_before_e0000] = {\n";
|
||||
print OUT "static const Uint16 type_table_part1[$pages_before_e0000] = {\n";
|
||||
for ($count = 0; $count <= $last_part1; $count += 256)
|
||||
{
|
||||
print OUT ",\n" if $count > 0;
|
||||
@@ -670,7 +670,7 @@ sub print_tables
|
||||
print OUT "\n};\n\n";
|
||||
|
||||
printf OUT "/* U+E0000 through U+%04X */\n", $last;
|
||||
print OUT "static const gint16 type_table_part2[768] = {\n";
|
||||
print OUT "static const Uint16 type_table_part2[768] = {\n";
|
||||
for ($count = 0xE0000; $count <= $last; $count += 256)
|
||||
{
|
||||
print OUT ",\n" if $count > 0xE0000;
|
||||
@@ -685,7 +685,7 @@ sub print_tables
|
||||
#
|
||||
|
||||
$table_index = 0;
|
||||
printf OUT "static const unsigned int attr_data[][256] = {\n";
|
||||
printf OUT "static const Uchar32 attr_data[][256] = {\n";
|
||||
for ($count = 0; $count <= $last; $count += 256)
|
||||
{
|
||||
$row[$count / 256] = &print_row ($count, 4, \&fetch_attr);
|
||||
@@ -693,7 +693,7 @@ sub print_tables
|
||||
printf OUT "\n};\n\n";
|
||||
|
||||
printf OUT "/* U+0000 through U+%04X */\n", $last_part1;
|
||||
print OUT "static const gint16 attr_table_part1[$pages_before_e0000] = {\n";
|
||||
print OUT "static const Uint16 attr_table_part1[$pages_before_e0000] = {\n";
|
||||
for ($count = 0; $count <= $last_part1; $count += 256)
|
||||
{
|
||||
print OUT ",\n" if $count > 0;
|
||||
@@ -703,7 +703,7 @@ sub print_tables
|
||||
print OUT "\n};\n\n";
|
||||
|
||||
printf OUT "/* U+E0000 through U+%04X */\n", $last;
|
||||
print OUT "static const gint16 attr_table_part2[768] = {\n";
|
||||
print OUT "static const Uint16 attr_table_part2[768] = {\n";
|
||||
for ($count = 0xE0000; $count <= $last; $count += 256)
|
||||
{
|
||||
print OUT ",\n" if $count > 0xE0000;
|
||||
@@ -716,7 +716,7 @@ sub print_tables
|
||||
# print title case table
|
||||
#
|
||||
|
||||
print OUT "static const unsigned int title_table[][3] = {\n";
|
||||
print OUT "static const Uchar32 title_table[][3] = {\n";
|
||||
my ($item);
|
||||
my ($first) = 1;
|
||||
foreach $item (sort keys %title_to_lower)
|
||||
@@ -740,7 +740,7 @@ sub print_tables
|
||||
#
|
||||
&output_width_tables (\*OUT);
|
||||
|
||||
print OUT "#endif /* CHARTABLES_H */\n";
|
||||
print OUT "#endif /* _MGFONT_UNICODE_TABLES_H */\n";
|
||||
|
||||
close (OUT);
|
||||
|
||||
@@ -864,7 +864,7 @@ sub print_decomp
|
||||
print OUT "#ifndef DECOMP_H\n";
|
||||
print OUT "#define DECOMP_H\n\n";
|
||||
|
||||
printf OUT "#define UCHAR_LAST_CHAR 0x%04x\n\n", $last;
|
||||
printf OUT "#define UCHAR_LAST_CHAR 0x%04X\n\n", $last;
|
||||
|
||||
printf OUT "#define UCHAR_MAX_TABLE_INDEX (0x110000 / 256)\n\n";
|
||||
|
||||
@@ -877,14 +877,14 @@ sub print_decomp
|
||||
|
||||
my ($count, @row);
|
||||
$table_index = 0;
|
||||
printf OUT "static const guchar cclass_data[][256] = {\n";
|
||||
printf OUT "static const Uint8 cclass_data[][256] = {\n";
|
||||
for ($count = 0; $count <= $last; $count += 256)
|
||||
{
|
||||
$row[$count / 256] = &print_row ($count, 1, \&fetch_cclass);
|
||||
}
|
||||
printf OUT "\n};\n\n";
|
||||
|
||||
print OUT "static const gint16 combining_class_table_part1[$pages_before_e0000] = {\n";
|
||||
print OUT "static const Uint16 combining_class_table_part1[$pages_before_e0000] = {\n";
|
||||
for ($count = 0; $count <= $last_part1; $count += 256)
|
||||
{
|
||||
print OUT ",\n" if $count > 0;
|
||||
@@ -893,7 +893,7 @@ sub print_decomp
|
||||
}
|
||||
print OUT "\n};\n\n";
|
||||
|
||||
print OUT "static const gint16 combining_class_table_part2[768] = {\n";
|
||||
print OUT "static const Uint16 combining_class_table_part2[768] = {\n";
|
||||
for ($count = 0xE0000; $count <= $last; $count += 256)
|
||||
{
|
||||
print OUT ",\n" if $count > 0xE0000;
|
||||
@@ -903,9 +903,9 @@ sub print_decomp
|
||||
print OUT "\n};\n\n";
|
||||
|
||||
print OUT "typedef struct\n{\n";
|
||||
print OUT " unsigned int ch;\n";
|
||||
print OUT " unsigned short canon_offset;\n";
|
||||
print OUT " unsigned short compat_offset;\n";
|
||||
print OUT " Uchar32 ch;\n";
|
||||
print OUT " Uint16 canon_offset;\n";
|
||||
print OUT " Uint16 compat_offset;\n";
|
||||
print OUT "} decomposition;\n\n";
|
||||
|
||||
print OUT "static const decomposition decomp_table[] =\n{\n";
|
||||
@@ -945,12 +945,12 @@ sub print_decomp
|
||||
print OUT "\n};\n\n";
|
||||
$bytes_out += $decomp_string_offset + 1;
|
||||
|
||||
printf OUT "static const gchar decomp_expansion_string[] = %s;\n\n", $decomp_string;
|
||||
printf OUT "static const unsigned char decomp_expansion_string[] = %s;\n\n", $decomp_string;
|
||||
|
||||
print OUT "typedef struct\n{\n";
|
||||
print OUT " unsigned int ch;\n";
|
||||
print OUT " unsigned int a;\n";
|
||||
print OUT " unsigned int b;\n";
|
||||
print OUT " Uchar32 ch;\n";
|
||||
print OUT " Uchar32 a;\n";
|
||||
print OUT " Uchar32 b;\n";
|
||||
print OUT "} decomposition_step;\n\n";
|
||||
|
||||
# There's lots of room to optimize the following table...
|
||||
@@ -982,7 +982,7 @@ sub print_decomp
|
||||
sub print_line_break
|
||||
{
|
||||
my ($last) = @_;
|
||||
my ($outfile) = "gunibreak.h";
|
||||
my ($outfile) = "unicode-break-tables.h";
|
||||
|
||||
local ($bytes_out) = 0;
|
||||
|
||||
@@ -993,11 +993,8 @@ sub print_line_break
|
||||
print OUT "/* This file is automatically generated. DO NOT EDIT!\n";
|
||||
print OUT " Instead, edit gen-unicode-tables.pl and re-run. */\n\n";
|
||||
|
||||
print OUT "#ifndef BREAKTABLES_H\n";
|
||||
print OUT "#define BREAKTABLES_H\n\n";
|
||||
|
||||
print OUT "#include <glib/gtypes.h>\n";
|
||||
print OUT "#include <glib/gunicode.h>\n\n";
|
||||
print OUT "#ifndef _MGFONT_UNICODE_BREAK_TABLES_H\n";
|
||||
print OUT "#define _MGFONT_UNICODE_BREAK_TABLES_H\n\n";
|
||||
|
||||
print OUT "#define UCHAR_DATA_VERSION \"$ARGV[0]\"\n\n";
|
||||
|
||||
@@ -1010,7 +1007,7 @@ sub print_line_break
|
||||
printf OUT "#define UCHAR_LAST_CHAR_PART1 0x%04X\n\n", $last_part1;
|
||||
|
||||
$table_index = 0;
|
||||
printf OUT "static const gint8 break_property_data[][256] = {\n";
|
||||
printf OUT "static const Uint8 break_property_data[][256] = {\n";
|
||||
for ($count = 0; $count <= $last; $count += 256)
|
||||
{
|
||||
$row[$count / 256] = &print_row ($count, 1, \&fetch_break_type);
|
||||
@@ -1018,7 +1015,7 @@ sub print_line_break
|
||||
printf OUT "\n};\n\n";
|
||||
|
||||
printf OUT "/* U+0000 through U+%04X */\n", $last_part1;
|
||||
print OUT "static const gint16 break_property_table_part1[$pages_before_e0000] = {\n";
|
||||
print OUT "static const Uint16 break_property_table_part1[$pages_before_e0000] = {\n";
|
||||
for ($count = 0; $count <= $last_part1; $count += 256)
|
||||
{
|
||||
print OUT ",\n" if $count > 0;
|
||||
@@ -1028,7 +1025,7 @@ sub print_line_break
|
||||
print OUT "\n};\n\n";
|
||||
|
||||
printf OUT "/* U+E0000 through U+%04X */\n", $last;
|
||||
print OUT "static const gint16 break_property_table_part2[768] = {\n";
|
||||
print OUT "static const Uint16 break_property_table_part2[768] = {\n";
|
||||
for ($count = 0xE0000; $count <= $last; $count += 256)
|
||||
{
|
||||
print OUT ",\n" if $count > 0xE0000;
|
||||
@@ -1038,7 +1035,7 @@ sub print_line_break
|
||||
print OUT "\n};\n\n";
|
||||
|
||||
|
||||
print OUT "#endif /* BREAKTABLES_H */\n";
|
||||
print OUT "#endif /* _MGFONT_UNICODE_BREAK_TABLES_H */\n";
|
||||
|
||||
close (OUT);
|
||||
|
||||
@@ -1134,7 +1131,7 @@ sub output_special_case_table
|
||||
* other than the case of the codepoint, in the order [Ll],[Lu],[Lt],
|
||||
* encoded in UTF-8, separated and terminated by a null character.
|
||||
*/
|
||||
static const gchar special_case_table[] = {
|
||||
static const unsigned char special_case_table[] = {
|
||||
EOT
|
||||
|
||||
my $i = 0;
|
||||
@@ -1256,7 +1253,7 @@ sub output_composition_table
|
||||
|
||||
my %vals;
|
||||
|
||||
open OUT, ">gunicomp.h" or die "Cannot open gunicomp.h: $!\n";
|
||||
open OUT, ">unicode-comp.h" or die "Cannot open unicode-comp.h: $!\n";
|
||||
|
||||
# Assign values in lookup table for all code points involved
|
||||
|
||||
@@ -1296,14 +1293,14 @@ sub output_composition_table
|
||||
|
||||
my @row;
|
||||
$table_index = 0;
|
||||
printf OUT "static const unsigned short compose_data[][256] = {\n";
|
||||
printf OUT "static const Uint16 compose_data[][256] = {\n";
|
||||
for (my $count = 0; $count <= $last; $count += 256)
|
||||
{
|
||||
$row[$count / 256] = &print_row ($count, 2, sub { exists $vals{$_[0]} ? $vals{$_[0]} : 0; });
|
||||
}
|
||||
printf OUT "\n};\n\n";
|
||||
|
||||
print OUT "static const gint16 compose_table[COMPOSE_TABLE_LAST + 1] = {\n";
|
||||
print OUT "static const Uint16 compose_table[COMPOSE_TABLE_LAST + 1] = {\n";
|
||||
for (my $count = 0; $count <= $last; $count += 256)
|
||||
{
|
||||
print OUT ",\n" if $count > 0;
|
||||
@@ -1314,7 +1311,7 @@ sub output_composition_table
|
||||
|
||||
# Output first singletons
|
||||
|
||||
print OUT "static const unsigned int compose_first_single[][2] = {\n";
|
||||
print OUT "static const Uchar32 compose_first_single[][2] = {\n";
|
||||
$i = 0;
|
||||
for $record (@first_singletons) {
|
||||
print OUT ",\n" if $i++ > 0;
|
||||
@@ -1326,7 +1323,7 @@ sub output_composition_table
|
||||
|
||||
# Output second singletons
|
||||
|
||||
print OUT "static const unsigned int compose_second_single[][2] = {\n";
|
||||
print OUT "static const Uchar32 compose_second_single[][2] = {\n";
|
||||
$i = 0;
|
||||
for $record (@second_singletons) {
|
||||
print OUT ",\n" if $i++ > 0;
|
||||
@@ -1339,7 +1336,7 @@ sub output_composition_table
|
||||
# Output array of composition pairs
|
||||
|
||||
print OUT <<EOT;
|
||||
static const unsigned short compose_array[$n_first][$n_second] = {
|
||||
static const Uint16 compose_array[$n_first][$n_second] = {
|
||||
EOT
|
||||
|
||||
for (my $i = 0; $i < $n_first; $i++) {
|
||||
@@ -1349,7 +1346,7 @@ EOT
|
||||
print OUT ", " if $j;
|
||||
if (exists $reverse{"$i|$j"}) {
|
||||
if ($reverse{"$i|$j"} > 0xFFFF) {
|
||||
die "time to switch compose_array to unsigned int" ;
|
||||
die "time to switch compose_array to Uchar32" ;
|
||||
}
|
||||
printf OUT "0x%04x", $reverse{"$i|$j"};
|
||||
} else {
|
||||
@@ -1378,8 +1375,8 @@ sub output_casefold_table
|
||||
/* Table of casefolding cases that can't be derived by lowercasing
|
||||
*/
|
||||
static const struct {
|
||||
unsigned short ch;
|
||||
gchar data[$casefoldlen];
|
||||
Uint16 ch;
|
||||
char data[$casefoldlen];
|
||||
} casefold_table[] = {
|
||||
EOT
|
||||
|
||||
@@ -1391,7 +1388,7 @@ EOT
|
||||
$string = $case->[1];
|
||||
|
||||
if ($code > 0xFFFF) {
|
||||
die "time to switch casefold_table to unsigned int" ;
|
||||
die "time to switch casefold_table to Uchar32" ;
|
||||
}
|
||||
|
||||
print $out sprintf(qq( { 0x%04x, "$string" },\n), $code);
|
||||
@@ -1415,7 +1412,7 @@ sub output_one_width_table
|
||||
my $wp;
|
||||
my $rex;
|
||||
|
||||
print $out "static const struct Interval g_unicode_width_table_${name}[] = {\n";
|
||||
print $out "static const struct Interval unicode_width_table_${name}[] = {\n";
|
||||
|
||||
$rex = qr/$wpe/;
|
||||
|
||||
@@ -1449,7 +1446,7 @@ sub output_width_tables
|
||||
|
||||
struct Interval
|
||||
{
|
||||
unsigned int start, end;
|
||||
Uchar32 start, end;
|
||||
};
|
||||
|
||||
EOT
|
||||
@@ -1466,16 +1463,16 @@ sub print_scripts
|
||||
my $easy_range;
|
||||
my $i;
|
||||
|
||||
print STDERR "Writing unicode-scripttable.h\n";
|
||||
print STDERR "Writing unicode-script-table.h\n";
|
||||
|
||||
open OUT, ">unicode-scripttable.h" or die "Cannot open gscripttable.h: $!\n";
|
||||
open OUT, ">unicode-script-table.h" or die "Cannot open unicode-script-table.h: $!\n";
|
||||
|
||||
print OUT<<EOT;
|
||||
/* This file is automatically generated. DO NOT EDIT!
|
||||
Instead, edit gen-unicode-tables.pl and re-run. */
|
||||
|
||||
#ifndef SCRIPTTABLES_H
|
||||
#define SCRIPTTABLES_H
|
||||
#ifndef _MGFONT_UNICODE_SCRIPT_TABLE_H
|
||||
#define _MGFONT_UNICODE_SCRIPT_TABLE_H
|
||||
|
||||
EOT
|
||||
|
||||
@@ -1484,9 +1481,9 @@ EOT
|
||||
$easy_range = 0x2000;
|
||||
|
||||
print OUT<<EOT;
|
||||
#define G_EASY_SCRIPTS_RANGE $easy_range
|
||||
#define EASY_SCRIPTS_RANGE $easy_range
|
||||
|
||||
static const guchar g_script_easy_table[$easy_range] = {
|
||||
static const Uint8 unicode_script_easy_table[$easy_range] = {
|
||||
EOT
|
||||
|
||||
$i = 0;
|
||||
@@ -1522,10 +1519,10 @@ EOT
|
||||
};
|
||||
|
||||
static const struct {
|
||||
unsigned int start;
|
||||
unsigned short chars;
|
||||
unsigned short script;
|
||||
} g_script_table[] = {
|
||||
Uchar32 start;
|
||||
Uint16 chars;
|
||||
Uint16 script;
|
||||
} unicode_script_table[] = {
|
||||
EOT
|
||||
|
||||
for (; $i <= $#scripts; $i++) {
|
||||
@@ -1545,7 +1542,7 @@ EOT
|
||||
printf OUT<<EOT;
|
||||
};
|
||||
|
||||
#endif /* SCRIPTTABLES_H */
|
||||
#endif /* _MGFONT_UNICODE_SCRIPT_TABLE_H */
|
||||
EOT
|
||||
|
||||
close OUT;
|
||||
|
||||
Reference in New Issue
Block a user