OSDN Git Service

Revert "fix #37467 (Is it safe to write a whatsit in math mode?)"
[luatex-ja/luatexja.git] / tool / table_ivd_aj1.lua
1 print([[
2 return {
3 version = 2,
4 table_ivd_aj1 = {]])
5
6 local f = io.open('IVD_Sequences.txt')
7 local t, maxcid = {}, 0
8 local s = f:read()
9 while s do
10     if s:match('#') then
11         print('-- ' .. s)
12     elseif s:match('Adobe.Japan.') then
13         local c1,c2,c3 = s:match('(%x+)%s+(%x+);%s+Adobe.Japan.;%s+CID%+(%d+)')
14         c1, c2, c3 = tonumber(c1, 16), tonumber(c2, 16), tonumber(c3)
15         if c2 and c2>=0xE0100 then
16             c2 = c2 - 0xE00FF
17             if maxcid<c3 then maxcid = c3 end
18             t[c3] = c2*0x200000+c1
19         end
20     end
21     s = f:read()
22 end
23 f:close()
24
25 for i=1,maxcid do
26     print(' ' .. tostring(t[i] or false) .. ',')
27 end
28
29
30 -- ( echo 'luatexja.otf.ivd_aj1 = {' ; grep 'Adobe-Japan1' IVD_Sequences.txt|sed 's/\([0-9A-F][0-9A-F]*\) \([0-9A-F][0-9A-F]*\)\;.*CID.\([0-9][0-9]*\)$/[\3]=\{0x\1,0x\2\},/' ; echo '}' )
31 print([[}}]])
32