From 697a65c5f5cda53bc68720886a253a019e8212a8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 1 Jun 2011 20:52:00 -0400 Subject: [PATCH] Minor --- src/gen-arabic-table.py | 21 +++++++++++++-------- src/hb-ot-shape-complex-arabic-table.hh | 9 ++++----- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/gen-arabic-table.py b/src/gen-arabic-table.py index 762cd38a7..10fb22d43 100755 --- a/src/gen-arabic-table.py +++ b/src/gen-arabic-table.py @@ -2,8 +2,14 @@ import sys -header = sys.stdin.readline (), sys.stdin.readline () -while sys.stdin.readline ().find ('##################') < 0: +if len (sys.argv) < 2: + print >>sys.stderr, "usage: ./gen-arabic-table.py ArabicShaping.txt" + sys.exit (1) + +f = file (sys.argv[1]) + +header = f.readline (), f.readline () +while f.readline ().find ('##################') < 0: pass @@ -11,9 +17,9 @@ print "/* == Start of generated table == */" print "/*" print " * The following table is generated by running:" print " *" -print " * ./gen-arabic-table.py < ArabicShaping.txt" +print " * ./gen-arabic-table.py ArabicShaping.txt" print " *" -print " * on the ArabicShaping.txt file with the header:" +print " * on files with these headers:" print " *" for line in header: print " * %s" % (line.strip()) @@ -28,7 +34,7 @@ max_u = 0 num = 0 last = -1 block = '' -for line in sys.stdin: +for line in f: if line[0] == '#': if line.find (" characters"): @@ -67,12 +73,11 @@ for line in sys.stdin: print " %s, /* %s */" % (value, '; '.join(fields)) print -print " JOINING_TYPE_X /* dummy */" print "};" print -print "#define JOINING_TABLE_FIRST 0x%04x" % min_u -print "#define JOINING_TABLE_LAST 0x%04x" % max_u +print "#define JOINING_TABLE_FIRST 0x%04X" % min_u +print "#define JOINING_TABLE_LAST 0x%04X" % max_u print print "/* == End of generated table == */" diff --git a/src/hb-ot-shape-complex-arabic-table.hh b/src/hb-ot-shape-complex-arabic-table.hh index ea2350ef6..2b66dccac 100644 --- a/src/hb-ot-shape-complex-arabic-table.hh +++ b/src/hb-ot-shape-complex-arabic-table.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2010 Google, Inc. + * Copyright © 2011 Google, Inc. * * This is part of HarfBuzz, a text shaping library. * @@ -35,9 +35,9 @@ HB_BEGIN_DECLS /* * The following table is generated by running: * - * ./gen-arabic-table.py < ArabicShaping.txt + * ./gen-arabic-table.py ArabicShaping.txt * - * on the ArabicShaping.txt file with the header: + * on files with these headers: * * # ArabicShaping-6.1.0.txt * # Date: 2011-04-15, 23:16:00 GMT [KW] @@ -748,11 +748,10 @@ static const uint8_t joining_table[] = JOINING_TYPE_R, /* 08AB; WAW WITH DOT WITHIN; R; WAW */ JOINING_TYPE_R, /* 08AC; ROHINGYA YEH; R; ROHINGYA YEH */ - JOINING_TYPE_X /* dummy */ }; #define JOINING_TABLE_FIRST 0x0600 -#define JOINING_TABLE_LAST 0x08ac +#define JOINING_TABLE_LAST 0x08AC /* == End of generated table == */