summaryrefslogtreecommitdiff
path: root/Build/source/texk/xdvipdfmx/src/mk_agl_standard_c.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/xdvipdfmx/src/mk_agl_standard_c.pl')
-rwxr-xr-xBuild/source/texk/xdvipdfmx/src/mk_agl_standard_c.pl51
1 files changed, 51 insertions, 0 deletions
diff --git a/Build/source/texk/xdvipdfmx/src/mk_agl_standard_c.pl b/Build/source/texk/xdvipdfmx/src/mk_agl_standard_c.pl
new file mode 100755
index 00000000000..93a7b7984fd
--- /dev/null
+++ b/Build/source/texk/xdvipdfmx/src/mk_agl_standard_c.pl
@@ -0,0 +1,51 @@
+#!/usr/bin/perl
+
+# mk_agl_standard_nam_c.pl -- convert STANDARD.NAM and glyphlist.txt
+# to C source for xdvipdfmx;
+# this allows us to have the standard list compiled into the binary,
+# and so the user doesn't have to install a glyphlist file separately.
+
+# usage:
+#
+# mk_agl_standard_nam_c.pl STANDARD.NAM glyphlist.txt > agl_standard.c
+#
+# where STANDARD.NAM is the glyph name list in FontLab's format,
+# and glyphlist.txt is the Adobe glyph name list as found at
+# http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt
+#
+# xdvipdfmx includes data derived from STANDARD.NAM
+# by kind permission of Adam Twardoch.
+
+print << "__EOT__";
+#include "agl.h"
+
+char* agl_standard_names[] = {
+__EOT__
+
+my %knownNames;
+while (<ARGV>) {
+ s/ *[\r\n]+$//;
+ s/[\#%].*//;
+ next if $_ eq '';
+ if (m/^0x[0-9A-Fa-f]{4}/) {
+ my ($unicode, $name) = split(/ +/);
+ next unless defined $name and defined $unicode;
+ $name =~ s/^!//;
+ next if exists $knownNames{$name};
+ $knownNames{$name} = 1;
+ $unicode =~ s/^0x//;
+ print " \"$name;$unicode\",\n";
+ next;
+ }
+ if (m/^.+;[0-9A-Fa-f]{4}/) {
+ my ($name, $unicodes) = split(/;/);
+ next unless defined $name and defined $unicodes;
+ next if exists $knownNames{$name};
+ print " \"$name;$unicodes\",\n";
+ }
+}
+
+print << "__EOT__";
+ "" /* terminator */
+};
+__EOT__