]> Lady’s Gitweb - OldStandard/commitdiff
added font table
authorRobert Alessi <redacted>
Wed, 7 Aug 2019 06:49:07 +0000 (08:49 +0200)
committerRobert Alessi <redacted>
Wed, 7 Aug 2019 06:49:07 +0000 (08:49 +0200)
fonttable.lua [new file with mode: 0644]
fonttable.tex [new file with mode: 0644]
makefile

diff --git a/fonttable.lua b/fonttable.lua
new file mode 100644 (file)
index 0000000..d50a314
--- /dev/null
@@ -0,0 +1,36 @@
+-- the following is adapted from https://tex.stackexchange.com/a/380780
+ft = {}
+function ft.print_glyphs(maxCols,maxChars) 
+   local id = font.current()
+   local fnt = font.getfont(id)
+   local col = 1
+   local maxU4 = 15*(16^3+16^2+16+1)
+   a = {}
+   for k, v in pairs(fnt.characters) do
+      a [#a + 1] = k
+   end
+   table.sort(a)
+   for i, k in ipairs(a) do
+      if i >= maxChars then break end
+      if col == 1 then
+        if k > maxU4 then
+           tex.sprint(string.format("U+%06x", k))
+        else
+           tex.sprint(string.format("U+%04x", k))
+        end
+        tex.sprint("&") 
+      end
+      if (i) then
+        tex.sprint(string.format([[\char%i]], k))
+      else
+        tex.sprint("~")
+      end
+      if col == maxCols then
+        tex.sprint([[\\\cline{2-]] .. maxCols+1 .. "} ")
+        col = 1
+      else
+        tex.sprint("&")
+        col = col + 1
+      end
+   end
+end
diff --git a/fonttable.tex b/fonttable.tex
new file mode 100644 (file)
index 0000000..f1b2814
--- /dev/null
@@ -0,0 +1,30 @@
+\documentclass[12pt]{article}
+\usepackage{fontspec}
+
+\usepackage{array}
+\usepackage{longtable}
+\usepackage{latexcolors}
+
+\usepackage{luacode}
+\luadirect{require("fonttable.lua")}
+
+\setmainfont{Old Standard}
+
+\title{\textsc{Old Standard}}
+\author{Font Table}
+\date{}
+
+\begin{document}
+\maketitle
+
+\color{cinnamon}
+
+\begin{longtable}{>{\color{gray}\ttfamily\footnotesize}r|
+                  *{10}{>{\color{black}}p{1.5em}|}}
+\cline{2-11}
+\endhead
+
+\luadirect{ft.print_glyphs(10,65463)} \\ \cline{2-11}
+\end{longtable}
+
+\end{document}
\ No newline at end of file
index a7b8032197156169557cea772cdacc534c75fd2b..5c34fdfc43bca75f8d799d360ef87e0baa22a159 100644 (file)
--- a/makefile
+++ b/makefile
@@ -10,6 +10,9 @@ doc: local
        biber $(pkg) >/dev/null
        lualatex --shell-escape $(pkg).tex >/dev/null
        lualatex --shell-escape $(pkg).tex >/dev/null
+       @echo "Building font table..."
+       lualatex --shell-escape fonttable.tex >/dev/null
+       lualatex --shell-escape fonttable.tex >/dev/null
        @echo "Removing OldStandard .otf files from $(LOCALFONTDIR)..."
        rm -f $(LOCALFONTDIR)/OldStandard-*.otf
        luaotfload-tool --update
@@ -26,7 +29,7 @@ local:
 
 package: doc
        mkdir $(pkg)-$(ver)
-       cp *.{txt,md,tex,pdf} $(pkg)-$(ver)
+       cp *.{txt,md,lua,tex,pdf} $(pkg)-$(ver)
        cp otf/*.otf $(pkg)-$(ver)
        tar czf $(pkg)-$(ver).tar.gz $(pkg)-$(ver)
        @echo "$(pkg)-$(ver).tar.gz has been created."
This page took 0.717822 seconds and 4 git commands to generate.