Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1187)

Side by Side Diff: third_party/harfbuzz/contrib/tables/combining-class-parse.py

Issue 384503008: Delete third_party/harfbuzz (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove public header Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 import sys
2 from unicode_parse_common import *
3
4 # http://www.unicode.org/Public/5.1.0/ucd/extracted/DerivedCombiningClass.txt
5
6 class IdentityMap(object):
7 def __getitem__(_, key):
8 return key
9
10 def main(infile, outfile):
11 ranges = unicode_file_parse(infile, IdentityMap(), '0')
12 ranges = sort_and_merge(ranges)
13
14 print >>outfile, '// Generated from Unicode tables\n'
15 print >>outfile, '#ifndef COMBINING_PROPERTIES_H_'
16 print >>outfile, '#define COMBINING_PROPERTIES_H_\n'
17 print >>outfile, '#include <stdint.h>'
18 print >>outfile, 'struct combining_property {'
19 print >>outfile, ' uint32_t range_start;'
20 print >>outfile, ' uint32_t range_end;'
21 print >>outfile, ' uint8_t klass;'
22 print >>outfile, '};\n'
23 print >>outfile, 'static const struct combining_property combining_properties[ ] = {'
24 for (start, end, value) in ranges:
25 print >>outfile, ' {0x%x, 0x%x, %s},' % (start, end, value)
26 print >>outfile, '};\n'
27 print >>outfile, 'static const unsigned combining_properties_count = %d;\n' % len(ranges)
28 print >>outfile, '#endif // COMBINING_PROPERTIES_H_'
29
30 if __name__ == '__main__':
31 if len(sys.argv) != 3:
32 print 'Usage: %s <input .txt> <output .h>' % sys.argv[0]
33 else:
34 main(file(sys.argv[1], 'r'), file(sys.argv[2], 'w+'))
OLDNEW
« no previous file with comments | « third_party/harfbuzz/contrib/tables/category-properties.h ('k') | third_party/harfbuzz/contrib/tables/combining-properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698