Created
July 22, 2016 21:51
-
-
Save henryso/d94e28ee96bf1e5d3b9f8832b723ccf3 to your computer and use it in GitHub Desktop.
MWE for gregorio-project/gregorio#1188
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local EXCLUDE = { | |
['.notdef'] = true, | |
['.null'] = true, | |
notdef = true, | |
nonmarkingreturn = true, | |
} | |
Mwe = {} | |
function Mwe.emit(csname) | |
local glyphs = font.fonts[font.id(csname)].resources.unicodes | |
local ignored = glyphs['___magic___'] | |
local first = true | |
local odd = true | |
for name, cp in pairs(glyphs) do | |
if cp >= 0xe000 and not EXCLUDE[name] then | |
if first then | |
first = false | |
elseif odd then | |
tex.print([[\hline]]) | |
end | |
tex.sprint(string.format([[{\scriptsize %s}&{\%s\char%d}]], name, csname, cp)) | |
if odd then | |
tex.sprint([[&]]) | |
else | |
tex.print([[\\]]) | |
end | |
odd = not odd | |
if odd then break end | |
end | |
end | |
if not odd then | |
tex.print([[&\\]]) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[12pt,a4paper]{article} | |
\usepackage{fontspec} | |
\usepackage{libertine} | |
\usepackage{longtable} | |
\directlua{dofile('mwe.lua')} | |
\font\greextra = {name:greextra} at 1000000 sp\relax | |
\begin{document} | |
\begin{longtable}{lc|lc} | |
\directlua{Mwe.emit('greextra')} | |
\end{longtable} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment