From 2e52dd1a3d1d648e1968775b5efe0801c57857af Mon Sep 17 00:00:00 2001 From: pcg Date: Thu, 4 Mar 2004 02:05:49 +0000 Subject: [PATCH] *** empty log message *** --- MANIFEST | 2 + src/gencompose | 45 ++ src/table/compose.h | 1313 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1360 insertions(+) create mode 100755 src/gencompose create mode 100644 src/table/compose.h diff --git a/MANIFEST b/MANIFEST index 02a685eb..761a5507 100644 --- a/MANIFEST +++ b/MANIFEST @@ -163,6 +163,8 @@ src/test/gettty.c src/test/strings-memmove.c src/gentables +src/gencompose +src/table/compose.h src/table/viscii.h src/table/ksc5601_1987_0.h src/table/gb2312_1980_0.h diff --git a/src/gencompose b/src/gencompose new file mode 100755 index 00000000..75c40029 --- /dev/null +++ b/src/gencompose @@ -0,0 +1,45 @@ +#!/usr/bin/perl + +open UNIDATA, "<", "www.unicode.org/Public/UNIDATA/UnicodeData.txt" + or die "www.unicode.org/Public/UNIDATA/UnicodeData.txt: $!"; +open TABLE, ">", "table/compose.h" + or die "table/compose.h: $!"; + +print TABLE <) { + my ($code, undef, undef, undef, undef, $decompose, undef) = split /;/; + next unless $decompose; + $type = $decompose =~ s/^<(.*)>\s*// ? $1 : "none"; + + next unless $docom{$type}; + next unless $decompose =~ /^([0-9a-f]+) ([0-9a-f]+)$/i; + my $pfx = sprintf "%08d %08d %08d", hex $1, hex $2, hex $code; + push @compose, [$pfx, hex $1, hex $2, hex $code]; +} + +for (sort { $a->[0] cmp $b->[0] } @compose) { + next if $seen{$_->[1],$_->[2]}++; + printf TABLE " { 0x%05x, 0x%05x, 0x%05x },\n", $_->[1], $_->[2], $_->[3]; + $count++; +} + + +print TABLE <