aboutsummaryrefslogtreecommitdiff
path: root/archive
diff options
context:
space:
mode:
Diffstat (limited to 'archive')
-rw-r--r--archive/fonttable.lua36
-rw-r--r--archive/fonttable.tex33
2 files changed, 69 insertions, 0 deletions
diff --git a/archive/fonttable.lua b/archive/fonttable.lua
new file mode 100644
index 0000000..d50a314
--- /dev/null
+++ b/archive/fonttable.lua
@@ -0,0 +1,36 @@
1-- the following is adapted from https://tex.stackexchange.com/a/380780
2ft = {}
3function ft.print_glyphs(maxCols,maxChars)
4 local id = font.current()
5 local fnt = font.getfont(id)
6 local col = 1
7 local maxU4 = 15*(16^3+16^2+16+1)
8 a = {}
9 for k, v in pairs(fnt.characters) do
10 a [#a + 1] = k
11 end
12 table.sort(a)
13 for i, k in ipairs(a) do
14 if i >= maxChars then break end
15 if col == 1 then
16 if k > maxU4 then
17 tex.sprint(string.format("U+%06x", k))
18 else
19 tex.sprint(string.format("U+%04x", k))
20 end
21 tex.sprint("&")
22 end
23 if (i) then
24 tex.sprint(string.format([[\char%i]], k))
25 else
26 tex.sprint("~")
27 end
28 if col == maxCols then
29 tex.sprint([[\\\cline{2-]] .. maxCols+1 .. "} ")
30 col = 1
31 else
32 tex.sprint("&")
33 col = col + 1
34 end
35 end
36end
diff --git a/archive/fonttable.tex b/archive/fonttable.tex
new file mode 100644
index 0000000..5e90225
--- /dev/null
+++ b/archive/fonttable.tex
@@ -0,0 +1,33 @@
1% arara: lualatex
2% arara: lualatex
3% arara: lualatex
4\documentclass[12pt]{article}
5\usepackage{fontspec}
6
7\usepackage{array}
8\usepackage{longtable}
9\usepackage{latexcolors}
10
11\usepackage{luacode}
12\luadirect{require("fonttable.lua")}
13
14\setmainfont{Old Standard}
15
16\title{\textsc{Old Standard}}
17\author{Font Table}
18\date{}
19
20\begin{document}
21\maketitle
22
23\color{cinnamon}
24
25\begin{longtable}{>{\color{gray}\ttfamily\footnotesize}r|
26 *{10}{>{\color{black}}p{1.5em}|}}
27\cline{2-11}
28\endhead
29
30\luadirect{ft.print_glyphs(10,65463)} \\ \cline{2-11}
31\end{longtable}
32
33\end{document} \ No newline at end of file