OSDN Git Service

ltj[s]classes.dtx: use Kozuka fonts )only for documents), if they exist
[luatex-ja/luatexja.git] / tool / blocks2defcharrange.rb
1 #! /usr/bin/ruby
2
3 # The following script converts Blocks.txt
4 # (http://unicode.org/Public/UNIDATA/Blocks.txt)
5 # to the character range definitions of LuaTeX-ja.
6
7 # USAGE: ruby blocks2defcharrange.rb > unicodeBlocks.tex
8
9 count = 1
10 open("Blocks.txt", "r").each_line {|line|
11   if line =~ /#/
12     line = $`
13   end
14   if line =~ /^\s*$/
15     next
16   end
17   if line =~ /([0-9a-f]+)\.\.([0-9a-f]+); (.*)/i
18     bcharcode = $1
19     echarcode = $2
20     blockname = $3
21     print "\\defcharrange{", count
22     print "}{\"", bcharcode, "-\"", echarcode, "} % ", blockname, "\n"
23     count += 1
24   end
25 }