OSDN Git Service

regenerated ltjsclasses.pdf
[luatex-ja/luatexja.git] / tool / ivslist.tex
1 %#!lualatex
2 \documentclass{article}
3 \batchmode
4 \usepackage{luaotfload,booktabs,array,luacode,longtable}
5 \usepackage[scale=0.8]{geometry}
6 \errorstopmode
7
8 \ifdefined\myfontname\else
9 {\newlinechar=`@
10 \message{@Name of the font to test = }
11 \read-1 to\myfontname \global\let\myfontname\myfontname
12 \message{@}}
13 \fi
14 \font\test=\myfontname\space at 12pt
15 {\test\begin{luacode}
16   ident = fonts.hashes.identifiers[font.current()]
17 \end{luacode}
18 }
19
20
21 \def\FMT#1#2{{\oalign{\test\char#1\crcr\rm\tiny\hss#2\hss\crcr}}}
22 \def\OUT#1{\leavevmode\hbox to 7em{{\test\char"#1}\ ({\tt U+#1})\hss}}%"
23 \begin{document}
24 {\noindent\Large\bf \myfontname\\\null\hfill (%
25   \directlua{tex.sprint(ident.fullname)}%
26 )}
27
28 \bigskip
29 \baselineskip18pt
30
31 \begin{luacode}
32 local t = ident.shared.rawdata
33 t = t and t.resources
34 t = t and t.variants
35 local ivs, ivsi = {}, {}
36 for i,v in pairs(t) do
37   if i>=0xE0100 then
38     for j,w in pairs(v) do
39        if not ivs[j] then table.insert(ivsi,j); ivs[j]=ivs[j] or {}; end
40        table.insert(ivs[j],{i-0xE0100,w})
41     end
42   end
43 end
44 local sort = table.sort
45 local sortfn = function (a,b) return a[1]<b[1] end
46 sort(ivsi)
47 for _,v in pairs(ivsi) do
48    sort(ivs[v], sortfn)
49    tex.sprint('\\OUT{' .. string.format('%X', v) .. '}\\ ')
50    for _, cn in pairs(ivs[v]) do
51      tex.sprint('\\FMT{' .. tostring(cn[2]) .. '}{' .. cn[1] .. '}' )
52    end
53    tex.sprint('\\par')
54 end
55 \end{luacode}
56
57
58 \end{document}