diff options
author | Karl Berry <karl@freefriends.org> | 2014-11-02 21:54:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-11-02 21:54:27 +0000 |
commit | 24eeab9bcd6973c495381d583d49a2f2d904658e (patch) | |
tree | a701aa0aaaca7e602c27d49c0e60709a336854f5 /Master/texmf-dist/doc/luatex/luaintro/02-02-7.lualtx2 | |
parent | cd753845429d84c7f01270618abcbdeae44a2b0e (diff) |
luaintro (30oct14)
git-svn-id: svn://tug.org/texlive/trunk@35490 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/luatex/luaintro/02-02-7.lualtx2')
-rw-r--r-- | Master/texmf-dist/doc/luatex/luaintro/02-02-7.lualtx2 | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Master/texmf-dist/doc/luatex/luaintro/02-02-7.lualtx2 b/Master/texmf-dist/doc/luatex/luaintro/02-02-7.lualtx2 index 4a8c091f2f2..6560fc71793 100644 --- a/Master/texmf-dist/doc/luatex/luaintro/02-02-7.lualtx2 +++ b/Master/texmf-dist/doc/luatex/luaintro/02-02-7.lualtx2 @@ -4,7 +4,7 @@ %% 1. Auflage %% %% -%% Copyright (C) 2013 Herbert Voss +%% Copyright (C) 2014 Herbert Voss %% %% It may be distributed and/or modified under the conditions %% of the LaTeX Project Public License, either version 1.3 @@ -26,18 +26,26 @@ \usepackage{fontspec,luacode} \newfontface\LMML{Latin Modern Mono Light Cond} \begin{luacode} -local teststring = "Lua\\TeX~--~Eine Einführung." -local myfonts = dofile(fonts.names.path.dir .. "/" .. fonts.names.path.basename) +local teststring = "Lua\\LaTeX~--~Eine Einführung." function printFontDemo(fontname) + local starttime = os.gettimeofday () + local foundname = file.replacesuffix (config.luaotfload.paths.index_path_lua, "luc") + local fh = io.open (foundname, "rb") + local chunk = fh:read"*all" + fh:close() + local code = load (chunk, "b") + data = code() local fnA = string.lower(fontname) local a = {} local b = {} - for i, v in ipairs(myfonts.mappings) do - m, n = string.find(string.lower(v.names.family),fnA) +-- print(table.serialize(data.mappings[1])) + for i, v in ipairs(data.mappings) do + m, n = string.find(string.lower(v.familyname),fnA) if m then a[v.fontname] = v.familyname b[#b + 1] = v.fontname end + print(i, tostring(v.familyname)) end table.sort(b) for i, v in ipairs(b) do @@ -53,5 +61,5 @@ end \end{luacode} %StopShownPreambleCommands \begin{document} -\directlua{printFontDemo("Latin Modern")} +\directlua{printFontDemo("LatinModern")} \end{document} |