Smaller stuff

This commit is contained in:
Marcel Krüger 2020-07-05 20:40:09 +02:00
parent f18f6a3219
commit ad44afdb0b
3 changed files with 8 additions and 5 deletions

View File

@ -6,7 +6,7 @@ This code is in early stages of development and contains more bugs than features
## Prerequisites ## Prerequisites
You need an up-to-date TeX Live installation and the latest version of LuaMetaTeX. 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) ## 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`. Obtain `luametatex` from ConTeXt, drop the binary into the same location where your `luatex` binary is installed and then run `install.sh`.

View File

@ -3,6 +3,7 @@ local pdfvariable = pdf.variable
local writer = require'luametalatex-nodewriter' local writer = require'luametalatex-nodewriter'
local newpdf = require'luametalatex-pdf' local newpdf = require'luametalatex-pdf'
local nametree = require'luametalatex-pdf-nametree' local nametree = require'luametalatex-pdf-nametree'
local build_fontdir = require'luametalatex-pdf-font'
local pdfname, pfile local pdfname, pfile
local fontdirs = setmetatable({}, {__index=function(t, k)t[k] = pfile:getobj() return t[k] end}) local fontdirs = setmetatable({}, {__index=function(t, k)t[k] = pfile:getobj() return t[k] end})
local usedglyphs = {} local usedglyphs = {}
@ -27,9 +28,10 @@ local function get_pfile()
return pfile return pfile
end end
local outline local outline
local build_outline = require'luametalatex-pdf-outline'
local function get_outline() local function get_outline()
if not outline then if not outline then
outline = require'luametalatex-pdf-outline'() outline = build_outline()
end end
return outline return outline
end end
@ -107,7 +109,7 @@ callback.register("stop_run", function()
sorted[#sorted+1] = v sorted[#sorted+1] = v
end end
table.sort(sorted, function(a,b) return a[1] < b[1] 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 end
pfile.root = pfile:getobj() pfile.root = pfile:getobj()
pfile.version = string.format("%i.%i", pdfvariable.majorversion, pdfvariable.minorversion) 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())) error(string.format("Unknown PDF extension %s", token.scan_word()))
end end
end, "protected") end, "protected")
imglib = require'luametalatex-pdf-image' local imglib = require'luametalatex-pdf-image'
local imglib_node = imglib.node local imglib_node = imglib.node
local imglib_write = imglib.write local imglib_write = imglib.write
local imglib_immediatewrite = imglib.immediatewrite local imglib_immediatewrite = imglib.immediatewrite

View File

@ -37,7 +37,8 @@ package.searchers[2] = function(modname)
return mod, filename return mod, filename
end end
kpse.set_maketex("fmt", true, "compile") 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' require'luametalatex-init-config'
local callback_register = callback.register local callback_register = callback.register
local build_bytecode local build_bytecode