From ad44afdb0b9607ca5afd40db957474a463600cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Fabian=20Kr=C3=BCger?= Date: Sun, 5 Jul 2020 20:40:09 +0200 Subject: [PATCH] Smaller stuff --- README.md | 2 +- luametalatex-back-pdf.lua | 8 +++++--- luametalatex-init.lua | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1802e83..f73287a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This code is in early stages of development and contains more bugs than features ## Prerequisites You need an up-to-date TeX Live installation and the latest version of LuaMetaTeX. -Additionally a special library version of LuaTeX's kpathsea Lua binding is needed which is provided as a binary for Linux x64. For other platforms you might have to compile it yourself. Drop me a line if you need any instructions. +Additionally a special library version of LuaTeX's kpathsea Lua binding is needed which is provided as a binary for Linux x64. For other platforms you might have to compile it yourself. Drop me a line if you need any instructions. (The source can be found under https://github.com/zauguin/luametalatex-kpse) ## How to install (automatically) Obtain `luametatex` from ConTeXt, drop the binary into the same location where your `luatex` binary is installed and then run `install.sh`. diff --git a/luametalatex-back-pdf.lua b/luametalatex-back-pdf.lua index 56d2df6..2899e40 100644 --- a/luametalatex-back-pdf.lua +++ b/luametalatex-back-pdf.lua @@ -3,6 +3,7 @@ local pdfvariable = pdf.variable local writer = require'luametalatex-nodewriter' local newpdf = require'luametalatex-pdf' local nametree = require'luametalatex-pdf-nametree' +local build_fontdir = require'luametalatex-pdf-font' local pdfname, pfile local fontdirs = setmetatable({}, {__index=function(t, k)t[k] = pfile:getobj() return t[k] end}) local usedglyphs = {} @@ -27,9 +28,10 @@ local function get_pfile() return pfile end local outline +local build_outline = require'luametalatex-pdf-outline' local function get_outline() if not outline then - outline = require'luametalatex-pdf-outline'() + outline = build_outline() end return outline end @@ -107,7 +109,7 @@ callback.register("stop_run", function() sorted[#sorted+1] = v end table.sort(sorted, function(a,b) return a[1] < b[1] end) - pfile:indirect(id, require'luametalatex-pdf-font'(pfile, f, sorted)) + pfile:indirect(id, build_fontdir(pfile, f, sorted)) end pfile.root = pfile:getobj() pfile.version = string.format("%i.%i", pdfvariable.majorversion, pdfvariable.minorversion) @@ -744,7 +746,7 @@ token.luacmd("pdfextension", function(_, imm) error(string.format("Unknown PDF extension %s", token.scan_word())) end end, "protected") -imglib = require'luametalatex-pdf-image' +local imglib = require'luametalatex-pdf-image' local imglib_node = imglib.node local imglib_write = imglib.write local imglib_immediatewrite = imglib.immediatewrite diff --git a/luametalatex-init.lua b/luametalatex-init.lua index 6e60aa8..528f3a2 100644 --- a/luametalatex-init.lua +++ b/luametalatex-init.lua @@ -37,7 +37,8 @@ package.searchers[2] = function(modname) return mod, filename end kpse.set_maketex("fmt", true, "compile") --- kpse.init_prog("LUATEX", 400, "nexthi", nil) +kpse.set_maketex("pk", true, "compile") +kpse.init_prog("LUATEX", 600, "ljfour", nil) require'luametalatex-init-config' local callback_register = callback.register local build_bytecode