1 kpse.set_program_name('luatex')
2 dofile(kpse.find_file('lualibs.lua'))
4 local function toX(a) return string.format('0x%X',a) end
6 local uax_revision = '10.0.0'
7 print(' -- UAX#50 for Unicode ' .. uax_revision)
8 local fh = io.open('VerticalOrientation-' .. uax_revision .. '.txt')
11 for c in fh:lines() do
12 if c:match('(%x+)%.%.(%x+)%s+;%sT-[rR]') then
13 local b, e = c:match('(%x+)%.%.(%x+)%s+;')
14 b, e = tonumber(b,16), tonumber(e,16)
15 for i=b,e do t[i]=true end
16 elseif c:match('(%x+)%s+;%sT-[rR]') then
17 local b = c:match('(%x+)%s+;')
18 t[tonumber(b,16)]=true
27 table.insert(t2,b); b, v=i, t[i]
32 print(' -- t[0] = ' .. tostring(t[0]))
33 print(table.serialize(t2,' local t'))
36 for i,v in ipairs(t2) do
37 print(i, toX(v[1]) .. ' ≦x< ' .. toX(v[2]), v[3])
41 print([[ local function rotate_in_uax50(i)
44 local mi = math.ceil((lo+hi)/2)
45 if t[mi]<=i then lo=mi else hi=mi-1 end