summaryrefslogtreecommitdiff
path: root/macros/luatex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-05-22 03:00:53 +0000
committerNorbert Preining <norbert@preining.info>2021-05-22 03:00:53 +0000
commit58aa1ac09b1d9e4769d0a0661cf12e2b2db41b14 (patch)
tree366a7a5e1310dc291fa9969ce6ed1af604bb8d89 /macros/luatex
parent6a52d8839d334ac56f36195aa404fac667862830 (diff)
CTAN sync 202105220300
Diffstat (limited to 'macros/luatex')
-rw-r--r--macros/luatex/generic/lualibs/NEWS2
-rw-r--r--macros/luatex/generic/lualibs/README.md6
-rw-r--r--macros/luatex/generic/lualibs/lualibs-basic-merged.lua28
-rw-r--r--macros/luatex/generic/lualibs/lualibs-extended-merged.lua60
-rw-r--r--macros/luatex/generic/lualibs/lualibs-lpeg.lua2
-rw-r--r--macros/luatex/generic/lualibs/lualibs-number.lua52
-rw-r--r--macros/luatex/generic/lualibs/lualibs-os.lua2
-rw-r--r--macros/luatex/generic/lualibs/lualibs-package.lua22
-rw-r--r--macros/luatex/generic/lualibs/lualibs-trac-inf.lua2
-rw-r--r--macros/luatex/generic/lualibs/lualibs-url.lua100
-rw-r--r--macros/luatex/generic/lualibs/lualibs-util-str.lua70
-rw-r--r--macros/luatex/generic/lualibs/lualibs.dtx35
-rw-r--r--macros/luatex/generic/lualibs/lualibs.pdfbin81487 -> 81627 bytes
-rw-r--r--macros/luatex/generic/luaotfload/NEWS6
-rw-r--r--macros/luatex/generic/luaotfload/README.md4
-rw-r--r--macros/luatex/generic/luaotfload/filegraph.pdfbin41362 -> 40024 bytes
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-2021-05-20.lua (renamed from macros/luatex/generic/luaotfload/fontloader-2021-01-07.lua)1360
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-basics-nod.lua221
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-font-cff.lua43
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-font-imp-effects.lua172
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-font-ocl.lua27
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-font-one.lua1
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-font-osd.lua28
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-font-ota.lua10
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-font-otj.lua115
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-font-otl.lua3
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-font-otr.lua4
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-font-ots.lua740
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-font-ott.lua6
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-font-oup.lua91
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-font-shp.lua2
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-fonts-gbn.lua44
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-l-lpeg.lua2
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-reference.lua1250
-rw-r--r--macros/luatex/generic/luaotfload/fontloader-util-str.lua70
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-auxiliary.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-case-el.lua294
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-colors.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-conf.pdfbin78522 -> 77497 bytes
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-configuration.lua6
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-database.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-diagnostics.lua6
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-dvi.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-embolden.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-fakesc.lua204
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-fallback.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-features.lua15
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-filelist.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-glyphlist.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-harf-define.lua24
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-harf-plug.lua47
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-init.lua6
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-latex.pdfbin501958 -> 494977 bytes
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-letterspace.lua28
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-loaders.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-log.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-main.tex10
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-multiscript.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-notdef.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-parsers.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-resolvers.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-scripts.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-status.lua100
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-suppress.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-szss.lua5
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-tool.17
-rwxr-xr-x[-rw-r--r--]macros/luatex/generic/luaotfload/luaotfload-tool.lua58
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-tool.pdfbin78960 -> 77067 bytes
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-tool.rst8
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-tounicode.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload-unicode.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload.conf.52
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload.conf.rst4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload.lua4
-rw-r--r--macros/luatex/generic/luaotfload/luaotfload.sty2
-rw-r--r--macros/luatex/generic/luaotfload/scripts-demo.pdfbin21837 -> 21837 bytes
-rw-r--r--macros/luatex/generic/luaotfload/shaper-demo-graphite.pdfbin8559 -> 8559 bytes
-rw-r--r--macros/luatex/generic/luaotfload/shaper-demo.pdfbin8479 -> 8479 bytes
-rw-r--r--macros/luatex/generic/luatexja/README8
-rw-r--r--macros/luatex/generic/luatexja/doc/luatexja-en.pdfbin693538 -> 693535 bytes
-rw-r--r--macros/luatex/generic/luatexja/doc/luatexja-ja.pdfbin1130313 -> 1130307 bytes
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-inputbuf.lua8
-rw-r--r--macros/luatex/generic/luatexja/src/luatexja-core.sty4
-rw-r--r--macros/luatex/generic/luatexja/src/luatexja.sty4
84 files changed, 2721 insertions, 2785 deletions
diff --git a/macros/luatex/generic/lualibs/NEWS b/macros/luatex/generic/lualibs/NEWS
index 4c80d06987..cf8a853b6c 100644
--- a/macros/luatex/generic/lualibs/NEWS
+++ b/macros/luatex/generic/lualibs/NEWS
@@ -1,4 +1,6 @@
History of the lualibs package
+2021/05/20 v2.74/
+ * sync with Context current as of 2021/05/20.
2020/12/30 v2.73/
* sync with Context current as of 2020/12/30.
diff --git a/macros/luatex/generic/lualibs/README.md b/macros/luatex/generic/lualibs/README.md
index cf330df159..e2cd6be9bd 100644
--- a/macros/luatex/generic/lualibs/README.md
+++ b/macros/luatex/generic/lualibs/README.md
@@ -1,10 +1,10 @@
# The Lualibs Package
-VERSION: 2.73
+VERSION: 2.74
-DATE: 2020-12-30
+DATE: 2021-05-20
-FONTLOADERDATE: 2020-12-30
+FONTLOADERDATE: 2021-05-20
Lualibs is a collection of Lua modules useful for general programming.
diff --git a/macros/luatex/generic/lualibs/lualibs-basic-merged.lua b/macros/luatex/generic/lualibs/lualibs-basic-merged.lua
index 92e571a7cc..ac98df379a 100644
--- a/macros/luatex/generic/lualibs/lualibs-basic-merged.lua
+++ b/macros/luatex/generic/lualibs/lualibs-basic-merged.lua
@@ -1,6 +1,6 @@
-- merged file : lualibs-basic-merged.lua
-- parent file : lualibs-basic.lua
--- merge date : Wed Dec 30 17:55:54 2020
+-- merge date : 2021-05-20 23:14
do -- begin closure to overcome local limits and interference
@@ -133,7 +133,7 @@ if not modules then modules={} end modules ['l-package']={
copyright="PRAGMA ADE / ConTeXt Development Team",
license="see context related readme files"
}
-local type=type
+local type,unpack=type,unpack
local gsub,format,find=string.gsub,string.format,string.find
local insert,remove=table.insert,table.remove
local P,S,Cs,lpegmatch=lpeg.P,lpeg.S,lpeg.Cs,lpeg.match
@@ -163,6 +163,7 @@ local helpers=package.helpers or {
},
methods={},
sequence={
+ "reset loaded",
"already loaded",
"preload table",
"qualified path",
@@ -179,6 +180,7 @@ local methods=helpers.methods
local builtin=helpers.builtin
local extraluapaths={}
local extralibpaths={}
+local checkedfiles={}
local luapaths=nil
local libpaths=nil
local oldluapath=nil
@@ -312,10 +314,16 @@ end
local function loadedaslib(resolved,rawname)
local base=gsub(rawname,"%.","_")
local init="luaopen_"..gsub(base,"%.","_")
+ local data={ resolved,init,"" }
+ checkedfiles[#checkedfiles+1]=data
if helpers.trace then
helpers.report("calling loadlib with '%s' with init '%s'",resolved,init)
end
- return package.loadlib(resolved,init)
+ local a,b,c=package.loadlib(resolved,init)
+ if not a and type(b)=="string" then
+ data[3]=string.fullstrip(b or "unknown error")
+ end
+ return a,b,c
end
helpers.loadedaslib=loadedaslib
local function loadedbypath(name,rawname,paths,islib,what)
@@ -354,6 +362,10 @@ local function loadedbyname(name,rawname)
end
end
helpers.loadedbyname=loadedbyname
+methods["reset loaded"]=function(name)
+ checkedfiles={}
+ return false
+end
methods["already loaded"]=function(name)
return package.loaded[name]
end
@@ -395,6 +407,9 @@ end
methods["not loaded"]=function(name)
if helpers.trace then
helpers.report("unable to locate '%s'",name or "?")
+ for i=1,#checkedfiles do
+ helpers.report("checked file '%s', initializer '%s', message '%s'",unpack(checkedfiles[i]))
+ end
end
return nil
end
@@ -2591,13 +2606,13 @@ do -- begin closure to overcome local limits and interference
if not modules then modules={} end modules ['l-number']={
version=1.001,
- comment="companion to luat-lib.mkiv",
+ comment="companion to luat-lib.mkxl",
author="Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright="PRAGMA ADE / ConTeXt Development Team",
license="see context related readme files"
}
local tostring,tonumber=tostring,tonumber
-local format,floor,match,rep=string.format,math.floor,string.match,string.rep
+local format,match,rep=string.format,string.match,string.rep
local concat,insert=table.concat,table.insert
local lpegmatch=lpeg.match
local floor=math.floor
@@ -3371,7 +3386,7 @@ elseif name=="macosx" then
elseif find(architecture,"x86_64",1,true) then
platform="osx-64"
elseif find(architecture,"arm64",1,true) then
- platform="osx-64"
+ platform="osx-arm"
else
platform="osx-ppc"
end
@@ -4698,7 +4713,6 @@ if not modules then modules={} end modules ['l-unicode']={
license="see context related readme files"
}
utf=utf or {}
--- unicode=nil
if not string.utfcharacters then
local gmatch=string.gmatch
function string.characters(str)
diff --git a/macros/luatex/generic/lualibs/lualibs-extended-merged.lua b/macros/luatex/generic/lualibs/lualibs-extended-merged.lua
index cac8889ca3..9cd4487bf2 100644
--- a/macros/luatex/generic/lualibs/lualibs-extended-merged.lua
+++ b/macros/luatex/generic/lualibs/lualibs-extended-merged.lua
@@ -1,6 +1,6 @@
-- merged file : lualibs-extended-merged.lua
-- parent file : lualibs-extended.lua
--- merge date : Wed Dec 30 17:55:44 2020
+-- merge date : 2021-05-20 23:14
do -- begin closure to overcome local limits and interference
@@ -54,25 +54,59 @@ local function points(n)
n=n*ptf
if n%1==0 then
return format("%ipt",n)
+ else
+ return lpegmatch(stripzeros,format("%.5fpt",n))
+ end
+end
+local function nupoints(n)
+ if n==0 then
+ return "0"
+ end
+ n=tonumber(n)
+ if not n or n==0 then
+ return "0"
+ end
+ n=n*ptf
+ if n%1==0 then
+ return format("%i",n)
+ else
+ return format("%.5f",n)
end
- return lpegmatch(stripzeros,format("%.5fpt",n))
end
local function basepoints(n)
if n==0 then
- return "0pt"
+ return "0bp"
end
n=tonumber(n)
if not n or n==0 then
- return "0pt"
+ return "0bp"
end
n=n*bpf
if n%1==0 then
return format("%ibp",n)
+ else
+ return lpegmatch(stripzeros,format("%.5fbp",n))
+ end
+end
+local function nubasepoints(n)
+ if n==0 then
+ return "0"
+ end
+ n=tonumber(n)
+ if not n or n==0 then
+ return "0"
+ end
+ n=n*bpf
+ if n%1==0 then
+ return format("%i",n)
+ else
+ return format("%.5f",n)
end
- return lpegmatch(stripzeros,format("%.5fbp",n))
end
number.points=points
+number.nupoints=nupoints
number.basepoints=basepoints
+number.nubasepoints=nubasepoints
local rubish=spaceortab^0*newline
local anyrubish=spaceortab+newline
local stripped=(spaceortab^1/"")*newline
@@ -350,7 +384,9 @@ local environment={
concat=table.concat,
signed=number.signed,
points=number.points,
+ nupoints=number.nupoints,
basepoints=number.basepoints,
+ nubasepoints=number.nubasepoints,
utfchar=utf.char,
utfbyte=utf.byte,
lpegmatch=lpeg.match,
@@ -545,10 +581,18 @@ local format_p=function()
n=n+1
return format("points(a%s)",n)
end
+local format_P=function()
+ n=n+1
+ return format("nupoints(a%s)",n)
+end
local format_b=function()
n=n+1
return format("basepoints(a%s)",n)
end
+local format_B=function()
+ n=n+1
+ return format("nubasepoints(a%s)",n)
+end
local format_t=function(f)
n=n+1
if f and f~="" then
@@ -701,7 +745,7 @@ local builder=Cs { "start",
+V("n")
+V("N")
+V("k")
-+V("r")+V("h")+V("H")+V("u")+V("U")+V("p")+V("b")+V("t")+V("T")+V("l")+V("L")+V("I")+V("w")
++V("r")+V("h")+V("H")+V("u")+V("U")+V("p")+V("P")+V("b")+V("B")+V("t")+V("T")+V("l")+V("L")+V("I")+V("w")
+V("W")
+V("a")
+V("A")
@@ -739,7 +783,9 @@ local builder=Cs { "start",
["u"]=(prefix_any*P("u"))/format_u,
["U"]=(prefix_any*P("U"))/format_U,
["p"]=(prefix_any*P("p"))/format_p,
+ ["P"]=(prefix_any*P("P"))/format_P,
["b"]=(prefix_any*P("b"))/format_b,
+ ["B"]=(prefix_any*P("B"))/format_B,
["t"]=(prefix_tab*P("t"))/format_t,
["T"]=(prefix_tab*P("T"))/format_T,
["l"]=(prefix_any*P("l"))/format_l,
@@ -3312,10 +3358,8 @@ local function stoptiming(instance)
timer.loadtime=timer.loadtime+loadtime
timer.timing=0
timer.starttime=0
- return loadtime
end
end
- return 0
end
local function benchmarktimer(instance)
local timer=timers[instance or "notimer"]
diff --git a/macros/luatex/generic/lualibs/lualibs-lpeg.lua b/macros/luatex/generic/lualibs/lualibs-lpeg.lua
index b0868ba488..50306e4ab6 100644
--- a/macros/luatex/generic/lualibs/lualibs-lpeg.lua
+++ b/macros/luatex/generic/lualibs/lualibs-lpeg.lua
@@ -507,7 +507,7 @@ end
-- todo: cache when string
-function lpeg.replacer(one,two,makefunction,isutf) -- in principle we should sort the keys
+function lpeg.replacer(one,two,makefunction,isutf) -- in principle we should sort the keys but we have a better one anyway
local pattern
local u = isutf and utf8char or 1
if type(one) == "table" then
diff --git a/macros/luatex/generic/lualibs/lualibs-number.lua b/macros/luatex/generic/lualibs/lualibs-number.lua
index 9fd2f82f78..0ec60880d7 100644
--- a/macros/luatex/generic/lualibs/lualibs-number.lua
+++ b/macros/luatex/generic/lualibs/lualibs-number.lua
@@ -1,16 +1,13 @@
if not modules then modules = { } end modules ['l-number'] = {
version = 1.001,
- comment = "companion to luat-lib.mkiv",
+ comment = "companion to luat-lib.mkxl",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
--- this module will be replaced when we have the bit library .. the number based sets
--- might go away
-
local tostring, tonumber = tostring, tonumber
-local format, floor, match, rep = string.format, math.floor, string.match, string.rep
+local format, match, rep = string.format, string.match, string.rep
local concat, insert = table.concat, table.insert
local lpegmatch = lpeg.match
local floor = math.floor
@@ -18,51 +15,6 @@ local floor = math.floor
number = number or { }
local number = number
--- begin obsolete code --
-
--- if bit32 then
---
--- local btest, bor = bit32.btest, bit32.bor
---
--- function number.bit(p)
--- return 2 ^ (p - 1) -- 1-based indexing
--- end
---
--- number.hasbit = btest
--- number.setbit = bor
---
--- function number.setbit(x,p) -- why not bor?
--- return btest(x,p) and x or x + p
--- end
---
--- function number.clearbit(x,p)
--- return btest(x,p) and x - p or x
--- end
---
--- else
---
--- -- http://ricilake.blogspot.com/2007/10/iterating-bits-in-lua.html
---
--- function number.bit(p)
--- return 2 ^ (p - 1) -- 1-based indexing
--- end
---
--- function number.hasbit(x, p) -- typical call: if hasbit(x, bit(3)) then ...
--- return x % (p + p) >= p
--- end
---
--- function number.setbit(x, p)
--- return (x % (p + p) >= p) and x or x + p
--- end
---
--- function number.clearbit(x, p)
--- return (x % (p + p) >= p) and x - p or x
--- end
---
--- end
-
--- end obsolete code --
-
-- print(number.tobitstring(8))
-- print(number.tobitstring(14))
-- print(number.tobitstring(66))
diff --git a/macros/luatex/generic/lualibs/lualibs-os.lua b/macros/luatex/generic/lualibs/lualibs-os.lua
index 73841074c4..c7584ccce9 100644
--- a/macros/luatex/generic/lualibs/lualibs-os.lua
+++ b/macros/luatex/generic/lualibs/lualibs-os.lua
@@ -359,7 +359,7 @@ elseif name == "macosx" then
elseif find(architecture,"x86_64",1,true) then
platform = "osx-64"
elseif find(architecture,"arm64",1,true) then
- platform = "osx-64"
+ platform = "osx-arm"
else
platform = "osx-ppc"
end
diff --git a/macros/luatex/generic/lualibs/lualibs-package.lua b/macros/luatex/generic/lualibs/lualibs-package.lua
index a35ec3e2a9..ef37aebe74 100644
--- a/macros/luatex/generic/lualibs/lualibs-package.lua
+++ b/macros/luatex/generic/lualibs/lualibs-package.lua
@@ -16,7 +16,7 @@ if not modules then modules = { } end modules ['l-package'] = {
-- -- local mylib = require("libtest")
-- -- local mysql = require("luasql.mysql")
-local type = type
+local type, unpack = type, unpack
local gsub, format, find = string.gsub, string.format, string.find
local insert, remove = table.insert, table.remove
@@ -70,6 +70,7 @@ local helpers = package.helpers or {
methods = {
},
sequence = {
+ "reset loaded",
"already loaded",
"preload table",
"qualified path", -- beware, lua itself doesn't handle qualified paths (prepends ./)
@@ -91,6 +92,7 @@ local builtin = helpers.builtin
local extraluapaths = { }
local extralibpaths = { }
+local checkedfiles = { }
local luapaths = nil -- delayed
local libpaths = nil -- delayed
local oldluapath = nil
@@ -245,10 +247,17 @@ local function loadedaslib(resolved,rawname) -- todo: strip all before first -
-- so, we can do a require("foo/bar") and initialize bar
-- local base = gsub(file.basename(rawname),"%.","_")
local init = "luaopen_" .. gsub(base,"%.","_")
+ local data = { resolved, init, "" }
+ checkedfiles[#checkedfiles+1] = data
if helpers.trace then
helpers.report("calling loadlib with '%s' with init '%s'",resolved,init)
end
- return package.loadlib(resolved,init)
+ local a, b, c = package.loadlib(resolved,init)
+ if not a and type(b) == "string" then
+-- data[3] = gsub(b or "unknown error","[\n\r]","")
+ data[3] = string.fullstrip(b or "unknown error")
+ end
+ return a, b, c -- c can be 'init'
end
helpers.loadedaslib = loadedaslib
@@ -295,6 +304,12 @@ end
helpers.loadedbyname = loadedbyname
+methods["reset loaded"] = function(name)
+ checkedfiles = { }
+ return false
+end
+
+
methods["already loaded"] = function(name)
return package.loaded[name]
end
@@ -344,6 +359,9 @@ end
methods["not loaded"] = function(name)
if helpers.trace then
helpers.report("unable to locate '%s'",name or "?")
+ for i=1,#checkedfiles do
+ helpers.report("checked file '%s', initializer '%s', message '%s'",unpack(checkedfiles[i]))
+ end
end
return nil
end
diff --git a/macros/luatex/generic/lualibs/lualibs-trac-inf.lua b/macros/luatex/generic/lualibs/lualibs-trac-inf.lua
index 3db912be1f..e2736cfb6e 100644
--- a/macros/luatex/generic/lualibs/lualibs-trac-inf.lua
+++ b/macros/luatex/generic/lualibs/lualibs-trac-inf.lua
@@ -129,10 +129,8 @@ local function stoptiming(instance)
timer.loadtime = timer.loadtime + loadtime
timer.timing = 0
timer.starttime = 0
- return loadtime
end
end
- return 0
end
local function benchmarktimer(instance)
diff --git a/macros/luatex/generic/lualibs/lualibs-url.lua b/macros/luatex/generic/lualibs/lualibs-url.lua
index 6f834d778d..2e01ad4080 100644
--- a/macros/luatex/generic/lualibs/lualibs-url.lua
+++ b/macros/luatex/generic/lualibs/lualibs-url.lua
@@ -379,53 +379,53 @@ end
-- print(url.barepath("/test"),url.barepath("test/"),url.barepath("/test/"),url.barepath("test"))
-- print(url.barepath("/x/yz"),url.barepath("x/yz/"),url.barepath("/x/yz/"),url.barepath("x/yz"))
---~ print(url.filename("file:///c:/oeps.txt"))
---~ print(url.filename("c:/oeps.txt"))
---~ print(url.filename("file:///oeps.txt"))
---~ print(url.filename("file:///etc/test.txt"))
---~ print(url.filename("/oeps.txt"))
-
---~ from the spec on the web (sort of):
-
---~ local function test(str)
---~ local t = url.hashed(str)
---~ t.constructed = url.construct(t)
---~ print(table.serialize(t))
---~ end
-
---~ inspect(url.hashed("http://www.pragma-ade.com/test%20test?test=test%20test&x=123%3d45"))
---~ inspect(url.hashed("http://www.pragma-ade.com/test%20test?test=test%20test&x=123%3d45"))
-
---~ test("sys:///./colo-rgb")
-
---~ test("/data/site/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733/figuur-cow.jpg")
---~ test("file:///M:/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
---~ test("M:/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
---~ test("file:///q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
---~ test("/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
-
---~ test("file:///cow%20with%20spaces")
---~ test("file:///cow%20with%20spaces.pdf")
---~ test("cow%20with%20spaces.pdf")
---~ test("some%20file")
---~ test("/etc/passwords")
---~ test("http://www.myself.com/some%20words.html")
---~ test("file:///c:/oeps.txt")
---~ test("file:///c|/oeps.txt")
---~ test("file:///etc/oeps.txt")
---~ test("file://./etc/oeps.txt")
---~ test("file:////etc/oeps.txt")
---~ test("ftp://ftp.is.co.za/rfc/rfc1808.txt")
---~ test("http://www.ietf.org/rfc/rfc2396.txt")
---~ test("ldap://[2001:db8::7]/c=GB?objectClass?one#what")
---~ test("mailto:John.Doe@example.com")
---~ test("news:comp.infosystems.www.servers.unix")
---~ test("tel:+1-816-555-1212")
---~ test("telnet://192.0.2.16:80/")
---~ test("urn:oasis:names:specification:docbook:dtd:xml:4.1.2")
---~ test("http://www.pragma-ade.com/spaced%20name")
-
---~ test("zip:///oeps/oeps.zip#bla/bla.tex")
---~ test("zip:///oeps/oeps.zip?bla/bla.tex")
-
---~ table.print(url.hashed("/test?test"))
+-- print(url.filename("file:///c:/oeps.txt"))
+-- print(url.filename("c:/oeps.txt"))
+-- print(url.filename("file:///oeps.txt"))
+-- print(url.filename("file:///etc/test.txt"))
+-- print(url.filename("/oeps.txt"))
+
+-- from the spec on the web (sort of):
+
+-- local function test(str)
+-- local t = url.hashed(str)
+-- t.constructed = url.construct(t)
+-- print(table.serialize(t))
+-- end
+
+-- inspect(url.hashed("http://www.pragma-ade.com/test%20test?test=test%20test&x=123%3d45"))
+-- inspect(url.hashed("http://www.pragma-ade.com/test%20test?test=test%20test&x=123%3d45"))
+
+-- test("sys:///./colo-rgb")
+
+-- test("/data/site/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733/figuur-cow.jpg")
+-- test("file:///M:/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
+-- test("M:/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
+-- test("file:///q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
+-- test("/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
+
+-- test("file:///cow%20with%20spaces")
+-- test("file:///cow%20with%20spaces.pdf")
+-- test("cow%20with%20spaces.pdf")
+-- test("some%20file")
+-- test("/etc/passwords")
+-- test("http://www.myself.com/some%20words.html")
+-- test("file:///c:/oeps.txt")
+-- test("file:///c|/oeps.txt")
+-- test("file:///etc/oeps.txt")
+-- test("file://./etc/oeps.txt")
+-- test("file:////etc/oeps.txt")
+-- test("ftp://ftp.is.co.za/rfc/rfc1808.txt")
+-- test("http://www.ietf.org/rfc/rfc2396.txt")
+-- test("ldap://[2001:db8::7]/c=GB?objectClass?one#what")
+-- test("mailto:John.Doe@example.com")
+-- test("news:comp.infosystems.www.servers.unix")
+-- test("tel:+1-816-555-1212")
+-- test("telnet://192.0.2.16:80/")
+-- test("urn:oasis:names:specification:docbook:dtd:xml:4.1.2")
+-- test("http://www.pragma-ade.com/spaced%20name")
+
+-- test("zip:///oeps/oeps.zip#bla/bla.tex")
+-- test("zip:///oeps/oeps.zip?bla/bla.tex")
+
+-- table.print(url.hashed("/test?test"))
diff --git a/macros/luatex/generic/lualibs/lualibs-util-str.lua b/macros/luatex/generic/lualibs/lualibs-util-str.lua
index 2d3f4d669f..0d1f39de9d 100644
--- a/macros/luatex/generic/lualibs/lualibs-util-str.lua
+++ b/macros/luatex/generic/lualibs/lualibs-util-str.lua
@@ -70,27 +70,63 @@ local function points(n)
n = n * ptf
if n % 1 == 0 then
return format("%ipt",n)
+ else
+ return lpegmatch(stripzeros,format("%.5fpt",n)) -- plural as we need to keep the pt
+ end
+end
+
+local function nupoints(n)
+ if n == 0 then
+ return "0"
+ end
+ n = tonumber(n)
+ if not n or n == 0 then
+ return "0"
+ end
+ n = n * ptf
+ if n % 1 == 0 then
+ return format("%i",n)
+ else
+ return format("%.5f",n) -- no strip
end
- return lpegmatch(stripzeros,format("%.5fpt",n)) -- plural as we need to keep the pt
end
local function basepoints(n)
if n == 0 then
- return "0pt"
+ return "0bp"
end
n = tonumber(n)
if not n or n == 0 then
- return "0pt"
+ return "0bp"
end
n = n * bpf
if n % 1 == 0 then
return format("%ibp",n)
+ else
+ return lpegmatch(stripzeros,format("%.5fbp",n)) -- plural as we need to keep the pt
+ end
+end
+
+local function nubasepoints(n)
+ if n == 0 then
+ return "0"
+ end
+ n = tonumber(n)
+ if not n or n == 0 then
+ return "0"
+ end
+ n = n * bpf
+ if n % 1 == 0 then
+ return format("%i",n)
+ else
+ return format("%.5f",n) -- no strip
end
- return lpegmatch(stripzeros,format("%.5fbp",n)) -- plural as we need to keep the pt
end
-number.points = points
-number.basepoints = basepoints
+number.points = points
+number.nupoints = nupoints
+number.basepoints = basepoints
+number.nubasepoints = nubasepoints
-- str = " \n \ntest \n test\ntest "
-- print("["..string.gsub(string.collapsecrlf(str),"\n","+").."]")
@@ -357,7 +393,9 @@ end
-- U+hexadecimal %...u character number
-- U+HEXADECIMAL %...U character number
-- points %p number (scaled points)
+-- nupoints %P number (scaled points) / without unit / always 5 decimals
-- basepoints %b number (scaled points)
+-- nubasepoints %B number (scaled points) / without unit / always 5 decimals
-- table concat %...t table
-- table concat %{.}t table
-- serialize %...T sequenced (no nested tables)
@@ -616,7 +654,9 @@ local environment = {
concat = table.concat,
signed = number.signed,
points = number.points,
+ nupoints = number.nupoints,
basepoints = number.basepoints,
+ nubasepoints = number.nubasepoints,
utfchar = utf.char,
utfbyte = utf.byte,
lpegmatch = lpeg.match,
@@ -879,11 +919,21 @@ local format_p = function()
return format("points(a%s)",n)
end
+local format_P = function()
+ n = n + 1
+ return format("nupoints(a%s)",n)
+end
+
local format_b = function()
n = n + 1
return format("basepoints(a%s)",n)
end
+local format_B = function()
+ n = n + 1
+ return format("nubasepoints(a%s)",n)
+end
+
local format_t = function(f)
n = n + 1
if f and f ~= "" then
@@ -1125,7 +1175,7 @@ local builder = Cs { "start",
--
+ V("r")
+ V("h") + V("H") + V("u") + V("U")
- + V("p") + V("b")
+ + V("p") + V("P") + V("b") + V("B")
+ V("t") + V("T")
+ V("l") + V("L")
+ V("I")
@@ -1174,8 +1224,10 @@ local builder = Cs { "start",
["H"] = (prefix_any * P("H")) / format_H, -- %H => 0x0A1B2 (when - no 0x) was V
["u"] = (prefix_any * P("u")) / format_u, -- %u => u+0a1b2 (when - no u+)
["U"] = (prefix_any * P("U")) / format_U, -- %U => U+0A1B2 (when - no U+)
- ["p"] = (prefix_any * P("p")) / format_p, -- %p => 12.345pt / maybe: P (and more units)
- ["b"] = (prefix_any * P("b")) / format_b, -- %b => 12.342bp / maybe: B (and more units)
+ ["p"] = (prefix_any * P("p")) / format_p, -- %p => 12.345pt
+ ["P"] = (prefix_any * P("P")) / format_P, -- %p => 12.345
+ ["b"] = (prefix_any * P("b")) / format_b, -- %b => 12.342bp
+ ["B"] = (prefix_any * P("B")) / format_B, -- %b => 12.342
["t"] = (prefix_tab * P("t")) / format_t, -- %t => concat
["T"] = (prefix_tab * P("T")) / format_T, -- %t => sequenced
["l"] = (prefix_any * P("l")) / format_l, -- %l => boolean
diff --git a/macros/luatex/generic/lualibs/lualibs.dtx b/macros/luatex/generic/lualibs/lualibs.dtx
index 7246e8541e..73c5aafcc1 100644
--- a/macros/luatex/generic/lualibs/lualibs.dtx
+++ b/macros/luatex/generic/lualibs/lualibs.dtx
@@ -1,9 +1,9 @@
% \iffalse meta-comment
%
-% Copyright (C) 2009--2019 by
+% Copyright (C) 2009--2021 by
%
% PRAGMA ADE / ConTeXt Development Team
-% The LuaLaTeX Dev Team
+% The LaTeX Project Team
%
% See ConTeXt's mreadme.pdf for the license.
%
@@ -37,7 +37,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: lualibs 2020-12-30 v2.73 Lua additional functions.}
+\Msg{* Package: lualibs 2021-05-20 v2.74 Lua additional functions.}
\Msg{************************************************************************}
\keepsilent
@@ -48,9 +48,9 @@
\preamble
This is a generated file.
-Copyright (C) 2009--2019 by
+Copyright (C) 2009--2021 by
PRAGMA ADE / ConTeXt Development Team
- The LuaLaTeX Dev Team
+ The LaTeX Project Team
See ConTeXt's mreadme.pdf for the license.
@@ -107,7 +107,7 @@ and lualibs-extended.lua.
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{lualibs.drv}
- [2020/12/30 v2.73 Lua Libraries.]
+ [2021/05/20 v2.74 Lua Libraries.]
\documentclass{ltxdoc}
\usepackage{fancyvrb,xspace}
\usepackage[x11names]{xcolor}
@@ -115,8 +115,7 @@ and lualibs-extended.lua.
\def\primarycolor{DodgerBlue4} %%-> rgb 16 78 139 | #104e8b
\def\secondarycolor{Goldenrod4} %%-> rgb 139 105 200 | #8b6914
%
-\usepackage[
- bookmarks=true,
+\hypersetup{
colorlinks=true,
linkcolor=\primarycolor,
urlcolor=\secondarycolor,
@@ -124,8 +123,8 @@ and lualibs-extended.lua.
pdftitle={The lualibs package},
pdfsubject={Port of the ConTeXt Lua libraries},
pdfauthor={Elie Roux & Philipp Gesang},
- pdfkeywords={luatex, lualatex, unicode, opentype}
-]{hyperref}
+ pdfkeywords={luatex, lualatex, unicode, opentype}}
+
\newcommand*\email[1]{\href{mailto:#1}{#1}}
\usepackage{fontspec}
\setmainfont[
@@ -208,10 +207,10 @@ and lualibs-extended.lua.
% \GetFileInfo{lualibs.drv}
%
% \title{The \identifier{lualibs} package}
-% \date{2020/12/30 v2.73}
+% \date{2021/05/20 v2.74}
% \author{Élie Roux · \email{elie.roux@telecom-bretagne.eu}\\
% Philipp Gesang · \email{phg@phi-gamma.net}\\
-% The \LaTeX3 Project · \email{https://github.com/latex3/lualibs/}\\
+% The \LaTeX{} Project · \email{https://github.com/latex3/lualibs/}\\
% }
%
% \maketitle
@@ -429,8 +428,8 @@ lualibs = lualibs or { }
lualibs.module_info = {
name = "lualibs",
- version = "2.73", --TAGVERSION
- date = "2020-12-30", --TAGDATE
+ version = "2.74", --TAGVERSION
+ date = "2021-05-20", --TAGDATE
description = "ConTeXt Lua standard libraries.",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux & Philipp Gesang",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -583,8 +582,8 @@ local loadmodule = lualibs.loadmodule
local lualibs_basic_module = {
name = "lualibs-basic",
- version = "2.73", --TAGVERSION
- date = "2020-12-30", --TAGDATE
+ version = "2.74", --TAGVERSION
+ date = "2021-05-20", --TAGDATE
description = "ConTeXt Lua libraries -- basic collection.",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux & Philipp Gesang",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -665,8 +664,8 @@ lualibs = lualibs or { }
local lualibs_extended_module = {
name = "lualibs-extended",
- version = "2.73", --TAGVERSION
- date = "2020-12-30", --TAGDATE
+ version = "2.74", --TAGVERSION
+ date = "2021-05-20", --TAGDATE
description = "ConTeXt Lua libraries -- extended collection.",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL & Elie Roux & Philipp Gesang",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/macros/luatex/generic/lualibs/lualibs.pdf b/macros/luatex/generic/lualibs/lualibs.pdf
index 10274b447b..23df3045e6 100644
--- a/macros/luatex/generic/lualibs/lualibs.pdf
+++ b/macros/luatex/generic/lualibs/lualibs.pdf
Binary files differ
diff --git a/macros/luatex/generic/luaotfload/NEWS b/macros/luatex/generic/luaotfload/NEWS
index 5b17fe46c1..f6e4e0fcb7 100644
--- a/macros/luatex/generic/luaotfload/NEWS
+++ b/macros/luatex/generic/luaotfload/NEWS
@@ -1,5 +1,11 @@
Change History
--------------
+2021-05-21 luaotfload v3.18
+
+ * Allow using variable fonts without explicitly specifying any axis values
+ * The fontloader has been synced with the context code from 2021-05-20
+ * Multiple small fixes, mostly concerning discretionaries in harf mode.
+
2021-01-08 luaotfload v3.17
* The fontloader has been synced with the context code from 2021-01-07.
diff --git a/macros/luatex/generic/luaotfload/README.md b/macros/luatex/generic/luaotfload/README.md
index 6704e66b90..a58b1c99fb 100644
--- a/macros/luatex/generic/luaotfload/README.md
+++ b/macros/luatex/generic/luaotfload/README.md
@@ -1,8 +1,8 @@
# The Luaotfload Package
-VERSION: 3.17
+VERSION: 3.18
-DATE: 2021-01-08
+DATE: 2021-05-21
## Description
diff --git a/macros/luatex/generic/luaotfload/filegraph.pdf b/macros/luatex/generic/luaotfload/filegraph.pdf
index c019d96ba8..0704762fd1 100644
--- a/macros/luatex/generic/luaotfload/filegraph.pdf
+++ b/macros/luatex/generic/luaotfload/filegraph.pdf
Binary files differ
diff --git a/macros/luatex/generic/luaotfload/fontloader-2021-01-07.lua b/macros/luatex/generic/luaotfload/fontloader-2021-05-20.lua
index e333584b00..f541668099 100644
--- a/macros/luatex/generic/luaotfload/fontloader-2021-01-07.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-2021-05-20.lua
@@ -1,6 +1,6 @@
--[[info-----------------------------------------------------------------------
Luaotfload fontloader package
- build 2021-01-07 23:19:37
+ build 2021-05-20 19:43:52
-------------------------------------------------------------------------------
© 2021 PRAGMA ADE / ConTeXt Development Team
@@ -63,7 +63,7 @@
--info]]-----------------------------------------------------------------------
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “data-con” 23a0f5386d46a1c157ae82a373e35fa0] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “data-con” 23a0f5386d46a1c157ae82a373e35fa0] ---
if not modules then modules={} end modules ['data-con']={
version=1.100,
@@ -184,10 +184,10 @@ function containers.cleanname(name)
return (gsub(lower(name),"[^%w\128-\255]+","-"))
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “data-con”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “data-con”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “basics-nod” 4b5c3c63e19df1b3f37fae7f87c25bda] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “basics-nod” b2e0a0e5e1e27349aed464fa738b8db1] ---
if not modules then modules={} end modules ['luatex-fonts-nod']={
version=1.001,
@@ -241,8 +241,8 @@ nodes.nodecodes=nodecodes
nodes.glyphcodes=glyphcodes
nodes.disccodes=disccodes
nodes.dirvalues={ lefttoright=0,righttoleft=1 }
-nodes.handlers.protectglyphs=node.protect_glyphs
-nodes.handlers.unprotectglyphs=node.unprotect_glyphs
+nodes.handlers.protectglyphs=node.protectglyphs or node.protect_glyphs
+nodes.handlers.unprotectglyphs=node.unprotectglyphs or node.unprotect_glyphs
local direct=node.direct
local nuts={}
nodes.nuts=nuts
@@ -286,31 +286,33 @@ nuts.setprev=direct.setprev
nuts.setsplit=direct.setsplit
nuts.setsubtype=direct.setsubtype
nuts.setwidth=direct.setwidth
-nuts.getglyphdata=nuts.getattr
-nuts.setglyphdata=nuts.setattr
-nuts.ischar=direct.is_char
-nuts.isglyph=direct.is_glyph
+nuts.getglyphdata=nuts.getattribute or nuts.getattr
+nuts.setglyphdata=nuts.setattribute or nuts.setattr
+nuts.ischar=direct.ischar or direct.is_char
+nuts.isglyph=direct.isglyph or direct.is_glyph
nuts.copy=direct.copy
-nuts.copy_list=direct.copy_list
-nuts.copy_node=direct.copy
-nuts.end_of_math=direct.end_of_math
+nuts.copynode=direct.copy
+nuts.copylist=direct.copylist or direct.copy_list
+nuts.endofmath=direct.endofmath or direct.end_of_math
nuts.flush=direct.flush
-nuts.flush_list=direct.flush_list
-nuts.flush_node=direct.flush_node
+nuts.flushlist=direct.flushlist or direct.flush_list
+nuts.flushnode=direct.flushnode or direct.flush_node
nuts.free=direct.free
-nuts.insert_after=direct.insert_after
-nuts.insert_before=direct.insert_before
-nuts.is_node=direct.is_node
+nuts.insertafter=direct.insertafter or direct.insert_after
+nuts.insertbefore=direct.insertbefore or direct.insert_before
+nuts.isnode=direct.isnode or direct.is_node
+nuts.isdirect=direct.isdirect or direct.is_direct
+nuts.isnut=direct.isdirect or direct.is_direct
nuts.kerning=direct.kerning
nuts.ligaturing=direct.ligaturing
nuts.new=direct.new
nuts.remove=direct.remove
nuts.tail=direct.tail
nuts.traverse=direct.traverse
-nuts.traverse_char=direct.traverse_char
-nuts.traverse_glyph=direct.traverse_glyph
-nuts.traverse_id=direct.traverse_id
-local propertydata=direct.get_properties_table()
+nuts.traversechar=direct.traversechar or direct.traverse_char
+nuts.traverseglyph=direct.traverseglyph or direct.traverse_glyph
+nuts.traverseid=direct.traverseid or direct.traverse_id
+local propertydata=(direct.getpropertiestable or direct.get_properties_table)()
nodes.properties={ data=propertydata }
if direct.set_properties_mode then
direct.set_properties_mode(true,true)
@@ -343,10 +345,10 @@ local setfield=nuts.setfield
local getsubtype=nuts.getsubtype
local isglyph=nuts.isglyph
local find_tail=nuts.tail
-local flush_list=nuts.flush_list
-local flush_node=nuts.flush_node
-local traverse_id=nuts.traverse_id
-local copy_node=nuts.copy_node
+local flushlist=nuts.flushlist
+local flushnode=nuts.flushnode
+local traverseid=nuts.traverseid
+local copynode=nuts.copynode
local glyph_code=nodes.nodecodes.glyph
local ligature_code=nodes.glyphcodes.ligature
do
@@ -359,31 +361,31 @@ do
end
end
do
- local get_components=node.direct.getcomponents
- local set_components=node.direct.setcomponents
- local function copy_no_components(g,copyinjection)
- local components=get_components(g)
+ local getcomponents=node.direct.getcomponents
+ local setcomponents=node.direct.setcomponents
+ local function copynocomponents(g,copyinjection)
+ local components=getcomponents(g)
if components then
- set_components(g)
- local n=copy_node(g)
+ setcomponents(g)
+ local n=copynode(g)
if copyinjection then
copyinjection(n,g)
end
- set_components(g,components)
+ setcomponents(g,components)
return n
else
- local n=copy_node(g)
+ local n=copynode(g)
if copyinjection then
copyinjection(n,g)
end
return n
end
end
- local function copy_only_glyphs(current)
+ local function copyonlyglyphs(current)
local head=nil
local previous=nil
- for n in traverse_id(glyph_code,current) do
- n=copy_node(n)
+ for n in traverseid(glyph_code,current) do
+ n=copynode(n)
if head then
setlink(previous,n)
else
@@ -393,14 +395,14 @@ do
end
return head
end
- local function count_components(start,marks)
+ local function countcomponents(start,marks)
local char=isglyph(start)
if char then
if getsubtype(start)==ligature_code then
local n=0
- local components=get_components(start)
+ local components=getcomponents(start)
while components do
- n=n+count_components(components,marks)
+ n=n+countcomponents(components,marks)
components=getnext(components)
end
return n
@@ -410,24 +412,26 @@ do
end
return 0
end
- local function flush_components()
+ local function flushcomponents()
end
- nuts.set_components=set_components
- nuts.get_components=get_components
- nuts.copy_only_glyphs=copy_only_glyphs
- nuts.copy_no_components=copy_no_components
- nuts.count_components=count_components
- nuts.flush_components=flush_components
+ nuts.components={
+ set=setcomponents,
+ get=getcomponents,
+ copyonlyglyphs=copyonlyglyphs,
+ copynocomponents=copynocomponents,
+ count=countcomponents,
+ flush=flushcomponents,
+ }
end
-nuts.uses_font=direct.uses_font
+nuts.usesfont=direct.usesfont or direct.uses_font
do
local dummy=tonut(node.new("glyph"))
nuts.traversers={
- glyph=nuts.traverse_id(nodecodes.glyph,dummy),
- glue=nuts.traverse_id(nodecodes.glue,dummy),
- disc=nuts.traverse_id(nodecodes.disc,dummy),
- boundary=nuts.traverse_id(nodecodes.boundary,dummy),
- char=nuts.traverse_char(dummy),
+ glyph=nuts.traverseid(nodecodes.glyph,dummy),
+ glue=nuts.traverseid(nodecodes.glue,dummy),
+ disc=nuts.traverseid(nodecodes.disc,dummy),
+ boundary=nuts.traverseid(nodecodes.boundary,dummy),
+ char=nuts.traversechar(dummy),
node=nuts.traverse(dummy),
}
end
@@ -444,16 +448,16 @@ if not nuts.setreplace then
end
do
local getsubtype=nuts.getsubtype
- function nuts.start_of_par(n)
+ function nuts.startofpar(n)
local s=getsubtype(n)
return s==0 or s==2
end
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “basics-nod”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “basics-nod”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “basics-chr” 64fafe4eaf55d64aead6513c1e74a024] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “basics-chr” 64fafe4eaf55d64aead6513c1e74a024] ---
characters=characters or {}
@@ -4063,10 +4067,10 @@ characters.indicgroups={
},
}
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “basics-chr”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “basics-chr”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ini” 5343de60613adb24cdd7a8d2ee1d153c] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ini” 5343de60613adb24cdd7a8d2ee1d153c] ---
if not modules then modules={} end modules ['font-ini']={
version=1.001,
@@ -4107,10 +4111,10 @@ if node and not tex.getfontoffamily then
tex.getfontoffamily=node.family_font
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ini”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ini”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-mis” 17e967c9ec4d001deefd43ddf25e98f7] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-mis” 17e967c9ec4d001deefd43ddf25e98f7] ---
if not modules then modules={} end modules ['luatex-font-mis']={
version=1.001,
@@ -4142,10 +4146,10 @@ function font.each()
return table.sortedhash(fonts.hashes.identifiers)
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-mis”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-mis”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-con” 724e5dd14aec2d4d189f8619898004cf] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-con” 724e5dd14aec2d4d189f8619898004cf] ---
if not modules then modules={} end modules ['font-con']={
version=1.001,
@@ -5513,10 +5517,10 @@ function constructors.addcoreunicodes(unicodes)
return unicodes
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-con”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-con”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-enc” 5ff4ca50493d7c4ecea0e15c203099f0] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-enc” 5ff4ca50493d7c4ecea0e15c203099f0] ---
if not modules then modules={} end modules ['luatex-font-enc']={
version=1.001,
@@ -5585,10 +5589,10 @@ function encodings.load(filename)
return containers.write(encodings.cache,name,data)
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-enc”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-enc”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-cid” 22b0367742fb253deef84ef7ccf5e8de] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-cid” 22b0367742fb253deef84ef7ccf5e8de] ---
if not modules then modules={} end modules ['font-cid']={
version=1.001,
@@ -5739,10 +5743,10 @@ function cid.getmap(specification)
return found
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-cid”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-cid”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-map” c4a39db5ad822b348aa61bca5f4a599a] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-map” c4a39db5ad822b348aa61bca5f4a599a] ---
if not modules then modules={} end modules ['font-map']={
version=1.001,
@@ -6150,10 +6154,10 @@ function mappings.addtounicode(data,filename,checklookups,forceligatures)
end
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-map”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-map”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-vfc” a81c29eda98cd62cbebdb6c93544b50d] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-vfc” a81c29eda98cd62cbebdb6c93544b50d] ---
if not modules then modules={} end modules ['font-vfc']={
version=1.001,
@@ -6250,10 +6254,10 @@ helpers.commands=utilities.storage.allocate {
dummy=dummy,
}
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-vfc”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-vfc”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otr” 64dcbbc7107538723990e1119a80a9f8] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otr” ad238624c9ebd488d4bbe9af3b620189] ---
if not modules then modules={} end modules ['font-otr']={
version=1.001,
@@ -7010,8 +7014,6 @@ readers.post=function(f,fontdata,specification)
if length>0 then
glyphs[mapping].name=readstring(f,length)
else
- report("quit post name fetching at %a of %a: %s",i,maxnames,"overflow")
- break
end
end
end
@@ -8097,10 +8099,10 @@ function readers.extend(fontdata)
end
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otr”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otr”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-oti” 309a75f9c14b77d87e94eba827dc4e71] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-oti” 309a75f9c14b77d87e94eba827dc4e71] ---
if not modules then modules={} end modules ['font-oti']={
version=1.001,
@@ -8243,10 +8245,10 @@ function otffeatures.checkeddefaultlanguage(featuretype,autolanguage,languages)
end
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-oti”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-oti”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ott” 673ed11e1d159997f535bfec5fa73808] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ott” 3f67b1b1d40bbc222681d8db4aff0f42] ---
if not modules then modules={} end modules ["font-ott"]={
version=1.001,
@@ -9362,10 +9364,10 @@ function otffeatures.normalize(features,wrap)
end
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ott”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ott”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-cff” 2b677fad52d9999d0685e8525271a8cc] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-cff” 01e7c6fbc8961a566f4e4f8cbedb7004] ---
if not modules then modules={} end modules ['font-cff']={
version=1.001,
@@ -9377,7 +9379,7 @@ if not modules then modules={} end modules ['font-cff']={
}
local next,type,tonumber,rawget=next,type,tonumber,rawget
local byte,char,gmatch,sub=string.byte,string.char,string.gmatch,string.sub
-local concat,remove,unpack=table.concat,table.remove,table.unpack
+local concat,insert,remove,unpack=table.concat,table.insert,table.remove,table.unpack
local floor,abs,round,ceil,min,max=math.floor,math.abs,math.round,math.ceil,math.min,math.max
local P,C,R,S,C,Cs,Ct=lpeg.P,lpeg.C,lpeg.R,lpeg.S,lpeg.C,lpeg.Cs,lpeg.Ct
local lpegmatch=lpeg.match
@@ -10981,8 +10983,34 @@ do
showstate(reverse[t] or "<action>")
end
if top>0 then
- for i=1,top do
- r=r+1;result[r]=encode[stack[i]]
+ if t==8 and top>48 then
+ local n=0
+ for i=1,top do
+ if n==48 then
+ local zero=encode[0]
+ local res3=result[r-3]
+ local res2=result[r-2]
+ local res1=result[r-1]
+ local res0=result[r]
+ result[r-3]=zero
+ result[r-2]=zero
+ r=r+1;result[r]=chars[t]
+ r=r+1;result[r]=zero
+ r=r+1;result[r]=zero
+ r=r+1;result[r]=res3
+ r=r+1;result[r]=res2
+ r=r+1;result[r]=res1
+ r=r+1;result[r]=res0
+ n=1
+ else
+ n=n+1
+ end
+ r=r+1;result[r]=encode[stack[i]]
+ end
+ else
+ for i=1,top do
+ r=r+1;result[r]=encode[stack[i]]
+ end
end
top=0
end
@@ -11564,10 +11592,10 @@ function readers.cffcheck(filename)
end
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-cff”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-cff”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ttf” ffffc827e1bcddc33a2b615340ecff7f] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ttf” ffffc827e1bcddc33a2b615340ecff7f] ---
if not modules then modules={} end modules ['font-ttf']={
version=1.001,
@@ -12738,10 +12766,10 @@ function readers.gvar(f,fontdata,specification,glyphdata,shapedata)
end
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ttf”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ttf”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-dsp” 174ce11f3ba0bddf270f48d8d2addd56] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-dsp” 174ce11f3ba0bddf270f48d8d2addd56] ---
if not modules then modules={} end modules ['font-dsp']={
version=1.001,
@@ -16017,10 +16045,10 @@ function readers.mvar(f,fontdata,specification)
end
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-dsp”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-dsp”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-oup” 6f46aa00ae1c20c43f8ffaf329dc8695] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-oup” 4eb2f26e51835239e26a8df2ecf04366] ---
if not modules then modules={} end modules ['font-oup']={
version=1.001,
@@ -18264,6 +18292,28 @@ local function checkkerns(lookup)
end
return kerned
end
+local strip_pairs=true
+local compact_pairs=true
+local compact_singles=true
+local merge_pairs=true
+local merge_singles=true
+local merge_substitutions=true
+local merge_alternates=true
+local merge_multiples=true
+local merge_ligatures=true
+local merge_cursives=true
+local merge_marks=true
+directives.register("otf.strip.pairs",function(v) strip_pairs=v end)
+directives.register("otf.compact.pairs",function(v) compact_pairs=v end)
+directives.register("otf.compact.singles",function(v) compact_singles=v end)
+directives.register("otf.merge.pairs",function(v) merge_pairs=v end)
+directives.register("otf.merge.singles",function(v) merge_singles=v end)
+directives.register("otf.merge.substitutions",function(v) merge_substitutions=v end)
+directives.register("otf.merge.alternates",function(v) merge_alternates=v end)
+directives.register("otf.merge.multiples",function(v) merge_multiples=v end)
+directives.register("otf.merge.ligatures",function(v) merge_ligatures=v end)
+directives.register("otf.merge.cursives",function(v) merge_cursives=v end)
+directives.register("otf.merge.marks",function(v) merge_marks=v end)
local function checkpairs(lookup)
local steps=lookup.steps
local nofsteps=lookup.nofsteps
@@ -18311,26 +18361,27 @@ local function checkpairs(lookup)
end
return kerned
end
-local compact_pairs=true
-local compact_singles=true
-local merge_pairs=true
-local merge_singles=true
-local merge_substitutions=true
-local merge_alternates=true
-local merge_multiples=true
-local merge_ligatures=true
-local merge_cursives=true
-local merge_marks=true
-directives.register("otf.compact.pairs",function(v) compact_pairs=v end)
-directives.register("otf.compact.singles",function(v) compact_singles=v end)
-directives.register("otf.merge.pairs",function(v) merge_pairs=v end)
-directives.register("otf.merge.singles",function(v) merge_singles=v end)
-directives.register("otf.merge.substitutions",function(v) merge_substitutions=v end)
-directives.register("otf.merge.alternates",function(v) merge_alternates=v end)
-directives.register("otf.merge.multiples",function(v) merge_multiples=v end)
-directives.register("otf.merge.ligatures",function(v) merge_ligatures=v end)
-directives.register("otf.merge.cursives",function(v) merge_cursives=v end)
-directives.register("otf.merge.marks",function(v) merge_marks=v end)
+local function strippairs(lookup)
+ local steps=lookup.steps
+ local nofsteps=lookup.nofsteps
+ local stripped=0
+ for i=1,nofsteps do
+ local step=steps[i]
+ if step.format=="pair" then
+ local coverage=step.coverage
+ for g1,d1 in next,coverage do
+ for g2,d2 in next,d1 do
+ if d2[2] then
+ elseif d2[1]==true then
+ d1[g2]=nil
+ stripped=stripped+1
+ end
+ end
+ end
+ end
+ end
+ return stripped
+end
function readers.compact(data)
if not data or data.compacted then
return
@@ -18338,6 +18389,7 @@ function readers.compact(data)
data.compacted=true
end
local resources=data.resources
+ local stripped=0
local merged=0
local kerned=0
local allsteps=0
@@ -18375,6 +18427,9 @@ function readers.compact(data)
kerned=kerned+checkkerns(lookup)
end
elseif kind=="gpos_pair" then
+ if strip_pairs then
+ stripped=stripped+strippairs(lookup)
+ end
if merge_pairs then
merged=merged+mergesteps_2(lookup)
end
@@ -18415,6 +18470,9 @@ function readers.compact(data)
compact("sequences")
compact("sublookups")
if trace_optimizations then
+ if stripped>0 then
+ report_optimizations("%i zero positions stripped before merging",stripped)
+ end
if merged>0 then
report_optimizations("%i steps of %i removed due to merging",merged,allsteps)
end
@@ -18661,10 +18719,10 @@ function readers.expand(data)
expandlookups(sublookups)
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-oup”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-oup”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otl” f4e6652a191003493389de230b14cfb3] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otl” 6f701653de713e8aa80d82c7cdf32d75] ---
if not modules then modules={} end modules ['font-otl']={
version=1.001,
@@ -18692,7 +18750,7 @@ local trace_defining=false registertracker("fonts.defining",function(v) trace_d
local report_otf=logs.reporter("fonts","otf loading")
local fonts=fonts
local otf=fonts.handlers.otf
-otf.version=3.113
+otf.version=3.116
otf.cache=containers.define("fonts","otl",otf.version,true)
otf.svgcache=containers.define("fonts","svg",otf.version,true)
otf.pngcache=containers.define("fonts","png",otf.version,true)
@@ -19145,6 +19203,7 @@ local function read_from_otf(specification)
if tfmdata then
tfmdata.properties.name=specification.name
tfmdata.properties.sub=specification.sub
+ tfmdata.properties.id=specification.id
tfmdata=constructors.scale(tfmdata,specification)
local allfeatures=tfmdata.shared.features or specification.features.normal
constructors.applymanipulators("otf",tfmdata,allfeatures,trace_features,report_otf)
@@ -19370,10 +19429,10 @@ otf.coverup={
end
}
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otl”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otl”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-oto” 2b1d6bc63b2ebf8f2655a15e1cda6541] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-oto” 2b1d6bc63b2ebf8f2655a15e1cda6541] ---
if not modules then modules={} end modules ['font-oto']={
version=1.001,
@@ -19831,10 +19890,10 @@ registerotffeature {
}
otf.basemodeinitializer=featuresinitializer
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-oto”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-oto”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otj” 8de59cb9b043e5f73c6b9f7cc8f6978e] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otj” b2c165bd6771a57633f992d07384b739] ---
if not modules then modules={} end modules ['font-otj']={
version=1.001,
@@ -19884,6 +19943,8 @@ local getoffsets=nuts.getoffsets
local getboth=nuts.getboth
local getdisc=nuts.getdisc
local setdisc=nuts.setdisc
+local getreplace=nuts.getreplace
+local setreplace=nuts.setreplace
local setoffsets=nuts.setoffsets
local ischar=nuts.ischar
local getkern=nuts.getkern
@@ -19893,8 +19954,8 @@ local setwidth=nuts.setwidth
local getwidth=nuts.getwidth
local nextchar=nuts.traversers.char
local nextglue=nuts.traversers.glue
-local insert_node_before=nuts.insert_before
-local insert_node_after=nuts.insert_after
+local insertnodebefore=nuts.insertbefore
+local insertnodeafter=nuts.insertafter
local properties=nodes.properties.data
local fontkern=nuts.pool and nuts.pool.fontkern
local italickern=nuts.pool and nuts.pool.italickern
@@ -19908,7 +19969,7 @@ end)
if not fontkern then
local thekern=nuts.new("kern",0)
local setkern=nuts.setkern
- local copy_node=nuts.copy_node
+ local copy_node=nuts.copy
fontkern=function(k)
local n=copy_node(thekern)
setkern(n,k)
@@ -19918,7 +19979,7 @@ end
if not italickern then
local thekern=nuts.new("kern",3)
local setkern=nuts.setkern
- local copy_node=nuts.copy_node
+ local copy_node=nuts.copy
italickern=function(k)
local n=copy_node(thekern)
setkern(n,k)
@@ -20379,12 +20440,12 @@ local function inject_kerns_only(head,where)
if leftkern and leftkern~=0 then
if prev and getid(prev)==glue_code then
if useitalickerns then
- head=insert_node_before(head,current,italickern(leftkern))
+ head=insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev,getwidth(prev)+leftkern)
end
else
- head=insert_node_before(head,current,fontkern(leftkern))
+ head=insertnodebefore(head,current,fontkern(leftkern))
end
end
end
@@ -20438,7 +20499,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- pre=insert_node_before(pre,n,fontkern(leftkern))
+ pre=insertnodebefore(pre,n,fontkern(leftkern))
done=true
end
end
@@ -20453,7 +20514,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- post=insert_node_before(post,n,fontkern(leftkern))
+ post=insertnodebefore(post,n,fontkern(leftkern))
done=true
end
end
@@ -20468,7 +20529,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- replace=insert_node_before(replace,n,fontkern(leftkern))
+ replace=insertnodebefore(replace,n,fontkern(leftkern))
done=true
end
end
@@ -20530,36 +20591,34 @@ local function inject_positions_only(head,where)
rightkern=0
elseif prev and getid(prev)==glue_code then
if useitalickerns then
- head=insert_node_before(head,current,italickern(leftkern))
+ head=insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev,getwidth(prev)+leftkern)
end
else
- head=insert_node_before(head,current,fontkern(leftkern))
+ head=insertnodebefore(head,current,fontkern(leftkern))
end
end
if rightkern and rightkern~=0 then
if next and getid(next)==glue_code then
if useitalickerns then
- insert_node_after(head,current,italickern(rightkern))
+ insertnodeafter(head,current,italickern(rightkern))
else
setwidth(next,getwidth(next)+rightkern)
end
else
- insert_node_after(head,current,fontkern(rightkern))
+ insertnodeafter(head,current,fontkern(rightkern))
end
end
- else
+ elseif next then
local i=p.emptyinjections
if i then
local rightkern=i.rightkern
- if rightkern and rightkern~=0 then
- if next and getid(next)==disc_code then
- if replace then
- else
- replace=fontkern(rightkern)
- done=true
- end
+ if rightkern and rightkern~=0 and getid(next)==disc_code then
+ local replace=getreplace(next)
+ if replace then
+ else
+ setreplace(next,fontkern(rightkern))
end
end
end
@@ -20620,12 +20679,12 @@ local function inject_positions_only(head,where)
end
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- pre=insert_node_before(pre,n,fontkern(leftkern))
+ pre=insertnodebefore(pre,n,fontkern(leftkern))
done=true
end
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- insert_node_after(pre,n,fontkern(rightkern))
+ insertnodeafter(pre,n,fontkern(rightkern))
done=true
end
end
@@ -20644,12 +20703,12 @@ local function inject_positions_only(head,where)
end
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- post=insert_node_before(post,n,fontkern(leftkern))
+ post=insertnodebefore(post,n,fontkern(leftkern))
done=true
end
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- insert_node_after(post,n,fontkern(rightkern))
+ insertnodeafter(post,n,fontkern(rightkern))
done=true
end
end
@@ -20668,12 +20727,12 @@ local function inject_positions_only(head,where)
end
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- replace=insert_node_before(replace,n,fontkern(leftkern))
+ replace=insertnodebefore(replace,n,fontkern(leftkern))
done=true
end
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- insert_node_after(replace,n,fontkern(rightkern))
+ insertnodeafter(replace,n,fontkern(rightkern))
done=true
end
end
@@ -20688,7 +20747,7 @@ local function inject_positions_only(head,where)
if i then
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- pre=insert_node_before(pre,pre,fontkern(rightkern))
+ pre=insertnodebefore(pre,pre,fontkern(rightkern))
done=true
end
end
@@ -20701,7 +20760,7 @@ local function inject_positions_only(head,where)
if i then
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- replace=insert_node_before(replace,replace,fontkern(rightkern))
+ replace=insertnodebefore(replace,replace,fontkern(rightkern))
done=true
end
end
@@ -20804,8 +20863,8 @@ local function inject_everything(head,where)
if trace_injections then
report_injections("correcting non zero width mark %C",getchar(n))
end
- insert_node_before(n,n,fontkern(-wn))
- insert_node_after(n,n,fontkern(-wn))
+ insertnodebefore(n,n,fontkern(-wn))
+ insertnodeafter(n,n,fontkern(-wn))
end
end
end
@@ -20897,37 +20956,35 @@ local function inject_everything(head,where)
rightkern=0
elseif prev and getid(prev)==glue_code then
if useitalickerns then
- head=insert_node_before(head,current,italickern(leftkern))
+ head=insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev,getwidth(prev)+leftkern)
end
else
- head=insert_node_before(head,current,fontkern(leftkern))
+ head=insertnodebefore(head,current,fontkern(leftkern))
end
end
if rightkern and rightkern~=0 then
if next and getid(next)==glue_code then
if useitalickerns then
- insert_node_after(head,current,italickern(rightkern))
+ insertnodeafter(head,current,italickern(rightkern))
else
setwidth(next,getwidth(next)+rightkern)
end
else
- insert_node_after(head,current,fontkern(rightkern))
+ insertnodeafter(head,current,fontkern(rightkern))
end
end
end
- else
+ elseif next then
local i=p.emptyinjections
if i then
local rightkern=i.rightkern
- if rightkern and rightkern~=0 then
- if next and getid(next)==disc_code then
- if replace then
- else
- replace=fontkern(rightkern)
- done=true
- end
+ if rightkern and rightkern~=0 and getid(next)==disc_code then
+ local replace=getreplace(next)
+ if replace then
+ else
+ setreplace(next,fontkern(rightkern))
end
end
end
@@ -21002,12 +21059,12 @@ local function inject_everything(head,where)
end
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- pre=insert_node_before(pre,n,fontkern(leftkern))
+ pre=insertnodebefore(pre,n,fontkern(leftkern))
done=true
end
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- insert_node_after(pre,n,fontkern(rightkern))
+ insertnodeafter(pre,n,fontkern(rightkern))
done=true
end
if hasmarks then
@@ -21032,12 +21089,12 @@ local function inject_everything(head,where)
end
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- post=insert_node_before(post,n,fontkern(leftkern))
+ post=insertnodebefore(post,n,fontkern(leftkern))
done=true
end
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- insert_node_after(post,n,fontkern(rightkern))
+ insertnodeafter(post,n,fontkern(rightkern))
done=true
end
if hasmarks then
@@ -21062,12 +21119,12 @@ local function inject_everything(head,where)
end
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- replace=insert_node_before(replace,n,fontkern(leftkern))
+ replace=insertnodebefore(replace,n,fontkern(leftkern))
done=true
end
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- insert_node_after(replace,n,fontkern(rightkern))
+ insertnodeafter(replace,n,fontkern(rightkern))
done=true
end
if hasmarks then
@@ -21088,7 +21145,7 @@ local function inject_everything(head,where)
if i then
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- pre=insert_node_before(pre,pre,fontkern(rightkern))
+ pre=insertnodebefore(pre,pre,fontkern(rightkern))
done=true
end
end
@@ -21101,7 +21158,7 @@ local function inject_everything(head,where)
if i then
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- replace=insert_node_before(replace,replace,fontkern(rightkern))
+ replace=insertnodebefore(replace,replace,fontkern(rightkern))
done=true
end
end
@@ -21254,8 +21311,8 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("%C [%p + %p + %p] %C",prevchar,lnew,old,rnew,nextchar)
end
- head=insert_node_before(head,n,italickern(lnew))
- insert_node_after(head,n,italickern(rnew))
+ head=insertnodebefore(head,n,italickern(lnew))
+ insertnodeafter(head,n,italickern(rnew))
else
local new=old+(leftkern+rightkern)*factor
if trace_spaces then
@@ -21270,7 +21327,7 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("%C [%p + %p]",prevchar,old,new)
end
- insert_node_after(head,n,italickern(new))
+ insertnodeafter(head,n,italickern(new))
else
local new=old+leftkern*factor
if trace_spaces then
@@ -21289,7 +21346,7 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("[%p + %p] %C",old,new,nextchar)
end
- insert_node_after(head,n,italickern(new))
+ insertnodeafter(head,n,italickern(new))
else
local new=old+rightkern*factor
if trace_spaces then
@@ -21329,10 +21386,10 @@ function injections.handler(head,where)
end
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otj”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otj”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ota” ad1d5de06400f88829509e1f3ff2b473] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ota” 2bb12d708e35bc05443eba791e2554e7] ---
if not modules then modules={} end modules ['font-ota']={
version=1.001,
@@ -21362,7 +21419,7 @@ local setprop=nuts.setprop
local getsubtype=nuts.getsubtype
local getchar=nuts.getchar
local ischar=nuts.ischar
-local end_of_math=nuts.end_of_math
+local endofmath=nuts.endofmath
local nodecodes=nodes.nodecodes
local disc_code=nodecodes.disc
local math_code=nodecodes.math
@@ -21468,7 +21525,7 @@ function analyzers.setstate(head,font)
end
first,last,n=nil,nil,0
if id==math_code then
- current=end_of_math(current)
+ current=endofmath(current)
end
elseif id==disc_code then
setstate(current,s_medi)
@@ -21481,7 +21538,7 @@ function analyzers.setstate(head,font)
end
first,last,n=nil,nil,0
if id==math_code then
- current=end_of_math(current)
+ current=endofmath(current)
end
end
current=getnext(current)
@@ -21697,7 +21754,7 @@ function methods.arab(head,font,attr)
first=nil
end
if id==math_code then
- current=end_of_math(current)
+ current=endofmath(current)
end
end
current=getnext(current)
@@ -21811,7 +21868,7 @@ do
wrapup()
end
if id==math_code then
- current=end_of_math(current)
+ current=endofmath(current)
end
end
current=getnext(current)
@@ -21826,10 +21883,10 @@ directives.register("otf.analyze.useunicodemarks",function(v)
analyzers.useunicodemarks=v
end)
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ota”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ota”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ots” c780a471147527f4ddc139e017927ffe] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ots” cb106ae882e8548051f00aac8b7fa862] ---
if not modules then modules={} end modules ['font-ots']={
version=1.001,
@@ -21908,23 +21965,24 @@ local setlink=nuts.setlink
local getwidth=nuts.getwidth
local getattr=nuts.getattr
local getglyphdata=nuts.getglyphdata
-local copy_no_components=nuts.copy_no_components
-local copy_only_glyphs=nuts.copy_only_glyphs
-local count_components=nuts.count_components
-local set_components=nuts.set_components
-local get_components=nuts.get_components
-local flush_components=nuts.flush_components
+local components=nuts.components
+local copynocomponents=components.copynocomponents
+local copyonlyglyphs=components.copyonlyglyphs
+local countcomponents=components.count
+local setcomponents=components.set
+local getcomponents=components.get
+local flushcomponents=components.flush
local ischar=nuts.ischar
-local usesfont=nuts.uses_font
-local insert_node_after=nuts.insert_after
+local usesfont=nuts.usesfont
+local insertnodeafter=nuts.insertafter
local copy_node=nuts.copy
-local copy_node_list=nuts.copy_list
+local copy_node_list=nuts.copylist
local remove_node=nuts.remove
local find_node_tail=nuts.tail
-local flush_node_list=nuts.flush_list
-local flush_node=nuts.flush_node
-local end_of_math=nuts.end_of_math
-local start_of_par=nuts.start_of_par
+local flushnodelist=nuts.flushlist
+local flushnode=nuts.flushnode
+local endofmath=nuts.endofmath
+local startofpar=nuts.startofpar
local setmetatable=setmetatable
local setmetatableindex=table.setmetatableindex
local nextnode=nuts.traversers.node
@@ -22055,12 +22113,12 @@ local function flattendisk(head,disc)
local prev,next=getboth(disc)
local ishead=head==disc
setdisc(disc)
- flush_node(disc)
+ flushnode(disc)
if pre then
- flush_node_list(pre)
+ flushnodelist(pre)
end
if post then
- flush_node_list(post)
+ flushnodelist(post)
end
if ishead then
if replace then
@@ -22109,16 +22167,16 @@ local function markstoligature(head,start,stop,char)
local next=getnext(stop)
setprev(start)
setnext(stop)
- local base=copy_no_components(start,copyinjection)
+ local base=copynocomponents(start,copyinjection)
if head==start then
head=base
end
resetinjection(base)
setchar(base,char)
setsubtype(base,ligatureglyph_code)
- set_components(base,start)
+ setcomponents(base,start)
setlink(prev,base,next)
- flush_components(start)
+ flushcomponents(start)
return head,base
end
end
@@ -22126,7 +22184,7 @@ local no_left_ligature_code=1
local no_right_ligature_code=2
local no_left_kern_code=4
local no_right_kern_code=8
-local has_glyph_option=node.direct.has_glyph_option or function(n,c)
+local hasglyphoption=function(n,c)
if c==no_left_ligature_code or c==no_right_ligature_code then
return getattr(n,a_noligature)==1
else
@@ -22134,7 +22192,7 @@ local has_glyph_option=node.direct.has_glyph_option or function(n,c)
end
end
local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfound,hasmarks)
- if has_glyph_option(start,no_right_ligature_code) then
+ if hasglyphoption(start,no_right_ligature_code) then
return head,start
end
if start==stop and getchar(start)==char then
@@ -22147,14 +22205,14 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
local comp=start
setprev(start)
setnext(stop)
- local base=copy_no_components(start,copyinjection)
+ local base=copynocomponents(start,copyinjection)
if start==head then
head=base
end
resetinjection(base)
setchar(base,char)
setsubtype(base,ligatureglyph_code)
- set_components(base,comp)
+ setcomponents(base,comp)
setlink(prev,base,next)
if not discfound then
local deletemarks=not skiphash or hasmarks
@@ -22167,7 +22225,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
local char=getchar(start)
if not marks[char] then
baseindex=baseindex+componentindex
- componentindex=count_components(start,marks)
+ componentindex=countcomponents(start,marks)
elseif not deletemarks then
setligaindex(start,baseindex+getligaindex(start,componentindex))
if trace_marks then
@@ -22175,7 +22233,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
end
local n=copy_node(start)
copyinjection(n,start)
- head,current=insert_node_after(head,current,n)
+ head,current=insertnodeafter(head,current,n)
elseif trace_marks then
logwarning("%s: delete ligature mark %s",pref(dataset,sequence),gref(char))
end
@@ -22198,14 +22256,14 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
break
end
end
- flush_components(components)
+ flushcomponents(components)
else
local discprev,discnext=getboth(discfound)
if discprev and discnext then
local pre,post,replace,pretail,posttail,replacetail=getdisc(discfound,true)
if not replace then
local prev=getprev(base)
- local copied=copy_only_glyphs(comp)
+ local copied=copyonlyglyphs(comp)
if pre then
setlink(discprev,pre)
else
@@ -22221,7 +22279,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
end
setlink(prev,discfound,next)
setboth(base)
- set_components(base,copied)
+ setcomponents(base,copied)
replace=base
if forcediscretionaries then
setdisc(discfound,pre,post,replace,discretionarydisc_code)
@@ -22245,7 +22303,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop)
local n=copy_node(start)
resetinjection(n)
setchar(n,multiple[k])
- insert_node_after(head,start,n)
+ insertnodeafter(head,start,n)
start=n
end
if what==true then
@@ -22255,7 +22313,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop)
local n=copy_node(start)
resetinjection(n)
setchar(n,m)
- insert_node_after(head,start,n)
+ insertnodeafter(head,start,n)
start=n
end
end
@@ -22485,7 +22543,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
return head,start,false,false
end
function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- if has_glyph_option(start,no_right_kern_code) then
+ if hasglyphoption(start,no_right_kern_code) then
return head,start,false
else
local startchar=getchar(start)
@@ -22505,7 +22563,7 @@ function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,
end
end
function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- if has_glyph_option(start,no_right_kern_code) then
+ if hasglyphoption(start,no_right_kern_code) then
return head,start,false
else
local snext=getnext(start)
@@ -22994,7 +23052,7 @@ function chainprocs.gsub_ligature(head,start,stop,dataset,sequence,currentlookup
return head,start,false,0,false
end
function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex)
- if not has_glyph_option(start,no_right_kern_code) then
+ if not hasglyphoption(start,no_right_kern_code) then
local mapping=currentlookup.mapping
if mapping==nil then
mapping=getmapping(dataset,sequence,currentlookup)
@@ -23022,7 +23080,7 @@ function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,r
return head,start,false
end
function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex)
- if not has_glyph_option(start,no_right_kern_code) then
+ if not hasglyphoption(start,no_right_kern_code) then
local mapping=currentlookup.mapping
if mapping==nil then
mapping=getmapping(dataset,sequence,currentlookup)
@@ -23345,13 +23403,13 @@ local function checked(head)
if next then
setlink(kern,next)
end
- flush_node(current)
+ flushnode(current)
head=kern
current=next
else
local prev,next=getboth(current)
setlink(prev,kern,next)
- flush_node(current)
+ flushnode(current)
current=next
end
else
@@ -23801,105 +23859,225 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
goto next
end
local s=seq.n
- local l=ck[5]
- local current=start
- local last=start
if s==1 then
- goto next
- end
- if l>f then
- local discfound
- local n=f+1
- last=startnext
- while n<=l do
- if postreplace and not last then
- last=getnext(sweepnode)
- sweeptype=nil
- end
- if last then
- local char,id=ischar(last,currentfont)
- if char then
- if skiphash and skiphash[char] then
- skipped=true
- if trace_skips then
- show_skip(dataset,sequence,char,ck,classes[char])
- end
- last=getnext(last)
- elseif seq[n][char] then
- if n<l then
+ else
+ local l=ck[5]
+ local current=start
+ local last=start
+ if l>f then
+ local discfound
+ local n=f+1
+ last=startnext
+ while n<=l do
+ if postreplace and not last then
+ last=getnext(sweepnode)
+ sweeptype=nil
+ end
+ if last then
+ local char,id=ischar(last,currentfont)
+ if char then
+ if skiphash and skiphash[char] then
+ skipped=true
+ if trace_skips then
+ show_skip(dataset,sequence,char,ck,classes[char])
+ end
last=getnext(last)
- end
- n=n+1
- elseif discfound then
- notmatchreplace[discfound]=true
- if notmatchpre[discfound] then
- goto next
+ elseif seq[n][char] then
+ if n<l then
+ last=getnext(last)
+ end
+ n=n+1
+ elseif discfound then
+ notmatchreplace[discfound]=true
+ if notmatchpre[discfound] then
+ goto next
+ else
+ break
+ end
else
- break
- end
- else
- goto next
- end
- elseif char==false then
- if discfound then
- notmatchreplace[discfound]=true
- if notmatchpre[discfound] then
goto next
+ end
+ elseif char==false then
+ if discfound then
+ notmatchreplace[discfound]=true
+ if notmatchpre[discfound] then
+ goto next
+ else
+ break
+ end
else
- break
+ goto next
end
- else
- goto next
- end
- elseif id==disc_code then
- discseen=true
- discfound=last
- notmatchpre[last]=nil
- notmatchpost[last]=true
- notmatchreplace[last]=nil
- local pre,post,replace=getdisc(last)
- if pre then
- local n=n
- while pre do
- if seq[n][getchar(pre)] then
- n=n+1
- if n>l then
+ elseif id==disc_code then
+ discseen=true
+ discfound=last
+ notmatchpre[last]=nil
+ notmatchpost[last]=true
+ notmatchreplace[last]=nil
+ local pre,post,replace=getdisc(last)
+ if pre then
+ local n=n
+ while pre do
+ if seq[n][getchar(pre)] then
+ n=n+1
+ if n>l then
+ break
+ end
+ pre=getnext(pre)
+ else
+ notmatchpre[last]=true
break
end
- pre=getnext(pre)
- else
+ end
+ if n<=l then
notmatchpre[last]=true
- break
end
- end
- if n<=l then
+ else
notmatchpre[last]=true
end
+ if replace then
+ while replace do
+ if seq[n][getchar(replace)] then
+ n=n+1
+ if n>l then
+ break
+ end
+ replace=getnext(replace)
+ else
+ notmatchreplace[last]=true
+ if notmatchpre[last] then
+ goto next
+ else
+ break
+ end
+ end
+ end
+ if notmatchpre[last] then
+ goto next
+ end
+ end
+ last=getnext(last)
else
- notmatchpre[last]=true
+ goto next
end
- if replace then
- while replace do
- if seq[n][getchar(replace)] then
- n=n+1
- if n>l then
- break
+ else
+ goto next
+ end
+ end
+ end
+ if f>1 then
+ if startprev then
+ local prev=startprev
+ if prereplace and prev==checkdisc then
+ prev=getprev(sweepnode)
+ end
+ if prev then
+ local discfound
+ local n=f-1
+ while n>=1 do
+ if prev then
+ local char,id=ischar(prev,currentfont)
+ if char then
+ if skiphash and skiphash[char] then
+ skipped=true
+ if trace_skips then
+ show_skip(dataset,sequence,char,ck,classes[char])
+ end
+ prev=getprev(prev)
+ elseif seq[n][char] then
+ if n>1 then
+ prev=getprev(prev)
+ end
+ n=n-1
+ elseif discfound then
+ notmatchreplace[discfound]=true
+ if notmatchpost[discfound] then
+ goto next
+ else
+ break
+ end
+ else
+ goto next
end
- replace=getnext(replace)
- else
- notmatchreplace[last]=true
- if notmatchpre[last] then
+ elseif char==false then
+ if discfound then
+ notmatchreplace[discfound]=true
+ if notmatchpost[discfound] then
+ goto next
+ end
+ else
goto next
+ end
+ break
+ elseif id==disc_code then
+ discseen=true
+ discfound=prev
+ notmatchpre[prev]=true
+ notmatchpost[prev]=nil
+ notmatchreplace[prev]=nil
+ local pre,post,replace,pretail,posttail,replacetail=getdisc(prev,true)
+ if pre~=start and post~=start and replace~=start then
+ if post then
+ local n=n
+ while posttail do
+ if seq[n][getchar(posttail)] then
+ n=n-1
+ if posttail==post or n<1 then
+ break
+ else
+ posttail=getprev(posttail)
+ end
+ else
+ notmatchpost[prev]=true
+ break
+ end
+ end
+ if n>=1 then
+ notmatchpost[prev]=true
+ end
+ else
+ notmatchpost[prev]=true
+ end
+ if replace then
+ while replacetail do
+ if seq[n][getchar(replacetail)] then
+ n=n-1
+ if replacetail==replace or n<1 then
+ break
+ else
+ replacetail=getprev(replacetail)
+ end
+ else
+ notmatchreplace[prev]=true
+ if notmatchpost[prev] then
+ goto next
+ else
+ break
+ end
+ end
+ end
+ else
+ end
+ end
+ prev=getprev(prev)
+ elseif id==glue_code then
+ local sn=seq[n]
+ if (sn[32] and spaces[prev]) or sn[0xFFFC] then
+ n=n-1
+ prev=getprev(prev)
else
- break
+ goto next
end
+ elseif seq[n][0xFFFC] then
+ n=n-1
+ prev=getprev(prev)
+ else
+ goto next
end
- end
- if notmatchpre[last] then
+ else
goto next
end
end
- last=getnext(last)
else
goto next
end
@@ -23907,34 +24085,32 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
goto next
end
end
- end
- if f>1 then
- if startprev then
- local prev=startprev
- if prereplace and prev==checkdisc then
- prev=getprev(sweepnode)
+ if s>l then
+ local current=last and getnext(last)
+ if not current and postreplace then
+ current=getnext(sweepnode)
end
- if prev then
+ if current then
local discfound
- local n=f-1
- while n>=1 do
- if prev then
- local char,id=ischar(prev,currentfont)
+ local n=l+1
+ while n<=s do
+ if current then
+ local char,id=ischar(current,currentfont)
if char then
if skiphash and skiphash[char] then
skipped=true
if trace_skips then
show_skip(dataset,sequence,char,ck,classes[char])
end
- prev=getprev(prev)
+ current=getnext(current)
elseif seq[n][char] then
- if n>1 then
- prev=getprev(prev)
+ if n<s then
+ current=getnext(current)
end
- n=n-1
+ n=n+1
elseif discfound then
notmatchreplace[discfound]=true
- if notmatchpost[discfound] then
+ if notmatchpre[discfound] then
goto next
else
break
@@ -23945,202 +24121,84 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
elseif char==false then
if discfound then
notmatchreplace[discfound]=true
- if notmatchpost[discfound] then
+ if notmatchpre[discfound] then
goto next
+ else
+ break
end
else
goto next
end
- break
elseif id==disc_code then
discseen=true
- discfound=prev
- notmatchpre[prev]=true
- notmatchpost[prev]=nil
- notmatchreplace[prev]=nil
- local pre,post,replace,pretail,posttail,replacetail=getdisc(prev,true)
- if pre~=start and post~=start and replace~=start then
- if post then
- local n=n
- while posttail do
- if seq[n][getchar(posttail)] then
- n=n-1
- if posttail==post or n<1 then
- break
- else
- posttail=getprev(posttail)
- end
- else
- notmatchpost[prev]=true
+ discfound=current
+ notmatchpre[current]=nil
+ notmatchpost[current]=true
+ notmatchreplace[current]=nil
+ local pre,post,replace=getdisc(current)
+ if pre then
+ local n=n
+ while pre do
+ if seq[n][getchar(pre)] then
+ n=n+1
+ if n>s then
break
+ else
+ pre=getnext(pre)
end
+ else
+ notmatchpre[current]=true
+ break
end
- if n>=1 then
- notmatchpost[prev]=true
- end
- else
- notmatchpost[prev]=true
end
- if replace then
- while replacetail do
- if seq[n][getchar(replacetail)] then
- n=n-1
- if replacetail==replace or n<1 then
- break
- else
- replacetail=getprev(replacetail)
- end
+ if n<=s then
+ notmatchpre[current]=true
+ end
+ else
+ notmatchpre[current]=true
+ end
+ if replace then
+ while replace do
+ if seq[n][getchar(replace)] then
+ n=n+1
+ if n>s then
+ break
else
- notmatchreplace[prev]=true
- if notmatchpost[prev] then
- goto next
- else
- break
- end
+ replace=getnext(replace)
+ end
+ else
+ notmatchreplace[current]=true
+ if notmatchpre[current] then
+ goto next
+ else
+ break
end
end
- else
end
+ else
end
- prev=getprev(prev)
+ current=getnext(current)
elseif id==glue_code then
local sn=seq[n]
- if (sn[32] and spaces[prev]) or sn[0xFFFC] then
- n=n-1
- prev=getprev(prev)
+ if (sn[32] and spaces[current]) or sn[0xFFFC] then
+ n=n+1
+ current=getnext(current)
else
goto next
end
elseif seq[n][0xFFFC] then
- n=n-1
- prev=getprev(prev)
- else
- goto next
- end
- else
- goto next
- end
- end
- else
- goto next
- end
- else
- goto next
- end
- end
- if s>l then
- local current=last and getnext(last)
- if not current and postreplace then
- current=getnext(sweepnode)
- end
- if current then
- local discfound
- local n=l+1
- while n<=s do
- if current then
- local char,id=ischar(current,currentfont)
- if char then
- if skiphash and skiphash[char] then
- skipped=true
- if trace_skips then
- show_skip(dataset,sequence,char,ck,classes[char])
- end
- current=getnext(current)
- elseif seq[n][char] then
- if n<s then
- current=getnext(current)
- end
- n=n+1
- elseif discfound then
- notmatchreplace[discfound]=true
- if notmatchpre[discfound] then
- goto next
- else
- break
- end
- else
- goto next
- end
- elseif char==false then
- if discfound then
- notmatchreplace[discfound]=true
- if notmatchpre[discfound] then
- goto next
- else
- break
- end
- else
- goto next
- end
- elseif id==disc_code then
- discseen=true
- discfound=current
- notmatchpre[current]=nil
- notmatchpost[current]=true
- notmatchreplace[current]=nil
- local pre,post,replace=getdisc(current)
- if pre then
- local n=n
- while pre do
- if seq[n][getchar(pre)] then
- n=n+1
- if n>s then
- break
- else
- pre=getnext(pre)
- end
- else
- notmatchpre[current]=true
- break
- end
- end
- if n<=s then
- notmatchpre[current]=true
- end
- else
- notmatchpre[current]=true
- end
- if replace then
- while replace do
- if seq[n][getchar(replace)] then
- n=n+1
- if n>s then
- break
- else
- replace=getnext(replace)
- end
- else
- notmatchreplace[current]=true
- if notmatchpre[current] then
- goto next
- else
- break
- end
- end
- end
- else
- end
- current=getnext(current)
- elseif id==glue_code then
- local sn=seq[n]
- if (sn[32] and spaces[current]) or sn[0xFFFC] then
n=n+1
current=getnext(current)
else
goto next
end
- elseif seq[n][0xFFFC] then
- n=n+1
- current=getnext(current)
else
goto next
end
- else
- goto next
end
+ else
+ goto next
end
- else
- goto next
end
end
if trace_contexts then
@@ -24902,7 +24960,7 @@ do
checkstep(head)
end
local initialrl=0
- if getid(head)==par_code and start_of_par(head) then
+ if getid(head)==par_code and startofpar(head) then
initialrl=pardirstate(head)
elseif direction==righttoleft_code then
initialrl=-1
@@ -25019,7 +25077,7 @@ do
start=getnext(start)
end
elseif id==math_code then
- start=getnext(end_of_math(start))
+ start=getnext(endofmath(start))
elseif id==dir_code then
topstack,rlmode=txtdirstate(start,dirstack,topstack,rlparmode)
start=getnext(start)
@@ -25089,7 +25147,7 @@ do
start=getnext(start)
end
elseif id==math_code then
- start=getnext(end_of_math(start))
+ start=getnext(endofmath(start))
elseif id==dir_code then
topstack,rlmode=txtdirstate(start,dirstack,topstack,rlparmode)
start=getnext(start)
@@ -25167,7 +25225,7 @@ do
elseif char==false or id==glue_code then
start=getnext(start)
elseif id==math_code then
- start=getnext(end_of_math(start))
+ start=getnext(endofmath(start))
elseif id==dir_code then
topstack,rlmode=txtdirstate(start,dirstack,topstack,rlparmode)
start=getnext(start)
@@ -25178,44 +25236,52 @@ do
return head
end
end
-local plugins={}
-otf.plugins=plugins
-local report=logs.reporter("fonts")
-function otf.registerplugin(name,f)
- if type(name)=="string" and type(f)=="function" then
- plugins[name]={ name,f }
- report()
- report("plugin %a has been loaded, please be aware of possible side effects",name)
- report()
- if logs.pushtarget then
- logs.pushtarget("log")
- end
- report("Plugins are not officially supported unless stated otherwise. This is because")
- report("they bypass the regular font handling and therefore some features in ConTeXt")
- report("(especially those related to fonts) might not work as expected or might not work")
- report("at all. Some plugins are for testing and development only and might change")
- report("whenever we feel the need for it.")
- report()
- if logs.poptarget then
- logs.poptarget()
+do
+ local plugins={}
+ otf.plugins=plugins
+ local report=logs.reporter("fonts")
+ local warned=false
+ local okay={ text=true }
+ function otf.registerplugin(name,f)
+ if type(name)=="string" and type(f)=="function" then
+ plugins[name]={ name,f }
+ if okay[name] then
+ else
+ report("plugin %a has been loaded, please be aware of possible side effects",name)
+ if not warned then
+ if logs.pushtarget then
+ logs.pushtarget("log")
+ end
+ report("Plugins are not officially supported unless stated otherwise. This is because")
+ report("they bypass the regular font handling and therefore some features in ConTeXt")
+ report("(especially those related to fonts) might not work as expected or might not work")
+ report("at all. Some plugins are for testing and development only and might change")
+ report("whenever we feel the need for it.")
+ report()
+ if logs.poptarget then
+ logs.poptarget()
+ end
+ warned=true
+ end
+ end
end
end
-end
-function otf.plugininitializer(tfmdata,value)
- if type(value)=="string" then
- tfmdata.shared.plugin=plugins[value]
+ function otf.plugininitializer(tfmdata,value)
+ if type(value)=="string" then
+ tfmdata.shared.plugin=plugins[value]
+ end
end
-end
-function otf.pluginprocessor(head,font,attr,direction)
- local s=fontdata[font].shared
- local p=s and s.plugin
- if p then
- if trace_plugins then
- report_process("applying plugin %a",p[1])
+ function otf.pluginprocessor(head,font,dynamic,direction)
+ local s=fontdata[font].shared
+ local p=s and s.plugin
+ if p then
+ if trace_plugins then
+ report_process("applying plugin %a",p[1])
+ end
+ return p[2](head,font,dynamic,direction)
+ else
+ return head,false
end
- return p[2](head,font,attr,direction)
- else
- return head,false
end
end
function otf.featuresinitializer(tfmdata,value)
@@ -25447,10 +25513,10 @@ registerotffeature {
},
}
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ots”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ots”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-osd” 73c9531c79df5ada320cb20777f7ed49] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-osd” 0e051ca0d3b1a8e0604ced27e753fde8] ---
if not modules then modules={} end modules ['font-osd']={
version=1.001,
@@ -25487,11 +25553,11 @@ local setprop=nuts.setprop
local getstate=nuts.getstate
local setstate=nuts.setstate
local ischar=nuts.ischar
-local insert_node_after=nuts.insert_after
+local insertnodeafter=nuts.insertafter
local copy_node=nuts.copy
local remove_node=nuts.remove
-local flush_list=nuts.flush_list
-local flush_node=nuts.flush_node
+local flushlist=nuts.flushlist
+local flushnode=nuts.flushnode
local copyinjection=nodes.injections.copy
local unsetvalue=attributes.unsetvalue
local fontdata=fonts.hashes.identifiers
@@ -26121,7 +26187,7 @@ local function inject_syntax_error(head,current,char)
else
setchar(current,dotted_circle)
end
- return insert_node_after(head,current,signal)
+ return insertnodeafter(head,current,signal)
end
local function initialize_one(font,attr)
local tfmdata=fontdata[font]
@@ -26239,7 +26305,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
if current==stop then
stop=getprev(stop)
head=remove_node(head,current)
- flush_node(current)
+ flushnode(current)
return head,stop,nbspaces
else
nbspaces=nbspaces+1
@@ -26269,7 +26335,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
tempcurrent=processcharacters(tempcurrent,font)
setstate(tempcurrent,unsetvalue)
if getchar(next)==getchar(tempcurrent) then
- flush_list(tempcurrent)
+ flushlist(tempcurrent)
if show_syntax_errors then
head,current=inject_syntax_error(head,current,char)
end
@@ -26277,8 +26343,8 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
setchar(current,getchar(tempcurrent))
local freenode=getnext(current)
setlink(current,tmp)
- flush_node(freenode)
- flush_list(tempcurrent)
+ flushnode(freenode)
+ flushlist(tempcurrent)
if changestop then
stop=current
end
@@ -26405,7 +26471,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
ch=tpm[1]
setchar(n,ch)
setchar(extra,tpm[2])
- head=insert_node_after(head,current,extra)
+ head=insertnodeafter(head,current,extra)
tpm=twopart_mark[ch]
end
while c~=stop and dependent_vowel[ch] do
@@ -26579,7 +26645,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
stop=getprev(stop)
end
head=remove_node(head,base)
- flush_node(base)
+ flushnode(base)
end
return head,stop,nbspaces
end
@@ -26839,7 +26905,7 @@ function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replaceme
if head==start then
head=stop
end
- flush_list(start)
+ flushlist(start)
return head,stop,true
end
local function initialize_two(font,attr)
@@ -26984,7 +27050,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces)
if current==stop then
stop=getprev(stop)
head=remove_node(head,current)
- flush_node(current)
+ flushnode(current)
return head,stop,nbspaces
else
nbspaces=nbspaces+1
@@ -27081,7 +27147,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces)
char=tpm[1]
setchar(current,char)
setchar(extra,tpm[2])
- head=insert_node_after(head,current,extra)
+ head=insertnodeafter(head,current,extra)
tpm=twopart_mark[char]
end
if not moved[current] and dependent_vowel[char] then
@@ -27231,7 +27297,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces)
end
nbspaces=nbspaces-1
head=remove_node(head,base)
- flush_node(base)
+ flushnode(base)
end
return head,stop,nbspaces
end
@@ -27883,10 +27949,10 @@ for i=1,nofscripts do
methods[scripts_two[i]]=method_two
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-osd”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-osd”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ocl” 797b5c71bf819c5f4fb314a4d646e9a7] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ocl” 2a377351ae23c339764ec8ce2e8e9164] ---
if not modules then modules={} end modules ['font-ocl']={
version=1.001,
@@ -28172,7 +28238,11 @@ if context then
local xmlconvert=xml.convert
local xmlfirst=xml.first
function otfsvg.filterglyph(entry,index)
- local svg=xmlconvert(entry.data)
+ local d=entry.data
+ if gzip.compressed(d) then
+ d=gzip.decompress(d) or d
+ end
+ local svg=xmlconvert(d)
local root=svg and xmlfirst(svg,"/svg[@id='glyph"..index.."']")
local data=root and tostring(root)
return data
@@ -28208,9 +28278,10 @@ end
if inkscape then
local descriptions=tfmdata.descriptions
local nofshapes=#svgshapes
+ local s_format=inkscapeformat("pdf")
local f_svgfile=formatters["temp-otf-svg-shape-%i.svg"]
local f_pdffile=formatters["temp-otf-svg-shape-%i.pdf"]
- local f_convert=formatters["%s --export-%s=%s\n"]
+ local f_convert=formatters[new and "file-open:%s; export-%s:%s; export-do\n" or "%s --export-%s=%s\n"]
local filterglyph=otfsvg.filterglyph
local nofdone=0
local processed={}
@@ -28224,7 +28295,7 @@ end
local svgfile=f_svgfile(index)
local pdffile=f_pdffile(index)
savedata(svgfile,data)
- inkscape:write(f_convert(svgfile,inkscapeformat("pdf"),pdffile))
+ inkscape:write(f_convert(svgfile,s_format,pdffile))
processed[index]=true
nofdone=nofdone+1
if nofdone%25==0 then
@@ -28429,10 +28500,10 @@ if context then
}
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-ocl”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-ocl”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otc” 0f12230ea07b5151f75d52726977e91f] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otc” 0f12230ea07b5151f75d52726977e91f] ---
if not modules then modules={} end modules ['font-otc']={
version=1.001,
@@ -29189,10 +29260,10 @@ end
otf.enhancers.enhance=enhance
otf.enhancers.register("check extra features",enhance)
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-otc”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-otc”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-onr” 6d161533f3437435e12a0ad64866df44] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-onr” 6d161533f3437435e12a0ad64866df44] ---
if not modules then modules={} end modules ['font-onr']={
version=1.001,
@@ -29565,10 +29636,10 @@ function readers.getinfo(filename)
end
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-onr”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-onr”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-one” 53cd565030e919da984b50471cc3be37] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-one” bd39d42055a44ca2002f8ddbbbbf27c3] ---
if not modules then modules={} end modules ['font-one']={
version=1.001,
@@ -30179,6 +30250,7 @@ local function read_from_afm(specification)
local tfmdata=afmtotfm(specification)
if tfmdata then
tfmdata.properties.name=specification.name
+ tfmdata.properties.id=specification.id
tfmdata=constructors.scale(tfmdata,specification)
local allfeatures=tfmdata.shared.features or specification.features.normal
constructors.applymanipulators("afm",tfmdata,allfeatures,trace_features,report_afm)
@@ -30282,10 +30354,10 @@ registerafmenhancer("normalize features",enhance_normalize_features)
registerafmenhancer("check extra features",otfenhancers.enhance)
registerafmenhancer("fix names",enhance_fix_names)
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-one”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-one”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-afk” 9da14e0fb22129c053acc599d1312544] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-afk” 9da14e0fb22129c053acc599d1312544] ---
if not modules then modules={} end modules ['font-afk']={
version=1.001,
@@ -30452,10 +30524,10 @@ fonts.handlers.afm.helpdata={
}
}
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-afk”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-afk”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-tfm” f0eb5e2a8068b17ad401bb7efdba1630] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-tfm” f0eb5e2a8068b17ad401bb7efdba1630] ---
if not modules then modules={} end modules ['luatex-fonts-tfm']={
version=1.001,
@@ -30970,10 +31042,10 @@ registertfmfeature {
}
}
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-tfm”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-tfm”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-lua” 1fbfdf7b689b2bdfd0e3bb9bf74ce136] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-lua” 1fbfdf7b689b2bdfd0e3bb9bf74ce136] ---
if not modules then modules={} end modules ['font-lua']={
version=1.001,
@@ -31013,10 +31085,10 @@ function readers.lua(specification)
return check_lua(specification,fullname)
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-lua”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-lua”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-def” b9d908c2338b7dc443ce9d1e9fcb7139] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-def” b9d908c2338b7dc443ce9d1e9fcb7139] ---
if not modules then modules={} end modules ['font-def']={
version=1.001,
@@ -31416,10 +31488,10 @@ if not context then
callbacks.register('define_font',definers.read,"definition of fonts (tfmdata preparation)")
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-def”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-def”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-shp” 5ff497c993112d4fef4c148348d964eb] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-shp” 2bb36adb4b264a895a2c4d97e1ac1d1e] ---
if not modules then modules={} end modules ['font-shp']={
version=1.001,
@@ -31436,7 +31508,7 @@ local afm=fonts.handlers.afm
local pfb=fonts.handlers.pfb
local hashes=fonts.hashes
local identifiers=hashes.identifiers
-local version=0.009
+local version=0.010
local shapescache=containers.define("fonts","shapes",version,true)
local streamscache=containers.define("fonts","streams",version,true)
local compact_streams=false
@@ -31784,10 +31856,10 @@ callback.register("glyph_stream_provider",function(id,index,mode)
return ""
end)
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-shp”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-shp”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-def” f435e0875f203f343157baeff876ec9c] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-def” f435e0875f203f343157baeff876ec9c] ---
if not modules then modules={} end modules ['luatex-fonts-def']={
version=1.001,
@@ -31868,10 +31940,10 @@ function fonts.definers.applypostprocessors(tfmdata)
return tfmdata
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-def”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-def”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-ext” 32013cbc5d5d336be8b1d1e5879d86c4] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-ext” 32013cbc5d5d336be8b1d1e5879d86c4] ---
if not modules then modules={} end modules ['luatex-fonts-ext']={
version=1.001,
@@ -32057,10 +32129,10 @@ registerotffeature {
}
}
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-ext”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-ext”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-tex” ceb087ef6fa2f89aed7179f60ddf8f35] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-tex” ceb087ef6fa2f89aed7179f60ddf8f35] ---
if not modules then modules={} end modules ['font-imp-tex']={
version=1.001,
@@ -32159,10 +32231,10 @@ registerotffeature {
description="arabic digits",
}
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-tex”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-tex”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-ligatures” 26ffcf089391445f7af59536c8814364] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-ligatures” 26ffcf089391445f7af59536c8814364] ---
if not modules then modules={} end modules ['font-imp-ligatures']={
version=1.001,
@@ -32276,10 +32348,10 @@ if context then
}
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-ligatures”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-ligatures”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-italics” defcb415bc1e0a0999b27773902adc18] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-italics” defcb415bc1e0a0999b27773902adc18] ---
if not modules then modules={} end modules ['font-imp-italics']={
version=1.001,
@@ -32383,10 +32455,10 @@ if context then
registerafmfeature(dimensions_specification)
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-italics”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-italics”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-effects” a2dde5e071fcb3fc7b90f2bcd5aa4f22] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-effects” d05997c1826355548ec9aec1346f9f23] ---
if not modules then modules={} end modules ['font-imp-effects']={
version=1.001,
@@ -32570,74 +32642,55 @@ local rules={
"FractionRuleThickness",
"UnderbarRuleThickness",
}
-local setmathparameters
-local setmathcharacters
-if CONTEXTLMTXMODE and CONTEXTLMTXMODE>0 then
- setmathparameters=function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
- if delta~=0 then
- for i=1,#rules do
- local name=rules[i]
- local value=mathparameters[name]
- if value then
- mathparameters[name]=(squeeze or 1)*(value+dy)
- end
+local function setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
+ if dy~=0 then
+ for i=1,#rules do
+ local name=rules[i]
+ local value=mathparameters[name]
+ if value then
+ mathparameters[name]=(squeeze or 1)*(value+dy)
end
end
end
- setmathcharacters=function()
- end
-else
- setmathparameters=function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
- if delta~=0 then
- for i=1,#rules do
- local name=rules[i]
- local value=mathparameters[name]
- if value then
- mathparameters[name]=(squeeze or 1)*(value+dy)
- end
- end
+end
+local function setmathcharacters(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta)
+ local function wdpatch(char)
+ if wsnap~=0 then
+ char.width=char.width+wdelta/2
end
end
- setmathcharacters=function(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta)
- local function wdpatch(char)
- if wsnap~=0 then
- char.width=char.width+wdelta/2
+ local function htpatch(char)
+ if hsnap~=0 then
+ local height=char.height
+ if height then
+ char.height=char.height+2*dy
end
end
- local function htpatch(char)
- if hsnap~=0 then
- local height=char.height
- if height then
- char.height=char.height+2*dy
- end
- end
- end
- local character=characters[0x221A]
- if character and character.next then
- local char=character
- local next=character.next
+ end
+ local character=characters[0x221A]
+ if character and character.next then
+ local char=character
+ local next=character.next
+ wdpatch(char)
+ htpatch(char)
+ while next do
+ char=characters[next]
wdpatch(char)
htpatch(char)
- while next do
- char=characters[next]
- wdpatch(char)
- htpatch(char)
- next=char.next
- end
- if char then
- local v=char.vert_variants
- if v then
- local top=v[#v]
- if top then
- local char=characters[top.glyph]
- htpatch(char)
- end
+ next=char.next
+ end
+ if char then
+ local v=char.vert_variants
+ if v then
+ local top=v[#v]
+ if top then
+ local char=characters[top.glyph]
+ htpatch(char)
end
end
end
end
end
-local shiftmode=CONTEXTLMTXMODE and CONTEXTLMTXMODE>0
local function manipulateeffect(tfmdata)
local effect=tfmdata.properties.effect
if effect then
@@ -32659,45 +32712,38 @@ local function manipulateeffect(tfmdata)
local factor=(1+effect.factor)*factor
local hfactor=(1+effect.hfactor)*hfactor
local vfactor=(1+effect.vfactor)*vfactor
- if shiftmode then
- parameters.hshift=hshift
- parameters.vshift=vshift
- else
- vshift=vshift~=0 and upcommand[vshift] or false
- hshift=rightcommand[hshift]
- end
+ vshift=vshift~=0 and upcommand[vshift] or false
+ hshift=rightcommand[hshift]
for unicode,character in next,characters do
local oldwidth=character.width
local oldheight=character.height
local olddepth=character.depth
if oldwidth and oldwidth>0 then
character.width=oldwidth+wdelta
- if not shiftmode then
- local commands=character.commands
- if vshift then
- if commands then
+ local commands=character.commands
+ if vshift then
+ if commands then
+ prependcommands (commands,
+ hshift,
+ vshift
+ )
+ else
+ character.commands={
+ hshift,
+ vshift,
+ charcommand[unicode]
+ }
+ end
+ else
+ if commands then
prependcommands (commands,
- hshift,
- vshift
+ hshift
)
- else
- character.commands={
- hshift,
- vshift,
- charcommand[unicode]
- }
- end
else
- if commands then
- prependcommands (commands,
- hshift
- )
- else
- character.commands={
- hshift,
- charcommand[unicode]
- }
- end
+ character.commands={
+ hshift,
+ charcommand[unicode]
+ }
end
end
end
@@ -32769,10 +32815,10 @@ local specification={
registerotffeature(specification)
registerafmfeature(specification)
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “font-imp-effects”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “font-imp-effects”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-lig” fbd251eea3810a43a8d5542319361d68] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-lig” fbd251eea3810a43a8d5542319361d68] ---
fonts.handlers.otf.addfeature {
@@ -34841,10 +34887,10 @@ fonts.handlers.otf.addfeature {
["type"]="ligature",
}
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-lig”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-lig”] ---
-do --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-gbn” 10ecdf01e7c926e5128ad8a9dff4d677] ---
+do --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-gbn” 34e4543a02f6fbc8c2ade896cb6dc7df] ---
if not modules then modules={} end modules ['luatex-fonts-gbn']={
version=1.001,
@@ -34860,8 +34906,8 @@ local next=next
local fonts=fonts
local nodes=nodes
local nuts=nodes.nuts
-local traverse_id=nuts.traverse_id
-local flush_node=nuts.flush_node
+local traverseid=nuts.traverseid
+local flushnode=nuts.flushnode
local glyph_code=nodes.nodecodes.glyph
local disc_code=nodes.nodecodes.disc
local tonode=nuts.tonode
@@ -34920,7 +34966,7 @@ local function nodepass(head,groupcode,size,packtype,direction)
local variants=nil
local redundant=nil
local nofused=0
- for n in traverse_id(glyph_code,head) do
+ for n in traverseid(glyph_code,head) do
local font=getfont(n)
if font~=prevfont then
if basefont then
@@ -34998,13 +35044,13 @@ local function nodepass(head,groupcode,size,packtype,direction)
end
end
end
- flush_node(r)
+ flushnode(r)
end
end
- for d in traverse_id(disc_code,head) do
+ for d in traverseid(disc_code,head) do
local _,_,r=getdisc(d)
if r then
- for n in traverse_id(glyph_code,r) do
+ for n in traverseid(glyph_code,r) do
local font=getfont(n)
if font~=prevfont then
prevfont=font
@@ -35072,7 +35118,7 @@ local function basepass(head)
end
return head
end
-local protectpass=node.direct.protect_glyphs
+local protectpass=node.direct.protectglyphs or node.direct.protect_glyphs
local injectpass=nodes.injections.handler
function nodes.handlers.nodepass(head,...)
if head then
@@ -35109,7 +35155,7 @@ function nodes.simple_font_handler(head,groupcode,size,packtype,direction)
return head
end
-end --- [luaotfload, fontloader-2021-01-07.lua scope for “fonts-gbn”] ---
+end --- [luaotfload, fontloader-2021-05-20.lua scope for “fonts-gbn”] ---
--- vim:ft=lua:sw=2:ts=8:et:tw=79
diff --git a/macros/luatex/generic/luaotfload/fontloader-basics-nod.lua b/macros/luatex/generic/luaotfload/fontloader-basics-nod.lua
index 25f5473a5a..76e36f2aab 100644
--- a/macros/luatex/generic/luaotfload/fontloader-basics-nod.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-basics-nod.lua
@@ -71,8 +71,8 @@ nodes.glyphcodes = glyphcodes
nodes.disccodes = disccodes
nodes.dirvalues = { lefttoright = 0, righttoleft = 1 }
-nodes.handlers.protectglyphs = node.protect_glyphs -- beware: nodes!
-nodes.handlers.unprotectglyphs = node.unprotect_glyphs -- beware: nodes!
+nodes.handlers.protectglyphs = node.protectglyphs or node.protect_glyphs -- beware: nodes!
+nodes.handlers.unprotectglyphs = node.unprotectglyphs or node.unprotect_glyphs -- beware: nodes!
-- in generic code, at least for some time, we stay nodes, while in context
-- we can go nuts (e.g. experimental); this split permits us us keep code
@@ -81,84 +81,85 @@ nodes.handlers.unprotectglyphs = node.unprotect_glyphs -- beware: nodes!
-- much of this will go away .. it's part of the context interface and not
-- officially in luatex-*.lua
-local direct = node.direct
-local nuts = { }
-nodes.nuts = nuts
-
-local tonode = direct.tonode
-local tonut = direct.todirect
-
-nodes.tonode = tonode
-nodes.tonut = tonut
-
-nuts.tonode = tonode
-nuts.tonut = tonut
-
-nuts.getattr = direct.get_attribute
-nuts.getboth = direct.getboth
-nuts.getchar = direct.getchar
-nuts.getdirection = direct.getdirection
-nuts.getdisc = direct.getdisc
-nuts.getreplace = direct.getreplace
-nuts.getfield = direct.getfield
-nuts.getfont = direct.getfont
-nuts.getid = direct.getid
-nuts.getkern = direct.getkern
-nuts.getlist = direct.getlist
-nuts.getnext = direct.getnext
-nuts.getoffsets = direct.getoffsets
-nuts.getoptions = direct.getoptions or function() return 0 end
-nuts.getprev = direct.getprev
-nuts.getsubtype = direct.getsubtype
-nuts.getwidth = direct.getwidth
-nuts.setattr = direct.setfield
-nuts.setboth = direct.setboth
-nuts.setchar = direct.setchar
-nuts.setcomponents = direct.setcomponents
-nuts.setdirection = direct.setdirection
-nuts.setdisc = direct.setdisc
-nuts.setreplace = direct.setreplace
-nuts.setfield = setfield
-nuts.setkern = direct.setkern
-nuts.setlink = direct.setlink
-nuts.setlist = direct.setlist
-nuts.setnext = direct.setnext
-nuts.setoffsets = direct.setoffsets
-nuts.setprev = direct.setprev
-nuts.setsplit = direct.setsplit
-nuts.setsubtype = direct.setsubtype
-nuts.setwidth = direct.setwidth
-
-nuts.getglyphdata = nuts.getattr
-nuts.setglyphdata = nuts.setattr
-
-nuts.ischar = direct.is_char
-nuts.isglyph = direct.is_glyph
-
-nuts.copy = direct.copy
-nuts.copy_list = direct.copy_list
-nuts.copy_node = direct.copy
-nuts.end_of_math = direct.end_of_math
-nuts.flush = direct.flush
-nuts.flush_list = direct.flush_list
-nuts.flush_node = direct.flush_node
-nuts.free = direct.free
-nuts.insert_after = direct.insert_after
-nuts.insert_before = direct.insert_before
-nuts.is_node = direct.is_node
-nuts.kerning = direct.kerning
-nuts.ligaturing = direct.ligaturing
-nuts.new = direct.new
-nuts.remove = direct.remove
-nuts.tail = direct.tail
-nuts.traverse = direct.traverse
-nuts.traverse_char = direct.traverse_char
-nuts.traverse_glyph = direct.traverse_glyph
-nuts.traverse_id = direct.traverse_id
+local direct = node.direct
+local nuts = { }
+nodes.nuts = nuts
+
+local tonode = direct.tonode
+local tonut = direct.todirect
+
+nodes.tonode = tonode
+nodes.tonut = tonut
+
+nuts.tonode = tonode
+nuts.tonut = tonut
+
+nuts.getattr = direct.get_attribute
+nuts.getboth = direct.getboth
+nuts.getchar = direct.getchar
+nuts.getdirection = direct.getdirection
+nuts.getdisc = direct.getdisc
+nuts.getreplace = direct.getreplace
+nuts.getfield = direct.getfield
+nuts.getfont = direct.getfont
+nuts.getid = direct.getid
+nuts.getkern = direct.getkern
+nuts.getlist = direct.getlist
+nuts.getnext = direct.getnext
+nuts.getoffsets = direct.getoffsets
+nuts.getoptions = direct.getoptions or function() return 0 end
+nuts.getprev = direct.getprev
+nuts.getsubtype = direct.getsubtype
+nuts.getwidth = direct.getwidth
+nuts.setattr = direct.setfield
+nuts.setboth = direct.setboth
+nuts.setchar = direct.setchar
+nuts.setcomponents = direct.setcomponents
+nuts.setdirection = direct.setdirection
+nuts.setdisc = direct.setdisc
+nuts.setreplace = direct.setreplace
+nuts.setfield = setfield
+nuts.setkern = direct.setkern
+nuts.setlink = direct.setlink
+nuts.setlist = direct.setlist
+nuts.setnext = direct.setnext
+nuts.setoffsets = direct.setoffsets
+nuts.setprev = direct.setprev
+nuts.setsplit = direct.setsplit
+nuts.setsubtype = direct.setsubtype
+nuts.setwidth = direct.setwidth
+
+nuts.getglyphdata = nuts.getattribute or nuts.getattr
+nuts.setglyphdata = nuts.setattribute or nuts.setattr
+
+nuts.ischar = direct.ischar or direct.is_char
+nuts.isglyph = direct.isglyph or direct.is_glyph
+nuts.copy = direct.copy
+nuts.copynode = direct.copy
+nuts.copylist = direct.copylist or direct.copy_list
+nuts.endofmath = direct.endofmath or direct.end_of_math
+nuts.flush = direct.flush
+nuts.flushlist = direct.flushlist or direct.flush_list
+nuts.flushnode = direct.flushnode or direct.flush_node
+nuts.free = direct.free
+nuts.insertafter = direct.insertafter or direct.insert_after
+nuts.insertbefore = direct.insertbefore or direct.insert_before
+nuts.isnode = direct.isnode or direct.is_node
+nuts.isdirect = direct.isdirect or direct.is_direct
+nuts.isnut = direct.isdirect or direct.is_direct
+nuts.kerning = direct.kerning
+nuts.ligaturing = direct.ligaturing
+nuts.new = direct.new
+nuts.remove = direct.remove
+nuts.tail = direct.tail
+nuts.traverse = direct.traverse
+nuts.traversechar = direct.traversechar or direct.traverse_char
+nuts.traverseglyph = direct.traverseglyph or direct.traverse_glyph
+nuts.traverseid = direct.traverseid or direct.traverse_id
-- properties as used in the (new) injector:
-local propertydata = direct.get_properties_table()
+local propertydata = (direct.getpropertiestable or direct.get_properties_table)()
nodes.properties = { data = propertydata }
if direct.set_properties_mode then
@@ -199,10 +200,10 @@ local setfield = nuts.setfield
local getsubtype = nuts.getsubtype
local isglyph = nuts.isglyph
local find_tail = nuts.tail
-local flush_list = nuts.flush_list
-local flush_node = nuts.flush_node
-local traverse_id = nuts.traverse_id
-local copy_node = nuts.copy_node
+local flushlist = nuts.flushlist
+local flushnode = nuts.flushnode
+local traverseid = nuts.traverseid
+local copynode = nuts.copynode
local glyph_code = nodes.nodecodes.glyph
local ligature_code = nodes.glyphcodes.ligature
@@ -222,22 +223,22 @@ end
do
- local get_components = node.direct.getcomponents
- local set_components = node.direct.setcomponents
+ local getcomponents = node.direct.getcomponents
+ local setcomponents = node.direct.setcomponents
- local function copy_no_components(g,copyinjection)
- local components = get_components(g)
+ local function copynocomponents(g,copyinjection)
+ local components = getcomponents(g)
if components then
- set_components(g)
- local n = copy_node(g)
+ setcomponents(g)
+ local n = copynode(g)
if copyinjection then
copyinjection(n,g)
end
- set_components(g,components)
+ setcomponents(g,components)
-- maybe also upgrade the subtype but we don't use it anyway
return n
else
- local n = copy_node(g)
+ local n = copynode(g)
if copyinjection then
copyinjection(n,g)
end
@@ -245,11 +246,11 @@ do
end
end
- local function copy_only_glyphs(current)
+ local function copyonlyglyphs(current)
local head = nil
local previous = nil
- for n in traverse_id(glyph_code,current) do
- n = copy_node(n)
+ for n in traverseid(glyph_code,current) do
+ n = copynode(n)
if head then
setlink(previous,n)
else
@@ -260,14 +261,14 @@ do
return head
end
- local function count_components(start,marks)
+ local function countcomponents(start,marks)
local char = isglyph(start)
if char then
if getsubtype(start) == ligature_code then
local n = 0
- local components = get_components(start)
+ local components = getcomponents(start)
while components do
- n = n + count_components(components,marks)
+ n = n + countcomponents(components,marks)
components = getnext(components)
end
return n
@@ -278,20 +279,22 @@ do
return 0
end
- local function flush_components()
+ local function flushcomponents()
-- this is a no-op in mkiv / generic
end
- nuts.set_components = set_components
- nuts.get_components = get_components
- nuts.copy_only_glyphs = copy_only_glyphs
- nuts.copy_no_components = copy_no_components
- nuts.count_components = count_components
- nuts.flush_components = flush_components
+ nuts.components = {
+ set = setcomponents,
+ get = getcomponents,
+ copyonlyglyphs = copyonlyglyphs,
+ copynocomponents = copynocomponents,
+ count = countcomponents,
+ flush = flushcomponents,
+ }
end
-nuts.uses_font = direct.uses_font
+nuts.usesfont = direct.usesfont or direct.uses_font
do
@@ -301,12 +304,12 @@ do
local dummy = tonut(node.new("glyph"))
nuts.traversers = {
- glyph = nuts.traverse_id(nodecodes.glyph,dummy),
- glue = nuts.traverse_id(nodecodes.glue,dummy),
- disc = nuts.traverse_id(nodecodes.disc,dummy),
- boundary = nuts.traverse_id(nodecodes.boundary,dummy),
+ glyph = nuts.traverseid(nodecodes.glyph,dummy),
+ glue = nuts.traverseid(nodecodes.glue,dummy),
+ disc = nuts.traverseid(nodecodes.disc,dummy),
+ boundary = nuts.traverseid(nodecodes.boundary,dummy),
- char = nuts.traverse_char(dummy),
+ char = nuts.traversechar(dummy),
node = nuts.traverse(dummy),
}
@@ -333,7 +336,7 @@ do
local getsubtype = nuts.getsubtype
- function nuts.start_of_par(n)
+ function nuts.startofpar(n)
local s = getsubtype(n)
return s == 0 or s == 2 -- sorry, hardcoded, won't change anyway
end
diff --git a/macros/luatex/generic/luaotfload/fontloader-font-cff.lua b/macros/luatex/generic/luaotfload/fontloader-font-cff.lua
index 4e2981011a..ff87292baf 100644
--- a/macros/luatex/generic/luaotfload/fontloader-font-cff.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-font-cff.lua
@@ -29,7 +29,7 @@ if not modules then modules = { } end modules ['font-cff'] = {
local next, type, tonumber, rawget = next, type, tonumber, rawget
local byte, char, gmatch, sub = string.byte, string.char, string.gmatch, string.sub
-local concat, remove, unpack = table.concat, table.remove, table.unpack
+local concat, insert, remove, unpack = table.concat, table.insert, table.remove, table.unpack
local floor, abs, round, ceil, min, max = math.floor, math.abs, math.round, math.ceil, math.min, math.max
local P, C, R, S, C, Cs, Ct = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.C, lpeg.Cs, lpeg.Ct
local lpegmatch = lpeg.match
@@ -745,6 +745,13 @@ do
-- some back. I inlined some of then and a bit speed can be gained by more
-- inlining but not that much.
+ -- Maybe have several action tables:
+ --
+ -- keep curve / checked
+ -- keep curve / not checked
+ -- checked
+ -- not checked
+
local function xymoveto()
if keepcurve then
r = r + 1
@@ -1968,8 +1975,38 @@ do
showstate(reverse[t] or "<action>")
end
if top > 0 then
- for i=1,top do
- r = r + 1 ; result[r] = encode[stack[i]]
+ -- if t == 8 and top > 42 then
+ if t == 8 and top > 48 then
+ -- let's assume this only happens for rrcurveto .. the other ones would need some more
+ -- complex handling (cff2 stuff)
+ local n = 0
+ for i=1,top do
+ -- if n == 42 then
+ if n == 48 then
+ local zero = encode[0]
+ local res3 = result[r-3]
+ local res2 = result[r-2]
+ local res1 = result[r-1]
+ local res0 = result[r]
+ result[r-3] = zero
+ result[r-2] = zero
+ r = r + 1 ; result[r] = chars[t]
+ r = r + 1 ; result[r] = zero
+ r = r + 1 ; result[r] = zero
+ r = r + 1 ; result[r] = res3
+ r = r + 1 ; result[r] = res2
+ r = r + 1 ; result[r] = res1
+ r = r + 1 ; result[r] = res0
+ n = 1
+ else
+ n = n + 1
+ end
+ r = r + 1 ; result[r] = encode[stack[i]]
+ end
+ else
+ for i=1,top do
+ r = r + 1 ; result[r] = encode[stack[i]]
+ end
end
top = 0
end
diff --git a/macros/luatex/generic/luaotfload/fontloader-font-imp-effects.lua b/macros/luatex/generic/luaotfload/fontloader-font-imp-effects.lua
index 43ce82b71a..27a16914b8 100644
--- a/macros/luatex/generic/luaotfload/fontloader-font-imp-effects.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-font-imp-effects.lua
@@ -207,94 +207,63 @@ local rules = {
"UnderbarRuleThickness",
}
--- local commands = char.commands
--- if commands then
--- local command = commands[1]
--- if command and command[1] == "right" then
--- commands[1] = rightcommand[command[2]-snap]
--- end
--- end
-
-- radicals are not yet ok
-local setmathparameters
-local setmathcharacters
-
-if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then
-
- setmathparameters = function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
- if delta ~= 0 then
- for i=1,#rules do
- local name = rules[i]
- local value = mathparameters[name]
- if value then
- mathparameters[name] = (squeeze or 1) * (value + dy)
- end
+local function setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
+ -- hm, this was "if delta ~= 0 then" but delta was gone
+ if dy ~= 0 then
+ for i=1,#rules do
+ local name = rules[i]
+ local value = mathparameters[name]
+ if value then
+ mathparameters[name] = (squeeze or 1) * (value + dy)
end
end
end
+end
- setmathcharacters = function()
- end
+local function setmathcharacters(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta)
-else
+ -- still not the perfect rule
- setmathparameters = function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
- if delta ~= 0 then
- for i=1,#rules do
- local name = rules[i]
- local value = mathparameters[name]
- if value then
- mathparameters[name] = (squeeze or 1) * (value + dy)
- end
- end
+ local function wdpatch(char)
+ if wsnap ~= 0 then
+ char.width = char.width + wdelta/2
end
end
- setmathcharacters = function(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta)
-
- -- still not the perfect rule
-
- local function wdpatch(char)
- if wsnap ~= 0 then
- char.width = char.width + wdelta/2
- end
- end
-
- local function htpatch(char)
- if hsnap ~= 0 then
- local height = char.height
- if height then
- char.height = char.height + 2 * dy
- end
+ local function htpatch(char)
+ if hsnap ~= 0 then
+ local height = char.height
+ if height then
+ char.height = char.height + 2 * dy
end
end
+ end
- local character = characters[0x221A]
+ local character = characters[0x221A]
- if character and character.next then
- local char = character
- local next = character.next
+ if character and character.next then
+ local char = character
+ local next = character.next
+ wdpatch(char)
+ htpatch(char)
+ while next do
+ char = characters[next]
wdpatch(char)
htpatch(char)
- while next do
- char = characters[next]
- wdpatch(char)
- htpatch(char)
- next = char.next
- end
- if char then
- local v = char.vert_variants
- if v then
- local top = v[#v]
- if top then
- local char = characters[top.glyph]
- htpatch(char)
- end
+ next = char.next
+ end
+ if char then
+ local v = char.vert_variants
+ if v then
+ local top = v[#v]
+ if top then
+ local char = characters[top.glyph]
+ htpatch(char)
end
end
end
-
end
end
@@ -304,8 +273,6 @@ end
-- inspect(fonts.hashes.characters[f][c])
-- end }
-local shiftmode = CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0
-
local function manipulateeffect(tfmdata)
local effect = tfmdata.properties.effect
if effect then
@@ -327,49 +294,42 @@ local function manipulateeffect(tfmdata)
local factor = (1 + effect.factor) * factor
local hfactor = (1 + effect.hfactor) * hfactor
local vfactor = (1 + effect.vfactor) * vfactor
- if shiftmode then
- parameters.hshift = hshift
- parameters.vshift = vshift
- else
- vshift = vshift ~= 0 and upcommand[vshift] or false
- hshift = rightcommand[hshift]
- end
+ vshift = vshift ~= 0 and upcommand[vshift] or false
+ hshift = rightcommand[hshift]
for unicode, character in next, characters do
local oldwidth = character.width
local oldheight = character.height
local olddepth = character.depth
if oldwidth and oldwidth > 0 then
character.width = oldwidth + wdelta
- if not shiftmode then
- local commands = character.commands
- if vshift then
- if commands then
- prependcommands ( commands,
- -- show_effect,
- hshift,
- vshift
- )
- else
- character.commands = {
- -- show_effect,
- hshift,
- vshift,
- charcommand[unicode]
- }
- end
+ local commands = character.commands
+ if vshift then
+ if commands then
+ prependcommands ( commands,
+ -- show_effect,
+ hshift,
+ vshift
+ )
+ else
+ character.commands = {
+ -- show_effect,
+ hshift,
+ vshift,
+ charcommand[unicode]
+ }
+ end
+ else
+ if commands then
+ prependcommands ( commands,
+ -- show_effect,
+ hshift
+ )
else
- if commands then
- prependcommands ( commands,
- -- show_effect,
- hshift
- )
- else
- character.commands = {
- -- show_effect,
- hshift,
- charcommand[unicode]
- }
- end
+ character.commands = {
+ -- show_effect,
+ hshift,
+ charcommand[unicode]
+ }
end
end
end
diff --git a/macros/luatex/generic/luaotfload/fontloader-font-ocl.lua b/macros/luatex/generic/luaotfload/fontloader-font-ocl.lua
index e6a38af5c3..7d960922f4 100644
--- a/macros/luatex/generic/luaotfload/fontloader-font-ocl.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-font-ocl.lua
@@ -370,13 +370,24 @@ if context then
local xmlconvert = xml.convert
local xmlfirst = xml.first
+ -- function otfsvg.filterglyph(entry,index)
+ -- -- we only support decompression in lmtx, so one needs to wipe the
+ -- -- cache when invalid xml is reported
+ -- local svg = xmlconvert(entry.data)
+ -- local root = svg and xmlfirst(svg,"/svg[@id='glyph"..index.."']")
+ -- local data = root and tostring(root)
+ -- -- report_svg("data for glyph %04X: %s",index,data)
+ -- return data
+ -- end
+
function otfsvg.filterglyph(entry,index)
- -- we only support decompression in lmtx, so one needs to wipe the
- -- cache when invalid xml is reported
- local svg = xmlconvert(entry.data)
+ local d = entry.data
+ if gzip.compressed(d) then
+ d = gzip.decompress(d) or d
+ end
+ local svg = xmlconvert(d)
local root = svg and xmlfirst(svg,"/svg[@id='glyph"..index.."']")
local data = root and tostring(root)
- -- report_svg("data for glyph %04X: %s",index,data)
return data
end
@@ -412,6 +423,9 @@ end
--
-- Because a generic setup can be flawed we need to catch bad inkscape runs which add a bit of
-- ugly overhead. Bah.
+ --
+ -- In the long run this method is a dead end because we cannot rely on command line arguments
+ -- etc to be upward compatible (so no real batch tool).
local new = nil
@@ -430,9 +444,10 @@ end
-- local indices = fonts.getindices(tfmdata)
local descriptions = tfmdata.descriptions
local nofshapes = #svgshapes
+ local s_format = inkscapeformat("pdf") -- hack, this will go away when is >= 0 is everywhere
local f_svgfile = formatters["temp-otf-svg-shape-%i.svg"]
local f_pdffile = formatters["temp-otf-svg-shape-%i.pdf"]
- local f_convert = formatters["%s --export-%s=%s\n"]
+ local f_convert = formatters[new and "file-open:%s; export-%s:%s; export-do\n" or "%s --export-%s=%s\n"]
local filterglyph = otfsvg.filterglyph
local nofdone = 0
local processed = { }
@@ -446,7 +461,7 @@ end
local svgfile = f_svgfile(index)
local pdffile = f_pdffile(index)
savedata(svgfile,data)
- inkscape:write(f_convert(svgfile,inkscapeformat("pdf"),pdffile))
+ inkscape:write(f_convert(svgfile,s_format,pdffile))
processed[index] = true
nofdone = nofdone + 1
if nofdone % 25 == 0 then
diff --git a/macros/luatex/generic/luaotfload/fontloader-font-one.lua b/macros/luatex/generic/luaotfload/fontloader-font-one.lua
index 5ef6e47497..829f52ea04 100644
--- a/macros/luatex/generic/luaotfload/fontloader-font-one.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-font-one.lua
@@ -727,6 +727,7 @@ local function read_from_afm(specification)
local tfmdata = afmtotfm(specification)
if tfmdata then
tfmdata.properties.name = specification.name
+ tfmdata.properties.id = specification.id
tfmdata = constructors.scale(tfmdata, specification)
local allfeatures = tfmdata.shared.features or specification.features.normal
constructors.applymanipulators("afm",tfmdata,allfeatures,trace_features,report_afm)
diff --git a/macros/luatex/generic/luaotfload/fontloader-font-osd.lua b/macros/luatex/generic/luaotfload/fontloader-font-osd.lua
index 87453d9e2d..2d0e685c19 100644
--- a/macros/luatex/generic/luaotfload/fontloader-font-osd.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-font-osd.lua
@@ -118,11 +118,11 @@ local setstate = nuts.setstate
local ischar = nuts.ischar
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
local copy_node = nuts.copy
local remove_node = nuts.remove
-local flush_list = nuts.flush_list
-local flush_node = nuts.flush_node
+local flushlist = nuts.flushlist
+local flushnode = nuts.flushnode
local copyinjection = nodes.injections.copy -- KE: is this necessary? HH: probably not as positioning comes later and we rawget/set
@@ -826,7 +826,7 @@ local function inject_syntax_error(head,current,char)
else
setchar(current,dotted_circle)
end
- return insert_node_after(head,current,signal)
+ return insertnodeafter(head,current,signal)
end
-- hm, this is applied to one character:
@@ -968,7 +968,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
if current == stop then
stop = getprev(stop)
head = remove_node(head,current)
- flush_node(current)
+ flushnode(current)
return head, stop, nbspaces
else
nbspaces = nbspaces + 1
@@ -998,7 +998,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
tempcurrent = processcharacters(tempcurrent,font)
setstate(tempcurrent,unsetvalue)
if getchar(next) == getchar(tempcurrent) then
- flush_list(tempcurrent)
+ flushlist(tempcurrent)
if show_syntax_errors then
head, current = inject_syntax_error(head,current,char)
end
@@ -1006,8 +1006,8 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
setchar(current,getchar(tempcurrent)) -- we assumes that the result of blwf consists of one node
local freenode = getnext(current)
setlink(current,tmp)
- flush_node(freenode)
- flush_list(tempcurrent)
+ flushnode(freenode)
+ flushlist(tempcurrent)
if changestop then
stop = current
end
@@ -1154,7 +1154,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
ch = tpm[1]
setchar(n,ch)
setchar(extra,tpm[2])
- head = insert_node_after(head,current,extra)
+ head = insertnodeafter(head,current,extra)
tpm = twopart_mark[ch]
end
while c ~= stop and dependent_vowel[ch] do
@@ -1335,7 +1335,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
stop = getprev(stop)
end
head = remove_node(head,base)
- flush_node(base)
+ flushnode(base)
end
return head, stop, nbspaces
@@ -1712,7 +1712,7 @@ function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replaceme
if head == start then
head = stop
end
- flush_list(start)
+ flushlist(start)
return head, stop, true
end
@@ -1876,7 +1876,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
if current == stop then
stop = getprev(stop)
head = remove_node(head,current)
- flush_node(current)
+ flushnode(current)
return head, stop, nbspaces
else
nbspaces = nbspaces + 1
@@ -1979,7 +1979,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
char = tpm[1]
setchar(current,char)
setchar(extra,tpm[2])
- head = insert_node_after(head,current,extra)
+ head = insertnodeafter(head,current,extra)
tpm = twopart_mark[char]
end
--
@@ -2154,7 +2154,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
end
nbspaces = nbspaces - 1
head = remove_node(head, base)
- flush_node(base)
+ flushnode(base)
end
return head, stop, nbspaces
diff --git a/macros/luatex/generic/luaotfload/fontloader-font-ota.lua b/macros/luatex/generic/luaotfload/fontloader-font-ota.lua
index ce1b22b50d..a8f9f0047c 100644
--- a/macros/luatex/generic/luaotfload/fontloader-font-ota.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-font-ota.lua
@@ -40,7 +40,7 @@ local getsubtype = nuts.getsubtype
local getchar = nuts.getchar
local ischar = nuts.ischar
-local end_of_math = nuts.end_of_math
+local endofmath = nuts.endofmath
local nodecodes = nodes.nodecodes
----- glyph_code = nodecodes.glyph
@@ -173,7 +173,7 @@ function analyzers.setstate(head,font)
end
first, last, n = nil, nil, 0
if id == math_code then
- current = end_of_math(current)
+ current = endofmath(current)
end
elseif id == disc_code then
-- always in the middle .. it doesn't make much sense to assign a property
@@ -189,7 +189,7 @@ function analyzers.setstate(head,font)
end
first, last, n = nil, nil, 0
if id == math_code then
- current = end_of_math(current)
+ current = endofmath(current)
end
end
current = getnext(current)
@@ -435,7 +435,7 @@ function methods.arab(head,font,attr)
first = nil
end
if id == math_code then -- a bit duplicate as we test for glyphs twice
- current = end_of_math(current)
+ current = endofmath(current)
end
end
current = getnext(current)
@@ -562,7 +562,7 @@ do
wrapup()
end
if id == math_code then -- a bit duplicate as we test for glyphs twice
- current = end_of_math(current)
+ current = endofmath(current)
end
end
current = getnext(current)
diff --git a/macros/luatex/generic/luaotfload/fontloader-font-otj.lua b/macros/luatex/generic/luaotfload/fontloader-font-otj.lua
index bb02044dca..c4ec9972cd 100644
--- a/macros/luatex/generic/luaotfload/fontloader-font-otj.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-font-otj.lua
@@ -90,6 +90,8 @@ local getoffsets = nuts.getoffsets
local getboth = nuts.getboth
local getdisc = nuts.getdisc
local setdisc = nuts.setdisc
+local getreplace = nuts.getreplace
+local setreplace = nuts.setreplace
local setoffsets = nuts.setoffsets
local ischar = nuts.ischar
local getkern = nuts.getkern
@@ -98,13 +100,11 @@ local setlink = nuts.setlink
local setwidth = nuts.setwidth
local getwidth = nuts.getwidth
------ traverse_id = nuts.traverse_id
------ traverse_char = nuts.traverse_char
local nextchar = nuts.traversers.char
local nextglue = nuts.traversers.glue
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local properties = nodes.properties.data
@@ -124,7 +124,7 @@ if not fontkern then -- generic
local thekern = nuts.new("kern",0) -- fontkern
local setkern = nuts.setkern
- local copy_node = nuts.copy_node
+ local copy_node = nuts.copy
fontkern = function(k)
local n = copy_node(thekern)
@@ -138,7 +138,7 @@ if not italickern then -- generic
local thekern = nuts.new("kern",3) -- italiccorrection
local setkern = nuts.setkern
- local copy_node = nuts.copy_node
+ local copy_node = nuts.copy
italickern = function(k)
local n = copy_node(thekern)
@@ -667,12 +667,12 @@ local function inject_kerns_only(head,where)
if leftkern and leftkern ~= 0 then
if prev and getid(prev) == glue_code then
if useitalickerns then
- head = insert_node_before(head,current,italickern(leftkern))
+ head = insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev, getwidth(prev) + leftkern)
end
else
- head = insert_node_before(head,current,fontkern(leftkern))
+ head = insertnodebefore(head,current,fontkern(leftkern))
end
end
end
@@ -731,7 +731,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- pre = insert_node_before(pre,n,fontkern(leftkern))
+ pre = insertnodebefore(pre,n,fontkern(leftkern))
done = true
end
end
@@ -747,7 +747,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- post = insert_node_before(post,n,fontkern(leftkern))
+ post = insertnodebefore(post,n,fontkern(leftkern))
done = true
end
end
@@ -763,7 +763,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = insert_node_before(replace,n,fontkern(leftkern))
+ replace = insertnodebefore(replace,n,fontkern(leftkern))
done = true
end
end
@@ -830,39 +830,36 @@ local function inject_positions_only(head,where)
rightkern = 0
elseif prev and getid(prev) == glue_code then
if useitalickerns then
- head = insert_node_before(head,current,italickern(leftkern))
+ head = insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev, getwidth(prev) + leftkern)
end
else
- head = insert_node_before(head,current,fontkern(leftkern))
+ head = insertnodebefore(head,current,fontkern(leftkern))
end
end
if rightkern and rightkern ~= 0 then
if next and getid(next) == glue_code then
if useitalickerns then
- insert_node_after(head,current,italickern(rightkern))
+ insertnodeafter(head,current,italickern(rightkern))
else
setwidth(next, getwidth(next) + rightkern)
end
else
- insert_node_after(head,current,fontkern(rightkern))
+ insertnodeafter(head,current,fontkern(rightkern))
end
end
- else
+ elseif next then
local i = p.emptyinjections
if i then
-- glyph|disc|glyph (special case)
local rightkern = i.rightkern
- if rightkern and rightkern ~= 0 then
- if next and getid(next) == disc_code then
- if replace then
- -- error, we expect an empty one
- else
- -- KE setfield(next,"replace",fontkern(rightkern)) -- maybe also leftkern
- replace = fontkern(rightkern) -- maybe also leftkern
- done = true --KE
- end
+ if rightkern and rightkern ~= 0 and getid(next) == disc_code then
+ local replace = getreplace(next)
+ if replace then
+ -- can't happen
+ else
+ setreplace(next,fontkern(rightkern))
end
end
end
@@ -925,12 +922,12 @@ local function inject_positions_only(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- pre = insert_node_before(pre,n,fontkern(leftkern))
+ pre = insertnodebefore(pre,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(pre,n,fontkern(rightkern))
+ insertnodeafter(pre,n,fontkern(rightkern))
done = true
end
end
@@ -950,12 +947,12 @@ local function inject_positions_only(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- post = insert_node_before(post,n,fontkern(leftkern))
+ post = insertnodebefore(post,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(post,n,fontkern(rightkern))
+ insertnodeafter(post,n,fontkern(rightkern))
done = true
end
end
@@ -975,12 +972,12 @@ local function inject_positions_only(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = insert_node_before(replace,n,fontkern(leftkern))
+ replace = insertnodebefore(replace,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(replace,n,fontkern(rightkern))
+ insertnodeafter(replace,n,fontkern(rightkern))
done = true
end
end
@@ -996,7 +993,7 @@ local function inject_positions_only(head,where)
-- glyph|pre glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- pre = insert_node_before(pre,pre,fontkern(rightkern))
+ pre = insertnodebefore(pre,pre,fontkern(rightkern))
done = true
end
end
@@ -1010,7 +1007,7 @@ local function inject_positions_only(head,where)
-- glyph|replace glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- replace = insert_node_before(replace,replace,fontkern(rightkern))
+ replace = insertnodebefore(replace,replace,fontkern(rightkern))
done = true
end
end
@@ -1144,8 +1141,8 @@ local function inject_everything(head,where)
--
-- todo: head and check for prev / next kern
--
- insert_node_before(n,n,fontkern(-wn))
- insert_node_after(n,n,fontkern(-wn))
+ insertnodebefore(n,n,fontkern(-wn))
+ insertnodeafter(n,n,fontkern(-wn))
end
end
end
@@ -1295,39 +1292,37 @@ local function inject_everything(head,where)
rightkern = 0
elseif prev and getid(prev) == glue_code then
if useitalickerns then
- head = insert_node_before(head,current,italickern(leftkern))
+ head = insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev, getwidth(prev) + leftkern)
end
else
- head = insert_node_before(head,current,fontkern(leftkern))
+ head = insertnodebefore(head,current,fontkern(leftkern))
end
end
if rightkern and rightkern ~= 0 then
if next and getid(next) == glue_code then
if useitalickerns then
- insert_node_after(head,current,italickern(rightkern))
+ insertnodeafter(head,current,italickern(rightkern))
else
setwidth(next, getwidth(next) + rightkern)
end
else
- insert_node_after(head,current,fontkern(rightkern))
+ insertnodeafter(head,current,fontkern(rightkern))
end
end
end
- else
+ elseif next then
local i = p.emptyinjections
if i then
-- glyph|disc|glyph (special case)
local rightkern = i.rightkern
- if rightkern and rightkern ~= 0 then
- if next and getid(next) == disc_code then
- if replace then
- -- error, we expect an empty one
- else
- replace = fontkern(rightkern)
- done = true
- end
+ if rightkern and rightkern ~= 0 and getid(next) == disc_code then
+ local replace = getreplace(next)
+ if replace then
+ -- can't happen
+ else
+ setreplace(next,fontkern(rightkern))
end
end
end
@@ -1406,12 +1401,12 @@ local function inject_everything(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- pre = insert_node_before(pre,n,fontkern(leftkern))
+ pre = insertnodebefore(pre,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(pre,n,fontkern(rightkern))
+ insertnodeafter(pre,n,fontkern(rightkern))
done = true
end
if hasmarks then
@@ -1437,12 +1432,12 @@ local function inject_everything(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- post = insert_node_before(post,n,fontkern(leftkern))
+ post = insertnodebefore(post,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(post,n,fontkern(rightkern))
+ insertnodeafter(post,n,fontkern(rightkern))
done = true
end
if hasmarks then
@@ -1468,12 +1463,12 @@ local function inject_everything(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = insert_node_before(replace,n,fontkern(leftkern))
+ replace = insertnodebefore(replace,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(replace,n,fontkern(rightkern))
+ insertnodeafter(replace,n,fontkern(rightkern))
done = true
end
if hasmarks then
@@ -1495,7 +1490,7 @@ local function inject_everything(head,where)
-- glyph|pre glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- pre = insert_node_before(pre,pre,fontkern(rightkern))
+ pre = insertnodebefore(pre,pre,fontkern(rightkern))
done = true
end
end
@@ -1509,7 +1504,7 @@ local function inject_everything(head,where)
-- glyph|replace glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- replace = insert_node_before(replace,replace,fontkern(rightkern))
+ replace = insertnodebefore(replace,replace,fontkern(rightkern))
done = true
end
end
@@ -1711,8 +1706,8 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("%C [%p + %p + %p] %C",prevchar,lnew,old,rnew,nextchar)
end
- head = insert_node_before(head,n,italickern(lnew))
- insert_node_after(head,n,italickern(rnew))
+ head = insertnodebefore(head,n,italickern(lnew))
+ insertnodeafter(head,n,italickern(rnew))
else
local new = old + (leftkern + rightkern) * factor
if trace_spaces then
@@ -1727,7 +1722,7 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("%C [%p + %p]",prevchar,old,new)
end
- insert_node_after(head,n,italickern(new)) -- tricky with traverse but ok
+ insertnodeafter(head,n,italickern(new)) -- tricky with traverse but ok
else
local new = old + leftkern * factor
if trace_spaces then
@@ -1746,7 +1741,7 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("[%p + %p] %C",old,new,nextchar)
end
- insert_node_after(head,n,italickern(new))
+ insertnodeafter(head,n,italickern(new))
else
local new = old + rightkern * factor
if trace_spaces then
diff --git a/macros/luatex/generic/luaotfload/fontloader-font-otl.lua b/macros/luatex/generic/luaotfload/fontloader-font-otl.lua
index 19de2bb777..4619e13dcf 100644
--- a/macros/luatex/generic/luaotfload/fontloader-font-otl.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-font-otl.lua
@@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading")
local fonts = fonts
local otf = fonts.handlers.otf
-otf.version = 3.113 -- beware: also sync font-mis.lua and in mtx-fonts
+otf.version = 3.116 -- beware: also sync font-mis.lua and in mtx-fonts
otf.cache = containers.define("fonts", "otl", otf.version, true)
otf.svgcache = containers.define("fonts", "svg", otf.version, true)
otf.pngcache = containers.define("fonts", "png", otf.version, true)
@@ -608,6 +608,7 @@ local function read_from_otf(specification)
-- this late ? .. needs checking
tfmdata.properties.name = specification.name
tfmdata.properties.sub = specification.sub
+ tfmdata.properties.id = specification.id
--
tfmdata = constructors.scale(tfmdata,specification)
local allfeatures = tfmdata.shared.features or specification.features.normal
diff --git a/macros/luatex/generic/luaotfload/fontloader-font-otr.lua b/macros/luatex/generic/luaotfload/fontloader-font-otr.lua
index 531f665de7..4b154b2563 100644
--- a/macros/luatex/generic/luaotfload/fontloader-font-otr.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-font-otr.lua
@@ -1292,8 +1292,8 @@ readers.post = function(f,fontdata,specification)
if length > 0 then
glyphs[mapping].name = readstring(f,length)
else
- report("quit post name fetching at %a of %a: %s",i,maxnames,"overflow")
- break
+ -- report("quit post name fetching at %a of %a: %s",i,maxnames,"overflow")
+ -- break
end
end
end
diff --git a/macros/luatex/generic/luaotfload/fontloader-font-ots.lua b/macros/luatex/generic/luaotfload/fontloader-font-ots.lua
index 880bcb6d50..30d79c4077 100644
--- a/macros/luatex/generic/luaotfload/fontloader-font-ots.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-font-ots.lua
@@ -213,27 +213,29 @@ local getglyphdata = nuts.getglyphdata
-- their positions because some complex ligatures might need that. For the moment we
-- use an x_ prefix because for now generic follows the other approach.
-local copy_no_components = nuts.copy_no_components
-local copy_only_glyphs = nuts.copy_only_glyphs
-local count_components = nuts.count_components
-local set_components = nuts.set_components
-local get_components = nuts.get_components
-local flush_components = nuts.flush_components
+local components = nuts.components
+local copynocomponents = components.copynocomponents
+local copyonlyglyphs = components.copyonlyglyphs
+local countcomponents = components.count
+local setcomponents = components.set
+local getcomponents = components.get
+local flushcomponents = components.flush
---------------------------------------------------------------------------------------
local ischar = nuts.ischar
-local usesfont = nuts.uses_font
+local usesfont = nuts.usesfont
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
local copy_node = nuts.copy
-local copy_node_list = nuts.copy_list
+local copy_node_list = nuts.copylist
local remove_node = nuts.remove
local find_node_tail = nuts.tail
-local flush_node_list = nuts.flush_list
-local flush_node = nuts.flush_node
-local end_of_math = nuts.end_of_math
-local start_of_par = nuts.start_of_par
+local flushnodelist = nuts.flushlist
+local flushnode = nuts.flushnode
+local endofmath = nuts.endofmath
+
+local startofpar = nuts.startofpar
local setmetatable = setmetatable
local setmetatableindex = table.setmetatableindex
@@ -317,13 +319,6 @@ local checkstep = (tracers and tracers.steppers.check) or function()
local registerstep = (tracers and tracers.steppers.register) or function() end
local registermessage = (tracers and tracers.steppers.message) or function() end
--- local function checkdisccontent(d)
--- local pre, post, replace = getdisc(d)
--- if pre then for n in traverse_id(glue_code,pre) do report("pre: %s",nodes.idstostring(pre)) break end end
--- if post then for n in traverse_id(glue_code,post) do report("pos: %s",nodes.idstostring(post)) break end end
--- if replace then for n in traverse_id(glue_code,replace) do report("rep: %s",nodes.idstostring(replace)) break end end
--- end
-
local function logprocess(...)
if trace_steps then
registermessage(...)
@@ -423,12 +418,12 @@ local function flattendisk(head,disc)
local prev, next = getboth(disc)
local ishead = head == disc
setdisc(disc)
- flush_node(disc)
+ flushnode(disc)
if pre then
- flush_node_list(pre)
+ flushnodelist(pre)
end
if post then
- flush_node_list(post)
+ flushnodelist(post)
end
if ishead then
if replace then
@@ -480,16 +475,16 @@ local function markstoligature(head,start,stop,char)
local next = getnext(stop)
setprev(start)
setnext(stop)
- local base = copy_no_components(start,copyinjection)
+ local base = copynocomponents(start,copyinjection)
if head == start then
head = base
end
resetinjection(base)
setchar(base,char)
setsubtype(base,ligatureglyph_code)
- set_components(base,start)
+ setcomponents(base,start)
setlink(prev,base,next)
- flush_components(start)
+ flushcomponents(start)
return head, base
end
end
@@ -509,7 +504,7 @@ local no_right_ligature_code = 2
local no_left_kern_code = 4
local no_right_kern_code = 8
-local has_glyph_option = node.direct.has_glyph_option or function(n,c)
+local hasglyphoption = function(n,c)
if c == no_left_ligature_code or c == no_right_ligature_code then
return getattr(n,a_noligature) == 1
else
@@ -520,7 +515,7 @@ end
-- in lmtx we need to check the components and can be slightly more clever
local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfound,hasmarks) -- brr head
- if has_glyph_option(start,no_right_ligature_code) then
+ if hasglyphoption(start,no_right_ligature_code) then
return head, start
end
if start == stop and getchar(start) == char then
@@ -533,14 +528,14 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
local comp = start
setprev(start)
setnext(stop)
- local base = copy_no_components(start,copyinjection)
+ local base = copynocomponents(start,copyinjection)
if start == head then
head = base
end
resetinjection(base)
setchar(base,char)
setsubtype(base,ligatureglyph_code)
- set_components(base,comp)
+ setcomponents(base,comp)
setlink(prev,base,next)
if not discfound then
local deletemarks = not skiphash or hasmarks
@@ -554,7 +549,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
local char = getchar(start)
if not marks[char] then
baseindex = baseindex + componentindex
- componentindex = count_components(start,marks)
+ componentindex = countcomponents(start,marks)
-- we can be more clever here: "not deletemarks or (skiphash and not skiphash[char])"
-- and such:
elseif not deletemarks then
@@ -565,7 +560,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
end
local n = copy_node(start)
copyinjection(n,start) -- is this ok ? we position later anyway
- head, current = insert_node_after(head,current,n) -- unlikely that mark has components
+ head, current = insertnodeafter(head,current,n) -- unlikely that mark has components
elseif trace_marks then
logwarning("%s: delete ligature mark %s",pref(dataset,sequence),gref(char))
end
@@ -590,7 +585,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
break
end
end
- flush_components(components)
+ flushcomponents(components)
else
-- discfound ... forget about marks .. probably no scripts that hyphenate and have marks
local discprev, discnext = getboth(discfound)
@@ -602,8 +597,8 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
if not replace then
-- looks like we never come here as it's not okay
local prev = getprev(base)
- -- local comp = get_components(base) -- already set
- local copied = copy_only_glyphs(comp)
+ -- local comp = getcomponents(base) -- already set
+ local copied = copyonlyglyphs(comp)
if pre then
setlink(discprev,pre)
else
@@ -620,7 +615,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
setlink(prev,discfound,next)
setboth(base)
-- here components have a pointer so we can't free it!
- set_components(base,copied)
+ setcomponents(base,copied)
replace = base
if forcediscretionaries then
setdisc(discfound,pre,post,replace,discretionarydisc_code)
@@ -650,7 +645,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop) -- what t
local n = copy_node(start) -- ignore components
resetinjection(n)
setchar(n,multiple[k])
- insert_node_after(head,start,n)
+ insertnodeafter(head,start,n)
start = n
end
if what == true then
@@ -661,7 +656,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop) -- what t
local n = copy_node(start) -- ignore components
resetinjection(n)
setchar(n,m)
- insert_node_after(head,start,n)
+ insertnodeafter(head,start,n)
start = n
end
end
@@ -924,7 +919,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
end
function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- if has_glyph_option(start,no_right_kern_code) then
+ if hasglyphoption(start,no_right_kern_code) then
return head, start, false
else
local startchar = getchar(start)
@@ -945,7 +940,7 @@ function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,
end
function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- if has_glyph_option(start,no_right_kern_code) then
+ if hasglyphoption(start,no_right_kern_code) then
return head, start, false
else
local snext = getnext(start)
@@ -1536,7 +1531,7 @@ end
function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex)
-- we actually should check no_left_kern_code with next
- if not has_glyph_option(start,no_right_kern_code) then
+ if not hasglyphoption(start,no_right_kern_code) then
local mapping = currentlookup.mapping
if mapping == nil then
mapping = getmapping(dataset,sequence,currentlookup)
@@ -1566,7 +1561,7 @@ end
function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) -- todo: injections ?
-- we actually should check no_left_kern_code with next
- if not has_glyph_option(start,no_right_kern_code) then
+ if not hasglyphoption(start,no_right_kern_code) then
local mapping = currentlookup.mapping
if mapping == nil then
mapping = getmapping(dataset,sequence,currentlookup)
@@ -1934,13 +1929,13 @@ local function checked(head)
if next then
setlink(kern,next)
end
- flush_node(current)
+ flushnode(current)
head = kern
current = next
else
local prev, next = getboth(current)
setlink(prev,kern,next)
- flush_node(current)
+ flushnode(current)
current = next
end
else
@@ -2480,115 +2475,247 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
-- report("no hit in %a at %i of %i contexts",sequence.type,k,nofcontexts)
goto next
end
- local s = seq.n -- or #seq
- local l = ck[5] -- last current
- local current = start
- local last = start
-
+ local s = seq.n -- or #seq
if s == 1 then
- goto next
- end
+ -- bit weird case: why use a chain, but it is a hit
+ else
+ local l = ck[5] -- last current
+ local current = start
+ local last = start
- -- current match
+ -- current match
- if l > f then
- -- before/current/after | before/current | current/after
- local discfound -- = nil
- local n = f + 1
- last = startnext -- the second in current (first already matched)
- while n <= l do
- if postreplace and not last then
- last = getnext(sweepnode)
- sweeptype = nil
- end
- if last then
- local char, id = ischar(last,currentfont)
- if char then
- if skiphash and skiphash[char] then
- skipped = true
- if trace_skips then
- show_skip(dataset,sequence,char,ck,classes[char])
- end
- last = getnext(last)
- elseif seq[n][char] then
- if n < l then
+ if l > f then
+ -- before/current/after | before/current | current/after
+ local discfound -- = nil
+ local n = f + 1
+ last = startnext -- the second in current (first already matched)
+ while n <= l do
+ if postreplace and not last then
+ last = getnext(sweepnode)
+ sweeptype = nil
+ end
+ if last then
+ local char, id = ischar(last,currentfont)
+ if char then
+ if skiphash and skiphash[char] then
+ skipped = true
+ if trace_skips then
+ show_skip(dataset,sequence,char,ck,classes[char])
+ end
last = getnext(last)
- end
- n = n + 1
- elseif discfound then
- notmatchreplace[discfound] = true
- if notmatchpre[discfound] then
- goto next
+ elseif seq[n][char] then
+ if n < l then
+ last = getnext(last)
+ end
+ n = n + 1
+ elseif discfound then
+ notmatchreplace[discfound] = true
+ if notmatchpre[discfound] then
+ goto next
+ else
+ break
+ end
else
- break
- end
- else
- goto next
- end
- elseif char == false then
- if discfound then
- notmatchreplace[discfound] = true
- if notmatchpre[discfound] then
goto next
+ end
+ elseif char == false then
+ if discfound then
+ notmatchreplace[discfound] = true
+ if notmatchpre[discfound] then
+ goto next
+ else
+ break
+ end
else
- break
+ goto next
end
- else
- goto next
- end
- elseif id == disc_code then
- -- elseif id == disc_code and (not discs or discs[last]) then
- discseen = true
- discfound = last
- notmatchpre[last] = nil
- notmatchpost[last] = true
- notmatchreplace[last] = nil
- local pre, post, replace = getdisc(last)
- if pre then
- local n = n
- while pre do
- if seq[n][getchar(pre)] then
- n = n + 1
- if n > l then
+ elseif id == disc_code then
+ -- elseif id == disc_code and (not discs or discs[last]) then
+ discseen = true
+ discfound = last
+ notmatchpre[last] = nil
+ notmatchpost[last] = true
+ notmatchreplace[last] = nil
+ local pre, post, replace = getdisc(last)
+ if pre then
+ local n = n
+ while pre do
+ if seq[n][getchar(pre)] then
+ n = n + 1
+ if n > l then
+ break
+ end
+ pre = getnext(pre)
+ else
+ notmatchpre[last] = true
break
end
- pre = getnext(pre)
- else
+ end
+ if n <= l then
notmatchpre[last] = true
- break
end
- end
- if n <= l then
+ else
notmatchpre[last] = true
end
+ if replace then
+ -- so far we never entered this branch
+ while replace do
+ if seq[n][getchar(replace)] then
+ n = n + 1
+ if n > l then
+ break
+ end
+ replace = getnext(replace)
+ else
+ notmatchreplace[last] = true
+ if notmatchpre[last] then
+ goto next
+ else
+ break
+ end
+ end
+ end
+ -- why here again
+ if notmatchpre[last] then
+ goto next
+ end
+ end
+ -- maybe only if match
+ last = getnext(last)
else
- notmatchpre[last] = true
+ goto next
end
- if replace then
- -- so far we never entered this branch
- while replace do
- if seq[n][getchar(replace)] then
- n = n + 1
- if n > l then
- break
+ else
+ goto next
+ end
+ end
+ end
+
+ -- before
+
+ if f > 1 then
+ if startprev then
+ local prev = startprev
+ if prereplace and prev == checkdisc then
+ prev = getprev(sweepnode)
+ end
+ if prev then
+ local discfound -- = nil
+ local n = f - 1
+ while n >= 1 do
+ if prev then
+ local char, id = ischar(prev,currentfont)
+ if char then
+ if skiphash and skiphash[char] then
+ skipped = true
+ if trace_skips then
+ show_skip(dataset,sequence,char,ck,classes[char])
+ end
+ prev = getprev(prev)
+ elseif seq[n][char] then
+ if n > 1 then
+ prev = getprev(prev)
+ end
+ n = n - 1
+ elseif discfound then
+ notmatchreplace[discfound] = true
+ if notmatchpost[discfound] then
+ goto next
+ else
+ break
+ end
+ else
+ goto next
end
- replace = getnext(replace)
- else
- notmatchreplace[last] = true
- if notmatchpre[last] then
+ elseif char == false then
+ if discfound then
+ notmatchreplace[discfound] = true
+ if notmatchpost[discfound] then
+ goto next
+ end
+ else
goto next
+ end
+ break
+ elseif id == disc_code then
+ -- elseif id == disc_code and (not discs or discs[prev]) then
+ -- the special case: f i where i becomes dottless i ..
+ discseen = true
+ discfound = prev
+ notmatchpre[prev] = true
+ notmatchpost[prev] = nil
+ notmatchreplace[prev] = nil
+ local pre, post, replace, pretail, posttail, replacetail = getdisc(prev,true)
+ -- weird test: needs checking
+ if pre ~= start and post ~= start and replace ~= start then
+ if post then
+ local n = n
+ while posttail do
+ if seq[n][getchar(posttail)] then
+ n = n - 1
+ if posttail == post or n < 1 then
+ break
+ else
+ posttail = getprev(posttail)
+ end
+ else
+ notmatchpost[prev] = true
+ break
+ end
+ end
+ if n >= 1 then
+ notmatchpost[prev] = true
+ end
+ else
+ notmatchpost[prev] = true
+ end
+ if replace then
+ -- we seldom enter this branch (e.g. on brill efficient)
+ while replacetail do
+ if seq[n][getchar(replacetail)] then
+ n = n - 1
+ if replacetail == replace or n < 1 then
+ break
+ else
+ replacetail = getprev(replacetail)
+ end
+ else
+ notmatchreplace[prev] = true
+ if notmatchpost[prev] then
+ goto next
+ else
+ break
+ end
+ end
+ end
+ else
+ -- notmatchreplace[prev] = true -- not according to Kai
+ end
+ end
+ prev = getprev(prev)
+ -- elseif id == glue_code and seq[n][32] and isspace(prev,threshold,id) then
+ -- elseif seq[n][32] and spaces[prev] then
+ -- n = n - 1
+ -- prev = getprev(prev)
+ elseif id == glue_code then
+ local sn = seq[n]
+ if (sn[32] and spaces[prev]) or sn[0xFFFC] then
+ n = n - 1
+ prev = getprev(prev)
else
- break
+ goto next
end
+ elseif seq[n][0xFFFC] then
+ n = n - 1
+ prev = getprev(prev)
+ else
+ goto next
end
- end
- -- why here again
- if notmatchpre[last] then
+ else
goto next
end
end
- -- maybe only if match
- last = getnext(last)
else
goto next
end
@@ -2596,37 +2723,35 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
goto next
end
end
- end
- -- before
+ -- after
- if f > 1 then
- if startprev then
- local prev = startprev
- if prereplace and prev == checkdisc then
- prev = getprev(sweepnode)
+ if s > l then
+ local current = last and getnext(last)
+ if not current and postreplace then
+ current = getnext(sweepnode)
end
- if prev then
+ if current then
local discfound -- = nil
- local n = f - 1
- while n >= 1 do
- if prev then
- local char, id = ischar(prev,currentfont)
+ local n = l + 1
+ while n <= s do
+ if current then
+ local char, id = ischar(current,currentfont)
if char then
if skiphash and skiphash[char] then
skipped = true
if trace_skips then
show_skip(dataset,sequence,char,ck,classes[char])
end
- prev = getprev(prev)
+ current = getnext(current) -- was absent
elseif seq[n][char] then
- if n > 1 then
- prev = getprev(prev)
+ if n < s then -- new test
+ current = getnext(current) -- was absent
end
- n = n - 1
+ n = n + 1
elseif discfound then
notmatchreplace[discfound] = true
- if notmatchpost[discfound] then
+ if notmatchpre[discfound] then
goto next
else
break
@@ -2637,217 +2762,87 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
elseif char == false then
if discfound then
notmatchreplace[discfound] = true
- if notmatchpost[discfound] then
+ if notmatchpre[discfound] then
goto next
+ else
+ break
end
else
goto next
end
- break
elseif id == disc_code then
- -- elseif id == disc_code and (not discs or discs[prev]) then
- -- the special case: f i where i becomes dottless i ..
- discseen = true
- discfound = prev
- notmatchpre[prev] = true
- notmatchpost[prev] = nil
- notmatchreplace[prev] = nil
- local pre, post, replace, pretail, posttail, replacetail = getdisc(prev,true)
- -- weird test: needs checking
- if pre ~= start and post ~= start and replace ~= start then
- if post then
- local n = n
- while posttail do
- if seq[n][getchar(posttail)] then
- n = n - 1
- if posttail == post or n < 1 then
- break
- else
- posttail = getprev(posttail)
- end
- else
- notmatchpost[prev] = true
+ -- elseif id == disc_code and (not discs or discs[current]) then
+ discseen = true
+ discfound = current
+ notmatchpre[current] = nil
+ notmatchpost[current] = true
+ notmatchreplace[current] = nil
+ local pre, post, replace = getdisc(current)
+ if pre then
+ local n = n
+ while pre do
+ if seq[n][getchar(pre)] then
+ n = n + 1
+ if n > s then
break
+ else
+ pre = getnext(pre)
end
+ else
+ notmatchpre[current] = true
+ break
end
- if n >= 1 then
- notmatchpost[prev] = true
- end
- else
- notmatchpost[prev] = true
end
- if replace then
- -- we seldom enter this branch (e.g. on brill efficient)
- while replacetail do
- if seq[n][getchar(replacetail)] then
- n = n - 1
- if replacetail == replace or n < 1 then
- break
- else
- replacetail = getprev(replacetail)
- end
+ if n <= s then
+ notmatchpre[current] = true
+ end
+ else
+ notmatchpre[current] = true
+ end
+ if replace then
+ -- so far we never entered this branch
+ while replace do
+ if seq[n][getchar(replace)] then
+ n = n + 1
+ if n > s then
+ break
else
- notmatchreplace[prev] = true
- if notmatchpost[prev] then
- goto next
- else
- break
- end
+ replace = getnext(replace)
+ end
+ else
+ notmatchreplace[current] = true
+ if notmatchpre[current] then
+ goto next
+ else
+ break
end
end
- else
- -- notmatchreplace[prev] = true -- not according to Kai
end
+ else
+ -- notmatchreplace[current] = true -- not according to Kai
end
- prev = getprev(prev)
- -- elseif id == glue_code and seq[n][32] and isspace(prev,threshold,id) then
- -- elseif seq[n][32] and spaces[prev] then
- -- n = n - 1
- -- prev = getprev(prev)
+ current = getnext(current)
elseif id == glue_code then
local sn = seq[n]
- if (sn[32] and spaces[prev]) or sn[0xFFFC] then
- n = n - 1
- prev = getprev(prev)
+ if (sn[32] and spaces[current]) or sn[0xFFFC] then
+ n = n + 1
+ current = getnext(current)
else
goto next
end
elseif seq[n][0xFFFC] then
- n = n - 1
- prev = getprev(prev)
- else
- goto next
- end
- else
- goto next
- end
- end
- else
- goto next
- end
- else
- goto next
- end
- end
-
- -- after
-
- if s > l then
- local current = last and getnext(last)
- if not current and postreplace then
- current = getnext(sweepnode)
- end
- if current then
- local discfound -- = nil
- local n = l + 1
- while n <= s do
- if current then
- local char, id = ischar(current,currentfont)
- if char then
- if skiphash and skiphash[char] then
- skipped = true
- if trace_skips then
- show_skip(dataset,sequence,char,ck,classes[char])
- end
- current = getnext(current) -- was absent
- elseif seq[n][char] then
- if n < s then -- new test
- current = getnext(current) -- was absent
- end
- n = n + 1
- elseif discfound then
- notmatchreplace[discfound] = true
- if notmatchpre[discfound] then
- goto next
- else
- break
- end
- else
- goto next
- end
- elseif char == false then
- if discfound then
- notmatchreplace[discfound] = true
- if notmatchpre[discfound] then
- goto next
- else
- break
- end
- else
- goto next
- end
- elseif id == disc_code then
- -- elseif id == disc_code and (not discs or discs[current]) then
- discseen = true
- discfound = current
- notmatchpre[current] = nil
- notmatchpost[current] = true
- notmatchreplace[current] = nil
- local pre, post, replace = getdisc(current)
- if pre then
- local n = n
- while pre do
- if seq[n][getchar(pre)] then
- n = n + 1
- if n > s then
- break
- else
- pre = getnext(pre)
- end
- else
- notmatchpre[current] = true
- break
- end
- end
- if n <= s then
- notmatchpre[current] = true
- end
- else
- notmatchpre[current] = true
- end
- if replace then
- -- so far we never entered this branch
- while replace do
- if seq[n][getchar(replace)] then
- n = n + 1
- if n > s then
- break
- else
- replace = getnext(replace)
- end
- else
- notmatchreplace[current] = true
- if notmatchpre[current] then
- goto next
- else
- break
- end
- end
- end
- else
- -- notmatchreplace[current] = true -- not according to Kai
- end
- current = getnext(current)
- elseif id == glue_code then
- local sn = seq[n]
- if (sn[32] and spaces[current]) or sn[0xFFFC] then
n = n + 1
current = getnext(current)
else
goto next
end
- elseif seq[n][0xFFFC] then
- n = n + 1
- current = getnext(current)
else
goto next
end
- else
- goto next
end
+ else
+ goto next
end
- else
- goto next
end
end
@@ -3795,7 +3790,7 @@ do
local initialrl = 0
- if getid(head) == par_code and start_of_par(head) then
+ if getid(head) == par_code and startofpar(head) then
initialrl = pardirstate(head)
elseif direction == righttoleft_code then
initialrl = -1
@@ -3945,11 +3940,11 @@ do
start = getnext(start)
end
elseif id == math_code then
- start = getnext(end_of_math(start))
+ start = getnext(endofmath(start))
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = getnext(start)
- -- elseif id == par_code and start_of_par(start) then
+ -- elseif id == par_code and startofpar(start) then
-- rlparmode, rlmode = pardirstate(start)
-- start = getnext(start)
else
@@ -4029,11 +4024,11 @@ do
start = getnext(start)
end
elseif id == math_code then
- start = getnext(end_of_math(start))
+ start = getnext(endofmath(start))
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = getnext(start)
- -- elseif id == par_code and start_of_par(start) then
+ -- elseif id == par_code and startofpar(start) then
-- rlparmode, rlmode = pardirstate(start)
-- start = getnext(start)
else
@@ -4140,11 +4135,11 @@ do
-- a different font|state or glue (happens often)
start = getnext(start)
elseif id == math_code then
- start = getnext(end_of_math(start))
+ start = getnext(endofmath(start))
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = getnext(start)
- -- elseif id == par_code and start_of_par(start) then
+ -- elseif id == par_code and startofpar(start) then
-- rlparmode, rlmode = pardirstate(start)
-- start = getnext(start)
else
@@ -4161,49 +4156,60 @@ end
-- so far
-local plugins = { }
-otf.plugins = plugins
+do
-local report = logs.reporter("fonts")
+ local plugins = { }
+ otf.plugins = plugins
-function otf.registerplugin(name,f)
- if type(name) == "string" and type(f) == "function" then
- plugins[name] = { name, f }
- report()
- report("plugin %a has been loaded, please be aware of possible side effects",name)
- report()
- if logs.pushtarget then
- logs.pushtarget("log")
- end
- report("Plugins are not officially supported unless stated otherwise. This is because")
- report("they bypass the regular font handling and therefore some features in ConTeXt")
- report("(especially those related to fonts) might not work as expected or might not work")
- report("at all. Some plugins are for testing and development only and might change")
- report("whenever we feel the need for it.")
- report()
- if logs.poptarget then
- logs.poptarget()
+ local report = logs.reporter("fonts")
+ local warned = false
+ local okay = { text = true }
+
+ function otf.registerplugin(name,f)
+ if type(name) == "string" and type(f) == "function" then
+ plugins[name] = { name, f }
+ if okay[name] then
+ -- no warning (e.g. the diagnostic text plugin)
+ else
+ report("plugin %a has been loaded, please be aware of possible side effects",name)
+ if not warned then
+ if logs.pushtarget then
+ logs.pushtarget("log")
+ end
+ report("Plugins are not officially supported unless stated otherwise. This is because")
+ report("they bypass the regular font handling and therefore some features in ConTeXt")
+ report("(especially those related to fonts) might not work as expected or might not work")
+ report("at all. Some plugins are for testing and development only and might change")
+ report("whenever we feel the need for it.")
+ report()
+ if logs.poptarget then
+ logs.poptarget()
+ end
+ warned = true
+ end
+ end
end
end
-end
-function otf.plugininitializer(tfmdata,value)
- if type(value) == "string" then
- tfmdata.shared.plugin = plugins[value]
+ function otf.plugininitializer(tfmdata,value)
+ if type(value) == "string" then
+ tfmdata.shared.plugin = plugins[value]
+ end
end
-end
-function otf.pluginprocessor(head,font,attr,direction) -- n
- local s = fontdata[font].shared
- local p = s and s.plugin
- if p then
- if trace_plugins then
- report_process("applying plugin %a",p[1])
+ function otf.pluginprocessor(head,font,dynamic,direction) -- n
+ local s = fontdata[font].shared
+ local p = s and s.plugin
+ if p then
+ if trace_plugins then
+ report_process("applying plugin %a",p[1])
+ end
+ return p[2](head,font,dynamic,direction)
+ else
+ return head, false
end
- return p[2](head,font,attr,direction)
- else
- return head, false
end
+
end
function otf.featuresinitializer(tfmdata,value)
diff --git a/macros/luatex/generic/luaotfload/fontloader-font-ott.lua b/macros/luatex/generic/luaotfload/fontloader-font-ott.lua
index f4d7e05a13..aa1defd6a1 100644
--- a/macros/luatex/generic/luaotfload/fontloader-font-ott.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-font-ott.lua
@@ -821,13 +821,13 @@ local features = allocate {
["dist"] = "distances",
["dlig"] = "discretionary ligatures",
["dnom"] = "denominators",
- ["dtls"] = "dotless forms", -- math
+ ["dtls"] = "dotless forms", -- math
["expt"] = "expert forms",
["falt"] = "final glyph alternates",
["fin2"] = "terminal forms #2",
["fin3"] = "terminal forms #3",
["fina"] = "terminal forms",
- ["flac"] = "flattened accents over capitals", -- math
+ ["flac"] = "flattened accents over capitals", -- math
["frac"] = "fractions",
["fwid"] = "full width",
["half"] = "half forms",
@@ -836,7 +836,7 @@ local features = allocate {
["hist"] = "historical forms",
["hkna"] = "horizontal kana alternates",
["hlig"] = "historical ligatures",
- ["hngl"] = "hangul",
+ ["hngl"] = "hangul", -- depricated
["hojo"] = "hojo kanji forms",
["hwid"] = "half width",
["init"] = "initial forms",
diff --git a/macros/luatex/generic/luaotfload/fontloader-font-oup.lua b/macros/luatex/generic/luaotfload/fontloader-font-oup.lua
index 2c49bc993f..c93ad47438 100644
--- a/macros/luatex/generic/luaotfload/fontloader-font-oup.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-font-oup.lua
@@ -2564,6 +2564,34 @@ end
-- Because we pack we cannot mix tables and numbers so we can only turn a whole set in
-- format kern instead of pair.
+local strip_pairs = true
+
+local compact_pairs = true
+local compact_singles = true
+
+local merge_pairs = true
+local merge_singles = true
+local merge_substitutions = true
+local merge_alternates = true
+local merge_multiples = true
+local merge_ligatures = true
+local merge_cursives = true
+local merge_marks = true
+
+directives.register("otf.strip.pairs", function(v) strip_pairs = v end)
+
+directives.register("otf.compact.pairs", function(v) compact_pairs = v end)
+directives.register("otf.compact.singles", function(v) compact_singles = v end)
+
+directives.register("otf.merge.pairs", function(v) merge_pairs = v end)
+directives.register("otf.merge.singles", function(v) merge_singles = v end)
+directives.register("otf.merge.substitutions", function(v) merge_substitutions = v end)
+directives.register("otf.merge.alternates", function(v) merge_alternates = v end)
+directives.register("otf.merge.multiples", function(v) merge_multiples = v end)
+directives.register("otf.merge.ligatures", function(v) merge_ligatures = v end)
+directives.register("otf.merge.cursives", function(v) merge_cursives = v end)
+directives.register("otf.merge.marks", function(v) merge_marks = v end)
+
local function checkpairs(lookup)
local steps = lookup.steps
local nofsteps = lookup.nofsteps
@@ -2581,6 +2609,7 @@ local function checkpairs(lookup)
if v == true then
-- all zero
elseif v and (v[1] ~= 0 or v[2] ~= 0 or v[4] ~= 0) then
+ -- complex kerns
return false
end
end
@@ -2617,29 +2646,39 @@ local function checkpairs(lookup)
return kerned
end
-local compact_pairs = true
-local compact_singles = true
-
-local merge_pairs = true
-local merge_singles = true
-local merge_substitutions = true
-local merge_alternates = true
-local merge_multiples = true
-local merge_ligatures = true
-local merge_cursives = true
-local merge_marks = true
-
-directives.register("otf.compact.pairs", function(v) compact_pairs = v end)
-directives.register("otf.compact.singles", function(v) compact_singles = v end)
+local function strippairs(lookup)
+ local steps = lookup.steps
+ local nofsteps = lookup.nofsteps
+ local stripped = 0
-directives.register("otf.merge.pairs", function(v) merge_pairs = v end)
-directives.register("otf.merge.singles", function(v) merge_singles = v end)
-directives.register("otf.merge.substitutions", function(v) merge_substitutions = v end)
-directives.register("otf.merge.alternates", function(v) merge_alternates = v end)
-directives.register("otf.merge.multiples", function(v) merge_multiples = v end)
-directives.register("otf.merge.ligatures", function(v) merge_ligatures = v end)
-directives.register("otf.merge.cursives", function(v) merge_cursives = v end)
-directives.register("otf.merge.marks", function(v) merge_marks = v end)
+ for i=1,nofsteps do
+ local step = steps[i]
+ if step.format == "pair" then
+ local coverage = step.coverage
+ for g1, d1 in next, coverage do
+ for g2, d2 in next, d1 do
+ if d2[2] then
+ --- true or { a, b, c, d }
+ -- else
+ -- local v = d2[1]
+ -- if v == true then
+ -- d1[g2] = nil
+ -- stripped = stripped + 1
+ -- elseif v and (v[1] == 0 and v[2] == 0 and v[4] == 0) then -- vkrn can have v[3] ~= 0
+ -- d1[g2] = nil
+ -- stripped = stripped + 1
+ -- end
+ -- end
+ elseif d2[1] == true then
+ d1[g2] = nil
+ stripped = stripped + 1
+ end
+ end
+ end
+ end
+ end
+ return stripped
+end
function readers.compact(data)
if not data or data.compacted then
@@ -2648,6 +2687,7 @@ function readers.compact(data)
data.compacted = true
end
local resources = data.resources
+ local stripped = 0
local merged = 0
local kerned = 0
local allsteps = 0
@@ -2678,6 +2718,7 @@ function readers.compact(data)
merged = merged + mergesteps_4(lookup)
end
elseif kind == "gpos_single" then
+ -- maybe also strip zeros here
if merge_singles then
merged = merged + mergesteps_1(lookup,true)
end
@@ -2685,6 +2726,9 @@ function readers.compact(data)
kerned = kerned + checkkerns(lookup)
end
elseif kind == "gpos_pair" then
+ if strip_pairs then
+ stripped = stripped + strippairs(lookup) -- noto cjk from 24M -> 8 M
+ end
if merge_pairs then
merged = merged + mergesteps_2(lookup)
end
@@ -2726,6 +2770,9 @@ function readers.compact(data)
compact("sequences")
compact("sublookups")
if trace_optimizations then
+ if stripped > 0 then
+ report_optimizations("%i zero positions stripped before merging",stripped)
+ end
if merged > 0 then
report_optimizations("%i steps of %i removed due to merging",merged,allsteps)
end
diff --git a/macros/luatex/generic/luaotfload/fontloader-font-shp.lua b/macros/luatex/generic/luaotfload/fontloader-font-shp.lua
index 78e8597b93..ecf0c94180 100644
--- a/macros/luatex/generic/luaotfload/fontloader-font-shp.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-font-shp.lua
@@ -17,7 +17,7 @@ local pfb = fonts.handlers.pfb
local hashes = fonts.hashes
local identifiers = hashes.identifiers
-local version = 0.009
+local version = 0.010
local shapescache = containers.define("fonts", "shapes", version, true)
local streamscache = containers.define("fonts", "streams", version, true)
diff --git a/macros/luatex/generic/luaotfload/fontloader-fonts-gbn.lua b/macros/luatex/generic/luaotfload/fontloader-fonts-gbn.lua
index 53be41c7ed..d690ee567d 100644
--- a/macros/luatex/generic/luaotfload/fontloader-fonts-gbn.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-fonts-gbn.lua
@@ -17,27 +17,27 @@ local next = next
local fonts = fonts
local nodes = nodes
-local nuts = nodes.nuts -- context abstraction of direct nodes
+local nuts = nodes.nuts -- context abstraction of direct nodes
-local traverse_id = nuts.traverse_id
-local flush_node = nuts.flush_node
+local traverseid = nuts.traverseid
+local flushnode = nuts.flushnode
-local glyph_code = nodes.nodecodes.glyph
-local disc_code = nodes.nodecodes.disc
+local glyph_code = nodes.nodecodes.glyph
+local disc_code = nodes.nodecodes.disc
-local tonode = nuts.tonode
-local tonut = nuts.tonut
+local tonode = nuts.tonode
+local tonut = nuts.tonut
-local getfont = nuts.getfont
-local getchar = nuts.getchar
-local getid = nuts.getid
-local getboth = nuts.getboth
-local getprev = nuts.getprev
-local getnext = nuts.getnext
-local getdisc = nuts.getdisc
-local setchar = nuts.setchar
-local setlink = nuts.setlink
-local setprev = nuts.setprev
+local getfont = nuts.getfont
+local getchar = nuts.getchar
+local getid = nuts.getid
+local getboth = nuts.getboth
+local getprev = nuts.getprev
+local getnext = nuts.getnext
+local getdisc = nuts.getdisc
+local setchar = nuts.setchar
+local setlink = nuts.setlink
+local setprev = nuts.setprev
-- from now on we apply ligaturing and kerning here because it might interfere with complex
-- opentype discretionary handling where the base ligature pass expect some weird extra
@@ -99,7 +99,7 @@ local function nodepass(head,groupcode,size,packtype,direction)
local variants = nil
local redundant = nil
local nofused = 0
- for n in traverse_id(glyph_code,head) do
+ for n in traverseid(glyph_code,head) do
local font = getfont(n)
if font ~= prevfont then
if basefont then
@@ -178,13 +178,13 @@ local function nodepass(head,groupcode,size,packtype,direction)
end
end
end
- flush_node(r)
+ flushnode(r)
end
end
- for d in traverse_id(disc_code,head) do
+ for d in traverseid(disc_code,head) do
local _, _, r = getdisc(d)
if r then
- for n in traverse_id(glyph_code,r) do
+ for n in traverseid(glyph_code,r) do
local font = getfont(n)
if font ~= prevfont then
prevfont = font
@@ -254,7 +254,7 @@ local function basepass(head)
return head
end
-local protectpass = node.direct.protect_glyphs
+local protectpass = node.direct.protectglyphs or node.direct.protect_glyphs
local injectpass = nodes.injections.handler
-- This is the only official public interface and this one can be hooked into a callback (chain) and
diff --git a/macros/luatex/generic/luaotfload/fontloader-l-lpeg.lua b/macros/luatex/generic/luaotfload/fontloader-l-lpeg.lua
index b0868ba488..50306e4ab6 100644
--- a/macros/luatex/generic/luaotfload/fontloader-l-lpeg.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-l-lpeg.lua
@@ -507,7 +507,7 @@ end
-- todo: cache when string
-function lpeg.replacer(one,two,makefunction,isutf) -- in principle we should sort the keys
+function lpeg.replacer(one,two,makefunction,isutf) -- in principle we should sort the keys but we have a better one anyway
local pattern
local u = isutf and utf8char or 1
if type(one) == "table" then
diff --git a/macros/luatex/generic/luaotfload/fontloader-reference.lua b/macros/luatex/generic/luaotfload/fontloader-reference.lua
index dde25ac75d..59cbd9ef8c 100644
--- a/macros/luatex/generic/luaotfload/fontloader-reference.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-reference.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 2021-01-07 16:56
+-- merge date : 2021-05-20 15:57
do -- begin closure to overcome local limits and interference
@@ -3158,25 +3158,59 @@ local function points(n)
n=n*ptf
if n%1==0 then
return format("%ipt",n)
+ else
+ return lpegmatch(stripzeros,format("%.5fpt",n))
+ end
+end
+local function nupoints(n)
+ if n==0 then
+ return "0"
+ end
+ n=tonumber(n)
+ if not n or n==0 then
+ return "0"
+ end
+ n=n*ptf
+ if n%1==0 then
+ return format("%i",n)
+ else
+ return format("%.5f",n)
end
- return lpegmatch(stripzeros,format("%.5fpt",n))
end
local function basepoints(n)
if n==0 then
- return "0pt"
+ return "0bp"
end
n=tonumber(n)
if not n or n==0 then
- return "0pt"
+ return "0bp"
end
n=n*bpf
if n%1==0 then
return format("%ibp",n)
+ else
+ return lpegmatch(stripzeros,format("%.5fbp",n))
+ end
+end
+local function nubasepoints(n)
+ if n==0 then
+ return "0"
+ end
+ n=tonumber(n)
+ if not n or n==0 then
+ return "0"
+ end
+ n=n*bpf
+ if n%1==0 then
+ return format("%i",n)
+ else
+ return format("%.5f",n)
end
- return lpegmatch(stripzeros,format("%.5fbp",n))
end
number.points=points
+number.nupoints=nupoints
number.basepoints=basepoints
+number.nubasepoints=nubasepoints
local rubish=spaceortab^0*newline
local anyrubish=spaceortab+newline
local stripped=(spaceortab^1/"")*newline
@@ -3454,7 +3488,9 @@ local environment={
concat=table.concat,
signed=number.signed,
points=number.points,
+ nupoints=number.nupoints,
basepoints=number.basepoints,
+ nubasepoints=number.nubasepoints,
utfchar=utf.char,
utfbyte=utf.byte,
lpegmatch=lpeg.match,
@@ -3649,10 +3685,18 @@ local format_p=function()
n=n+1
return format("points(a%s)",n)
end
+local format_P=function()
+ n=n+1
+ return format("nupoints(a%s)",n)
+end
local format_b=function()
n=n+1
return format("basepoints(a%s)",n)
end
+local format_B=function()
+ n=n+1
+ return format("nubasepoints(a%s)",n)
+end
local format_t=function(f)
n=n+1
if f and f~="" then
@@ -3805,7 +3849,7 @@ local builder=Cs { "start",
+V("n")
+V("N")
+V("k")
-+V("r")+V("h")+V("H")+V("u")+V("U")+V("p")+V("b")+V("t")+V("T")+V("l")+V("L")+V("I")+V("w")
++V("r")+V("h")+V("H")+V("u")+V("U")+V("p")+V("P")+V("b")+V("B")+V("t")+V("T")+V("l")+V("L")+V("I")+V("w")
+V("W")
+V("a")
+V("A")
@@ -3843,7 +3887,9 @@ local builder=Cs { "start",
["u"]=(prefix_any*P("u"))/format_u,
["U"]=(prefix_any*P("U"))/format_U,
["p"]=(prefix_any*P("p"))/format_p,
+ ["P"]=(prefix_any*P("P"))/format_P,
["b"]=(prefix_any*P("b"))/format_b,
+ ["B"]=(prefix_any*P("B"))/format_B,
["t"]=(prefix_tab*P("t"))/format_t,
["T"]=(prefix_tab*P("T"))/format_T,
["l"]=(prefix_any*P("l"))/format_l,
@@ -4915,8 +4961,8 @@ nodes.nodecodes=nodecodes
nodes.glyphcodes=glyphcodes
nodes.disccodes=disccodes
nodes.dirvalues={ lefttoright=0,righttoleft=1 }
-nodes.handlers.protectglyphs=node.protect_glyphs
-nodes.handlers.unprotectglyphs=node.unprotect_glyphs
+nodes.handlers.protectglyphs=node.protectglyphs or node.protect_glyphs
+nodes.handlers.unprotectglyphs=node.unprotectglyphs or node.unprotect_glyphs
local direct=node.direct
local nuts={}
nodes.nuts=nuts
@@ -4960,31 +5006,33 @@ nuts.setprev=direct.setprev
nuts.setsplit=direct.setsplit
nuts.setsubtype=direct.setsubtype
nuts.setwidth=direct.setwidth
-nuts.getglyphdata=nuts.getattr
-nuts.setglyphdata=nuts.setattr
-nuts.ischar=direct.is_char
-nuts.isglyph=direct.is_glyph
+nuts.getglyphdata=nuts.getattribute or nuts.getattr
+nuts.setglyphdata=nuts.setattribute or nuts.setattr
+nuts.ischar=direct.ischar or direct.is_char
+nuts.isglyph=direct.isglyph or direct.is_glyph
nuts.copy=direct.copy
-nuts.copy_list=direct.copy_list
-nuts.copy_node=direct.copy
-nuts.end_of_math=direct.end_of_math
+nuts.copynode=direct.copy
+nuts.copylist=direct.copylist or direct.copy_list
+nuts.endofmath=direct.endofmath or direct.end_of_math
nuts.flush=direct.flush
-nuts.flush_list=direct.flush_list
-nuts.flush_node=direct.flush_node
+nuts.flushlist=direct.flushlist or direct.flush_list
+nuts.flushnode=direct.flushnode or direct.flush_node
nuts.free=direct.free
-nuts.insert_after=direct.insert_after
-nuts.insert_before=direct.insert_before
-nuts.is_node=direct.is_node
+nuts.insertafter=direct.insertafter or direct.insert_after
+nuts.insertbefore=direct.insertbefore or direct.insert_before
+nuts.isnode=direct.isnode or direct.is_node
+nuts.isdirect=direct.isdirect or direct.is_direct
+nuts.isnut=direct.isdirect or direct.is_direct
nuts.kerning=direct.kerning
nuts.ligaturing=direct.ligaturing
nuts.new=direct.new
nuts.remove=direct.remove
nuts.tail=direct.tail
nuts.traverse=direct.traverse
-nuts.traverse_char=direct.traverse_char
-nuts.traverse_glyph=direct.traverse_glyph
-nuts.traverse_id=direct.traverse_id
-local propertydata=direct.get_properties_table()
+nuts.traversechar=direct.traversechar or direct.traverse_char
+nuts.traverseglyph=direct.traverseglyph or direct.traverse_glyph
+nuts.traverseid=direct.traverseid or direct.traverse_id
+local propertydata=(direct.getpropertiestable or direct.get_properties_table)()
nodes.properties={ data=propertydata }
if direct.set_properties_mode then
direct.set_properties_mode(true,true)
@@ -5017,10 +5065,10 @@ local setfield=nuts.setfield
local getsubtype=nuts.getsubtype
local isglyph=nuts.isglyph
local find_tail=nuts.tail
-local flush_list=nuts.flush_list
-local flush_node=nuts.flush_node
-local traverse_id=nuts.traverse_id
-local copy_node=nuts.copy_node
+local flushlist=nuts.flushlist
+local flushnode=nuts.flushnode
+local traverseid=nuts.traverseid
+local copynode=nuts.copynode
local glyph_code=nodes.nodecodes.glyph
local ligature_code=nodes.glyphcodes.ligature
do
@@ -5033,31 +5081,31 @@ do
end
end
do
- local get_components=node.direct.getcomponents
- local set_components=node.direct.setcomponents
- local function copy_no_components(g,copyinjection)
- local components=get_components(g)
+ local getcomponents=node.direct.getcomponents
+ local setcomponents=node.direct.setcomponents
+ local function copynocomponents(g,copyinjection)
+ local components=getcomponents(g)
if components then
- set_components(g)
- local n=copy_node(g)
+ setcomponents(g)
+ local n=copynode(g)
if copyinjection then
copyinjection(n,g)
end
- set_components(g,components)
+ setcomponents(g,components)
return n
else
- local n=copy_node(g)
+ local n=copynode(g)
if copyinjection then
copyinjection(n,g)
end
return n
end
end
- local function copy_only_glyphs(current)
+ local function copyonlyglyphs(current)
local head=nil
local previous=nil
- for n in traverse_id(glyph_code,current) do
- n=copy_node(n)
+ for n in traverseid(glyph_code,current) do
+ n=copynode(n)
if head then
setlink(previous,n)
else
@@ -5067,14 +5115,14 @@ do
end
return head
end
- local function count_components(start,marks)
+ local function countcomponents(start,marks)
local char=isglyph(start)
if char then
if getsubtype(start)==ligature_code then
local n=0
- local components=get_components(start)
+ local components=getcomponents(start)
while components do
- n=n+count_components(components,marks)
+ n=n+countcomponents(components,marks)
components=getnext(components)
end
return n
@@ -5084,24 +5132,26 @@ do
end
return 0
end
- local function flush_components()
+ local function flushcomponents()
end
- nuts.set_components=set_components
- nuts.get_components=get_components
- nuts.copy_only_glyphs=copy_only_glyphs
- nuts.copy_no_components=copy_no_components
- nuts.count_components=count_components
- nuts.flush_components=flush_components
+ nuts.components={
+ set=setcomponents,
+ get=getcomponents,
+ copyonlyglyphs=copyonlyglyphs,
+ copynocomponents=copynocomponents,
+ count=countcomponents,
+ flush=flushcomponents,
+ }
end
-nuts.uses_font=direct.uses_font
+nuts.usesfont=direct.usesfont or direct.uses_font
do
local dummy=tonut(node.new("glyph"))
nuts.traversers={
- glyph=nuts.traverse_id(nodecodes.glyph,dummy),
- glue=nuts.traverse_id(nodecodes.glue,dummy),
- disc=nuts.traverse_id(nodecodes.disc,dummy),
- boundary=nuts.traverse_id(nodecodes.boundary,dummy),
- char=nuts.traverse_char(dummy),
+ glyph=nuts.traverseid(nodecodes.glyph,dummy),
+ glue=nuts.traverseid(nodecodes.glue,dummy),
+ disc=nuts.traverseid(nodecodes.disc,dummy),
+ boundary=nuts.traverseid(nodecodes.boundary,dummy),
+ char=nuts.traversechar(dummy),
node=nuts.traverse(dummy),
}
end
@@ -5118,7 +5168,7 @@ if not nuts.setreplace then
end
do
local getsubtype=nuts.getsubtype
- function nuts.start_of_par(n)
+ function nuts.startofpar(n)
local s=getsubtype(n)
return s==0 or s==2
end
@@ -11752,8 +11802,6 @@ readers.post=function(f,fontdata,specification)
if length>0 then
glyphs[mapping].name=readstring(f,length)
else
- report("quit post name fetching at %a of %a: %s",i,maxnames,"overflow")
- break
end
end
end
@@ -12853,7 +12901,7 @@ if not modules then modules={} end modules ['font-cff']={
}
local next,type,tonumber,rawget=next,type,tonumber,rawget
local byte,char,gmatch,sub=string.byte,string.char,string.gmatch,string.sub
-local concat,remove,unpack=table.concat,table.remove,table.unpack
+local concat,insert,remove,unpack=table.concat,table.insert,table.remove,table.unpack
local floor,abs,round,ceil,min,max=math.floor,math.abs,math.round,math.ceil,math.min,math.max
local P,C,R,S,C,Cs,Ct=lpeg.P,lpeg.C,lpeg.R,lpeg.S,lpeg.C,lpeg.Cs,lpeg.Ct
local lpegmatch=lpeg.match
@@ -14457,8 +14505,34 @@ do
showstate(reverse[t] or "<action>")
end
if top>0 then
- for i=1,top do
- r=r+1;result[r]=encode[stack[i]]
+ if t==8 and top>48 then
+ local n=0
+ for i=1,top do
+ if n==48 then
+ local zero=encode[0]
+ local res3=result[r-3]
+ local res2=result[r-2]
+ local res1=result[r-1]
+ local res0=result[r]
+ result[r-3]=zero
+ result[r-2]=zero
+ r=r+1;result[r]=chars[t]
+ r=r+1;result[r]=zero
+ r=r+1;result[r]=zero
+ r=r+1;result[r]=res3
+ r=r+1;result[r]=res2
+ r=r+1;result[r]=res1
+ r=r+1;result[r]=res0
+ n=1
+ else
+ n=n+1
+ end
+ r=r+1;result[r]=encode[stack[i]]
+ end
+ else
+ for i=1,top do
+ r=r+1;result[r]=encode[stack[i]]
+ end
end
top=0
end
@@ -20784,7 +20858,7 @@ local trace_defining=false registertracker("fonts.defining",function(v) trace_d
local report_otf=logs.reporter("fonts","otf loading")
local fonts=fonts
local otf=fonts.handlers.otf
-otf.version=3.113
+otf.version=3.116
otf.cache=containers.define("fonts","otl",otf.version,true)
otf.svgcache=containers.define("fonts","svg",otf.version,true)
otf.pngcache=containers.define("fonts","png",otf.version,true)
@@ -21237,6 +21311,7 @@ local function read_from_otf(specification)
if tfmdata then
tfmdata.properties.name=specification.name
tfmdata.properties.sub=specification.sub
+ tfmdata.properties.id=specification.id
tfmdata=constructors.scale(tfmdata,specification)
local allfeatures=tfmdata.shared.features or specification.features.normal
constructors.applymanipulators("otf",tfmdata,allfeatures,trace_features,report_otf)
@@ -21974,6 +22049,8 @@ local getoffsets=nuts.getoffsets
local getboth=nuts.getboth
local getdisc=nuts.getdisc
local setdisc=nuts.setdisc
+local getreplace=nuts.getreplace
+local setreplace=nuts.setreplace
local setoffsets=nuts.setoffsets
local ischar=nuts.ischar
local getkern=nuts.getkern
@@ -21983,8 +22060,8 @@ local setwidth=nuts.setwidth
local getwidth=nuts.getwidth
local nextchar=nuts.traversers.char
local nextglue=nuts.traversers.glue
-local insert_node_before=nuts.insert_before
-local insert_node_after=nuts.insert_after
+local insertnodebefore=nuts.insertbefore
+local insertnodeafter=nuts.insertafter
local properties=nodes.properties.data
local fontkern=nuts.pool and nuts.pool.fontkern
local italickern=nuts.pool and nuts.pool.italickern
@@ -21998,7 +22075,7 @@ end)
if not fontkern then
local thekern=nuts.new("kern",0)
local setkern=nuts.setkern
- local copy_node=nuts.copy_node
+ local copy_node=nuts.copy
fontkern=function(k)
local n=copy_node(thekern)
setkern(n,k)
@@ -22008,7 +22085,7 @@ end
if not italickern then
local thekern=nuts.new("kern",3)
local setkern=nuts.setkern
- local copy_node=nuts.copy_node
+ local copy_node=nuts.copy
italickern=function(k)
local n=copy_node(thekern)
setkern(n,k)
@@ -22469,12 +22546,12 @@ local function inject_kerns_only(head,where)
if leftkern and leftkern~=0 then
if prev and getid(prev)==glue_code then
if useitalickerns then
- head=insert_node_before(head,current,italickern(leftkern))
+ head=insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev,getwidth(prev)+leftkern)
end
else
- head=insert_node_before(head,current,fontkern(leftkern))
+ head=insertnodebefore(head,current,fontkern(leftkern))
end
end
end
@@ -22528,7 +22605,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- pre=insert_node_before(pre,n,fontkern(leftkern))
+ pre=insertnodebefore(pre,n,fontkern(leftkern))
done=true
end
end
@@ -22543,7 +22620,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- post=insert_node_before(post,n,fontkern(leftkern))
+ post=insertnodebefore(post,n,fontkern(leftkern))
done=true
end
end
@@ -22558,7 +22635,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- replace=insert_node_before(replace,n,fontkern(leftkern))
+ replace=insertnodebefore(replace,n,fontkern(leftkern))
done=true
end
end
@@ -22620,36 +22697,34 @@ local function inject_positions_only(head,where)
rightkern=0
elseif prev and getid(prev)==glue_code then
if useitalickerns then
- head=insert_node_before(head,current,italickern(leftkern))
+ head=insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev,getwidth(prev)+leftkern)
end
else
- head=insert_node_before(head,current,fontkern(leftkern))
+ head=insertnodebefore(head,current,fontkern(leftkern))
end
end
if rightkern and rightkern~=0 then
if next and getid(next)==glue_code then
if useitalickerns then
- insert_node_after(head,current,italickern(rightkern))
+ insertnodeafter(head,current,italickern(rightkern))
else
setwidth(next,getwidth(next)+rightkern)
end
else
- insert_node_after(head,current,fontkern(rightkern))
+ insertnodeafter(head,current,fontkern(rightkern))
end
end
- else
+ elseif next then
local i=p.emptyinjections
if i then
local rightkern=i.rightkern
- if rightkern and rightkern~=0 then
- if next and getid(next)==disc_code then
- if replace then
- else
- replace=fontkern(rightkern)
- done=true
- end
+ if rightkern and rightkern~=0 and getid(next)==disc_code then
+ local replace=getreplace(next)
+ if replace then
+ else
+ setreplace(next,fontkern(rightkern))
end
end
end
@@ -22710,12 +22785,12 @@ local function inject_positions_only(head,where)
end
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- pre=insert_node_before(pre,n,fontkern(leftkern))
+ pre=insertnodebefore(pre,n,fontkern(leftkern))
done=true
end
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- insert_node_after(pre,n,fontkern(rightkern))
+ insertnodeafter(pre,n,fontkern(rightkern))
done=true
end
end
@@ -22734,12 +22809,12 @@ local function inject_positions_only(head,where)
end
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- post=insert_node_before(post,n,fontkern(leftkern))
+ post=insertnodebefore(post,n,fontkern(leftkern))
done=true
end
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- insert_node_after(post,n,fontkern(rightkern))
+ insertnodeafter(post,n,fontkern(rightkern))
done=true
end
end
@@ -22758,12 +22833,12 @@ local function inject_positions_only(head,where)
end
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- replace=insert_node_before(replace,n,fontkern(leftkern))
+ replace=insertnodebefore(replace,n,fontkern(leftkern))
done=true
end
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- insert_node_after(replace,n,fontkern(rightkern))
+ insertnodeafter(replace,n,fontkern(rightkern))
done=true
end
end
@@ -22778,7 +22853,7 @@ local function inject_positions_only(head,where)
if i then
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- pre=insert_node_before(pre,pre,fontkern(rightkern))
+ pre=insertnodebefore(pre,pre,fontkern(rightkern))
done=true
end
end
@@ -22791,7 +22866,7 @@ local function inject_positions_only(head,where)
if i then
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- replace=insert_node_before(replace,replace,fontkern(rightkern))
+ replace=insertnodebefore(replace,replace,fontkern(rightkern))
done=true
end
end
@@ -22894,8 +22969,8 @@ local function inject_everything(head,where)
if trace_injections then
report_injections("correcting non zero width mark %C",getchar(n))
end
- insert_node_before(n,n,fontkern(-wn))
- insert_node_after(n,n,fontkern(-wn))
+ insertnodebefore(n,n,fontkern(-wn))
+ insertnodeafter(n,n,fontkern(-wn))
end
end
end
@@ -22987,37 +23062,35 @@ local function inject_everything(head,where)
rightkern=0
elseif prev and getid(prev)==glue_code then
if useitalickerns then
- head=insert_node_before(head,current,italickern(leftkern))
+ head=insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev,getwidth(prev)+leftkern)
end
else
- head=insert_node_before(head,current,fontkern(leftkern))
+ head=insertnodebefore(head,current,fontkern(leftkern))
end
end
if rightkern and rightkern~=0 then
if next and getid(next)==glue_code then
if useitalickerns then
- insert_node_after(head,current,italickern(rightkern))
+ insertnodeafter(head,current,italickern(rightkern))
else
setwidth(next,getwidth(next)+rightkern)
end
else
- insert_node_after(head,current,fontkern(rightkern))
+ insertnodeafter(head,current,fontkern(rightkern))
end
end
end
- else
+ elseif next then
local i=p.emptyinjections
if i then
local rightkern=i.rightkern
- if rightkern and rightkern~=0 then
- if next and getid(next)==disc_code then
- if replace then
- else
- replace=fontkern(rightkern)
- done=true
- end
+ if rightkern and rightkern~=0 and getid(next)==disc_code then
+ local replace=getreplace(next)
+ if replace then
+ else
+ setreplace(next,fontkern(rightkern))
end
end
end
@@ -23092,12 +23165,12 @@ local function inject_everything(head,where)
end
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- pre=insert_node_before(pre,n,fontkern(leftkern))
+ pre=insertnodebefore(pre,n,fontkern(leftkern))
done=true
end
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- insert_node_after(pre,n,fontkern(rightkern))
+ insertnodeafter(pre,n,fontkern(rightkern))
done=true
end
if hasmarks then
@@ -23122,12 +23195,12 @@ local function inject_everything(head,where)
end
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- post=insert_node_before(post,n,fontkern(leftkern))
+ post=insertnodebefore(post,n,fontkern(leftkern))
done=true
end
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- insert_node_after(post,n,fontkern(rightkern))
+ insertnodeafter(post,n,fontkern(rightkern))
done=true
end
if hasmarks then
@@ -23152,12 +23225,12 @@ local function inject_everything(head,where)
end
local leftkern=i.leftkern
if leftkern and leftkern~=0 then
- replace=insert_node_before(replace,n,fontkern(leftkern))
+ replace=insertnodebefore(replace,n,fontkern(leftkern))
done=true
end
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- insert_node_after(replace,n,fontkern(rightkern))
+ insertnodeafter(replace,n,fontkern(rightkern))
done=true
end
if hasmarks then
@@ -23178,7 +23251,7 @@ local function inject_everything(head,where)
if i then
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- pre=insert_node_before(pre,pre,fontkern(rightkern))
+ pre=insertnodebefore(pre,pre,fontkern(rightkern))
done=true
end
end
@@ -23191,7 +23264,7 @@ local function inject_everything(head,where)
if i then
local rightkern=i.rightkern
if rightkern and rightkern~=0 then
- replace=insert_node_before(replace,replace,fontkern(rightkern))
+ replace=insertnodebefore(replace,replace,fontkern(rightkern))
done=true
end
end
@@ -23337,8 +23410,8 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("%C [%p + %p + %p] %C",prevchar,lnew,old,rnew,nextchar)
end
- head=insert_node_before(head,n,italickern(lnew))
- insert_node_after(head,n,italickern(rnew))
+ head=insertnodebefore(head,n,italickern(lnew))
+ insertnodeafter(head,n,italickern(rnew))
else
local new=old+(leftkern+rightkern)*factor
if trace_spaces then
@@ -23353,7 +23426,7 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("%C [%p + %p]",prevchar,old,new)
end
- insert_node_after(head,n,italickern(new))
+ insertnodeafter(head,n,italickern(new))
else
local new=old+leftkern*factor
if trace_spaces then
@@ -23372,7 +23445,7 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("[%p + %p] %C",old,new,nextchar)
end
- insert_node_after(head,n,italickern(new))
+ insertnodeafter(head,n,italickern(new))
else
local new=old+rightkern*factor
if trace_spaces then
@@ -25658,6 +25731,28 @@ local function checkkerns(lookup)
end
return kerned
end
+local strip_pairs=true
+local compact_pairs=true
+local compact_singles=true
+local merge_pairs=true
+local merge_singles=true
+local merge_substitutions=true
+local merge_alternates=true
+local merge_multiples=true
+local merge_ligatures=true
+local merge_cursives=true
+local merge_marks=true
+directives.register("otf.strip.pairs",function(v) strip_pairs=v end)
+directives.register("otf.compact.pairs",function(v) compact_pairs=v end)
+directives.register("otf.compact.singles",function(v) compact_singles=v end)
+directives.register("otf.merge.pairs",function(v) merge_pairs=v end)
+directives.register("otf.merge.singles",function(v) merge_singles=v end)
+directives.register("otf.merge.substitutions",function(v) merge_substitutions=v end)
+directives.register("otf.merge.alternates",function(v) merge_alternates=v end)
+directives.register("otf.merge.multiples",function(v) merge_multiples=v end)
+directives.register("otf.merge.ligatures",function(v) merge_ligatures=v end)
+directives.register("otf.merge.cursives",function(v) merge_cursives=v end)
+directives.register("otf.merge.marks",function(v) merge_marks=v end)
local function checkpairs(lookup)
local steps=lookup.steps
local nofsteps=lookup.nofsteps
@@ -25705,26 +25800,27 @@ local function checkpairs(lookup)
end
return kerned
end
-local compact_pairs=true
-local compact_singles=true
-local merge_pairs=true
-local merge_singles=true
-local merge_substitutions=true
-local merge_alternates=true
-local merge_multiples=true
-local merge_ligatures=true
-local merge_cursives=true
-local merge_marks=true
-directives.register("otf.compact.pairs",function(v) compact_pairs=v end)
-directives.register("otf.compact.singles",function(v) compact_singles=v end)
-directives.register("otf.merge.pairs",function(v) merge_pairs=v end)
-directives.register("otf.merge.singles",function(v) merge_singles=v end)
-directives.register("otf.merge.substitutions",function(v) merge_substitutions=v end)
-directives.register("otf.merge.alternates",function(v) merge_alternates=v end)
-directives.register("otf.merge.multiples",function(v) merge_multiples=v end)
-directives.register("otf.merge.ligatures",function(v) merge_ligatures=v end)
-directives.register("otf.merge.cursives",function(v) merge_cursives=v end)
-directives.register("otf.merge.marks",function(v) merge_marks=v end)
+local function strippairs(lookup)
+ local steps=lookup.steps
+ local nofsteps=lookup.nofsteps
+ local stripped=0
+ for i=1,nofsteps do
+ local step=steps[i]
+ if step.format=="pair" then
+ local coverage=step.coverage
+ for g1,d1 in next,coverage do
+ for g2,d2 in next,d1 do
+ if d2[2] then
+ elseif d2[1]==true then
+ d1[g2]=nil
+ stripped=stripped+1
+ end
+ end
+ end
+ end
+ end
+ return stripped
+end
function readers.compact(data)
if not data or data.compacted then
return
@@ -25732,6 +25828,7 @@ function readers.compact(data)
data.compacted=true
end
local resources=data.resources
+ local stripped=0
local merged=0
local kerned=0
local allsteps=0
@@ -25769,6 +25866,9 @@ function readers.compact(data)
kerned=kerned+checkkerns(lookup)
end
elseif kind=="gpos_pair" then
+ if strip_pairs then
+ stripped=stripped+strippairs(lookup)
+ end
if merge_pairs then
merged=merged+mergesteps_2(lookup)
end
@@ -25809,6 +25909,9 @@ function readers.compact(data)
compact("sequences")
compact("sublookups")
if trace_optimizations then
+ if stripped>0 then
+ report_optimizations("%i zero positions stripped before merging",stripped)
+ end
if merged>0 then
report_optimizations("%i steps of %i removed due to merging",merged,allsteps)
end
@@ -26087,7 +26190,7 @@ local setprop=nuts.setprop
local getsubtype=nuts.getsubtype
local getchar=nuts.getchar
local ischar=nuts.ischar
-local end_of_math=nuts.end_of_math
+local endofmath=nuts.endofmath
local nodecodes=nodes.nodecodes
local disc_code=nodecodes.disc
local math_code=nodecodes.math
@@ -26193,7 +26296,7 @@ function analyzers.setstate(head,font)
end
first,last,n=nil,nil,0
if id==math_code then
- current=end_of_math(current)
+ current=endofmath(current)
end
elseif id==disc_code then
setstate(current,s_medi)
@@ -26206,7 +26309,7 @@ function analyzers.setstate(head,font)
end
first,last,n=nil,nil,0
if id==math_code then
- current=end_of_math(current)
+ current=endofmath(current)
end
end
current=getnext(current)
@@ -26422,7 +26525,7 @@ function methods.arab(head,font,attr)
first=nil
end
if id==math_code then
- current=end_of_math(current)
+ current=endofmath(current)
end
end
current=getnext(current)
@@ -26536,7 +26639,7 @@ do
wrapup()
end
if id==math_code then
- current=end_of_math(current)
+ current=endofmath(current)
end
end
current=getnext(current)
@@ -26632,23 +26735,24 @@ local setlink=nuts.setlink
local getwidth=nuts.getwidth
local getattr=nuts.getattr
local getglyphdata=nuts.getglyphdata
-local copy_no_components=nuts.copy_no_components
-local copy_only_glyphs=nuts.copy_only_glyphs
-local count_components=nuts.count_components
-local set_components=nuts.set_components
-local get_components=nuts.get_components
-local flush_components=nuts.flush_components
+local components=nuts.components
+local copynocomponents=components.copynocomponents
+local copyonlyglyphs=components.copyonlyglyphs
+local countcomponents=components.count
+local setcomponents=components.set
+local getcomponents=components.get
+local flushcomponents=components.flush
local ischar=nuts.ischar
-local usesfont=nuts.uses_font
-local insert_node_after=nuts.insert_after
+local usesfont=nuts.usesfont
+local insertnodeafter=nuts.insertafter
local copy_node=nuts.copy
-local copy_node_list=nuts.copy_list
+local copy_node_list=nuts.copylist
local remove_node=nuts.remove
local find_node_tail=nuts.tail
-local flush_node_list=nuts.flush_list
-local flush_node=nuts.flush_node
-local end_of_math=nuts.end_of_math
-local start_of_par=nuts.start_of_par
+local flushnodelist=nuts.flushlist
+local flushnode=nuts.flushnode
+local endofmath=nuts.endofmath
+local startofpar=nuts.startofpar
local setmetatable=setmetatable
local setmetatableindex=table.setmetatableindex
local nextnode=nuts.traversers.node
@@ -26779,12 +26883,12 @@ local function flattendisk(head,disc)
local prev,next=getboth(disc)
local ishead=head==disc
setdisc(disc)
- flush_node(disc)
+ flushnode(disc)
if pre then
- flush_node_list(pre)
+ flushnodelist(pre)
end
if post then
- flush_node_list(post)
+ flushnodelist(post)
end
if ishead then
if replace then
@@ -26833,16 +26937,16 @@ local function markstoligature(head,start,stop,char)
local next=getnext(stop)
setprev(start)
setnext(stop)
- local base=copy_no_components(start,copyinjection)
+ local base=copynocomponents(start,copyinjection)
if head==start then
head=base
end
resetinjection(base)
setchar(base,char)
setsubtype(base,ligatureglyph_code)
- set_components(base,start)
+ setcomponents(base,start)
setlink(prev,base,next)
- flush_components(start)
+ flushcomponents(start)
return head,base
end
end
@@ -26850,7 +26954,7 @@ local no_left_ligature_code=1
local no_right_ligature_code=2
local no_left_kern_code=4
local no_right_kern_code=8
-local has_glyph_option=node.direct.has_glyph_option or function(n,c)
+local hasglyphoption=function(n,c)
if c==no_left_ligature_code or c==no_right_ligature_code then
return getattr(n,a_noligature)==1
else
@@ -26858,7 +26962,7 @@ local has_glyph_option=node.direct.has_glyph_option or function(n,c)
end
end
local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfound,hasmarks)
- if has_glyph_option(start,no_right_ligature_code) then
+ if hasglyphoption(start,no_right_ligature_code) then
return head,start
end
if start==stop and getchar(start)==char then
@@ -26871,14 +26975,14 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
local comp=start
setprev(start)
setnext(stop)
- local base=copy_no_components(start,copyinjection)
+ local base=copynocomponents(start,copyinjection)
if start==head then
head=base
end
resetinjection(base)
setchar(base,char)
setsubtype(base,ligatureglyph_code)
- set_components(base,comp)
+ setcomponents(base,comp)
setlink(prev,base,next)
if not discfound then
local deletemarks=not skiphash or hasmarks
@@ -26891,7 +26995,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
local char=getchar(start)
if not marks[char] then
baseindex=baseindex+componentindex
- componentindex=count_components(start,marks)
+ componentindex=countcomponents(start,marks)
elseif not deletemarks then
setligaindex(start,baseindex+getligaindex(start,componentindex))
if trace_marks then
@@ -26899,7 +27003,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
end
local n=copy_node(start)
copyinjection(n,start)
- head,current=insert_node_after(head,current,n)
+ head,current=insertnodeafter(head,current,n)
elseif trace_marks then
logwarning("%s: delete ligature mark %s",pref(dataset,sequence),gref(char))
end
@@ -26922,14 +27026,14 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
break
end
end
- flush_components(components)
+ flushcomponents(components)
else
local discprev,discnext=getboth(discfound)
if discprev and discnext then
local pre,post,replace,pretail,posttail,replacetail=getdisc(discfound,true)
if not replace then
local prev=getprev(base)
- local copied=copy_only_glyphs(comp)
+ local copied=copyonlyglyphs(comp)
if pre then
setlink(discprev,pre)
else
@@ -26945,7 +27049,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
end
setlink(prev,discfound,next)
setboth(base)
- set_components(base,copied)
+ setcomponents(base,copied)
replace=base
if forcediscretionaries then
setdisc(discfound,pre,post,replace,discretionarydisc_code)
@@ -26969,7 +27073,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop)
local n=copy_node(start)
resetinjection(n)
setchar(n,multiple[k])
- insert_node_after(head,start,n)
+ insertnodeafter(head,start,n)
start=n
end
if what==true then
@@ -26979,7 +27083,7 @@ local function multiple_glyphs(head,start,multiple,skiphash,what,stop)
local n=copy_node(start)
resetinjection(n)
setchar(n,m)
- insert_node_after(head,start,n)
+ insertnodeafter(head,start,n)
start=n
end
end
@@ -27209,7 +27313,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
return head,start,false,false
end
function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- if has_glyph_option(start,no_right_kern_code) then
+ if hasglyphoption(start,no_right_kern_code) then
return head,start,false
else
local startchar=getchar(start)
@@ -27229,7 +27333,7 @@ function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,
end
end
function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- if has_glyph_option(start,no_right_kern_code) then
+ if hasglyphoption(start,no_right_kern_code) then
return head,start,false
else
local snext=getnext(start)
@@ -27718,7 +27822,7 @@ function chainprocs.gsub_ligature(head,start,stop,dataset,sequence,currentlookup
return head,start,false,0,false
end
function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex)
- if not has_glyph_option(start,no_right_kern_code) then
+ if not hasglyphoption(start,no_right_kern_code) then
local mapping=currentlookup.mapping
if mapping==nil then
mapping=getmapping(dataset,sequence,currentlookup)
@@ -27746,7 +27850,7 @@ function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,r
return head,start,false
end
function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex)
- if not has_glyph_option(start,no_right_kern_code) then
+ if not hasglyphoption(start,no_right_kern_code) then
local mapping=currentlookup.mapping
if mapping==nil then
mapping=getmapping(dataset,sequence,currentlookup)
@@ -28069,13 +28173,13 @@ local function checked(head)
if next then
setlink(kern,next)
end
- flush_node(current)
+ flushnode(current)
head=kern
current=next
else
local prev,next=getboth(current)
setlink(prev,kern,next)
- flush_node(current)
+ flushnode(current)
current=next
end
else
@@ -28525,105 +28629,225 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
goto next
end
local s=seq.n
- local l=ck[5]
- local current=start
- local last=start
if s==1 then
- goto next
- end
- if l>f then
- local discfound
- local n=f+1
- last=startnext
- while n<=l do
- if postreplace and not last then
- last=getnext(sweepnode)
- sweeptype=nil
- end
- if last then
- local char,id=ischar(last,currentfont)
- if char then
- if skiphash and skiphash[char] then
- skipped=true
- if trace_skips then
- show_skip(dataset,sequence,char,ck,classes[char])
- end
- last=getnext(last)
- elseif seq[n][char] then
- if n<l then
+ else
+ local l=ck[5]
+ local current=start
+ local last=start
+ if l>f then
+ local discfound
+ local n=f+1
+ last=startnext
+ while n<=l do
+ if postreplace and not last then
+ last=getnext(sweepnode)
+ sweeptype=nil
+ end
+ if last then
+ local char,id=ischar(last,currentfont)
+ if char then
+ if skiphash and skiphash[char] then
+ skipped=true
+ if trace_skips then
+ show_skip(dataset,sequence,char,ck,classes[char])
+ end
last=getnext(last)
- end
- n=n+1
- elseif discfound then
- notmatchreplace[discfound]=true
- if notmatchpre[discfound] then
- goto next
+ elseif seq[n][char] then
+ if n<l then
+ last=getnext(last)
+ end
+ n=n+1
+ elseif discfound then
+ notmatchreplace[discfound]=true
+ if notmatchpre[discfound] then
+ goto next
+ else
+ break
+ end
else
- break
- end
- else
- goto next
- end
- elseif char==false then
- if discfound then
- notmatchreplace[discfound]=true
- if notmatchpre[discfound] then
goto next
+ end
+ elseif char==false then
+ if discfound then
+ notmatchreplace[discfound]=true
+ if notmatchpre[discfound] then
+ goto next
+ else
+ break
+ end
else
- break
+ goto next
end
- else
- goto next
- end
- elseif id==disc_code then
- discseen=true
- discfound=last
- notmatchpre[last]=nil
- notmatchpost[last]=true
- notmatchreplace[last]=nil
- local pre,post,replace=getdisc(last)
- if pre then
- local n=n
- while pre do
- if seq[n][getchar(pre)] then
- n=n+1
- if n>l then
+ elseif id==disc_code then
+ discseen=true
+ discfound=last
+ notmatchpre[last]=nil
+ notmatchpost[last]=true
+ notmatchreplace[last]=nil
+ local pre,post,replace=getdisc(last)
+ if pre then
+ local n=n
+ while pre do
+ if seq[n][getchar(pre)] then
+ n=n+1
+ if n>l then
+ break
+ end
+ pre=getnext(pre)
+ else
+ notmatchpre[last]=true
break
end
- pre=getnext(pre)
- else
+ end
+ if n<=l then
notmatchpre[last]=true
- break
end
- end
- if n<=l then
+ else
notmatchpre[last]=true
end
+ if replace then
+ while replace do
+ if seq[n][getchar(replace)] then
+ n=n+1
+ if n>l then
+ break
+ end
+ replace=getnext(replace)
+ else
+ notmatchreplace[last]=true
+ if notmatchpre[last] then
+ goto next
+ else
+ break
+ end
+ end
+ end
+ if notmatchpre[last] then
+ goto next
+ end
+ end
+ last=getnext(last)
else
- notmatchpre[last]=true
+ goto next
end
- if replace then
- while replace do
- if seq[n][getchar(replace)] then
- n=n+1
- if n>l then
- break
+ else
+ goto next
+ end
+ end
+ end
+ if f>1 then
+ if startprev then
+ local prev=startprev
+ if prereplace and prev==checkdisc then
+ prev=getprev(sweepnode)
+ end
+ if prev then
+ local discfound
+ local n=f-1
+ while n>=1 do
+ if prev then
+ local char,id=ischar(prev,currentfont)
+ if char then
+ if skiphash and skiphash[char] then
+ skipped=true
+ if trace_skips then
+ show_skip(dataset,sequence,char,ck,classes[char])
+ end
+ prev=getprev(prev)
+ elseif seq[n][char] then
+ if n>1 then
+ prev=getprev(prev)
+ end
+ n=n-1
+ elseif discfound then
+ notmatchreplace[discfound]=true
+ if notmatchpost[discfound] then
+ goto next
+ else
+ break
+ end
+ else
+ goto next
end
- replace=getnext(replace)
- else
- notmatchreplace[last]=true
- if notmatchpre[last] then
+ elseif char==false then
+ if discfound then
+ notmatchreplace[discfound]=true
+ if notmatchpost[discfound] then
+ goto next
+ end
+ else
goto next
+ end
+ break
+ elseif id==disc_code then
+ discseen=true
+ discfound=prev
+ notmatchpre[prev]=true
+ notmatchpost[prev]=nil
+ notmatchreplace[prev]=nil
+ local pre,post,replace,pretail,posttail,replacetail=getdisc(prev,true)
+ if pre~=start and post~=start and replace~=start then
+ if post then
+ local n=n
+ while posttail do
+ if seq[n][getchar(posttail)] then
+ n=n-1
+ if posttail==post or n<1 then
+ break
+ else
+ posttail=getprev(posttail)
+ end
+ else
+ notmatchpost[prev]=true
+ break
+ end
+ end
+ if n>=1 then
+ notmatchpost[prev]=true
+ end
+ else
+ notmatchpost[prev]=true
+ end
+ if replace then
+ while replacetail do
+ if seq[n][getchar(replacetail)] then
+ n=n-1
+ if replacetail==replace or n<1 then
+ break
+ else
+ replacetail=getprev(replacetail)
+ end
+ else
+ notmatchreplace[prev]=true
+ if notmatchpost[prev] then
+ goto next
+ else
+ break
+ end
+ end
+ end
+ else
+ end
+ end
+ prev=getprev(prev)
+ elseif id==glue_code then
+ local sn=seq[n]
+ if (sn[32] and spaces[prev]) or sn[0xFFFC] then
+ n=n-1
+ prev=getprev(prev)
else
- break
+ goto next
end
+ elseif seq[n][0xFFFC] then
+ n=n-1
+ prev=getprev(prev)
+ else
+ goto next
end
- end
- if notmatchpre[last] then
+ else
goto next
end
end
- last=getnext(last)
else
goto next
end
@@ -28631,34 +28855,32 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
goto next
end
end
- end
- if f>1 then
- if startprev then
- local prev=startprev
- if prereplace and prev==checkdisc then
- prev=getprev(sweepnode)
+ if s>l then
+ local current=last and getnext(last)
+ if not current and postreplace then
+ current=getnext(sweepnode)
end
- if prev then
+ if current then
local discfound
- local n=f-1
- while n>=1 do
- if prev then
- local char,id=ischar(prev,currentfont)
+ local n=l+1
+ while n<=s do
+ if current then
+ local char,id=ischar(current,currentfont)
if char then
if skiphash and skiphash[char] then
skipped=true
if trace_skips then
show_skip(dataset,sequence,char,ck,classes[char])
end
- prev=getprev(prev)
+ current=getnext(current)
elseif seq[n][char] then
- if n>1 then
- prev=getprev(prev)
+ if n<s then
+ current=getnext(current)
end
- n=n-1
+ n=n+1
elseif discfound then
notmatchreplace[discfound]=true
- if notmatchpost[discfound] then
+ if notmatchpre[discfound] then
goto next
else
break
@@ -28669,202 +28891,84 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
elseif char==false then
if discfound then
notmatchreplace[discfound]=true
- if notmatchpost[discfound] then
+ if notmatchpre[discfound] then
goto next
+ else
+ break
end
else
goto next
end
- break
elseif id==disc_code then
discseen=true
- discfound=prev
- notmatchpre[prev]=true
- notmatchpost[prev]=nil
- notmatchreplace[prev]=nil
- local pre,post,replace,pretail,posttail,replacetail=getdisc(prev,true)
- if pre~=start and post~=start and replace~=start then
- if post then
- local n=n
- while posttail do
- if seq[n][getchar(posttail)] then
- n=n-1
- if posttail==post or n<1 then
- break
- else
- posttail=getprev(posttail)
- end
- else
- notmatchpost[prev]=true
+ discfound=current
+ notmatchpre[current]=nil
+ notmatchpost[current]=true
+ notmatchreplace[current]=nil
+ local pre,post,replace=getdisc(current)
+ if pre then
+ local n=n
+ while pre do
+ if seq[n][getchar(pre)] then
+ n=n+1
+ if n>s then
break
+ else
+ pre=getnext(pre)
end
+ else
+ notmatchpre[current]=true
+ break
end
- if n>=1 then
- notmatchpost[prev]=true
- end
- else
- notmatchpost[prev]=true
end
- if replace then
- while replacetail do
- if seq[n][getchar(replacetail)] then
- n=n-1
- if replacetail==replace or n<1 then
- break
- else
- replacetail=getprev(replacetail)
- end
+ if n<=s then
+ notmatchpre[current]=true
+ end
+ else
+ notmatchpre[current]=true
+ end
+ if replace then
+ while replace do
+ if seq[n][getchar(replace)] then
+ n=n+1
+ if n>s then
+ break
else
- notmatchreplace[prev]=true
- if notmatchpost[prev] then
- goto next
- else
- break
- end
+ replace=getnext(replace)
+ end
+ else
+ notmatchreplace[current]=true
+ if notmatchpre[current] then
+ goto next
+ else
+ break
end
end
- else
end
+ else
end
- prev=getprev(prev)
+ current=getnext(current)
elseif id==glue_code then
local sn=seq[n]
- if (sn[32] and spaces[prev]) or sn[0xFFFC] then
- n=n-1
- prev=getprev(prev)
+ if (sn[32] and spaces[current]) or sn[0xFFFC] then
+ n=n+1
+ current=getnext(current)
else
goto next
end
elseif seq[n][0xFFFC] then
- n=n-1
- prev=getprev(prev)
- else
- goto next
- end
- else
- goto next
- end
- end
- else
- goto next
- end
- else
- goto next
- end
- end
- if s>l then
- local current=last and getnext(last)
- if not current and postreplace then
- current=getnext(sweepnode)
- end
- if current then
- local discfound
- local n=l+1
- while n<=s do
- if current then
- local char,id=ischar(current,currentfont)
- if char then
- if skiphash and skiphash[char] then
- skipped=true
- if trace_skips then
- show_skip(dataset,sequence,char,ck,classes[char])
- end
- current=getnext(current)
- elseif seq[n][char] then
- if n<s then
- current=getnext(current)
- end
- n=n+1
- elseif discfound then
- notmatchreplace[discfound]=true
- if notmatchpre[discfound] then
- goto next
- else
- break
- end
- else
- goto next
- end
- elseif char==false then
- if discfound then
- notmatchreplace[discfound]=true
- if notmatchpre[discfound] then
- goto next
- else
- break
- end
- else
- goto next
- end
- elseif id==disc_code then
- discseen=true
- discfound=current
- notmatchpre[current]=nil
- notmatchpost[current]=true
- notmatchreplace[current]=nil
- local pre,post,replace=getdisc(current)
- if pre then
- local n=n
- while pre do
- if seq[n][getchar(pre)] then
- n=n+1
- if n>s then
- break
- else
- pre=getnext(pre)
- end
- else
- notmatchpre[current]=true
- break
- end
- end
- if n<=s then
- notmatchpre[current]=true
- end
- else
- notmatchpre[current]=true
- end
- if replace then
- while replace do
- if seq[n][getchar(replace)] then
- n=n+1
- if n>s then
- break
- else
- replace=getnext(replace)
- end
- else
- notmatchreplace[current]=true
- if notmatchpre[current] then
- goto next
- else
- break
- end
- end
- end
- else
- end
- current=getnext(current)
- elseif id==glue_code then
- local sn=seq[n]
- if (sn[32] and spaces[current]) or sn[0xFFFC] then
n=n+1
current=getnext(current)
else
goto next
end
- elseif seq[n][0xFFFC] then
- n=n+1
- current=getnext(current)
else
goto next
end
- else
- goto next
end
+ else
+ goto next
end
- else
- goto next
end
end
if trace_contexts then
@@ -29626,7 +29730,7 @@ do
checkstep(head)
end
local initialrl=0
- if getid(head)==par_code and start_of_par(head) then
+ if getid(head)==par_code and startofpar(head) then
initialrl=pardirstate(head)
elseif direction==righttoleft_code then
initialrl=-1
@@ -29743,7 +29847,7 @@ do
start=getnext(start)
end
elseif id==math_code then
- start=getnext(end_of_math(start))
+ start=getnext(endofmath(start))
elseif id==dir_code then
topstack,rlmode=txtdirstate(start,dirstack,topstack,rlparmode)
start=getnext(start)
@@ -29813,7 +29917,7 @@ do
start=getnext(start)
end
elseif id==math_code then
- start=getnext(end_of_math(start))
+ start=getnext(endofmath(start))
elseif id==dir_code then
topstack,rlmode=txtdirstate(start,dirstack,topstack,rlparmode)
start=getnext(start)
@@ -29891,7 +29995,7 @@ do
elseif char==false or id==glue_code then
start=getnext(start)
elseif id==math_code then
- start=getnext(end_of_math(start))
+ start=getnext(endofmath(start))
elseif id==dir_code then
topstack,rlmode=txtdirstate(start,dirstack,topstack,rlparmode)
start=getnext(start)
@@ -29902,44 +30006,52 @@ do
return head
end
end
-local plugins={}
-otf.plugins=plugins
-local report=logs.reporter("fonts")
-function otf.registerplugin(name,f)
- if type(name)=="string" and type(f)=="function" then
- plugins[name]={ name,f }
- report()
- report("plugin %a has been loaded, please be aware of possible side effects",name)
- report()
- if logs.pushtarget then
- logs.pushtarget("log")
- end
- report("Plugins are not officially supported unless stated otherwise. This is because")
- report("they bypass the regular font handling and therefore some features in ConTeXt")
- report("(especially those related to fonts) might not work as expected or might not work")
- report("at all. Some plugins are for testing and development only and might change")
- report("whenever we feel the need for it.")
- report()
- if logs.poptarget then
- logs.poptarget()
+do
+ local plugins={}
+ otf.plugins=plugins
+ local report=logs.reporter("fonts")
+ local warned=false
+ local okay={ text=true }
+ function otf.registerplugin(name,f)
+ if type(name)=="string" and type(f)=="function" then
+ plugins[name]={ name,f }
+ if okay[name] then
+ else
+ report("plugin %a has been loaded, please be aware of possible side effects",name)
+ if not warned then
+ if logs.pushtarget then
+ logs.pushtarget("log")
+ end
+ report("Plugins are not officially supported unless stated otherwise. This is because")
+ report("they bypass the regular font handling and therefore some features in ConTeXt")
+ report("(especially those related to fonts) might not work as expected or might not work")
+ report("at all. Some plugins are for testing and development only and might change")
+ report("whenever we feel the need for it.")
+ report()
+ if logs.poptarget then
+ logs.poptarget()
+ end
+ warned=true
+ end
+ end
end
end
-end
-function otf.plugininitializer(tfmdata,value)
- if type(value)=="string" then
- tfmdata.shared.plugin=plugins[value]
+ function otf.plugininitializer(tfmdata,value)
+ if type(value)=="string" then
+ tfmdata.shared.plugin=plugins[value]
+ end
end
-end
-function otf.pluginprocessor(head,font,attr,direction)
- local s=fontdata[font].shared
- local p=s and s.plugin
- if p then
- if trace_plugins then
- report_process("applying plugin %a",p[1])
+ function otf.pluginprocessor(head,font,dynamic,direction)
+ local s=fontdata[font].shared
+ local p=s and s.plugin
+ if p then
+ if trace_plugins then
+ report_process("applying plugin %a",p[1])
+ end
+ return p[2](head,font,dynamic,direction)
+ else
+ return head,false
end
- return p[2](head,font,attr,direction)
- else
- return head,false
end
end
function otf.featuresinitializer(tfmdata,value)
@@ -30971,11 +31083,11 @@ local setprop=nuts.setprop
local getstate=nuts.getstate
local setstate=nuts.setstate
local ischar=nuts.ischar
-local insert_node_after=nuts.insert_after
+local insertnodeafter=nuts.insertafter
local copy_node=nuts.copy
local remove_node=nuts.remove
-local flush_list=nuts.flush_list
-local flush_node=nuts.flush_node
+local flushlist=nuts.flushlist
+local flushnode=nuts.flushnode
local copyinjection=nodes.injections.copy
local unsetvalue=attributes.unsetvalue
local fontdata=fonts.hashes.identifiers
@@ -31600,7 +31712,7 @@ local function inject_syntax_error(head,current,char)
else
setchar(current,dotted_circle)
end
- return insert_node_after(head,current,signal)
+ return insertnodeafter(head,current,signal)
end
local function initialize_one(font,attr)
local tfmdata=fontdata[font]
@@ -31718,7 +31830,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
if current==stop then
stop=getprev(stop)
head=remove_node(head,current)
- flush_node(current)
+ flushnode(current)
return head,stop,nbspaces
else
nbspaces=nbspaces+1
@@ -31748,7 +31860,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
tempcurrent=processcharacters(tempcurrent,font)
setstate(tempcurrent,unsetvalue)
if getchar(next)==getchar(tempcurrent) then
- flush_list(tempcurrent)
+ flushlist(tempcurrent)
if show_syntax_errors then
head,current=inject_syntax_error(head,current,char)
end
@@ -31756,8 +31868,8 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
setchar(current,getchar(tempcurrent))
local freenode=getnext(current)
setlink(current,tmp)
- flush_node(freenode)
- flush_list(tempcurrent)
+ flushnode(freenode)
+ flushlist(tempcurrent)
if changestop then
stop=current
end
@@ -31884,7 +31996,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
ch=tpm[1]
setchar(n,ch)
setchar(extra,tpm[2])
- head=insert_node_after(head,current,extra)
+ head=insertnodeafter(head,current,extra)
tpm=twopart_mark[ch]
end
while c~=stop and dependent_vowel[ch] do
@@ -32058,7 +32170,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
stop=getprev(stop)
end
head=remove_node(head,base)
- flush_node(base)
+ flushnode(base)
end
return head,stop,nbspaces
end
@@ -32318,7 +32430,7 @@ function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replaceme
if head==start then
head=stop
end
- flush_list(start)
+ flushlist(start)
return head,stop,true
end
local function initialize_two(font,attr)
@@ -32463,7 +32575,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces)
if current==stop then
stop=getprev(stop)
head=remove_node(head,current)
- flush_node(current)
+ flushnode(current)
return head,stop,nbspaces
else
nbspaces=nbspaces+1
@@ -32560,7 +32672,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces)
char=tpm[1]
setchar(current,char)
setchar(extra,tpm[2])
- head=insert_node_after(head,current,extra)
+ head=insertnodeafter(head,current,extra)
tpm=twopart_mark[char]
end
if not moved[current] and dependent_vowel[char] then
@@ -32710,7 +32822,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces)
end
nbspaces=nbspaces-1
head=remove_node(head,base)
- flush_node(base)
+ flushnode(base)
end
return head,stop,nbspaces
end
@@ -33644,9 +33756,10 @@ end
if inkscape then
local descriptions=tfmdata.descriptions
local nofshapes=#svgshapes
+ local s_format=inkscapeformat("pdf")
local f_svgfile=formatters["temp-otf-svg-shape-%i.svg"]
local f_pdffile=formatters["temp-otf-svg-shape-%i.pdf"]
- local f_convert=formatters["%s --export-%s=%s\n"]
+ local f_convert=formatters[new and "file-open:%s; export-%s:%s; export-do\n" or "%s --export-%s=%s\n"]
local filterglyph=otfsvg.filterglyph
local nofdone=0
local processed={}
@@ -33660,7 +33773,7 @@ end
local svgfile=f_svgfile(index)
local pdffile=f_pdffile(index)
savedata(svgfile,data)
- inkscape:write(f_convert(svgfile,inkscapeformat("pdf"),pdffile))
+ inkscape:write(f_convert(svgfile,s_format,pdffile))
processed[index]=true
nofdone=nofdone+1
if nofdone%25==0 then
@@ -34833,6 +34946,7 @@ local function read_from_afm(specification)
local tfmdata=afmtotfm(specification)
if tfmdata then
tfmdata.properties.name=specification.name
+ tfmdata.properties.id=specification.id
tfmdata=constructors.scale(tfmdata,specification)
local allfeatures=tfmdata.shared.features or specification.features.normal
constructors.applymanipulators("afm",tfmdata,allfeatures,trace_features,report_afm)
@@ -36047,7 +36161,7 @@ local afm=fonts.handlers.afm
local pfb=fonts.handlers.pfb
local hashes=fonts.hashes
local identifiers=hashes.identifiers
-local version=0.009
+local version=0.010
local shapescache=containers.define("fonts","shapes",version,true)
local streamscache=containers.define("fonts","streams",version,true)
local compact_streams=false
@@ -37132,74 +37246,55 @@ local rules={
"FractionRuleThickness",
"UnderbarRuleThickness",
}
-local setmathparameters
-local setmathcharacters
-if CONTEXTLMTXMODE and CONTEXTLMTXMODE>0 then
- setmathparameters=function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
- if delta~=0 then
- for i=1,#rules do
- local name=rules[i]
- local value=mathparameters[name]
- if value then
- mathparameters[name]=(squeeze or 1)*(value+dy)
- end
+local function setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
+ if dy~=0 then
+ for i=1,#rules do
+ local name=rules[i]
+ local value=mathparameters[name]
+ if value then
+ mathparameters[name]=(squeeze or 1)*(value+dy)
end
end
end
- setmathcharacters=function()
- end
-else
- setmathparameters=function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
- if delta~=0 then
- for i=1,#rules do
- local name=rules[i]
- local value=mathparameters[name]
- if value then
- mathparameters[name]=(squeeze or 1)*(value+dy)
- end
- end
+end
+local function setmathcharacters(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta)
+ local function wdpatch(char)
+ if wsnap~=0 then
+ char.width=char.width+wdelta/2
end
end
- setmathcharacters=function(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta)
- local function wdpatch(char)
- if wsnap~=0 then
- char.width=char.width+wdelta/2
- end
- end
- local function htpatch(char)
- if hsnap~=0 then
- local height=char.height
- if height then
- char.height=char.height+2*dy
- end
+ local function htpatch(char)
+ if hsnap~=0 then
+ local height=char.height
+ if height then
+ char.height=char.height+2*dy
end
end
- local character=characters[0x221A]
- if character and character.next then
- local char=character
- local next=character.next
+ end
+ local character=characters[0x221A]
+ if character and character.next then
+ local char=character
+ local next=character.next
+ wdpatch(char)
+ htpatch(char)
+ while next do
+ char=characters[next]
wdpatch(char)
htpatch(char)
- while next do
- char=characters[next]
- wdpatch(char)
- htpatch(char)
- next=char.next
- end
- if char then
- local v=char.vert_variants
- if v then
- local top=v[#v]
- if top then
- local char=characters[top.glyph]
- htpatch(char)
- end
+ next=char.next
+ end
+ if char then
+ local v=char.vert_variants
+ if v then
+ local top=v[#v]
+ if top then
+ local char=characters[top.glyph]
+ htpatch(char)
end
end
end
end
end
-local shiftmode=CONTEXTLMTXMODE and CONTEXTLMTXMODE>0
local function manipulateeffect(tfmdata)
local effect=tfmdata.properties.effect
if effect then
@@ -37221,45 +37316,38 @@ local function manipulateeffect(tfmdata)
local factor=(1+effect.factor)*factor
local hfactor=(1+effect.hfactor)*hfactor
local vfactor=(1+effect.vfactor)*vfactor
- if shiftmode then
- parameters.hshift=hshift
- parameters.vshift=vshift
- else
- vshift=vshift~=0 and upcommand[vshift] or false
- hshift=rightcommand[hshift]
- end
+ vshift=vshift~=0 and upcommand[vshift] or false
+ hshift=rightcommand[hshift]
for unicode,character in next,characters do
local oldwidth=character.width
local oldheight=character.height
local olddepth=character.depth
if oldwidth and oldwidth>0 then
character.width=oldwidth+wdelta
- if not shiftmode then
- local commands=character.commands
- if vshift then
- if commands then
+ local commands=character.commands
+ if vshift then
+ if commands then
+ prependcommands (commands,
+ hshift,
+ vshift
+ )
+ else
+ character.commands={
+ hshift,
+ vshift,
+ charcommand[unicode]
+ }
+ end
+ else
+ if commands then
prependcommands (commands,
- hshift,
- vshift
+ hshift
)
- else
- character.commands={
- hshift,
- vshift,
- charcommand[unicode]
- }
- end
else
- if commands then
- prependcommands (commands,
- hshift
- )
- else
- character.commands={
- hshift,
- charcommand[unicode]
- }
- end
+ character.commands={
+ hshift,
+ charcommand[unicode]
+ }
end
end
end
@@ -39421,8 +39509,8 @@ local next=next
local fonts=fonts
local nodes=nodes
local nuts=nodes.nuts
-local traverse_id=nuts.traverse_id
-local flush_node=nuts.flush_node
+local traverseid=nuts.traverseid
+local flushnode=nuts.flushnode
local glyph_code=nodes.nodecodes.glyph
local disc_code=nodes.nodecodes.disc
local tonode=nuts.tonode
@@ -39481,7 +39569,7 @@ local function nodepass(head,groupcode,size,packtype,direction)
local variants=nil
local redundant=nil
local nofused=0
- for n in traverse_id(glyph_code,head) do
+ for n in traverseid(glyph_code,head) do
local font=getfont(n)
if font~=prevfont then
if basefont then
@@ -39559,13 +39647,13 @@ local function nodepass(head,groupcode,size,packtype,direction)
end
end
end
- flush_node(r)
+ flushnode(r)
end
end
- for d in traverse_id(disc_code,head) do
+ for d in traverseid(disc_code,head) do
local _,_,r=getdisc(d)
if r then
- for n in traverse_id(glyph_code,r) do
+ for n in traverseid(glyph_code,r) do
local font=getfont(n)
if font~=prevfont then
prevfont=font
@@ -39633,7 +39721,7 @@ local function basepass(head)
end
return head
end
-local protectpass=node.direct.protect_glyphs
+local protectpass=node.direct.protectglyphs or node.direct.protect_glyphs
local injectpass=nodes.injections.handler
function nodes.handlers.nodepass(head,...)
if head then
diff --git a/macros/luatex/generic/luaotfload/fontloader-util-str.lua b/macros/luatex/generic/luaotfload/fontloader-util-str.lua
index 2d3f4d669f..0d1f39de9d 100644
--- a/macros/luatex/generic/luaotfload/fontloader-util-str.lua
+++ b/macros/luatex/generic/luaotfload/fontloader-util-str.lua
@@ -70,27 +70,63 @@ local function points(n)
n = n * ptf
if n % 1 == 0 then
return format("%ipt",n)
+ else
+ return lpegmatch(stripzeros,format("%.5fpt",n)) -- plural as we need to keep the pt
+ end
+end
+
+local function nupoints(n)
+ if n == 0 then
+ return "0"
+ end
+ n = tonumber(n)
+ if not n or n == 0 then
+ return "0"
+ end
+ n = n * ptf
+ if n % 1 == 0 then
+ return format("%i",n)
+ else
+ return format("%.5f",n) -- no strip
end
- return lpegmatch(stripzeros,format("%.5fpt",n)) -- plural as we need to keep the pt
end
local function basepoints(n)
if n == 0 then
- return "0pt"
+ return "0bp"
end
n = tonumber(n)
if not n or n == 0 then
- return "0pt"
+ return "0bp"
end
n = n * bpf
if n % 1 == 0 then
return format("%ibp",n)
+ else
+ return lpegmatch(stripzeros,format("%.5fbp",n)) -- plural as we need to keep the pt
+ end
+end
+
+local function nubasepoints(n)
+ if n == 0 then
+ return "0"
+ end
+ n = tonumber(n)
+ if not n or n == 0 then
+ return "0"
+ end
+ n = n * bpf
+ if n % 1 == 0 then
+ return format("%i",n)
+ else
+ return format("%.5f",n) -- no strip
end
- return lpegmatch(stripzeros,format("%.5fbp",n)) -- plural as we need to keep the pt
end
-number.points = points
-number.basepoints = basepoints
+number.points = points
+number.nupoints = nupoints
+number.basepoints = basepoints
+number.nubasepoints = nubasepoints
-- str = " \n \ntest \n test\ntest "
-- print("["..string.gsub(string.collapsecrlf(str),"\n","+").."]")
@@ -357,7 +393,9 @@ end
-- U+hexadecimal %...u character number
-- U+HEXADECIMAL %...U character number
-- points %p number (scaled points)
+-- nupoints %P number (scaled points) / without unit / always 5 decimals
-- basepoints %b number (scaled points)
+-- nubasepoints %B number (scaled points) / without unit / always 5 decimals
-- table concat %...t table
-- table concat %{.}t table
-- serialize %...T sequenced (no nested tables)
@@ -616,7 +654,9 @@ local environment = {
concat = table.concat,
signed = number.signed,
points = number.points,
+ nupoints = number.nupoints,
basepoints = number.basepoints,
+ nubasepoints = number.nubasepoints,
utfchar = utf.char,
utfbyte = utf.byte,
lpegmatch = lpeg.match,
@@ -879,11 +919,21 @@ local format_p = function()
return format("points(a%s)",n)
end
+local format_P = function()
+ n = n + 1
+ return format("nupoints(a%s)",n)
+end
+
local format_b = function()
n = n + 1
return format("basepoints(a%s)",n)
end
+local format_B = function()
+ n = n + 1
+ return format("nubasepoints(a%s)",n)
+end
+
local format_t = function(f)
n = n + 1
if f and f ~= "" then
@@ -1125,7 +1175,7 @@ local builder = Cs { "start",
--
+ V("r")
+ V("h") + V("H") + V("u") + V("U")
- + V("p") + V("b")
+ + V("p") + V("P") + V("b") + V("B")
+ V("t") + V("T")
+ V("l") + V("L")
+ V("I")
@@ -1174,8 +1224,10 @@ local builder = Cs { "start",
["H"] = (prefix_any * P("H")) / format_H, -- %H => 0x0A1B2 (when - no 0x) was V
["u"] = (prefix_any * P("u")) / format_u, -- %u => u+0a1b2 (when - no u+)
["U"] = (prefix_any * P("U")) / format_U, -- %U => U+0A1B2 (when - no U+)
- ["p"] = (prefix_any * P("p")) / format_p, -- %p => 12.345pt / maybe: P (and more units)
- ["b"] = (prefix_any * P("b")) / format_b, -- %b => 12.342bp / maybe: B (and more units)
+ ["p"] = (prefix_any * P("p")) / format_p, -- %p => 12.345pt
+ ["P"] = (prefix_any * P("P")) / format_P, -- %p => 12.345
+ ["b"] = (prefix_any * P("b")) / format_b, -- %b => 12.342bp
+ ["B"] = (prefix_any * P("B")) / format_B, -- %b => 12.342
["t"] = (prefix_tab * P("t")) / format_t, -- %t => concat
["T"] = (prefix_tab * P("T")) / format_T, -- %t => sequenced
["l"] = (prefix_any * P("l")) / format_l, -- %l => boolean
diff --git a/macros/luatex/generic/luaotfload/luaotfload-auxiliary.lua b/macros/luatex/generic/luaotfload/luaotfload-auxiliary.lua
index fcbd644158..9c2d204aaa 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-auxiliary.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-auxiliary.lua
@@ -6,8 +6,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-auxiliary",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / auxiliary functions",
license = "GPL v2.0"
}
diff --git a/macros/luatex/generic/luaotfload/luaotfload-case-el.lua b/macros/luatex/generic/luaotfload/luaotfload-case-el.lua
deleted file mode 100644
index 1b329c4a65..0000000000
--- a/macros/luatex/generic/luaotfload/luaotfload-case-el.lua
+++ /dev/null
@@ -1,294 +0,0 @@
-local unicode_data = require'luaotfload-unicode'
-
-local has_accent = 1
-local has_combining_dialytika = 2
-local has_ypogegrammeni = 4
-local has_other_diacritic = 8
-local has_vowel = 16
-local vowels = {
- [0x03B1] = true,
- [0x0391] = true,
- [0x03B5] = true,
- [0x0395] = true,
- [0x03B7] = true,
- [0x0397] = true,
- [0x03B9] = true,
- [0x0399] = true,
- [0x03BF] = true,
- [0x039F] = true,
- [0x03C9] = true,
- [0x03A9] = true,
- [0x03C5] = true,
- [0x03A5] = true,
- [0x03F5] = true,
-}
-local diacritic_data = {
- [0x0300] = has_accent,
- [0x0301] = has_accent,
- [0x0302] = has_accent,
- [0x0303] = has_accent,
- [0x0311] = has_accent,
- [0x0342] = has_accent,
- [0x0308] = has_combining_dialytika,
- [0x0344] = has_accent | has_combining_dialytika,
- [0x0345] = has_ypogegrammeni,
- [0x0304] = has_other_diacritic,
- [0x0306] = has_other_diacritic,
- [0x0313] = has_other_diacritic,
- [0x0314] = has_other_diacritic,
- [0x0343] = has_other_diacritic,
-}
-
-local mapping_tables = unicode_data.casemapping
-local soft_dotted = unicode_data.soft_dotted
-local ccc = unicode_data.ccc
-
-local uppercase = mapping_tables.uppercase
-local lowercase = mapping_tables.lowercase
-local cased = mapping_tables.cased
-local case_ignorable = mapping_tables.case_ignorable
-
-local otfregister = fonts.constructors.features.otf.register
-
-local direct = node.direct
-local is_char = direct.is_char
-local has_glyph = direct.has_glyph
-local uses_font = direct.uses_font
-local getnext = direct.getnext
-local setchar = direct.setchar
-local setdisc = direct.setdisc
-local getdisc = direct.getdisc
-local getfield = direct.getfield
-local remove = direct.remove
-local copy = direct.copy
-local insert_after = direct.insert_after
-local traverse = direct.traverse
-
-local disc = node.id'disc'
-
-local nfd = {} -- FIXME: Data
-
-local data do
- for cp = 1, 0xFF, 1 do -- FIXME: Correct limits
- local decomposed = nfd[cp]
- local first = decomposed and decomposed[1] or cp
- local upper = uppercase[first]
- local data = vowels[first] and has_vowel or 0
- if decomposed then
- for i=1, #decomposed do
- data = data | (diacritic_data[decomposed[i]] or 0)
- end
- end
- end
-end
-
---[[ We make some implicit assumptions about contexts in SpecialCasing.txt here which happened to be true when I wrote the code:
---
--- * Before_Dot only appears as Not_Before_Dot
--- * No other context appears with Not_
--- * Final_Sigma is never language dependent
--- * Other contexts are always language dependent
--- * The only languages with special mappings are Lithuanian (lt/"LTH "/lit), Turkish (tr/"TRK "/tur), and Azeri/Azerbaijani (az/"AZE "/aze)
-]]
-
-local font_lang = setmetatable({}, {__index = function(t, fid)
- local f = font.getfont(fid)
- local lang = f.specification.features.normal.language
- lang = lang == 'lth' and 'lt' or lang == 'trk' and 'tr' or lang == 'aze' and 'az' or false
- t[fid] = lang
- return lang
-end})
-
-local function is_Final_Sigma(font, mapping, n, after)
- mapping = mapping.Final_Sigma
- if not mapping then return false end
- mapping = mapping._
- if not mapping then return false end
- n = getnext(n)
- repeat
- while n do
- local char, id = is_char(n, font)
- if id == disc then
- after = getnext(n)
- n = getfield(n, 'replace')
- char, id = is_char(n, font)
- elseif char then
- if not case_ignorable[char] then
- return not cased[char] and mapping
- end
- n = getnext(n)
- else
- return mapping
- end
- end
- n, after = after
- until not n
- return mapping
-end
-
-local function is_More_Above(font, mapping, n, after)
- mapping = mapping.More_Above
- if not mapping then return false end
- mapping = mapping._
- if not mapping then return false end
- n = getnext(n)
- repeat
- while n do
- local char, id = is_char(n, font)
- if id == disc then
- after = getnext(n)
- n = getfield(n, 'replace')
- char, id = is_char(n, font)
- elseif char then
- local char_ccc = ccc[char]
- if not char_ccc then
- return false
- elseif char_ccc == 230 then
- return mapping
- end
- n = getnext(n)
- else
- return false
- end
- end
- n, after = after
- until not n
- return false
-end
-
-local function is_Not_Before_Dot(font, mapping, n, after)
- mapping = mapping.Not_Before_Dot
- if not mapping then return false end
- mapping = mapping._
- if not mapping then return false end
- n = getnext(n)
- repeat
- while n do
- local char, id = is_char(n, font)
- if id == disc then
- after = getnext(n)
- n = getfield(n, 'replace')
- char, id = is_char(n, font)
- elseif char then
- local char_ccc = ccc[char]
- if not char_ccc then
- return mapping
- elseif char_ccc == 230 then
- return char ~= 0x0307 and mapping
- end
- n = getnext(n)
- else
- return mapping
- end
- end
- n, after = after
- until not n
- return mapping
-end
-
-local function is_Language_Mapping(font, mapping, n, after, seen_soft_dotted, seen_I)
- if not mapping then return false end
- if seen_soft_dotted then
- local mapping = mapping.After_Soft_Dotted
- mapping = mapping and mapping._
- if mapping then
- return mapping
- end
- end
- if seen_I then
- local mapping = mapping.After_I
- mapping = mapping and mapping._
- if mapping then
- return mapping
- end
- end
- return is_More_Above(font, mapping, n, after) or is_Not_Before_Dot(font, mapping, n, after) or mapping._ -- Might be nil
-end
-
-local function process(table)
- local function processor(head, font, after, seen_cased, seen_soft_dotted, seen_I)
- local lang = font_lang[font]
- local n = head
- while n do
- do
- local new = has_glyph(n)
- if n ~= new then
- seen_cased, seen_soft_dotted, seen_I = nil
- end
- n = new
- end
- if not n then break end
- local char, id = is_char(n, font)
- if char then
- local mapping = table[char]
- if mapping then
- if tonumber(mapping) then
- setchar(n, mapping)
- else
- mapping = seen_cased and is_Final_Sigma(font, mapping, n, after)
- or lang and is_Language_Mapping(font, mapping[lang], n, after, seen_soft_dotted, seen_I)
- or mapping._
- if #mapping == 0 then
- head, n = remove(head, n)
- goto continue
- else
- setchar(n, mapping[1])
- for i=2, #mapping do
- head, n = insert_after(head, n, copy(n))
- setchar(n, mapping[i])
- end
- end
- end
- end
- if not case_ignorable[char] then
- seen_cased = cased[char] or nil
- end
- local char_ccc = ccc[char]
- if not char_ccc or char_ccc == 230 then
- seen_I = char == 0x49 or nil
- seen_soft_dotted = soft_dotted[char]
- end
- elseif id == disc and uses_font(n, font) then
- local pre, post, rep = getdisc(n)
- local after = getnext(n)
- pre, post, rep, seen_cased, seen_soft_dotted, seen_I =
- processor(pre, font, nil, seen_cased, seen_soft_dotted, seen_I),
- processor(post, font, after),
- processor(rep, font, after, seen_cased, seen_soft_dotted, seen_I)
- setdisc(n, pre, post, rep)
- else
- seen_cased, seen_soft_dotted, seen_I = nil
- end
- n = getnext(n)
- ::continue::
- end
- return head, seen_cased, seen_soft_dotted, seen_I
- end
- return function(head, font) return (processor(head, font)) end
-end
-
-local upper_process = process(uppercase)
-otfregister {
- name = 'upper',
- description = 'Map to uppercase',
- default = false,
- processors = {
- position = 1,
- plug = upper_process,
- node = upper_process,
- base = upper_process,
- },
-}
-
-local lower_process = process(lowercase)
-otfregister {
- name = 'lower',
- description = 'Map to lowercase',
- default = false,
- processors = {
- position = 1,
- plug = lower_process,
- node = lower_process,
- base = lower_process,
- },
-}
diff --git a/macros/luatex/generic/luaotfload/luaotfload-colors.lua b/macros/luatex/generic/luaotfload/luaotfload-colors.lua
index fb1cbd3487..c6a437c92a 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-colors.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-colors.lua
@@ -5,8 +5,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-colors",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / color",
license = "GPL v2.0",
author = "Khaled Hosny, Elie Roux, Philipp Gesang, Dohyun Kim, David Carlisle",
diff --git a/macros/luatex/generic/luaotfload/luaotfload-conf.pdf b/macros/luatex/generic/luaotfload/luaotfload-conf.pdf
index afb5a2a4f5..7baffef63e 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-conf.pdf
+++ b/macros/luatex/generic/luaotfload/luaotfload-conf.pdf
Binary files differ
diff --git a/macros/luatex/generic/luaotfload/luaotfload-configuration.lua b/macros/luatex/generic/luaotfload/luaotfload-configuration.lua
index 07ac92096d..76a8d68754 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-configuration.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-configuration.lua
@@ -7,8 +7,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-configuration",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / config file reader",
license = "GPL v2.0"
}
@@ -994,7 +994,7 @@ local function dump ()
end
if next(confdata) then
iowrite (stringformat (conf_header,
- osdate ("%Y-%m-d %H:%M:%S", os.time ())))
+ osdate ("%Y-%m-%d %H:%M:%S", os.time ())))
iowrite (tableconcat (confdata, "\n"))
iowrite (conf_footer)
end
diff --git a/macros/luatex/generic/luaotfload/luaotfload-database.lua b/macros/luatex/generic/luaotfload/luaotfload-database.lua
index 288f4a21b2..b1d264f9b7 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-database.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-database.lua
@@ -5,8 +5,8 @@
do -- block to avoid to many local variables error
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-database",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / database",
license = "GPL v2.0",
author = "Khaled Hosny, Elie Roux, Philipp Gesang, Marcel Krüger",
diff --git a/macros/luatex/generic/luaotfload/luaotfload-diagnostics.lua b/macros/luatex/generic/luaotfload/luaotfload-diagnostics.lua
index 67970dc4c5..fe959a50de 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-diagnostics.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-diagnostics.lua
@@ -7,8 +7,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-diagnostics",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload-tool submodule / diagnostics",
license = "GPL v2.0"
}
@@ -376,7 +376,7 @@ else
out ("Try again later at %s.", osdate ("%F %T", reset))
else --- windows doesn’t C99
out ("Try again later at %s.",
- osdate ("%Y-%m-d %H:%M:%S", reset))
+ osdate ("%Y-%m-%d %H:%M:%S", reset))
end
end
return true
diff --git a/macros/luatex/generic/luaotfload/luaotfload-dvi.lua b/macros/luatex/generic/luaotfload/luaotfload-dvi.lua
index 12ca5d7d56..f368c3ae5a 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-dvi.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-dvi.lua
@@ -6,8 +6,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-dvi",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / DVI",
license = "GPL v2.0",
author = "Marcel Krüger",
diff --git a/macros/luatex/generic/luaotfload/luaotfload-embolden.lua b/macros/luatex/generic/luaotfload/luaotfload-embolden.lua
index d9f68f4d4d..ca035bc4cd 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-embolden.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-embolden.lua
@@ -5,8 +5,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-embolden",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / embolden",
license = "GPL v2.0",
author = "Marcel Krüger"
diff --git a/macros/luatex/generic/luaotfload/luaotfload-fakesc.lua b/macros/luatex/generic/luaotfload/luaotfload-fakesc.lua
deleted file mode 100644
index 421f6fd24d..0000000000
--- a/macros/luatex/generic/luaotfload/luaotfload-fakesc.lua
+++ /dev/null
@@ -1,204 +0,0 @@
------------------------------------------------------------------------
--- FILE: luaotfload-fakesc.lua
--- DESCRIPTION: part of luaotfload / fakesc
------------------------------------------------------------------------
-
-assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
- name = "luaotfload-fakesc",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
- description = "luaotfload submodule / fakesc",
- license = "GPL v2.0",
- author = "Marcel Krüger"
-}
-
-local nodenew = node.direct.new
-local getfont = font.getfont
-local setfont = node.direct.setfont
-local getwhd = node.direct.getwhd
-local insert_after = node.direct.insert_after
-local traverse_char = node.direct.traverse_char
-local protect_glyph = node.direct.protect_glyph
-local otffeatures = fonts.constructors.newfeatures "otf"
-
-local sep = lpeg.P' '^0 * ';' * lpeg.P' '^0
-local codepoint = lpeg.S'0123456789ABCDEF'^4/function(c)return tonumber(c, 16)end
-local codepoint_range = codepoint * ('..' * codepoint + lpeg.Cc(false))
-local function multirawset(table, key1, key2, value)
- for key = key1,(key2 or key1) do
- rawset(table, key, value)
- end
- return table
-end
-local script_extensions do
- local entry = lpeg.Cg(codepoint_range * sep * lpeg.Ct((lpeg.C(lpeg.R'AZ' * lpeg.R'az'^1))^1 * ' ') * '#')^-1 * (1-lpeg.P'\n')^0 * '\n'
- local file = lpeg.Cf(
- lpeg.Ct''
- * entry^0
- , multirawset)
-
- local f = io.open(kpse.find_file"ScriptExtensions.txt")
- script_extensions = file:match(f:read'*a')
- f:close()
- for cp,t in next, script_extensions do
- for i=1,#t do
- t[t[i]] = true
- end
- end
-end
-local script_mapping do
- -- We could extract these from PropertyValueAliases.txt...
- local script_aliases = {
- Adlam = "Adlm", Caucasian_Albanian = "Aghb", Ahom = "Ahom", Arabic = "Arab",
- Imperial_Aramaic = "Armi", Armenian = "Armn", Avestan = "Avst",
- Balinese = "Bali", Bamum = "Bamu", Bassa_Vah = "Bass", Batak = "Batk",
- Bengali = "Beng", Bhaiksuki = "Bhks", Bopomofo = "Bopo", Brahmi = "Brah",
- Braille = "Brai", Buginese = "Bugi", Buhid = "Buhd", Chakma = "Cakm",
- Canadian_Aboriginal = "Cans", Carian = "Cari", Cham = "Cham",
- Cherokee = "Cher", Coptic = "Copt", Cypriot = "Cprt", Cyrillic = "Cyrl",
- Devanagari = "Deva", Dogra = "Dogr", Deseret = "Dsrt", Duployan = "Dupl",
- Egyptian_Hieroglyphs = "Egyp", Elbasan = "Elba", Elymaic = "Elym",
- Ethiopic = "Ethi", Georgian = "Geor", Glagolitic = "Glag",
- Gunjala_Gondi = "Gong", Masaram_Gondi = "Gonm", Gothic = "Goth",
- Grantha = "Gran", Greek = "Grek", Gujarati = "Gujr", Gurmukhi = "Guru",
- Hangul = "Hang", Han = "Hani", Hanunoo = "Hano", Hatran = "Hatr",
- Hebrew = "Hebr", Hiragana = "Hira", Anatolian_Hieroglyphs = "Hluw",
- Pahawh_Hmong = "Hmng", Nyiakeng_Puachue_Hmong = "Hmnp",
- Katakana_Or_Hiragana = "Hrkt", Old_Hungarian = "Hung", Old_Italic = "Ital",
- Javanese = "Java", Kayah_Li = "Kali", Katakana = "Kana",
- Kharoshthi = "Khar", Khmer = "Khmr", Khojki = "Khoj", Kannada = "Knda",
- Kaithi = "Kthi", Tai_Tham = "Lana", Lao = "Laoo", Latin = "Latn",
- Lepcha = "Lepc", Limbu = "Limb", Linear_A = "Lina", Linear_B = "Linb",
- Lisu = "Lisu", Lycian = "Lyci", Lydian = "Lydi", Mahajani = "Mahj",
- Makasar = "Maka", Mandaic = "Mand", Manichaean = "Mani", Marchen = "Marc",
- Medefaidrin = "Medf", Mende_Kikakui = "Mend", Meroitic_Cursive = "Merc",
- Meroitic_Hieroglyphs = "Mero", Malayalam = "Mlym", Modi = "Modi",
- Mongolian = "Mong", Mro = "Mroo", Meetei_Mayek = "Mtei", Multani = "Mult",
- Myanmar = "Mymr", Nandinagari = "Nand", Old_North_Arabian = "Narb",
- Nabataean = "Nbat", Newa = "Newa", Nko = "Nkoo", Nushu = "Nshu",
- Ogham = "Ogam", Ol_Chiki = "Olck", Old_Turkic = "Orkh", Oriya = "Orya",
- Osage = "Osge", Osmanya = "Osma", Palmyrene = "Palm", Pau_Cin_Hau = "Pauc",
- Old_Permic = "Perm", Phags_Pa = "Phag", Inscriptional_Pahlavi = "Phli",
- Psalter_Pahlavi = "Phlp", Phoenician = "Phnx", Miao = "Plrd",
- Inscriptional_Parthian = "Prti", Rejang = "Rjng", Hanifi_Rohingya = "Rohg",
- Runic = "Runr", Samaritan = "Samr", Old_South_Arabian = "Sarb",
- Saurashtra = "Saur", SignWriting = "Sgnw", Shavian = "Shaw",
- Sharada = "Shrd", Siddham = "Sidd", Khudawadi = "Sind", Sinhala = "Sinh",
- Sogdian = "Sogd", Old_Sogdian = "Sogo", Sora_Sompeng = "Sora",
- Soyombo = "Soyo", Sundanese = "Sund", Syloti_Nagri = "Sylo",
- Syriac = "Syrc", Tagbanwa = "Tagb", Takri = "Takr", Tai_Le = "Tale",
- New_Tai_Lue = "Talu", Tamil = "Taml", Tangut = "Tang", Tai_Viet = "Tavt",
- Telugu = "Telu", Tifinagh = "Tfng", Tagalog = "Tglg", Thaana = "Thaa",
- Thai = "Thai", Tibetan = "Tibt", Tirhuta = "Tirh", Ugaritic = "Ugar",
- Vai = "Vaii", Warang_Citi = "Wara", Wancho = "Wcho", Old_Persian = "Xpeo",
- Cuneiform = "Xsux", Yi = "Yiii", Zanabazar_Square = "Zanb",
- Inherited = "Zinh", Common = "Zyyy", Unknown = "Zzzz",
- }
- local entry = lpeg.Cg(codepoint_range * sep * ((lpeg.R'AZ' + lpeg.R'az' + '_')^1/script_aliases))^-1 * (1-lpeg.P'\n')^0 * '\n'
- -- local entry = lpeg.Cg(codepoint_range * sep * lpeg.Cc(true))^-1 * (1-lpeg.P'\n')^0 * '\n'
- local file = lpeg.Cf(
- lpeg.Ct''
- * entry^0
- , multirawset)
-
- local f = io.open(kpse.find_file"Scripts.txt")
- script_mapping = file:match(f:read'*a')
- f:close()
-end
-
-local additional_scripts_tables = { }
-
-local additional_scripts_fonts = setmetatable({}, {
- __index = function(t, fid)
- local f = font.getfont(fid)
- -- table.tofile('myfont2', f)
- local res = f and f.additional_scripts or false
- t[fid] = res
- return res
- end,
-})
-
-local function makecombifont(tfmdata, _, additional_scripts)
- local basescript = tfmdata.properties.script
- local scripts = {basescript = false}
- additional_scripts = additional_scripts_tables[additional_scripts]
- for script, fontname in pairs(additional_scripts) do
- if script ~= basescript then
- local f = fonts.definers.read(fontname, tfmdata.size)
- local fid
- if type(f) == 'table' then
- fid = font.define(f)
- else
- error[[FIXME???]]
- end
- scripts[script] = {
- fid = fid,
- font = f,
- characters = f.characters,
- }
- end
- end
- tfmdata.additional_scripts = scripts
-end
-
-local glyph_id = node.id'glyph'
--- TODO: unset last_script, matching parentheses etc
-function domultiscript(head, _, _, _, direction)
- head = node.direct.todirect(head)
- local last_fid, last_fonts, last_script
- for cur, cid, fid in traverse_char(head) do
- if fid ~= last_fid then
- last_fid, last_fonts, last_script = fid, additional_scripts_fonts[fid]
- end
- if last_fonts then
- local mapped_scr = script_mapping[cid]
- if mapped_scr == "Zinh" then
- mapped_scr = last_script
- else
- local additional_scr = script_extensions[cid]
- if additional_scripts then
- if additional_scripts[last_script] then
- mapped_scr = last_script
- elseif not last_fonts[mapped_scr] then
- for i = 1, #additional_scripts do
- if last_fonts[additional_scripts[i]] then
- mapped_scr = additional_scripts[i]
- break
- end
- end
- end
- elseif mapped_scr == "Zyyy" then
- mapped_scr = last_script
- end
- end
- last_script = mapped_scr
- local mapped_font = last_fonts[mapped_scr]
- if mapped_font then
- setfont(cur, mapped_font.fid)
- end
- end
- end
-end
-
-function luaotfload.add_multiscript(name, fonts)
- if fonts == nil then
- fonts = name
- name = #additional_scripts_fonts + 1
- end
- additional_scripts_tables[name] = fonts
- return name
-end
-
-otffeatures.register {
- name = "multiscript",
- description = "Combine fonts for multiple scripts",
- manipulators = {
- node = makecombifont,
- },
- -- processors = { -- processors would be nice, but they are applied
- -- -- too late for our purposes
- -- node = donotdef,
- -- }
-}
-
---- vim:sw=2:ts=2:expandtab:tw=71
diff --git a/macros/luatex/generic/luaotfload/luaotfload-fallback.lua b/macros/luatex/generic/luaotfload/luaotfload-fallback.lua
index 0caef93589..3e5d65eaca 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-fallback.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-fallback.lua
@@ -5,8 +5,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-fallback",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / fallback",
license = "GPL v2.0",
author = "Marcel Krüger"
diff --git a/macros/luatex/generic/luaotfload/luaotfload-features.lua b/macros/luatex/generic/luaotfload/luaotfload-features.lua
index adce910c4e..bedcd59d76 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-features.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-features.lua
@@ -5,8 +5,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-features",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / features",
license = "GPL v2.0",
author = "Hans Hagen, Khaled Hosny, Elie Roux, Philipp Gesang, Marcel Krüger",
@@ -509,6 +509,17 @@ do
end
return factors
end
+
+ -- Additionally we patch trytosharefont to ensure that variable fonts work
+ -- with default values whenever no explicit values are passed.
+ local original_trytosharefont = fonts.constructors.trytosharefont
+ function fonts.constructors.trytosharefont(target, tfmdata)
+ original_trytosharefont(target, tfmdata)
+ if not target.streamprovider and tfmdata.resources.variabledata then
+ local format = tfmdata.properties.format
+ target.streamprovider = format == 'opentype' and 1 or format == 'truetype' and 2 or 0
+ end
+ end
end
-- MK: Added
diff --git a/macros/luatex/generic/luaotfload/luaotfload-filelist.lua b/macros/luatex/generic/luaotfload/luaotfload-filelist.lua
index 10421ee372..e3fc38acd3 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-filelist.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-filelist.lua
@@ -6,8 +6,8 @@
if luaotfload_module then luaotfload_module {
name = "luaotfload-filelist",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / filelist",
license = "GPL v2.0"
} end
diff --git a/macros/luatex/generic/luaotfload/luaotfload-glyphlist.lua b/macros/luatex/generic/luaotfload/luaotfload-glyphlist.lua
index 7a34f29ca1..93a2eaeffd 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-glyphlist.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-glyphlist.lua
@@ -1,8 +1,8 @@
if luaotfload_module then
luaotfload_module {
name = "luaotfload-glyphlist",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / autogenerated glyphlist",
copyright = "derived from https://raw.githubusercontent.com/adobe-type-tools/agl-aglfn/master/glyphlist.txt",
original = "Adobe Glyph List, version 2.0, September 20, 2002",
diff --git a/macros/luatex/generic/luaotfload/luaotfload-harf-define.lua b/macros/luatex/generic/luaotfload/luaotfload-harf-define.lua
index f470b13772..f128adbaae 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-harf-define.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-harf-define.lua
@@ -5,8 +5,8 @@
do -- block to avoid to many local variables error
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-harf-define",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / HarfBuzz font loading",
license = "GPL v2.0",
author = "Khaled Hosny, Marcel Krüger",
@@ -71,7 +71,7 @@ local get_designsize do
end
local containers = luaotfload.fontloader.containers
-local hbcacheversion = 1.1
+local hbcacheversion = 1.2
local facecache = containers.define("fonts", "hb", hbcacheversion, true)
local function loadfont(spec)
@@ -119,7 +119,8 @@ local function loadfont(spec)
local descender = fontextents and fontextents.descender or upem * .2
local gid = hbfont:get_nominal_glyph(0x0020)
- local space = gid and hbfont:get_glyph_h_advance(gid) or upem / 2
+ local real_space = hbfont:get_glyph_h_advance(gid or 0)
+ local tex_space = gid and real_space or upem / 2
local slant = 0
if haspost then
@@ -214,7 +215,8 @@ local function loadfont(spec)
gid_offset = 0x120000,
upem = upem,
fonttype = fonttype,
- space = space,
+ real_space = real_space,
+ tex_space = tex_space,
xheight = xheight,
capheight = capheight,
slant = slant,
@@ -260,7 +262,8 @@ local function scalefont(data, spec)
local hbface = data.face
local hbfont = data.font
local upem = data.upem
- local space = data.space
+ local tex_space = data.tex_space
+ local real_space = data.real_space
local gid_offset = data.gid_offset
if size < 0 then
@@ -321,15 +324,16 @@ local function scalefont(data, spec)
characters = characters,
parameters = {
slant = data.slant,
- space = space * scale,
- space_stretch = space * scale / 2,
- space_shrink = space * scale / 3,
+ space = tex_space * scale,
+ space_stretch = tex_space * scale / 2,
+ space_shrink = tex_space * scale / 3,
x_height = data.xheight * scale,
quad = size,
- extra_space = space * scale / 3,
+ extra_space = tex_space * scale / 3,
[8] = data.capheight * scale, -- for XeTeX compatibility.
},
hb = {
+ space = (real_space * scale + .5) // 1,
scale = scale,
palette = palette,
shared = data,
diff --git a/macros/luatex/generic/luaotfload/luaotfload-harf-plug.lua b/macros/luatex/generic/luaotfload/luaotfload-harf-plug.lua
index bf7028c54d..1577aa7004 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-harf-plug.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-harf-plug.lua
@@ -2,17 +2,15 @@
-- FILE: luaotfload-harf-plug.lua
-- DESCRIPTION: part of luaotfload / HarfBuzz / fontloader plugin
-----------------------------------------------------------------------
-do -- block to avoid to many local variables error
- assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
- name = "luaotfload-harf-plug",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
- description = "luaotfload submodule / HarfBuzz shaping",
- license = "GPL v2.0",
- author = "Khaled Hosny, Marcel Krüger",
- copyright = "Luaotfload Development Team",
- }
-end
+assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
+ name = "luaotfload-harf-plug",
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
+ description = "luaotfload submodule / HarfBuzz shaping",
+ license = "GPL v2.0",
+ author = "Khaled Hosny, Marcel Krüger",
+ copyright = "Luaotfload Development Team",
+}
local hb = luaotfload.harfbuzz
local logreport = luaotfload.log.report
@@ -181,7 +179,8 @@ local function itemize(head, fontid, direction)
local dirstack = {}
local currdir = direction or 0
local lastskip, lastdir = true
- local lastrun = {}
+ local dummyrun = { start = 0, len = 0 }
+ local lastrun = dummyrun
local lastdisc
local in_disc
@@ -226,9 +225,6 @@ local function itemize(head, fontid, direction)
setlink(prev, n)
code = nil
skip = false
- if not prev then
- head = n
- end
else
skip = true
end
@@ -272,6 +268,9 @@ local function itemize(head, fontid, direction)
lastrun.len = lastrun.len + 1
elseif disc then
if lastdisc then
+ if lastrun.len == 0 then
+ runs[#runs - 1].after = n
+ end
lastdisc.next = disc
lastdisc = disc
else
@@ -280,7 +279,7 @@ local function itemize(head, fontid, direction)
end
end
- return head, runs
+ return dummyrun.after, runs
end
@@ -439,6 +438,7 @@ function shape(head, firstnode, run)
while disc_cluster and after_cluster <= cluster
or not disc_cluster and anchor_cluster <= cluster do
if disc_cluster then
+ if false then -- The saved_... are for nested (aka first/second or init/select) discretionary nodes. The code is currently disabled because the linebreaking for these is broken on the engine level.
if not saved_after and saved_anchor < cluster then
saved_after = discs.next.after_cluster + offset
if saved_after > cluster then
@@ -448,11 +448,14 @@ function shape(head, firstnode, run)
elseif saved_after then
saved_after, after_cluster = after_cluster, saved_after
end
+ end
local rep_glyphs = table.move(glyphs, disc_glyph, i - 1, 1, {})
for j = 1, #rep_glyphs do
local glyph = rep_glyphs[j]
glyph.cluster = glyph.cluster - disc_cluster
- glyph.nextcluster = glyph.nextcluster - disc_cluster
+ if glyph.nextcluster then
+ glyph.nextcluster = glyph.nextcluster - disc_cluster
+ end
end
do
local cluster_offset = disc_cluster - cluster + (saved_after and 2 or 1) -- The offset the glyph indices will move
@@ -637,7 +640,6 @@ function shape(head, firstnode, run)
::NEXTCLUSTERFOUND:: -- end
glyph.nextcluster = nextcluster
- local disc, discindex
-- Calculate the Unicode code points of this glyph. If cluster did not
-- change then this is a glyph inside a complex cluster and will be
-- handled with the start of its cluster.
@@ -651,19 +653,12 @@ function shape(head, firstnode, run)
-- assert(char == codes[j])
hex = hex .. to_utf16_hex(char)
str = str .. utf8.char(char)
- elseif not discindex and id == disc_t then
- local props = properties[disc]
- if not (props and props.zwnj) then
- disc, discindex = node, j
- end
end
node = getnext(node)
end
glyph.tounicode = hex
glyph.string = str
end
- if not fordisc and discindex then
- end
end
return head, firstnode, glyphs, run.len - len
else
@@ -743,7 +738,6 @@ local function tonodes(head, node, run, glyphs)
local dir = run.dir
local fontid = run.font
local fontdata = font.getfont(fontid)
- local space = fontdata.parameters.space
local characters = fontdata.characters
local hbdata = fontdata.hb
local hfactor = (fontdata.extend or 1000) / 1000
@@ -758,6 +752,7 @@ local function tonodes(head, node, run, glyphs)
local lastprops
local scale = hbdata.scale
+ local space = hbdata.space
local haspng = hbshared.haspng
local fonttype = hbshared.fonttype
diff --git a/macros/luatex/generic/luaotfload/luaotfload-init.lua b/macros/luatex/generic/luaotfload/luaotfload-init.lua
index c0ec8cd84b..9ce1d2494d 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-init.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-init.lua
@@ -7,8 +7,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-init",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / initialization",
license = "GPL v2.0"
}
@@ -394,7 +394,7 @@ local function init_main(early_hook)
---load_fontloader_module "font-odv.lua" --- <= Devanagari support from Context
logreport ("log", 0, "init",
- "Context OpenType loader version %q",
+ "Context OpenType loader version %.3f",
fonts.handlers.otf.version)
callback.register = trapped_register
nodes = context_environment.nodes
diff --git a/macros/luatex/generic/luaotfload/luaotfload-latex.pdf b/macros/luatex/generic/luaotfload/luaotfload-latex.pdf
index 84c541dc0c..7931d9d1d4 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-latex.pdf
+++ b/macros/luatex/generic/luaotfload/luaotfload-latex.pdf
Binary files differ
diff --git a/macros/luatex/generic/luaotfload/luaotfload-letterspace.lua b/macros/luatex/generic/luaotfload/luaotfload-letterspace.lua
index bbdaa729e2..7963a839b9 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-letterspace.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-letterspace.lua
@@ -5,8 +5,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-letterspace",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / letterspacing",
license = "GPL v2.0",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -59,6 +59,12 @@ local setkern = nodedirect.setkern
local getglue = nodedirect.getglue
local setglue = nodedirect.setglue
+local hasattribute = nodedirect.has_attribute
+local setattribute = nodedirect.set_attribute
+
+local getattributelist = nodedirect.getattributelist
+local setattributelist = nodedirect.setattributelist
+
local find_node_tail = nodedirect.tail
local todirect = nodedirect.todirect
local tonode = nodedirect.tonode
@@ -80,6 +86,9 @@ local chardata = fonthashes.characters
local otffeatures = fonts.constructors.newfeatures "otf"
local markdata
+local attribute_table = {}
+local attr = luatexbase.new_attribute("luaotfload.letterspace_done")
+
local function getprevreal(n)
repeat
n = getprev(n)
@@ -243,6 +252,10 @@ kerncharacters = function (head)
local id = getid(start)
if id == glyph_code then
--- 1) look up kern factor (slow, but cached rudimentarily)
+ if hasattribute(start, attr, 1) then -- We already kerned this node
+ firstkern = false -- TODO: I'm not sure about this one yet
+ goto nextnode
+ end
local fontid = getfont(start)
local krn, fillup = unpack(kernamounts[fontid])
if not krn or krn == 0 then
@@ -426,6 +439,14 @@ kerncharacters = function (head)
setfield(disc, "replace", kern_injector(false, krn))
end --[[if replace and prv and nxt]]
end --[[if not pid]]
+ local attr_list = getattributelist(start)
+ local new_attr_list = attribute_table[attr_list]
+ if new_attr_list then
+ setattributelist(start, new_attr_list)
+ else
+ setattribute(start, attr, 1)
+ attribute_table[attr_list] = getattributelist(start)
+ end
end --[[if prev]]
end --[[if id == glyph_code]]
@@ -478,6 +499,9 @@ local function enablefontkerning ( )
logreport ("both", 0, "letterspace",
"kerncharacters() failed to return a valid new head")
end
+
+ for k in next, attribute_table do attribute_table[k] = nil end
+
return tonode (direct_hd)
end
diff --git a/macros/luatex/generic/luaotfload/luaotfload-loaders.lua b/macros/luatex/generic/luaotfload/luaotfload-loaders.lua
index e58f2429fe..1ed66aebea 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-loaders.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-loaders.lua
@@ -8,8 +8,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-loaders",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / callback handling",
license = "GPL v2.0"
}
diff --git a/macros/luatex/generic/luaotfload/luaotfload-log.lua b/macros/luatex/generic/luaotfload/luaotfload-log.lua
index 38208241f7..74c5fd6929 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-log.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-log.lua
@@ -6,8 +6,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-log",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / logging",
license = "GPL v2.0",
author = "Khaled Hosny, Elie Roux, Philipp Gesang",
diff --git a/macros/luatex/generic/luaotfload/luaotfload-main.tex b/macros/luatex/generic/luaotfload/luaotfload-main.tex
index acc136fd9d..ccc20ca578 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-main.tex
+++ b/macros/luatex/generic/luaotfload/luaotfload-main.tex
@@ -32,7 +32,7 @@
\beginfrontmatter
\setdocumenttitle {The \identifier{luaotfload} package}
- \setdocumentdate {2021-01-08 v3.17}
+ \setdocumentdate {2021-05-21 v3.18}
\setdocumentauthor {LaTeX3 Project\\
Elie Roux · Khaled Hosny · Philipp Gesang · Ulrike Fischer · Marcel Krüger\\
Home: \hyperlink {https://github.com/latex3/luaotfload}}
@@ -62,6 +62,14 @@ Supported is the \identifier{luatex} versions of a current TeXLive 2019 (and a c
\endsection
\beginsection{Changes}
+\beginsubsection {New in version 3.18 (by Ulrike Fischer/Marcel Krüger)}
+\begin{itemize}
+ \item Now variable fonts can be loaded with default values without specifying
+ any explicit axis values.
+ \item A number of small bugfixes.
+ \end{itemize}
+\endsubsection
+
\beginsubsection {New in version 3.17 (by Ulrike Fischer/Marcel Krüger)}
\begin{itemize}
\item The experimental support for OpenType variable fonts has been extended
diff --git a/macros/luatex/generic/luaotfload/luaotfload-multiscript.lua b/macros/luatex/generic/luaotfload/luaotfload-multiscript.lua
index 7caae3a222..e3cf9a0cbf 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-multiscript.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-multiscript.lua
@@ -5,8 +5,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-multiscript",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / multiscript",
license = "GPL v2.0",
author = "Marcel Krüger"
diff --git a/macros/luatex/generic/luaotfload/luaotfload-notdef.lua b/macros/luatex/generic/luaotfload/luaotfload-notdef.lua
index aa4ce3076e..d8cc677723 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-notdef.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-notdef.lua
@@ -5,8 +5,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-notdef",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / notdef",
license = "GPL v2.0",
author = "Marcel Krüger"
diff --git a/macros/luatex/generic/luaotfload/luaotfload-parsers.lua b/macros/luatex/generic/luaotfload/luaotfload-parsers.lua
index 40973db882..cd452b40c2 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-parsers.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-parsers.lua
@@ -7,8 +7,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-parsers",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / parsers",
license = "GPL v2.0"
}
diff --git a/macros/luatex/generic/luaotfload/luaotfload-resolvers.lua b/macros/luatex/generic/luaotfload/luaotfload-resolvers.lua
index 4aa27a513b..a24757777e 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-resolvers.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-resolvers.lua
@@ -11,8 +11,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-resolvers",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / resolvers",
license = "GPL v2.0"
}
diff --git a/macros/luatex/generic/luaotfload/luaotfload-scripts.lua b/macros/luatex/generic/luaotfload/luaotfload-scripts.lua
index 003dda6c07..8a4f51ea58 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-scripts.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-scripts.lua
@@ -5,8 +5,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-script",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / Script helpers",
license = "CC0 1.0 Universal",
author = "Marcel Krüger"
diff --git a/macros/luatex/generic/luaotfload/luaotfload-status.lua b/macros/luatex/generic/luaotfload/luaotfload-status.lua
index ef89e65010..6743a025c3 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-status.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-status.lua
@@ -1,8 +1,8 @@
return {
["hashes"]={
- { "fontloader-2021-01-07.lua", "ef54bfa34416e2c85fa48d3195c67fd2" },
+ { "fontloader-2021-05-20.lua", "d3d971e3e79aefcb828157b97cc33378" },
{ "fontloader-util-fil.lua", "aae2a2add764144bb58dd8216fd59260" },
- { "fontloader-util-str.lua", "c975ff7bbd178163cf47d9e9296c8b4b" },
+ { "fontloader-util-str.lua", "f3480da8f9a6f34fe320900f7224719b" },
{ "fontloader-l-unicode.lua", "f368874f11f3c525de5864fd413e4b24" },
{ "fontloader-l-math.lua", "082add08e0bb79f39191ae9534a79849" },
{ "fontloader-l-boolean.lua", "abe28515dd33e8f6c416c09bca351cf8" },
@@ -11,9 +11,9 @@ return {
{ "fontloader-l-table.lua", "0330da8b3a08d39876def70df8d9c0e5" },
{ "fontloader-l-string.lua", "9457f2af85723e0e6c46d0b5122e9000" },
{ "fontloader-l-function.lua", "a7e68a9703c35238729da41a474e951b" },
- { "fontloader-l-lpeg.lua", "10bdaef44175902917691835010ae5f5" },
+ { "fontloader-l-lpeg.lua", "446dc07c8f6d2884122679fb4c8589e2" },
{ "fontloader-l-lua.lua", "420bc442e6d81f4624728a6c56fcd175" },
- { "fontloader-fonts-gbn.lua", "10ecdf01e7c926e5128ad8a9dff4d677" },
+ { "fontloader-fonts-gbn.lua", "34e4543a02f6fbc8c2ade896cb6dc7df" },
{ "fontloader-fonts-lig.lua", "fbd251eea3810a43a8d5542319361d68" },
{ "fontloader-fonts-ext.lua", "32013cbc5d5d336be8b1d1e5879d86c4" },
{ "fontloader-fonts-def.lua", "f435e0875f203f343157baeff876ec9c" },
@@ -21,79 +21,79 @@ return {
{ "fontloader-fonts-enc.lua", "5ff4ca50493d7c4ecea0e15c203099f0" },
{ "fontloader-fonts-mis.lua", "17e967c9ec4d001deefd43ddf25e98f7" },
{ "fontloader-basics-chr.lua", "64fafe4eaf55d64aead6513c1e74a024" },
- { "fontloader-basics-nod.lua", "4b5c3c63e19df1b3f37fae7f87c25bda" },
- { "fontloader-font-imp-effects.lua", "a2dde5e071fcb3fc7b90f2bcd5aa4f22" },
+ { "fontloader-basics-nod.lua", "b2e0a0e5e1e27349aed464fa738b8db1" },
+ { "fontloader-font-imp-effects.lua", "d05997c1826355548ec9aec1346f9f23" },
{ "fontloader-font-imp-italics.lua", "defcb415bc1e0a0999b27773902adc18" },
{ "fontloader-font-imp-ligatures.lua", "26ffcf089391445f7af59536c8814364" },
{ "fontloader-font-imp-tex.lua", "ceb087ef6fa2f89aed7179f60ddf8f35" },
- { "fontloader-font-shp.lua", "5ff497c993112d4fef4c148348d964eb" },
+ { "fontloader-font-shp.lua", "2bb36adb4b264a895a2c4d97e1ac1d1e" },
{ "fontloader-font-def.lua", "b9d908c2338b7dc443ce9d1e9fcb7139" },
{ "fontloader-font-lua.lua", "1fbfdf7b689b2bdfd0e3bb9bf74ce136" },
{ "fontloader-font-afk.lua", "9da14e0fb22129c053acc599d1312544" },
- { "fontloader-font-one.lua", "53cd565030e919da984b50471cc3be37" },
+ { "fontloader-font-one.lua", "bd39d42055a44ca2002f8ddbbbbf27c3" },
{ "fontloader-font-onr.lua", "6d161533f3437435e12a0ad64866df44" },
- { "fontloader-font-ocl.lua", "797b5c71bf819c5f4fb314a4d646e9a7" },
- { "fontloader-font-osd.lua", "73c9531c79df5ada320cb20777f7ed49" },
+ { "fontloader-font-ocl.lua", "2a377351ae23c339764ec8ce2e8e9164" },
+ { "fontloader-font-osd.lua", "0e051ca0d3b1a8e0604ced27e753fde8" },
{ "fontloader-font-otc.lua", "0f12230ea07b5151f75d52726977e91f" },
- { "fontloader-font-ots.lua", "c780a471147527f4ddc139e017927ffe" },
- { "fontloader-font-ota.lua", "ad1d5de06400f88829509e1f3ff2b473" },
- { "fontloader-font-oup.lua", "6f46aa00ae1c20c43f8ffaf329dc8695" },
- { "fontloader-font-otj.lua", "8de59cb9b043e5f73c6b9f7cc8f6978e" },
+ { "fontloader-font-ots.lua", "cb106ae882e8548051f00aac8b7fa862" },
+ { "fontloader-font-ota.lua", "2bb12d708e35bc05443eba791e2554e7" },
+ { "fontloader-font-oup.lua", "4eb2f26e51835239e26a8df2ecf04366" },
+ { "fontloader-font-otj.lua", "b2c165bd6771a57633f992d07384b739" },
{ "fontloader-font-oto.lua", "2b1d6bc63b2ebf8f2655a15e1cda6541" },
- { "fontloader-font-otl.lua", "f4e6652a191003493389de230b14cfb3" },
- { "fontloader-font-ott.lua", "673ed11e1d159997f535bfec5fa73808" },
+ { "fontloader-font-otl.lua", "6f701653de713e8aa80d82c7cdf32d75" },
+ { "fontloader-font-ott.lua", "3f67b1b1d40bbc222681d8db4aff0f42" },
{ "fontloader-font-oti.lua", "309a75f9c14b77d87e94eba827dc4e71" },
{ "fontloader-font-dsp.lua", "174ce11f3ba0bddf270f48d8d2addd56" },
{ "fontloader-font-ttf.lua", "ffffc827e1bcddc33a2b615340ecff7f" },
- { "fontloader-font-cff.lua", "2b677fad52d9999d0685e8525271a8cc" },
- { "fontloader-font-otr.lua", "64dcbbc7107538723990e1119a80a9f8" },
+ { "fontloader-font-cff.lua", "01e7c6fbc8961a566f4e4f8cbedb7004" },
+ { "fontloader-font-otr.lua", "ad238624c9ebd488d4bbe9af3b620189" },
{ "fontloader-font-vfc.lua", "a81c29eda98cd62cbebdb6c93544b50d" },
{ "fontloader-font-map.lua", "c4a39db5ad822b348aa61bca5f4a599a" },
{ "fontloader-font-cid.lua", "22b0367742fb253deef84ef7ccf5e8de" },
{ "fontloader-font-con.lua", "724e5dd14aec2d4d189f8619898004cf" },
{ "fontloader-font-ini.lua", "5343de60613adb24cdd7a8d2ee1d153c" },
{ "fontloader-data-con.lua", "23a0f5386d46a1c157ae82a373e35fa0" },
- { "fontloader-reference.lua", "4807209e6a35420dd7528e9ec02f11da" },
+ { "fontloader-reference.lua", "29911e74397766ee36205736166dd763" },
{ "fontloader-basics-gen.lua", "4bc43036e9796fccb0b8869f4b05bf2e" },
{ "mktests", "918cb50be9ee8bd645ac1a27dc501e8c" },
- { "mkstatus", "d3bc6e7d0f6deb80db4edc6975e2ac5c" },
+ { "mkstatus", "7f2fd945c1247f6af6b96c4ed49ddeab" },
{ "mkcharacters", "bfca0e96e1e351afe7077502f9595af9" },
{ "mkglyphlist", "7a8a8fdc0eac7fac2f13ec8f4e8e7aa9" },
{ "mkimport", "7d62f1042e548f8b9368f26b9ba4be5c" },
- { "luaotfload-glyphlist.lua", "6097b4fd28b303a3ae7577e94f86610d" },
+ { "luaotfload-glyphlist.lua", "54908a38bf531914f350614afff2ccf6" },
{ "luaotfload-characters.lua", "76415ca3ede312cad6e09038323489ae" },
- { "luaotfload-dvi.lua", "a0d33e699c250c0e4abd4cfa1b974b6e" },
- { "luaotfload-tounicode.lua", "e07e112222777070250fbc980b2e6b85" },
- { "luaotfload-unicode.lua", "1d7fd6ab63640cb6c8e2091ac5a57915" },
- { "luaotfload-resolvers.lua", "b387d9435738f7ce8cf1e6af86b565a6" },
- { "luaotfload-parsers.lua", "dba42cb2f6bbfa13b9a56d0e4a2b2f44" },
- { "luaotfload-fallback.lua", "a3c8c048b14a304d3352871014ef1343" },
- { "luaotfload-szss.lua", "2413a2be98181fe77f7e110369194769" },
- { "luaotfload-scripts.lua", "2b924be852e17191e651faf5a2097e12" },
- { "luaotfload-multiscript.lua", "db7b6c7791b4b909d12234620ff7973d" },
- { "luaotfload-loaders.lua", "d169564522ac7194e7410d8263cd1b31" },
- { "luaotfload-harf-plug.lua", "8fdc1ba513a6026546b883259e559c7e" },
- { "luaotfload-harf-define.lua", "1c9a663bb7bfa650b93dcf01d5450675" },
- { "luaotfload-notdef.lua", "26fed1a76150718e05c8c56b1983ebdd" },
- { "luaotfload-embolden.lua", "5506419bc583d450f252542b1105d6ce" },
- { "luaotfload-letterspace.lua", "1a518a55f6663ce13866416a5b94d6a4" },
- { "luaotfload-features.lua", "33fdd06674606d043599dc4ea9b2a56b" },
- { "luaotfload-database.lua", "4a0f9f3b500df0d8a8234a0954065e46" },
- { "luaotfload-configuration.lua", "589ca99522479a0929d6824bafa36f63" },
- { "luaotfload-colors.lua", "7c201914c79310d9e79e75dfc7ee982b" },
- { "luaotfload-auxiliary.lua", "8e427ec79ced91d9fc6fbcece159d042" },
- { "luaotfload-filelist.lua", "3cd6b9d12ba2fb48783e393593cd9afd" },
- { "luaotfload-tool.lua", "f4534033397387433601040694b70c6b" },
- { "luaotfload-diagnostics.lua", "473e1a3cd00e4b277b1f7e17b13254da" },
- { "luaotfload-log.lua", "809e4afac4e070b619512461a6fedd90" },
- { "luaotfload-init.lua", "e3b832a9efc91c977044383640835069" },
+ { "luaotfload-dvi.lua", "403603ff9e267d2b9ac631e63b869718" },
+ { "luaotfload-tounicode.lua", "8f7850323417188eef5197d4e420bd34" },
+ { "luaotfload-unicode.lua", "5bc464447c3f5b154d8368904044d654" },
+ { "luaotfload-resolvers.lua", "3655371360dd87b4a7c83e355357e6eb" },
+ { "luaotfload-parsers.lua", "c715cb6ea43d644ec26d6e87d25b5d27" },
+ { "luaotfload-fallback.lua", "78a566243c0ad99e74f93fface672fb5" },
+ { "luaotfload-szss.lua", "4c431d8f76e06200b2df3269615097cc" },
+ { "luaotfload-scripts.lua", "12bf373853ead3eab3c83ec62e37bbd6" },
+ { "luaotfload-multiscript.lua", "a46096b20f5442acea29c75b77f763a7" },
+ { "luaotfload-loaders.lua", "ba59f0161e985f4c97c54245a74a8d29" },
+ { "luaotfload-harf-plug.lua", "bded3b2beccab4943f616b3069cbb372" },
+ { "luaotfload-harf-define.lua", "a5e760f71e08a8ff40a40defc9d59e4e" },
+ { "luaotfload-notdef.lua", "dbb4718b4c1b46adc5870af3f5cc6cac" },
+ { "luaotfload-embolden.lua", "7cc1563093c005c40c11b8c327e617f1" },
+ { "luaotfload-letterspace.lua", "e7ee541a56954ebfa1a227aa59614bb9" },
+ { "luaotfload-features.lua", "bf81e7630c3786ce12c1f9b61ef73037" },
+ { "luaotfload-database.lua", "9b911605805ca1fab7d4088c0c50a5d2" },
+ { "luaotfload-configuration.lua", "ddedd9c27f810b254547c6a799aba892" },
+ { "luaotfload-colors.lua", "f4e86b8cbbcc790a64dae59b6b05b3d1" },
+ { "luaotfload-auxiliary.lua", "e814d7c408817ae01a96f279c278ed08" },
+ { "luaotfload-filelist.lua", "1108447545fbcb08aa0f6d586988c2e1" },
+ { "luaotfload-tool.lua", "4ca593bc9413e4de889f1c0df6e48219" },
+ { "luaotfload-diagnostics.lua", "4fa11f02259f2f9e7cd60d4b668b6a33" },
+ { "luaotfload-log.lua", "e1af43403d8bf68d95276c0dc00e64f0" },
+ { "luaotfload-init.lua", "f80c78b2296664ba42514674d104d093" },
{ "luaotfload-main.lua", "b19c9cc34cf1d676c39f872cfb41aef6" },
},
["notes"]={
["committer"]="Marcel Fabian Krüger <tex@2krueger.de>",
- ["description"]="v3.17/2021-01-08",
- ["loader"]="fontloader-2021-01-07.lua",
- ["revision"]="359a8a50a0d1f778e358cc1507b6f08ec17b6898",
- ["timestamp"]="2021-01-08 14:15:42 +0100",
+ ["description"]="v3.18/2021-05-21",
+ ["loader"]="fontloader-2021-05-20.lua",
+ ["revision"]="3f2cacb9d2136142cffb183774c0edaeb4ea3314",
+ ["timestamp"]="2021-05-21 02:12:47 +0200",
},
} \ No newline at end of file
diff --git a/macros/luatex/generic/luaotfload/luaotfload-suppress.lua b/macros/luatex/generic/luaotfload/luaotfload-suppress.lua
index d78428ca96..8ea049ba91 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-suppress.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-suppress.lua
@@ -5,8 +5,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-suppress",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / suppress",
license = "GPL v2.0",
author = "Marcel Krüger"
diff --git a/macros/luatex/generic/luaotfload/luaotfload-szss.lua b/macros/luatex/generic/luaotfload/luaotfload-szss.lua
index 88b02350f0..26c89eafa2 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-szss.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-szss.lua
@@ -5,8 +5,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-szss",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / Special feature handling",
license = "GPL v2.0",
author = "Marcel Krüger"
@@ -90,6 +90,7 @@ otfregister {
end
tfmdata.extend = value * 1000
tfmdata.hb.hscale = tfmdata.units_per_em * value
+ tfmdata.hb.space = tfmdata.hb.space * value
local parameters = tfmdata.parameters
parameters.slant = parameters.slant * value
parameters.space = parameters.space * value
diff --git a/macros/luatex/generic/luaotfload/luaotfload-tool.1 b/macros/luatex/generic/luaotfload/luaotfload-tool.1
index 86f70ac706..9e2b12aed0 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-tool.1
+++ b/macros/luatex/generic/luaotfload/luaotfload-tool.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH LUAOTFLOAD-TOOL 1 "2021-01-08" "3.17" "text processing"
+.TH LUAOTFLOAD-TOOL 1 "2021-05-21" "3.18" "text processing"
.SH NAME
luaotfload-tool \- generate and query the Luaotfload font names database
.
@@ -391,6 +391,11 @@ concerning the format and available options.
Print the currently active configuration; the
output can be saved to a file and used for
bootstrapping a custom configuration files.
+.TP
+.B \-\-aliases
+Dump the font name database as a kpathsea
+aliases file. This option is experimental and
+might go away.
.UNINDENT
.SH FILES
.sp
diff --git a/macros/luatex/generic/luaotfload/luaotfload-tool.lua b/macros/luatex/generic/luaotfload/luaotfload-tool.lua
index 0c58363903..df80d4da78 100644..100755
--- a/macros/luatex/generic/luaotfload/luaotfload-tool.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-tool.lua
@@ -9,8 +9,8 @@
local ProvidesLuaModule = {
name = "luaotfload-tool",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload-tool / database functionality",
license = "GPL v2.0"
}
@@ -584,7 +584,7 @@ local function display_general (fullinfo)
--- the MS compiler doesn’t support C99, so
--- strftime is missing some functionality;
--- see loslib.c for details.
- val = osdate("%Y-%m-d %H:%M:%S", fullinfo[key])
+ val = osdate("%Y-%m-%d %H:%M:%S", fullinfo[key])
end
end
if not val then
@@ -736,7 +736,7 @@ local action_sequence = {
"config" , "loglevel" , "help" , "version" ,
"dumpconf" , "diagnose" , "blacklist" , "cache" ,
"flush" , "bisect" , "generate" , "list" ,
- "query" ,
+ "query" , "aliases" ,
}
local action_pending = tabletohash(action_sequence, false)
@@ -834,7 +834,7 @@ local bisect_status_fmt = [[
local function write_bisect_status (data)
local payload = tableserialize (data, true)
local status = stringformat (bisect_status_fmt,
- osdate ("%Y-%m-d %H:%M:%S", os.time ()),
+ osdate ("%Y-%m-%d %H:%M:%S", os.time ()),
payload)
if status and iosavedata (bisect_status_file, status) then
logreport ("info", 4, "bisect",
@@ -1396,6 +1396,51 @@ function actions.diagnose (job)
return diagnose (job)
end
+function actions.aliases (job)
+ --- Help XeTeX find fonts
+ local name_index = fonts.names.data() or fonts.names.load()
+ local mappings = name_index.mappings
+ local fontnames = name_index.fontnames.texmf
+ local families = name_index.families.texmf
+ local formats = { 'ttf', 'otf', }
+ for _, format in ipairs(formats) do
+ for name, mapping in pairs(fontnames[format]) do
+ mapping = mappings[mapping]
+ print(string.format('%s %s', mapping.basename, name))
+ end
+ end
+ local function best_match(options, target)
+ if not options then return end
+ if options.default then return mappings[options.default] end
+ local best, best_diff = nil, math.huge
+ for _, option in ipairs(options) do
+ local diff = math.abs(option[1]-target)
+ if diff < best_diff then
+ best, best_diff = option[4], diff
+ end
+ end
+ return mappings[best]
+ end
+ for _, format in ipairs(formats) do
+ for name, family in pairs(families[format]) do
+ local r = best_match(family.r, 655360, mappings)
+ local b = best_match(family.b, 655360, mappings)
+ local i = best_match(family.i, 655360, mappings)
+ local bi = best_match(family.bi, 655360, mappings)
+ r = r or b or i or bi -- Not sure if this is still needed
+ if r then
+ b, i, bi = b or r, i or r, bi or r
+ print(string.format('%s %s\n%s %s-b\n%s %s-i\n%s %s-bi',
+ r.basename, name,
+ b.basename, name,
+ i.basename, name,
+ bi.basename, name))
+ end
+ end
+ end
+ return true
+end
+
--- stuff to be carried out prior to exit
local finalizers = { }
@@ -1434,6 +1479,7 @@ local function process_cmdline ( ) -- unit -> jobspec
}
local long_options = {
+ aliases = 0,
["bisect"] = 1,
cache = 1,
conf = 1,
@@ -1587,6 +1633,8 @@ local function process_cmdline ( ) -- unit -> jobspec
action_pending["dumpconf"] = true
elseif v == "print-conf" then
result.print_config = true
+ elseif v == "aliases" then
+ action_pending["aliases"] = true
end
end
diff --git a/macros/luatex/generic/luaotfload/luaotfload-tool.pdf b/macros/luatex/generic/luaotfload/luaotfload-tool.pdf
index 3836a25b15..fb44487640 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-tool.pdf
+++ b/macros/luatex/generic/luaotfload/luaotfload-tool.pdf
Binary files differ
diff --git a/macros/luatex/generic/luaotfload/luaotfload-tool.rst b/macros/luatex/generic/luaotfload/luaotfload-tool.rst
index 9ebc3127a1..085a371386 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-tool.rst
+++ b/macros/luatex/generic/luaotfload/luaotfload-tool.rst
@@ -6,9 +6,9 @@
generate and query the Luaotfload font names database
-----------------------------------------------------------------------
-:Date: 2021-01-08
+:Date: 2021-05-21
:Copyright: GPL v2.0
-:Version: 3.17
+:Version: 3.18
:Manual section: 1
:Manual group: text processing
@@ -281,6 +281,10 @@ miscellaneous
output can be saved to a file and used for
bootstrapping a custom configuration files.
+--aliases Dump the font name database as a kpathsea
+ aliases file. This option is experimental and
+ might go away.
+
FILES
=======================================================================
diff --git a/macros/luatex/generic/luaotfload/luaotfload-tounicode.lua b/macros/luatex/generic/luaotfload/luaotfload-tounicode.lua
index 5c92785066..928dfd30fc 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-tounicode.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-tounicode.lua
@@ -5,8 +5,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-tounicode",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / tounicode",
license = "GPL v2.0",
author = "Hans Hagen, Khaled Hosny, Elie Roux, Philipp Gesang, Marcel Krüger",
diff --git a/macros/luatex/generic/luaotfload/luaotfload-unicode.lua b/macros/luatex/generic/luaotfload/luaotfload-unicode.lua
index 5320c48ab2..ccc3988ba1 100644
--- a/macros/luatex/generic/luaotfload/luaotfload-unicode.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload-unicode.lua
@@ -5,8 +5,8 @@
assert(luaotfload_module, "This is a part of luaotfload and should not be loaded independently") {
name = "luaotfload-unicode",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "luaotfload submodule / Unicode helpers",
license = "CC0 1.0 Universal",
author = "Marcel Krüger"
diff --git a/macros/luatex/generic/luaotfload/luaotfload.conf.5 b/macros/luatex/generic/luaotfload/luaotfload.conf.5
index efb8b5fff3..8285e71d7d 100644
--- a/macros/luatex/generic/luaotfload/luaotfload.conf.5
+++ b/macros/luatex/generic/luaotfload/luaotfload.conf.5
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH LUAOTFLOAD.CONF 5 "2021-01-08" "3.17" "text processing"
+.TH LUAOTFLOAD.CONF 5 "2021-05-21" "3.18" "text processing"
.SH NAME
luaotfload.conf \- Luaotfload configuration file
.
diff --git a/macros/luatex/generic/luaotfload/luaotfload.conf.rst b/macros/luatex/generic/luaotfload/luaotfload.conf.rst
index 645a659d2b..84db4dca17 100644
--- a/macros/luatex/generic/luaotfload/luaotfload.conf.rst
+++ b/macros/luatex/generic/luaotfload/luaotfload.conf.rst
@@ -6,9 +6,9 @@
Luaotfload configuration file
-----------------------------------------------------------------------
-:Date: 2021-01-08
+:Date: 2021-05-21
:Copyright: GPL v2.0
-:Version: 3.17
+:Version: 3.18
:Manual section: 5
:Manual group: text processing
diff --git a/macros/luatex/generic/luaotfload/luaotfload.lua b/macros/luatex/generic/luaotfload/luaotfload.lua
index 4a3cdb78ae..8d769d7dc8 100644
--- a/macros/luatex/generic/luaotfload/luaotfload.lua
+++ b/macros/luatex/generic/luaotfload/luaotfload.lua
@@ -20,8 +20,8 @@ local authors = "\z
-- version number is used below!
local ProvidesLuaModule = {
name = "luaotfload",
- version = "3.17", --TAGVERSION
- date = "2021-01-08", --TAGDATE
+ version = "3.18", --TAGVERSION
+ date = "2021-05-21", --TAGDATE
description = "Lua based OpenType font support",
author = authors,
copyright = authors,
diff --git a/macros/luatex/generic/luaotfload/luaotfload.sty b/macros/luatex/generic/luaotfload/luaotfload.sty
index 915b418693..20dc5ffb4f 100644
--- a/macros/luatex/generic/luaotfload/luaotfload.sty
+++ b/macros/luatex/generic/luaotfload/luaotfload.sty
@@ -39,7 +39,7 @@
\fi
\ifdefined\ProvidesPackage
\ProvidesPackage{luaotfload}%
- [2021/01/08 v3.17 OpenType layout system]
+ [2021/05/21 v3.18 OpenType layout system]
\fi
\directlua{
if xpcall(function ()%
diff --git a/macros/luatex/generic/luaotfload/scripts-demo.pdf b/macros/luatex/generic/luaotfload/scripts-demo.pdf
index 29d47c2695..d6513d6869 100644
--- a/macros/luatex/generic/luaotfload/scripts-demo.pdf
+++ b/macros/luatex/generic/luaotfload/scripts-demo.pdf
Binary files differ
diff --git a/macros/luatex/generic/luaotfload/shaper-demo-graphite.pdf b/macros/luatex/generic/luaotfload/shaper-demo-graphite.pdf
index bfb4258474..29b7c229f7 100644
--- a/macros/luatex/generic/luaotfload/shaper-demo-graphite.pdf
+++ b/macros/luatex/generic/luaotfload/shaper-demo-graphite.pdf
Binary files differ
diff --git a/macros/luatex/generic/luaotfload/shaper-demo.pdf b/macros/luatex/generic/luaotfload/shaper-demo.pdf
index 056db0fac3..a604a8c557 100644
--- a/macros/luatex/generic/luaotfload/shaper-demo.pdf
+++ b/macros/luatex/generic/luaotfload/shaper-demo.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/README b/macros/luatex/generic/luatexja/README
index e0f26c370c..3a433c20d4 100644
--- a/macros/luatex/generic/luatexja/README
+++ b/macros/luatex/generic/luatexja/README
@@ -1,4 +1,4 @@
-The LuaTeX-ja Package 20210517.0
+The LuaTeX-ja Package 20210521.0
--------------------------------
Copyright (c) 2011--2021 The LuaTeX-ja project
License: modified BSD (see COPYING)
@@ -42,9 +42,9 @@ Installation
2. If you must/want to install manually:
a. Download the source archive from CTAN,
- or tagged as 20210517.0 in the Git repository by
+ or tagged as 20210521.0 in the Git repository by
<http://git.osdn.jp/view?p=luatex-ja/luatexja.git
- ;a=snapshot;h=refs/tags/20210517.0;sf=tgz>
+ ;a=snapshot;h=refs/tags/20210521.0;sf=tgz>
b. Extract the archive and process following three files by LuaLaTeX
to generate classes for Japanese typesetting:
@@ -93,4 +93,4 @@ Notes
This file and ltj-kinsoku.lua are not used anymore.
(Do not remove ltj-kinsoku.tex.)
-Last commit date: Mon May 17 11:57:27 2021 +0900
+Last commit date: Fri May 21 21:07:11 2021 +0900
diff --git a/macros/luatex/generic/luatexja/doc/luatexja-en.pdf b/macros/luatex/generic/luatexja/doc/luatexja-en.pdf
index 12aada4965..4a31080cc1 100644
--- a/macros/luatex/generic/luatexja/doc/luatexja-en.pdf
+++ b/macros/luatex/generic/luatexja/doc/luatexja-en.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf b/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf
index 8799ab20c8..ba8dad3586 100644
--- a/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf
+++ b/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/src/ltj-inputbuf.lua b/macros/luatex/generic/luatexja/src/ltj-inputbuf.lua
index 6423f8817a..e1623199e4 100644
--- a/macros/luatex/generic/luatexja/src/ltj-inputbuf.lua
+++ b/macros/luatex/generic/luatexja/src/ltj-inputbuf.lua
@@ -5,7 +5,6 @@
luatexja.load_module 'base'; local ltjb = luatexja.base
luatexja.load_module 'charrange'; local ltjc = luatexja.charrange
-require "unicode"
local utflen = utf.len
local utfbyte = utf.byte
local utfchar = utf.char
@@ -24,12 +23,11 @@ local start_time_measure, stop_time_measure
local function add_comment(buffer)
start_time_measure 'inputbuf'
local i = utflen(buffer)
- while (i>0) and (getcatcode(utfbyte(buffer, i))==1
- or getcatcode(utfbyte(buffer, i))==2) do
- i=i-1
+ local c = utfbyte(buffer, i)
+ while (i>0) and (getcatcode(c)==1 or getcatcode(c)==2) do
+ i=i-1; if (i>0) then c = utfbyte(buffer, i) end;
end
if i>0 then
- local c = utfbyte(buffer, i)
if c>=0x80 then
local te = tex.endlinechar
-- Is the catcode of endline character is 5 (end-of-line)?
diff --git a/macros/luatex/generic/luatexja/src/luatexja-core.sty b/macros/luatex/generic/luatexja/src/luatexja-core.sty
index 5f596574e2..fb58eaf31d 100644
--- a/macros/luatex/generic/luatexja/src/luatexja-core.sty
+++ b/macros/luatex/generic/luatexja/src/luatexja-core.sty
@@ -65,7 +65,7 @@
\expandafter\let\csname ifltj@in@latex\expandafter\endcsname
\csname iftrue\endcsname
\NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{luatexja-core}[2021-05-11 Core of LuaTeX-ja]
+ \ProvidesPackage{luatexja-core}[2021-05-21 Core of LuaTeX-ja]
\fi %</LaTeX>
%% Load prerequisite packages.
@@ -630,7 +630,7 @@
t[\the\ltj@@vadjust@dirhook@inner]
= function () luatexja.direction.set_list_direction_hook('adj') end
t[\the\ltj@@vadjust@check@dir@inner]
- = luatexja.direction.check_adjust_direction()
+ = luatexja.direction.check_adjust_direction
}
\luadef\ltj@@vadjust@dirhook\ltj@@vadjust@dirhook@inner
\protected\luadef\ltj@@vadjust@check@dir\ltj@@vadjust@check@dir@inner
diff --git a/macros/luatex/generic/luatexja/src/luatexja.sty b/macros/luatex/generic/luatexja/src/luatexja.sty
index 28b139d95e..0eec4c94c0 100644
--- a/macros/luatex/generic/luatexja/src/luatexja.sty
+++ b/macros/luatex/generic/luatexja/src/luatexja.sty
@@ -35,13 +35,13 @@
\expandafter\let\csname ifltj@in@latex\expandafter\endcsname
\csname iftrue\endcsname
\NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{luatexja}[2021-05-17 Japanese Typesetting with Lua(La)TeX]
+ \ProvidesPackage{luatexja}[2021-05-21 Japanese Typesetting with Lua(La)TeX]
\DeclareOption{disablejfam}{\ltj@disablejfamtrue}
\DeclareOption*{}
\ProcessOptions\relax
\fi %</LaTeX>
%%%% VERSION
-\def\LuaTeXjaversion{20210517.0}
+\def\LuaTeXjaversion{20210521.0}
\directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs