summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2003-05-28 21:46:09 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-05-28 21:46:09 +0000
commitf74a7de5f5b66832db3102594973e638d5ced4ed (patch)
treeeff088005fbcfa678d70fadbe9f643e7233e0513
parentffca2103adc0e68e0977a44297ec4b5213164876 (diff)
downloadpango-f74a7de5f5b66832db3102594973e638d5ced4ed.tar.gz
(#107630, Federic Zhang)
Wed May 28 17:43:16 2003 Owen Taylor <otaylor@redhat.com> (#107630, Federic Zhang) * tools/compress-table.pl (convert): Make read the maps directly. * tools/make-table.pl: Remove.
-rw-r--r--ChangeLog9
-rw-r--r--ChangeLog.pre-1-109
-rw-r--r--ChangeLog.pre-1-49
-rw-r--r--ChangeLog.pre-1-69
-rw-r--r--ChangeLog.pre-1-89
-rwxr-xr-xtools/compress-table.pl97
-rwxr-xr-xtools/make-table.sh16
7 files changed, 101 insertions, 57 deletions
diff --git a/ChangeLog b/ChangeLog
index 07e5ee7c..e731522e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Wed May 28 17:43:16 2003 Owen Taylor <otaylor@redhat.com>
+
+ (#107630, Federic Zhang)
+
+ * tools/compress-table.pl (convert): Make read the
+ maps directly.
+
+ * tools/make-table.pl: Remove.
+
2003-05-28 Sven Neumann <sven@gimp.org>
* pango/pangoft2.c (pango_ft2_render): added support for rise,
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index 07e5ee7c..e731522e 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,12 @@
+Wed May 28 17:43:16 2003 Owen Taylor <otaylor@redhat.com>
+
+ (#107630, Federic Zhang)
+
+ * tools/compress-table.pl (convert): Make read the
+ maps directly.
+
+ * tools/make-table.pl: Remove.
+
2003-05-28 Sven Neumann <sven@gimp.org>
* pango/pangoft2.c (pango_ft2_render): added support for rise,
diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4
index 07e5ee7c..e731522e 100644
--- a/ChangeLog.pre-1-4
+++ b/ChangeLog.pre-1-4
@@ -1,3 +1,12 @@
+Wed May 28 17:43:16 2003 Owen Taylor <otaylor@redhat.com>
+
+ (#107630, Federic Zhang)
+
+ * tools/compress-table.pl (convert): Make read the
+ maps directly.
+
+ * tools/make-table.pl: Remove.
+
2003-05-28 Sven Neumann <sven@gimp.org>
* pango/pangoft2.c (pango_ft2_render): added support for rise,
diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6
index 07e5ee7c..e731522e 100644
--- a/ChangeLog.pre-1-6
+++ b/ChangeLog.pre-1-6
@@ -1,3 +1,12 @@
+Wed May 28 17:43:16 2003 Owen Taylor <otaylor@redhat.com>
+
+ (#107630, Federic Zhang)
+
+ * tools/compress-table.pl (convert): Make read the
+ maps directly.
+
+ * tools/make-table.pl: Remove.
+
2003-05-28 Sven Neumann <sven@gimp.org>
* pango/pangoft2.c (pango_ft2_render): added support for rise,
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index 07e5ee7c..e731522e 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -1,3 +1,12 @@
+Wed May 28 17:43:16 2003 Owen Taylor <otaylor@redhat.com>
+
+ (#107630, Federic Zhang)
+
+ * tools/compress-table.pl (convert): Make read the
+ maps directly.
+
+ * tools/make-table.pl: Remove.
+
2003-05-28 Sven Neumann <sven@gimp.org>
* pango/pangoft2.c (pango_ft2_render): added support for rise,
diff --git a/tools/compress-table.pl b/tools/compress-table.pl
index a11f3d8a..55129651 100755
--- a/tools/compress-table.pl
+++ b/tools/compress-table.pl
@@ -36,28 +36,53 @@ sub output {
}
}
-print "const guint32 char_mask_map[] = {\n 0,\n";
+#
+# Read in the maps
+#
+my @codepoints = ();
+
+opendir (MAPS, "maps") || die "Cannot open maps/ subdirectory: $!\n";
+while (defined (my $map = readdir (MAPS))) {
+ next if ($map =~ /^\./);
+ next if ($map =~ /~$/);
+ next if ($map =~ /^CVS|README$/);
+
+ open (MAP, "maps/$map") || die "Cannot open map '$map:!\n";
+
+ $encoding = convert($map);
+ while (<MAP>) {
+ s/\s*#.*//;
+ s/\s*$//;
+ next if /^$/;
+ if (!/^\s*(0x[A-Fa-f0-9]+)\s+(0x[A-Fa-f0-9]+)$/) {
+ die "Cannot parse line '%s' in map '$map'\n";
+ }
+ push @codepoints, [hex($2), $encoding];
+ }
+ close (MAP);
+}
+
+#
+# And sort them
+#
+@codepoints = sort { $a->[0] <=> $b->[0] } @codepoints;
-open TABLE, "table";
+print "const guint32 char_mask_map[] = {\n 0,\n";
$encodings = "";
-while (<TABLE>) {
- if (/^(0x[0-9a-fA-F]+)\s+([^:]*):(0x[0-9a-fA-F]+)/) {
- ($u, $e) = ($1, $2);
-
- $u = oct($u);
-
- if (!defined $old_u) {
- $old_u = $u;
- $encodings = convert($e);
- } elsif ($old_u ne $u) {
- add($encodings);
- $old_u = $u;
- $encodings = convert($e);
- } else {
- $encodings .= "|".convert($e);
- }
+for $cp (@codepoints) {
+ $u = $cp->[0]; $e = $cp->[1];
+
+ if (!defined $old_u) {
+ $old_u = $u;
+ $encodings = $e;
+ } elsif ($old_u ne $u) {
+ add($encodings);
+ $old_u = $u;
+ $encodings = $e;
+ } else {
+ $encodings .= "|".$e;
}
}
@@ -65,37 +90,29 @@ if (defined $old_u) {
add($encodings);
}
-close TABLE;
-
print <<EOF;
};
const guchar char_masks[] = {
EOF
-open TABLE, "table";
-
$encodings = "";
undef $old_u;
$start = 0;
-while (<TABLE>) {
- if (/^(0x[0-9a-fA-F]+)\s+([^:]*):(0x[0-9a-fA-F]+)/) {
- ($u, $e) = ($1, $2);
-
- $u = oct($u);
-
- if (!defined $old_u) {
- $old_u = $u;
- $encodings = convert($e);
- } elsif ($old_u ne $u) {
- output($start, $old_u, $combos{$encodings});
- $start = $old_u + 1;
- $old_u = $u;
- $encodings = convert($e);
- } else {
- $encodings .= "|".convert($e);
- }
+for $cp (@codepoints) {
+ $u = $cp->[0]; $e = $cp->[1];
+
+ if (!defined $old_u) {
+ $old_u = $u;
+ $encodings = $e;
+ } elsif ($old_u ne $u) {
+ output($start, $old_u, $combos{$encodings});
+ $start = $old_u + 1;
+ $old_u = $u;
+ $encodings = $e;
+ } else {
+ $encodings .= "|".$e;
}
}
@@ -103,6 +120,4 @@ if (defined $old_u) {
output($start, $old_u, $combos{$encodings});
}
-close TABLE;
-
print "\n};\n";
diff --git a/tools/make-table.sh b/tools/make-table.sh
deleted file mode 100755
index 5dbefb13..00000000
--- a/tools/make-table.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-echo -n > table.tmp
-
-for i in maps/* ; do
- name=`basename $i`
- case $name in
- README | CVS)
- ;;
- *)
- cat $i | grep -v '^#' | sed -e 's/[:space:]*#.*$//' | awk "{ printf \"%s %s:%s\\n\", \$NF, \"$name\", \$1 }" >> table.tmp
- ;;
- esac
-done
-sort table.tmp > table
-rm table.tmp