Fix TFM kerning and add plainTeX format

This commit is contained in:
Marcel Krüger 2020-06-15 05:59:54 +02:00
parent d4b1d7f9b4
commit ade568565c
4 changed files with 28 additions and 3 deletions

View File

@ -16,7 +16,7 @@ local function read_scaled(buf, i, count, factor)
return result, i + count * 4
end
local function parse_ligkern(buf, offset, r_boundary, kerns)
local kerns, ligatures, done = {}, {}, {}
local kerning, ligatures, done = {}, {}, {}
repeat
local skip, next, op, rem
skip, next, op, rem, offset = string.unpack("BBBB", buf, offset)
@ -25,7 +25,7 @@ local function parse_ligkern(buf, offset, r_boundary, kerns)
if not done[next] then
done[next] = true
if op >= 128 then
kerns[next] = kerns[(op - 128 << 8) + rem + 1]
kerning[next] = kerns[(op - 128 << 8) + rem + 1]
else
ligatures[next] = {
type = op,
@ -34,7 +34,7 @@ local function parse_ligkern(buf, offset, r_boundary, kerns)
end
end
until skip == 128
return next(kerns) and kerns or nil, next(ligatures) and ligatures or nil
return next(kerning) and kerning or nil, next(ligatures) and ligatures or nil
end
local function parse_tfm(buf, i, size)
local lf, lh, bc, ec, nw, nh, nd, ni, nl, nk, ne, np

1
luametaplain-init.lua Symbolic link
View File

@ -0,0 +1 @@
luametalatex-init.lua

23
luametaplain.ini Normal file
View File

@ -0,0 +1,23 @@
% tex-ini-files 2016-04-15: luatex.ini
% Karl Berry, originally written 2008. Public domain.
% PDF output by default.
% Must be done first (as needs to 'tidy up')
% \input luatexconfig.tex
% Activate primitives
\input luatexiniconfig.tex
\begingroup
% load-unicode-data needs \eTeXversion
\catcode`\{=1
\catcode`\}=2
\global\chardef\eTeXversion=2
\global\def\eTeXrevision{.2}
\endgroup
\input load-unicode-data.tex
\showthe\mathcode`\1
\input etex.src
\showthe\mathcode`\1
\input luametalatex-baseregisters
\showthe\mathcode`\1
\dump

1
luametaplain.lua Symbolic link
View File

@ -0,0 +1 @@
luametalatex.lua