summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2023-04-11 23:40:06 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2023-04-11 23:40:06 +0200
commit3b909ab613140e7a9c824c434b642f0578473a6d (patch)
treec4feec8afb3e9d1dfc26895a73c55ca194261601 /tex
parent059fc69b2c7853b937ddb4cfc9d36304dee07893 (diff)
downloadcontext-3b909ab613140e7a9c824c434b642f0578473a6d.tar.gz
2023-04-11 22:47:00
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/font-con.lua11
-rw-r--r--tex/context/base/mkiv/font-otc.lua7
-rw-r--r--tex/context/base/mkiv/font-otl.lua2
-rw-r--r--tex/context/base/mkiv/font-oto.lua11
-rw-r--r--tex/context/base/mkiv/font-sol.lua2
-rw-r--r--tex/context/base/mkiv/good-ini.lua44
-rw-r--r--tex/context/base/mkiv/lang-txt.lua24
-rw-r--r--tex/context/base/mkiv/mult-low.lua2
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin24625 -> 24623 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin267345 -> 267946 bytes
-rw-r--r--tex/context/base/mkiv/typo-duc.lua14
-rw-r--r--tex/context/base/mkxl/cont-new.mkxl2
-rw-r--r--tex/context/base/mkxl/context.mkxl2
-rw-r--r--tex/context/base/mkxl/core-uti.lmt14
-rw-r--r--tex/context/base/mkxl/driv-shp.lmt6
-rw-r--r--tex/context/base/mkxl/driv-usr.lmt6
-rw-r--r--tex/context/base/mkxl/file-job.lmt167
-rw-r--r--tex/context/base/mkxl/file-job.mklx27
-rw-r--r--tex/context/base/mkxl/font-con.lmt8
-rw-r--r--tex/context/base/mkxl/font-lib.mklx2
-rw-r--r--tex/context/base/mkxl/font-mat.mklx7
-rw-r--r--tex/context/base/mkxl/font-oto.lmt556
-rw-r--r--tex/context/base/mkxl/font-ots.lmt4
-rw-r--r--tex/context/base/mkxl/font-txt.lmt2
-rw-r--r--tex/context/base/mkxl/lpdf-ano.lmt189
-rw-r--r--tex/context/base/mkxl/lpdf-rul.lmt2
-rw-r--r--tex/context/base/mkxl/luat-run.lmt8
-rw-r--r--tex/context/base/mkxl/math-acc.mklx31
-rw-r--r--tex/context/base/mkxl/math-act.lmt55
-rw-r--r--tex/context/base/mkxl/math-fen.mkxl12
-rw-r--r--tex/context/base/mkxl/math-ini.mkxl28
-rw-r--r--tex/context/base/mkxl/math-noa.lmt95
-rw-r--r--tex/context/base/mkxl/math-ttv.lmt3
-rw-r--r--tex/context/base/mkxl/math-vfu.lmt3
-rw-r--r--tex/context/base/mkxl/node-dir.lmt3
-rw-r--r--tex/context/base/mkxl/node-ini.lmt77
-rw-r--r--tex/context/base/mkxl/node-ref.lmt9
-rw-r--r--tex/context/base/mkxl/node-res.lmt2
-rw-r--r--tex/context/base/mkxl/node-tra.lmt2
-rw-r--r--tex/context/base/mkxl/phys-dim.mkxl9
-rw-r--r--tex/context/base/mkxl/spac-ali.lmt3
-rw-r--r--tex/context/base/mkxl/strc-lst.lmt62
-rw-r--r--tex/context/base/mkxl/strc-ref.lmt346
-rw-r--r--tex/context/base/mkxl/strc-reg.lmt6
-rw-r--r--tex/context/base/mkxl/supp-box.lmt6
-rw-r--r--tex/context/base/mkxl/tabl-xtb.lmt2
-rw-r--r--tex/context/base/mkxl/toks-aux.lmt3
-rw-r--r--tex/context/base/mkxl/trac-inf.lmt3
-rw-r--r--tex/context/base/mkxl/trac-vis.lmt16
-rw-r--r--tex/context/base/mkxl/type-set.mkxl2
-rw-r--r--tex/context/base/mkxl/typo-dha.lmt8
-rw-r--r--tex/context/base/mkxl/typo-duc.lmt20
-rw-r--r--tex/context/base/mkxl/typo-lin.lmt2
-rw-r--r--tex/context/fonts/mkiv/antykwa-math.lfg8
-rw-r--r--tex/context/fonts/mkiv/bonum-math.lfg15
-rw-r--r--tex/context/fonts/mkiv/cambria-math.lfg6
-rw-r--r--tex/context/fonts/mkiv/concrete-math.lfg6
-rw-r--r--tex/context/fonts/mkiv/dejavu-math.lfg3
-rw-r--r--tex/context/fonts/mkiv/dejavu-text.lfg58
-rw-r--r--tex/context/fonts/mkiv/ebgaramond-math.lfg8
-rw-r--r--tex/context/fonts/mkiv/ebgaramond-text.lfg59
-rw-r--r--tex/context/fonts/mkiv/erewhon-math.lfg3
-rw-r--r--tex/context/fonts/mkiv/erewhon-text.lfg81
-rw-r--r--tex/context/fonts/mkiv/euler-math.lfg3
-rw-r--r--tex/context/fonts/mkiv/kpfonts-math.lfg4
-rw-r--r--tex/context/fonts/mkiv/kpfonts-text.lfg57
-rw-r--r--tex/context/fonts/mkiv/libertinus-math.lfg3
-rw-r--r--tex/context/fonts/mkiv/libertinus-text.lfg59
-rw-r--r--tex/context/fonts/mkiv/lucida-math.lfg14
-rw-r--r--tex/context/fonts/mkiv/lucida-text.lfg69
-rw-r--r--tex/context/fonts/mkiv/modern-math.lfg9
-rw-r--r--tex/context/fonts/mkiv/modern-text.lfg62
-rw-r--r--tex/context/fonts/mkiv/newcomputermodern-math.lfg27
-rw-r--r--tex/context/fonts/mkiv/newcomputermodern-text.lfg63
-rw-r--r--tex/context/fonts/mkiv/pagella-math.lfg30
-rw-r--r--tex/context/fonts/mkiv/schola-math.lfg7
-rw-r--r--tex/context/fonts/mkiv/stixtwo-math.lfg31
-rw-r--r--tex/context/fonts/mkiv/stixtwo-text.lfg60
-rw-r--r--tex/context/fonts/mkiv/termes-math.lfg9
-rw-r--r--tex/context/fonts/mkiv/texgyre-text.lfg185
-rw-r--r--tex/context/fonts/mkiv/type-imp-dejavu.mkiv10
-rw-r--r--tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv8
-rw-r--r--tex/context/fonts/mkiv/type-imp-erewhon.mkiv8
-rw-r--r--tex/context/fonts/mkiv/type-imp-kpfonts.mkiv8
-rw-r--r--tex/context/fonts/mkiv/type-imp-latinmodern.mkiv8
-rw-r--r--tex/context/fonts/mkiv/type-imp-libertinus.mkiv8
-rw-r--r--tex/context/fonts/mkiv/type-imp-lucida.mkiv8
-rw-r--r--tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv16
-rw-r--r--tex/context/fonts/mkiv/type-imp-stix.mkiv8
-rw-r--r--tex/context/fonts/mkiv/type-imp-texgyre.mkiv8
-rw-r--r--tex/context/fonts/mkiv/type-imp-xcharter.mkiv8
-rw-r--r--tex/context/fonts/mkiv/xcharter-math.lfg3
-rw-r--r--tex/context/fonts/mkiv/xcharter-text.lfg62
-rw-r--r--tex/context/fonts/mkxl/type-imp-bengali.mkxl (renamed from tex/context/base/mkxl/type-imp-bengali.mkxl)0
-rw-r--r--tex/context/fonts/mkxl/type-imp-braille.mkxl (renamed from tex/context/base/mkxl/type-imp-braille.mkxl)0
-rw-r--r--tex/context/fonts/mkxl/type-imp-devanagari.mkxl (renamed from tex/context/base/mkxl/type-imp-devanagari.mkxl)0
-rw-r--r--tex/context/fonts/mkxl/type-imp-euler.mkxl (renamed from tex/context/base/mkxl/type-imp-euler.mkxl)0
-rw-r--r--tex/context/fonts/mkxl/type-imp-gujarati.mkxl (renamed from tex/context/base/mkxl/type-imp-gujarati.mkxl)0
-rw-r--r--tex/context/fonts/mkxl/type-imp-indic.mkxl (renamed from tex/context/base/mkxl/type-imp-indic.mkxl)0
-rw-r--r--tex/context/fonts/mkxl/type-imp-kannada.mkxl (renamed from tex/context/base/mkxl/type-imp-kannada.mkxl)0
-rw-r--r--tex/context/fonts/mkxl/type-imp-malayalam.mkxl (renamed from tex/context/base/mkxl/type-imp-malayalam.mkxl)0
-rw-r--r--tex/context/fonts/mkxl/type-imp-tamil.mkxl (renamed from tex/context/base/mkxl/type-imp-tamil.mkxl)0
-rw-r--r--tex/context/fonts/mkxl/type-imp-telugu.mkxl (renamed from tex/context/base/mkxl/type-imp-telugu.mkxl)0
-rw-r--r--tex/context/modules/mkiv/m-tikz.mkiv8
-rw-r--r--tex/context/modules/mkiv/s-fonts-tables.lua4
-rw-r--r--tex/context/modules/mkxl/m-tikz-pgfplots.tex2
-rw-r--r--tex/context/modules/mkxl/m-tikz.mkxl9
-rw-r--r--tex/context/modules/mkxl/s-math-atoms.mkxl2
-rw-r--r--tex/context/modules/mkxl/s-math-tests.mkxl112
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua10
114 files changed, 2624 insertions, 560 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index 4eb526804..9a1ca833a 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2023.04.01 09:28}
+\newcontextversion{2023.04.11 22:45}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii
index a09091440..994439fa2 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2023.04.01 09:28}
+\edef\contextversion{2023.04.11 22:45}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index f0fd15f3b..c7c28fc7c 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2023.04.01 09:28}
+\newcontextversion{2023.04.11 22:45}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index c2735fa5e..aee10b279 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -49,7 +49,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2023.04.01 09:28}
+\edef\contextversion{2023.04.11 22:45}
%D Kind of special:
diff --git a/tex/context/base/mkiv/font-con.lua b/tex/context/base/mkiv/font-con.lua
index 77708ee08..10f98ca12 100644
--- a/tex/context/base/mkiv/font-con.lua
+++ b/tex/context/base/mkiv/font-con.lua
@@ -6,6 +6,9 @@ if not modules then modules = { } end modules ['font-con'] = {
license = "see context related readme files"
}
+-- Todo: Enable fixes from the lmt to here. Also in font-oto.lua wrt the changed
+-- assignments. (Around texlive 2024 in order not to disturb generic.)
+
-- some names of table entries will be changed (no _)
local next, tostring, tonumber, rawget = next, tostring, tonumber, rawget
@@ -648,6 +651,14 @@ function constructors.scale(tfmdata,specification)
if changed then
local c = changed[unicode]
if c and c ~= unicode then
+ -- local cc = changed[c]
+ -- if cc then
+ -- while cc do
+ -- c = cc
+ -- cc = changed[c]
+ -- end
+ -- end
+ -- check not needed:
if c then
description = descriptions[c] or descriptions[unicode] or character
character = characters[c] or character
diff --git a/tex/context/base/mkiv/font-otc.lua b/tex/context/base/mkiv/font-otc.lua
index f83c3e8ec..0787a2035 100644
--- a/tex/context/base/mkiv/font-otc.lua
+++ b/tex/context/base/mkiv/font-otc.lua
@@ -786,7 +786,12 @@ local function addfeature(data,feature,specifications,prepareonly)
local list = askedsteps[i]
local coverage = nil
local format = nil
- if featuretype == "substitution" then
+if type(list) == "function" then
+ list = list(data,specification,list,i)
+end
+ if not list then
+ -- see ebgaramond hack
+ elseif featuretype == "substitution" then
-- see font-imp-tweaks: we directly pass a mapping so no checks done
category = "gsub"
coverage = (mapping and list) or prepare_substitution(list,featuretype,nocheck)
diff --git a/tex/context/base/mkiv/font-otl.lua b/tex/context/base/mkiv/font-otl.lua
index 354ca59a7..0825077b3 100644
--- a/tex/context/base/mkiv/font-otl.lua
+++ b/tex/context/base/mkiv/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.132 -- beware: also sync font-mis.lua and in mtx-fonts
+otf.version = 3.133 -- 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)
diff --git a/tex/context/base/mkiv/font-oto.lua b/tex/context/base/mkiv/font-oto.lua
index e8b92c077..0689f4dfb 100644
--- a/tex/context/base/mkiv/font-oto.lua
+++ b/tex/context/base/mkiv/font-oto.lua
@@ -6,6 +6,9 @@ if not modules then modules = { } end modules ['font-oto'] = { -- original tex
license = "see context related readme files"
}
+-- Todo: Enable fixes from the lmt to here. Also in font-con.lua wrt the changed
+-- assignments. (Around texlive 2024 in order not to disturb generic.)
+
local concat, unpack = table.concat, table.unpack
local insert, remove = table.insert, table.remove
local format, gmatch, gsub, find, match, lower, strip = string.format, string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip
@@ -260,7 +263,9 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis
for i=1,#steps do
for unicode, data in next, steps[i].coverage do
if unicode ~= data then
+-- if not changed[unicode] then
changed[unicode] = data
+-- end
end
if trace_singles then
report_substitution(feature,sequence,descriptions,unicode,data)
@@ -273,7 +278,9 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis
local replacement = data[alternate]
if replacement then
if unicode ~= replacement then
+-- if not changed[unicode] then
changed[unicode] = replacement
+-- end
end
if trace_alternatives then
report_alternate(feature,sequence,descriptions,unicode,replacement,value,"normal")
@@ -281,7 +288,9 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis
elseif defaultalt == "first" then
replacement = data[1]
if unicode ~= replacement then
+-- if not changed[unicode] then
changed[unicode] = replacement
+-- end
end
if trace_alternatives then
report_alternate(feature,sequence,descriptions,unicode,replacement,value,defaultalt)
@@ -289,7 +298,9 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis
elseif defaultalt == "last" then
replacement = data[#data]
if unicode ~= replacement then
+-- if not changed[unicode] then
changed[unicode] = replacement
+-- end
end
if trace_alternatives then
report_alternate(feature,sequence,descriptions,unicode,replacement,value,defaultalt)
diff --git a/tex/context/base/mkiv/font-sol.lua b/tex/context/base/mkiv/font-sol.lua
index b3b514a16..b194a6ca9 100644
--- a/tex/context/base/mkiv/font-sol.lua
+++ b/tex/context/base/mkiv/font-sol.lua
@@ -111,7 +111,7 @@ local whatsit_code = nodecodes.whatsit
local fontkern_code = kerncodes.fontkern
-local righttoleft_code = nodes.dirvalues.righttoleft
+local righttoleft_code = (tex.directioncodes and tex.directioncodes.righttoleft) or nodes.dirvalues.righttoleft -- LMTX
local userdefinedwhatsit_code = whatsitcodes.userdefined
diff --git a/tex/context/base/mkiv/good-ini.lua b/tex/context/base/mkiv/good-ini.lua
index df79adb61..33e79a5d4 100644
--- a/tex/context/base/mkiv/good-ini.lua
+++ b/tex/context/base/mkiv/good-ini.lua
@@ -9,12 +9,14 @@ if not modules then modules = { } end modules ['good-ini'] = {
-- depends on ctx
local type, next = type, next
-local gmatch = string.gmatch
-local sortedhash, insert = table.sortedhash, table.insert
+local gmatch, find, topattern = string.gmatch, string.find, string.topattern
+local sortedhash, insert, contains = table.sortedhash, table.insert, table.contains
local fonts = fonts
-local trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end)
+local trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end)
+local trace_extensions = false trackers.register("fonts.goodies.extensions", function(v) trace_extensions = v end)
+
local report_goodies = logs.reporter("fonts","goodies")
local allocate = utilities.storage.allocate
@@ -324,15 +326,43 @@ end
local function setextensions(tfmdata)
local goodies = tfmdata.goodies
if goodies then
+ local shared = tfmdata.shared
+ local metadata = shared and shared.rawdata and shared.rawdata.metadata
for i=1,#goodies do
local g = goodies[i]
local e = g.extensions
if e then
- local goodie = g.name or "unknown"
+ local goodie = g.name or "unknown"
+ local fontname = metadata and metadata.fontname
+ if trace_extensions then
+ report_goodies("checking extensions for font %a",fontname or "unknown")
+ end
for i=1,#e do
- local name = "extension-" .. i
- -- report_goodies("adding extension %s from %s",name,goodie)
- otf.enhancers.addfeature(tfmdata.shared.rawdata,name,e[i])
+ local entry = e[i]
+ local fnames = entry.fonts
+ local tnames = type(fnames)
+ local valid = false
+ if not fontname then
+ valid = true
+ elseif tnames == "table" then
+ if fnames[fontname] then
+ valid = true
+ elseif #fnames > 0 and contains(fnames,fontname) then
+ valid = true
+ end
+ elseif tnames == "string" then
+ fnames = topattern(fnames)
+ valid = find(fontname,fnames) and true
+ else
+ valid = true
+ end
+ if valid then
+ local name = "extension-" .. i
+ if trace_extensions then
+ report_goodies("adding extension %a from %a for font %a",name,goodie,fontname or "unknown")
+ end
+ otf.enhancers.addfeature(tfmdata.shared.rawdata,name,entry)
+ end
end
end
end
diff --git a/tex/context/base/mkiv/lang-txt.lua b/tex/context/base/mkiv/lang-txt.lua
index cb8053fb6..af1f42c47 100644
--- a/tex/context/base/mkiv/lang-txt.lua
+++ b/tex/context/base/mkiv/lang-txt.lua
@@ -1192,7 +1192,7 @@ data.labels={
["ar"]="ملحق ",
["be"]="Апендыцыт",
["ca"]="Apèndix ",
- ["cn"]="附录",
+ ["cn"]="附录 ",
["cs"]="Příloha ",
["da"]="Bilag ",
["de"]="Anhang ",
@@ -1473,7 +1473,7 @@ data.labels={
["be"]="Глава ",
["bg"]="Eпизод ",
["ca"]="Capítol ",
- ["cn"]={ "第", "章" },
+ ["cn"]={ "第 ", " 章" },
["cs"]="Kapitola ",
["da"]="",
["de"]="Kapitel ",
@@ -1774,7 +1774,7 @@ data.labels={
["be"]="Малюнак",
["bg"]="Фигура",
["ca"]="Figura ",
- ["cn"]="图",
+ ["cn"]="图 ",
["cs"]="Obrázek ",
["da"]="Figur ",
["de"]="Abbildung ",
@@ -1925,7 +1925,7 @@ data.labels={
["be"]="Графіка ",
["bg"]="Графичен ",
["ca"]="Gràfica ",
- ["cn"]="插图",
+ ["cn"]="插图 ",
["cs"]="Graf ",
["da"]="Grafik ",
["de"]="Grafik ",
@@ -2058,7 +2058,7 @@ data.labels={
["be"]="Інтэрмецца ",
["bg"]="Интермецо ",
["ca"]="Intermedi ",
- ["cn"]="퉣",
+ ["cn"]="퉣 ",
["cs"]="Intermezzo ",
["da"]="Intermezzo ",
["de"]="Intermezzo ",
@@ -2395,7 +2395,7 @@ data.labels={
["be"]="радок ",
["bg"]="ред ",
["ca"]="línia ",
- ["cn"]="行",
+ ["cn"]="行 ",
["cs"]="řádek ",
["da"]="linie ",
["de"]="Zeile ",
@@ -2441,7 +2441,7 @@ data.labels={
["be"]="радкi ",
["bg"]="редове ",
["ca"]="línies ",
- ["cn"]="行",
+ ["cn"]="行 ",
["cs"]="řádky ",
["da"]="linier ",
["de"]="Zeilen ",
@@ -3002,7 +3002,7 @@ data.labels={
["be"]="Частка ",
["bg"]="Частка ",
["ca"]="Part ",
- ["cn"]={ "第", "部分" },
+ ["cn"]={ "第 ", " 部分" },
["cs"]="Část ",
["da"]="Del ",
["de"]="Teil ",
@@ -3130,7 +3130,7 @@ data.labels={
["ar"]="فصل ",
["bg"]="Cекция ",
["ca"]="Secció ",
- ["cn"]={ "第", "节" },
+ ["cn"]={ "第 ", " 节" },
["cs"]="Sekce ",
["da"]="",
["de"]="Abschnitt ",
@@ -3513,7 +3513,7 @@ data.labels={
["be"]="Табліца ",
["bg"]="Таблица ",
["ca"]="Taula ",
- ["cn"]="表",
+ ["cn"]="表 ",
["cs"]="Tabulka ",
["da"]="Tabel ",
["de"]="Tabelle ",
@@ -3863,7 +3863,7 @@ data.labels={
["ar"]="الأشكال",
["be"]="Спіс ілюстрацый",
["ca"]="Figures",
- ["cn"]="图形",
+ ["cn"]="图",
["cs"]="Seznam obrázků",
["da"]="Figurer",
["de"]="Abbildungen",
@@ -4046,7 +4046,7 @@ data.labels={
["be"]="Лагатыпы",
["bg"]="Логотипи",
["ca"]="Logotips",
- ["cn"]="徽贬",
+ ["cn"]="徽标",
["cs"]="Loga",
["da"]="Logoer",
["de"]="Logos",
diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua
index 686fbfb7a..8cc781034 100644
--- a/tex/context/base/mkiv/mult-low.lua
+++ b/tex/context/base/mkiv/mult-low.lua
@@ -146,7 +146,7 @@ return {
"startallmodes", "stopallmodes", "startnotallmodes", "stopnotallmodes",
"doifallmodes", "doifelseallmodes", "doifallmodeselse", "doifnotallmodes",
"startenvironment", "stopenvironment", "environment",
- "startcomponent", "stopcomponent", "component",
+ "startcomponent", "stopcomponent", "component", "startlocalcomponent", "stoplocalcomponent",
"startproduct", "stopproduct", "product",
"startproject", "stopproject", "project",
"starttext", "stoptext", "startnotext", "stopnotext",
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 476b1642f..074d13f5d 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index 734e7705c..e08a49d4e 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/typo-duc.lua b/tex/context/base/mkiv/typo-duc.lua
index 614defeb6..2f00fa038 100644
--- a/tex/context/base/mkiv/typo-duc.lua
+++ b/tex/context/base/mkiv/typo-duc.lua
@@ -599,23 +599,23 @@ local function resolve_weak(list,size,start,limit,orderbefore,orderafter)
else -- only more efficient when we have es/cs
local runner = start + 2
if runner <= limit then
- local before = list[start]
- local entry = list[start + 1]
- local after = list[runner]
+ local before = list[start]
+ local current = list[start + 1]
+ local after = list[runner]
while after do
- local direction = entry.direction
+ local direction = current.direction
if direction == "es" then
if before.direction == "en" and after.direction == "en" then
- entry.direction = "en"
+ current.direction = "en"
end
elseif direction == "cs" then
local prevdirection = before.direction
if prevdirection == "en" then
if after.direction == "en" then
- entry.direction = "en"
+ current.direction = "en"
end
elseif prevdirection == "an" and after.direction == "an" then
- entry.direction = "an"
+ current.direction = "an"
end
end
before = current
diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl
index 53ccef0b6..9f4678349 100644
--- a/tex/context/base/mkxl/cont-new.mkxl
+++ b/tex/context/base/mkxl/cont-new.mkxl
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2023.04.01 09:28}
+\newcontextversion{2023.04.11 22:45}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl
index 6f4b7d052..19cc4ee85 100644
--- a/tex/context/base/mkxl/context.mkxl
+++ b/tex/context/base/mkxl/context.mkxl
@@ -29,7 +29,7 @@
%D {YYYY.MM.DD HH:MM} format.
\immutable\edef\contextformat {\jobname}
-\immutable\edef\contextversion{2023.04.01 09:28}
+\immutable\edef\contextversion{2023.04.11 22:45}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
diff --git a/tex/context/base/mkxl/core-uti.lmt b/tex/context/base/mkxl/core-uti.lmt
index e4b6606e3..dbfa82ed7 100644
--- a/tex/context/base/mkxl/core-uti.lmt
+++ b/tex/context/base/mkxl/core-uti.lmt
@@ -377,16 +377,15 @@ function job.loadother(filename)
local jobname = environment.jobname
if filename == jobname then
return
- else
- report_passes("integrating list %a into %a",filename,jobname)
end
- statistics.starttiming(loadedfiles)
filename = file.addsuffix(filename,"tuc")
local unpacked = othercache[filename]
if not unpacked then
- -- so we can register the same name twice(in loading order)
+ -- so we can register the same name twice (in loading order) ... needs checking if we want this
+ statistics.starttiming(loadedfiles)
local utilitydata = load(filename)
if utilitydata then
+ report_passes("integrating list %a into %a",filename,jobname)
local jobpacker = utilitydata.job.packed
unpacknumberdata(jobpacker.index)
unpacked = { }
@@ -401,14 +400,15 @@ function job.loadother(filename)
end
unpacked.job.packed = nil -- nicer in inspecting
othercache[filename] = unpacked
- --
+ --
+ utilitydata.components, utilitydata.namestack = collectstructure(utilitydata.job.structure.collected)
+ --
structures.lists .integrate(utilitydata)
structures.registers .integrate(utilitydata)
structures.references.integrate(utilitydata)
- --
end
+ statistics.stoptiming(loadedfiles)
end
- statistics.stoptiming(loadedfiles)
return unpacked
end
diff --git a/tex/context/base/mkxl/driv-shp.lmt b/tex/context/base/mkxl/driv-shp.lmt
index 09928f303..18a12eff7 100644
--- a/tex/context/base/mkxl/driv-shp.lmt
+++ b/tex/context/base/mkxl/driv-shp.lmt
@@ -69,11 +69,11 @@ local parameters = fonthashes.parameters
local nodecodes = nodes.nodecodes
local whatsitcodes = nodes.whatsitcodes
local gluecodes = nodes.gluecodes
-local dirvalues = nodes.dirvalues
local subtypes = nodes.subtypes
-local lefttoright_code = dirvalues.lefttoright
-local righttoleft_code = dirvalues.righttoleft
+local directioncodes = tex.directioncodes
+local lefttoright_code = directioncodes.lefttoright
+local righttoleft_code = directioncodes.righttoleft
local glyph_code = nodecodes.glyph
local kern_code = nodecodes.kern
diff --git a/tex/context/base/mkxl/driv-usr.lmt b/tex/context/base/mkxl/driv-usr.lmt
index 0542228aa..df381f35f 100644
--- a/tex/context/base/mkxl/driv-usr.lmt
+++ b/tex/context/base/mkxl/driv-usr.lmt
@@ -40,10 +40,10 @@ local dirdimensions = nuts.dirdimensions
local nodecodes = nodes.nodecodes
local whatsitcodes = nodes.whatsitcodes
-local dirvalues = nodes.dirvalues
-local lefttoright_code = dirvalues.lefttoright
-local righttoleft_code = dirvalues.righttoleft
+local directioncodes = tex.directioncodes
+local lefttoright_code = directioncodes.lefttoright
+local righttoleft_code = directioncodes.righttoleft
local glyph_code = nodecodes.glyph
local kern_code = nodecodes.kern
diff --git a/tex/context/base/mkxl/file-job.lmt b/tex/context/base/mkxl/file-job.lmt
index e117b914e..c3906468b 100644
--- a/tex/context/base/mkxl/file-job.lmt
+++ b/tex/context/base/mkxl/file-job.lmt
@@ -13,7 +13,7 @@ local next, rawget, tostring, tonumber = next, rawget, tostring, tonumber
local gsub, match, gmatch, ind = string.gsub, string.match, string.gmatch, string.find
local insert, remove, concat, unique, imerged = table.insert, table.remove, table.concat, table.unique, table.imerged
local validstring, formatters = string.valid, string.formatters
-local sortedhash = table.sortedhash
+local sortedhash, copytable = table.sortedhash, table.copy
local setmetatableindex, setmetatablenewindex = table.setmetatableindex, table.setmetatablenewindex
local commands = commands
@@ -24,10 +24,12 @@ local ctx_doifelse = commands.doifelse
local implement = interfaces.implement
-local trace_jobfiles = false trackers.register("system.jobfiles", function(v) trace_jobfiles = v end)
+local trace_jobfiles = false trackers.register("system.jobfiles", function(v) trace_jobfiles = v end)
+local trace_structure = false trackers.register("system.structure", function(v) trace_structure = v end)
local report = logs.reporter("system")
local report_jobfiles = logs.reporter("system", "jobfiles")
+local report_structure = logs.reporter("system", "structure")
local report_functions = logs.reporter("system", "functions")
local texsetcount = tex.setcount
@@ -69,6 +71,12 @@ local v_product = variables.product
local v_component = variables.component
local v_yes = variables.yes
+local v_local = variables["local"]
+local v_global = variables["global"]
+
+local e_start = elements.start
+local e_stop = elements.stop
+
-- main code .. there is some overlap .. here we have loc://
local function findctxfile(name) -- loc ? any ?
@@ -402,7 +410,7 @@ local c_textlevel = tex.iscount("textlevel")
local function dummyfunction() end
local function startstoperror()
- report("invalid \\%s%s ... \\%s%s structure",elements.start,v_text,elements.stop,v_text)
+ report("invalid \\%s%s ... \\%s%s structure",e_start,v_text,e_stop,v_text)
startstoperror = dummyfunction
end
@@ -528,6 +536,10 @@ local tree = { type = "text", name = "", branches = { } }
local treestack = { }
local top = tree.branches
local root = tree
+local namestack = { }
+local namelist = { }
+local namehash = { }
+local nametop = false
local project_stack = { }
local product_stack = { }
@@ -550,6 +562,15 @@ local function pushtree(what,name)
top = t
end
+local function pushcurrent(what,name)
+ if what == v_product or what == v_component or what == v_text then
+ insert(namestack,name)
+ nametop = copytable(namestack)
+ namelist[#namelist+1] = nametop
+ insert(namehash,#namelist)
+ end
+end
+
local function poptree()
top = remove(treestack)
if #top[#top].branches == 0 then
@@ -557,6 +578,13 @@ local function poptree()
end
end
+local function popcurrent(what)
+ if what == v_product or what == v_component then
+ remove(namestack)
+ remove(namehash)
+ end
+end
+
do
local function log_tree(report,top,depth)
@@ -600,22 +628,75 @@ job.structure = jobstructure
jobstructure.collected = jobstructure.collected or { }
jobstructure.tobesaved = root
jobstructure.components = { }
+jobstructure.namestack = { }
-local function initialize()
- local function collect(root,result)
+function collectstructure(collected)
+ local namestack = { }
+ local n = 0
+ local function collect(root,result,stack)
local branches = root.branches
if branches then
+ local s = copytable(stack)
+ local m = #s + 1
for i=1,#branches do
local branch = branches[i]
- if branch.type == "component" then
+ local what = branch.type
+ if what == v_component then
result[#result+1] = branch.name
end
- collect(branch,result)
+ s[m] = branch.name
+ if what == v_product or what == v_component then
+ n = n + 1
+ namestack[n] = copytable(s)
+ end
+ collect(branch,result,s)
end
end
return result
end
- jobstructure.components = collect(jobstructure.collected,{})
+ local components = collect(collected,{},{})
+-- inspect(namestack)
+ return components, namestack
+end
+
+local function initialize()
+ jobstructure.components, jobstructure.namestack = collectstructure(jobstructure.collected)
+end
+
+function jobresolvers.collectstructure(collected)
+ return collectstructure(collected or jobstructure.collected)
+end
+
+do
+ local reported = { }
+
+ function jobresolvers.currentstructure()
+-- inspect(namehash)
+ local n = namehash[#namehash]
+ if trace_structure and not reported[n] then
+ local namestack = jobstructure.namestack
+ local new = namelist [n]
+ local old = namestack[n]
+ new = new and concat(new," ") or ""
+ old = old and concat(old," ") or ""
+ if old == new then
+ report_structure("%02i : %a",n,old)
+ else
+ report_structure("%02i : %a <> %a",n,old,new)
+ end
+ reported[n] = true
+ end
+ return n, namelist[n]
+ end
+
+end
+
+function jobresolvers.namelist(n,utilitydata)
+ if utilitydata then
+ return utilitydata.namestack[n]
+ else
+ return namelist[n] or jobstructure.namestack[n]
+ end
end
job.register('job.structure.collected',root,initialize)
@@ -836,36 +917,32 @@ implement { name = "usecomponent", public = true, protected = true, actions =
-- [v_environment] = context.stopenvironmentindeed,
-- }
-local start = {
- [v_project] = "startprojectindeed",
- [v_product] = "startproductindeed",
- [v_component] = "startcomponentindeed",
- [v_environment] = "startenvironmentindeed",
-}
+-- local start = {
+-- [v_project] = "startprojectindeed",
+-- [v_product] = "startproductindeed",
+-- [v_component] = "startcomponentindeed",
+-- [v_environment] = "startenvironmentindeed",
+-- }
-local stop = {
- [v_project] = "stopprojectindeed",
- [v_product] = "stopproductindeed",
- [v_component] = "stopcomponentindeed",
- [v_environment] = "stopenvironmentindeed",
-}
+-- local stop = {
+-- [v_project] = "stopprojectindeed",
+-- [v_product] = "stopproductindeed",
+-- [v_component] = "stopcomponentindeed",
+-- [v_environment] = "stopenvironmentindeed",
+-- }
-local function gotonextlevel(what,name) -- todo: something with suffix name
+local function gotonextlevel(what,how,name) -- todo: something with suffix name
insert(stacks[what],name)
insert(typestack,currenttype)
currenttype = what
pushtree(what,name)
- if start[what] then
- -- start[what]()
- token.expandmacro(start[what])
- end
+ pushcurrent(what,name)
+ token.expandmacro(e_start..":"..what..":"..how)
end
-local function gotopreviouslevel(what)
- if stop[what] then
- token.expandmacro(stop[what])
- -- stop[what]() -- not immediate
- end
+local function gotopreviouslevel(what,how)
+ token.expandmacro(e_stop..":"..what..":"..how)
+ popcurrent(what)
poptree()
currenttype = remove(typestack) or v_text
remove(stacks[what]) -- not currenttype ... weak recovery
@@ -881,20 +958,22 @@ local function autoname()
return name
end
-implement { name = "startproject", public = true, protected = true, actions = function() gotonextlevel(v_project, autoname()) end }
-implement { name = "startproduct", public = true, protected = true, actions = function() gotonextlevel(v_product, autoname()) end }
-implement { name = "startcomponent", public = true, protected = true, actions = function() gotonextlevel(v_component, autoname()) end }
-implement { name = "startenvironment", public = true, protected = true, actions = function() gotonextlevel(v_environment,autoname()) end }
-
-implement { name = "stopproject", public = true, protected = true, actions = function() gotopreviouslevel(v_project ) end }
-implement { name = "stopproduct", public = true, protected = true, actions = function() gotopreviouslevel(v_product ) end }
-implement { name = "stopcomponent", public = true, protected = true, actions = function() gotopreviouslevel(v_component ) end }
-implement { name = "stopenvironment", public = true, protected = true, actions = function() gotopreviouslevel(v_environment) end }
-
-implement { name = "currentproject", public = true, actions = function() context(topofstack(v_project )) end }
-implement { name = "currentproduct", public = true, actions = function() context(topofstack(v_product )) end }
-implement { name = "currentcomponent", public = true, actions = function() context(topofstack(v_component )) end }
-implement { name = "currentenvironment", public = true, actions = function() context(topofstack(v_environment)) end }
+implement { name = "startproject", public = true, protected = true, actions = function() gotonextlevel(v_project, v_global, autoname()) end }
+implement { name = "startproduct", public = true, protected = true, actions = function() gotonextlevel(v_product, v_global, autoname()) end }
+implement { name = "startcomponent", public = true, protected = true, actions = function() gotonextlevel(v_component, v_global, autoname()) end }
+implement { name = "startlocalcomponent", public = true, protected = true, actions = function() gotonextlevel(v_component, v_local, autoname()) end }
+implement { name = "startenvironment", public = true, protected = true, actions = function() gotonextlevel(v_environment, v_global, autoname()) end }
+
+implement { name = "stopproject", public = true, protected = true, actions = function() gotopreviouslevel(v_project, v_global) end }
+implement { name = "stopproduct", public = true, protected = true, actions = function() gotopreviouslevel(v_product, v_global) end }
+implement { name = "stopcomponent", public = true, protected = true, actions = function() gotopreviouslevel(v_component, v_global) end }
+implement { name = "stoplocalcomponent", public = true, protected = true, actions = function() gotopreviouslevel(v_component, v_local ) end }
+implement { name = "stopenvironment", public = true, protected = true, actions = function() gotopreviouslevel(v_environment, v_global) end }
+
+implement { name = "currentproject", public = true, actions = function() context(topofstack(v_project )) end }
+implement { name = "currentproduct", public = true, actions = function() context(topofstack(v_product )) end }
+implement { name = "currentcomponent", public = true, actions = function() context(topofstack(v_component )) end }
+implement { name = "currentenvironment", public = true, actions = function() context(topofstack(v_environment)) end }
-- -- -- this will move -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
diff --git a/tex/context/base/mkxl/file-job.mklx b/tex/context/base/mkxl/file-job.mklx
index 76b679bd6..1c57a832d 100644
--- a/tex/context/base/mkxl/file-job.mklx
+++ b/tex/context/base/mkxl/file-job.mklx
@@ -184,43 +184,54 @@
\newsystemmode\v!component
\newsystemmode\v!environment
-\permanent\protected\def\startprojectindeed
+\permanent\protected\defcsname\e!start:\v!project:\v!global\endcsname
{%starttext
\pushsystemmode\v!project
\setsystemmode\v!project}
-\permanent\protected\def\stopprojectindeed
+\permanent\protected\defcsname\e!stop:\v!project:\v!global\endcsname
{\popsystemmode\v!project
%stoptext
\endinput}
-\permanent\protected\def\startproductindeed
+\permanent\protected\defcsname\e!start:\v!product:\v!global\endcsname
{\starttext
\pushsystemmode\v!product
\setsystemmode\v!product}
-\permanent\protected\def\stopproductindeed
+\permanent\protected\defcsname\e!stop:\v!product:\v!global\endcsname
{\popsystemmode\v!product
\stoptext
\endinput}
-\permanent\protected\def\startcomponentindeed
+\permanent\protected\defcsname\e!start:\v!component:\v!global\endcsname
{\starttext
\pushreferenceprefix\currentcomponent
\pushsystemmode\v!component
\setsystemmode\v!component}
-\permanent\protected\def\stopcomponentindeed
+\permanent\protected\defcsname\e!stop:\v!component:\v!global\endcsname
{\popsystemmode\v!component
\popreferenceprefix
\stoptext
\endinput}
-\permanent\protected\def\startenvironmentindeed
+\permanent\protected\defcsname\e!start:\v!component:\v!local\endcsname
+ {\starttext
+ \pushreferenceprefix\currentcomponent
+ \pushsystemmode\v!component
+ \setsystemmode\v!component}
+
+\permanent\protected\defcsname\e!stop:\v!component:\v!local\endcsname
+ {\popsystemmode\v!component
+ \popreferenceprefix
+ \stoptext}
+
+\permanent\protected\defcsname\e!start:\v!environment:\v!global\endcsname
{\pushsystemmode\v!environment
\setsystemmode\v!environment}
-\permanent\protected\def\stopenvironmentindeed
+\permanent\protected\defcsname\e!stop:\v!environment:\v!global\endcsname
{\popsystemmode\v!environment
\endinput}
diff --git a/tex/context/base/mkxl/font-con.lmt b/tex/context/base/mkxl/font-con.lmt
index 5a887d61d..599641e2c 100644
--- a/tex/context/base/mkxl/font-con.lmt
+++ b/tex/context/base/mkxl/font-con.lmt
@@ -589,6 +589,14 @@ function constructors.scale(tfmdata,specification)
if changed then
local c = changed[unicode]
if c and c ~= unicode then
+ local cc = changed[c]
+ if cc then
+ while cc do
+ c = cc
+ cc = changed[c]
+ end
+ end
+ -- check not needed:
if c then
description = descriptions[c] or descriptions[unicode] or character
character = characters[c] or character
diff --git a/tex/context/base/mkxl/font-lib.mklx b/tex/context/base/mkxl/font-lib.mklx
index 6caf1daf8..9214a8b52 100644
--- a/tex/context/base/mkxl/font-lib.mklx
+++ b/tex/context/base/mkxl/font-lib.mklx
@@ -52,7 +52,7 @@
\registerctxluafile{font-oti}{} % otf initialization
\registerctxluafile{font-ott}{} % otf tables (first)
\registerctxluafile{font-otl}{autosuffix}
-\registerctxluafile{font-oto}{}
+\registerctxluafile{font-oto}{autosuffix}
\registerctxluafile{font-otj}{autosuffix}
\registerctxluafile{font-oup}{}
\registerctxluafile{font-ota}{autosuffix}
diff --git a/tex/context/base/mkxl/font-mat.mklx b/tex/context/base/mkxl/font-mat.mklx
index 54473a347..a93174e37 100644
--- a/tex/context/base/mkxl/font-mat.mklx
+++ b/tex/context/base/mkxl/font-mat.mklx
@@ -533,7 +533,12 @@
\else
\c_math_m_scaled\numericscale#1\relax
\fi
- \scaledmathstyle\c_math_m_scaled
+ \scaledmathstyle
+ \ifnum\glyphscale=\plusthousand
+ \c_math_m_scaled
+ \else
+ \numexpr(\c_math_m_scaled*\glyphscale)/\plusthousand\relax
+ \fi
\fi}
%D This is nasty, as the engine only stores the last set family parameters (per style) which
diff --git a/tex/context/base/mkxl/font-oto.lmt b/tex/context/base/mkxl/font-oto.lmt
new file mode 100644
index 000000000..f22696273
--- /dev/null
+++ b/tex/context/base/mkxl/font-oto.lmt
@@ -0,0 +1,556 @@
+if not modules then modules = { } end modules ['font-oto'] = { -- original tex
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local concat, unpack = table.concat, table.unpack
+local insert, remove = table.insert, table.remove
+local format, gmatch, gsub, find, match, lower, strip = string.format, string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip
+local type, next, tonumber, tostring = type, next, tonumber, tostring
+
+local trace_baseinit = false trackers.register("otf.baseinit", function(v) trace_baseinit = v end)
+local trace_singles = false trackers.register("otf.singles", function(v) trace_singles = v end)
+local trace_multiples = false trackers.register("otf.multiples", function(v) trace_multiples = v end)
+local trace_alternatives = false trackers.register("otf.alternatives", function(v) trace_alternatives = v end)
+local trace_ligatures = false trackers.register("otf.ligatures", function(v) trace_ligatures = v end)
+local trace_kerns = false trackers.register("otf.kerns", function(v) trace_kerns = v end)
+local trace_preparing = false trackers.register("otf.preparing", function(v) trace_preparing = v end)
+
+local report_prepare = logs.reporter("fonts","otf prepare")
+
+local fonts = fonts
+local otf = fonts.handlers.otf
+
+local otffeatures = otf.features
+local registerotffeature = otffeatures.register
+
+otf.defaultbasealternate = "none" -- first last
+
+local getprivate = fonts.constructors.getprivate
+
+local wildcard = "*"
+local default = "dflt"
+
+local formatters = string.formatters
+local f_unicode = formatters["%U"]
+local f_uniname = formatters["%U (%s)"]
+local f_unilist = formatters["% t (% t)"]
+
+local function gref(descriptions,n)
+ if type(n) == "number" then
+ local name = descriptions[n].name
+ if name then
+ return f_uniname(n,name)
+ else
+ return f_unicode(n)
+ end
+ elseif n then
+ local num = { }
+ local nam = { }
+ local j = 0
+ for i=1,#n do
+ local ni = n[i]
+ if tonumber(ni) then -- first is likely a key
+ j = j + 1
+ local di = descriptions[ni]
+ num[j] = f_unicode(ni)
+ nam[j] = di and di.name or "-"
+ end
+ end
+ return f_unilist(num,nam)
+ else
+ return "<error in base mode tracing>"
+ end
+end
+
+local function cref(feature,sequence)
+ return formatters["feature %a, type %a, (chain) lookup %a"](feature,sequence.type,sequence.name)
+end
+
+local function report_substitution(feature,sequence,descriptions,unicode,substitution)
+ if unicode == substitution then
+ report_prepare("%s: base substitution %s maps onto itself",
+ cref(feature,sequence),
+ gref(descriptions,unicode))
+ else
+ report_prepare("%s: base substitution %s => %S",
+ cref(feature,sequence),
+ gref(descriptions,unicode),
+ gref(descriptions,substitution))
+ end
+end
+
+local function report_alternate(feature,sequence,descriptions,unicode,replacement,value,comment)
+ if unicode == replacement then
+ report_prepare("%s: base alternate %s maps onto itself",
+ cref(feature,sequence),
+ gref(descriptions,unicode))
+ else
+ report_prepare("%s: base alternate %s => %s (%S => %S)",
+ cref(feature,sequence),
+ gref(descriptions,unicode),
+ replacement and gref(descriptions,replacement),
+ value,
+ comment)
+ end
+end
+
+local function report_ligature(feature,sequence,descriptions,unicode,ligature)
+ report_prepare("%s: base ligature %s => %S",
+ cref(feature,sequence),
+ gref(descriptions,ligature),
+ gref(descriptions,unicode))
+end
+
+local function report_kern(feature,sequence,descriptions,unicode,otherunicode,value)
+ report_prepare("%s: base kern %s + %s => %S",
+ cref(feature,sequence),
+ gref(descriptions,unicode),
+ gref(descriptions,otherunicode),
+ value)
+end
+
+-- We need to make sure that luatex sees the difference between base fonts that have
+-- different glyphs in the same slots in fonts that have the same fullname (or filename).
+-- LuaTeX will merge fonts eventually (and subset later on). If needed we can use a more
+-- verbose name as long as we don't use <()<>[]{}/%> and the length is < 128.
+
+local basehash, basehashes, applied = { }, 1, { }
+
+local function registerbasehash(tfmdata)
+ local properties = tfmdata.properties
+ local hash = concat(applied," ")
+ local base = basehash[hash]
+ if not base then
+ basehashes = basehashes + 1
+ base = basehashes
+ basehash[hash] = base
+ end
+ properties.basehash = base
+ properties.fullname = (properties.fullname or properties.name) .. "-" .. base
+ -- report_prepare("fullname base hash '%a, featureset %a",tfmdata.properties.fullname,hash)
+ applied = { }
+end
+
+local function registerbasefeature(feature,value)
+ applied[#applied+1] = feature .. "=" .. tostring(value)
+end
+
+-- The original basemode ligature builder used the names of components and did some expression
+-- juggling to get the chain right. The current variant starts with unicodes but still uses
+-- names to make the chain. This is needed because we have to create intermediates when needed
+-- but use predefined snippets when available. To some extend the current builder is more stupid
+-- but I don't worry that much about it as ligatures are rather predicatable.
+--
+-- Personally I think that an ff + i == ffi rule as used in for instance latin modern is pretty
+-- weird as no sane person will key that in and expect a glyph for that ligature plus the following
+-- character. Anyhow, as we need to deal with this, we do, but no guarantes are given.
+--
+-- latin modern dejavu
+--
+-- f+f 102 102 102 102
+-- f+i 102 105 102 105
+-- f+l 102 108 102 108
+-- f+f+i 102 102 105
+-- f+f+l 102 102 108 102 102 108
+-- ff+i 64256 105 64256 105
+-- ff+l 64256 108
+--
+-- As you can see here, latin modern is less complete than dejavu but
+-- in practice one will not notice it.
+--
+-- The while loop is needed because we need to resolve for instance pseudo names like
+-- hyphen_hyphen to endash so in practice we end up with a bit too many definitions but the
+-- overhead is neglectable. We can have changed[first] or changed[second] but it quickly becomes
+-- messy if we need to take that into account.
+
+local function makefake(tfmdata,name,present)
+ local private = getprivate(tfmdata)
+ local character = { intermediate = true, ligatures = { } }
+ tfmdata.resources.unicodes[name] = private
+ tfmdata.characters[private] = character
+ tfmdata.descriptions[private] = { name = name }
+ present[name] = private
+ return character
+end
+
+local function make_1(present,tree,name)
+ if tonumber(tree) then
+ present[name] = v
+ else
+ for k, v in next, tree do
+ if k == "ligature" then
+ present[name] = v
+ else
+ make_1(present,v,name .. "_" .. k)
+ end
+ end
+ end
+end
+
+local function make_3(present,tfmdata,characters,tree,name,preceding,unicode,done,v)
+ local character = characters[preceding]
+ if not character then
+ if trace_baseinit then
+ report_prepare("weird ligature in lookup %a, current %C, preceding %C",sequence.name,v,preceding)
+ end
+ character = makefake(tfmdata,name,present)
+ end
+ local ligatures = character.ligatures
+ if ligatures then
+ ligatures[unicode] = { char = v }
+ else
+ character.ligatures = { [unicode] = { char = v } }
+ end
+ if done then
+ local d = done[name]
+ if not d then
+ done[name] = { "dummy", v }
+ else
+ d[#d+1] = v
+ end
+ end
+end
+
+local function make_2(present,tfmdata,characters,tree,name,preceding,unicode,done)
+ if tonumber(tree) then
+ make_3(present,tfmdata,characters,tree,name,preceding,unicode,done,tree)
+ else
+ for k, v in next, tree do
+ if k == "ligature" then
+ make_3(present,tfmdata,characters,tree,name,preceding,unicode,done,v)
+ else
+ local code = present[name] or unicode
+ local name = name .. "_" .. k
+ make_2(present,tfmdata,characters,v,name,code,k,done)
+ end
+ end
+ end
+end
+
+local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplist)
+ local characters = tfmdata.characters
+ local descriptions = tfmdata.descriptions
+ local resources = tfmdata.resources
+ local changed = tfmdata.changed
+
+ local ligatures = { }
+ local alternate = tonumber(value) or true and 1
+ local defaultalt = otf.defaultbasealternate
+ local trace_singles = trace_baseinit and trace_singles
+ local trace_alternatives = trace_baseinit and trace_alternatives
+ local trace_ligatures = trace_baseinit and trace_ligatures
+
+ -- A chain of changes is handled in font-con which is cleaner because
+ -- we can have shared changes and such.
+
+ if not changed then
+ changed = { }
+ tfmdata.changed = changed
+ end
+
+ for i=1,#lookuplist do
+ local sequence = lookuplist[i]
+ local steps = sequence.steps
+ local kind = sequence.type
+ if kind == "gsub_single" then
+ for i=1,#steps do
+ for unicode, data in next, steps[i].coverage do
+ if unicode ~= data and not changed[unicode] then
+ changed[unicode] = data
+ end
+ if trace_singles then
+ report_substitution(feature,sequence,descriptions,unicode,data)
+ end
+ end
+ end
+ elseif kind == "gsub_alternate" then
+ for i=1,#steps do
+ for unicode, data in next, steps[i].coverage do
+ local replacement = data[alternate]
+ if replacement then
+ if unicode ~= replacement and not changed[unicode] then
+ changed[unicode] = replacement
+ end
+ if trace_alternatives then
+ report_alternate(feature,sequence,descriptions,unicode,replacement,value,"normal")
+ end
+ elseif defaultalt == "first" then
+ replacement = data[1]
+ if unicode ~= replacement and not changed[unicode] then
+ changed[unicode] = replacement
+ end
+ if trace_alternatives then
+ report_alternate(feature,sequence,descriptions,unicode,replacement,value,defaultalt)
+ end
+ elseif defaultalt == "last" then
+ replacement = data[#data]
+ if unicode ~= replacement and not changed[unicode] then
+ changed[unicode] = replacement
+ end
+ if trace_alternatives then
+ report_alternate(feature,sequence,descriptions,unicode,replacement,value,defaultalt)
+ end
+ else
+ if trace_alternatives then
+ report_alternate(feature,sequence,descriptions,unicode,replacement,value,"unknown")
+ end
+ end
+ end
+ end
+ elseif kind == "gsub_ligature" then
+ for i=1,#steps do
+ for unicode, data in next, steps[i].coverage do
+ ligatures[#ligatures+1] = { unicode, data, "" } -- lookupname }
+ if trace_ligatures then
+ report_ligature(feature,sequence,descriptions,unicode,data)
+ end
+ end
+ end
+ end
+ end
+
+ local nofligatures = #ligatures
+
+ if nofligatures > 0 then
+ local characters = tfmdata.characters
+ local present = { }
+ local done = trace_baseinit and trace_ligatures and { }
+
+ for i=1,nofligatures do
+ local ligature = ligatures[i]
+ local unicode = ligature[1]
+ local tree = ligature[2]
+ make_1(present,tree,"ctx_"..unicode)
+ end
+
+ for i=1,nofligatures do
+ local ligature = ligatures[i]
+ local unicode = ligature[1]
+ local tree = ligature[2]
+ local lookupname = ligature[3]
+ make_2(present,tfmdata,characters,tree,"ctx_"..unicode,unicode,unicode,done,sequence)
+ end
+
+ end
+
+end
+
+local function preparepositionings(tfmdata,feature,value,validlookups,lookuplist)
+ local characters = tfmdata.characters
+ local descriptions = tfmdata.descriptions
+ local resources = tfmdata.resources
+ local properties = tfmdata.properties
+ local traceindeed = trace_baseinit and trace_kerns
+ -- check out this sharedkerns trickery
+ for i=1,#lookuplist do
+ local sequence = lookuplist[i]
+ local steps = sequence.steps
+ local kind = sequence.type
+ local format = sequence.format
+ if kind == "gpos_pair" then
+ for i=1,#steps do
+ local step = steps[i]
+ local format = step.format
+ if format == "kern" or format == "move" then
+ for unicode, data in next, steps[i].coverage do
+ local character = characters[unicode]
+ local kerns = character.kerns
+ if not kerns then
+ kerns = { }
+ character.kerns = kerns
+ end
+ if traceindeed then
+ for otherunicode, kern in next, data do
+ if not kerns[otherunicode] and kern ~= 0 then
+ kerns[otherunicode] = kern
+ report_kern(feature,sequence,descriptions,unicode,otherunicode,kern)
+ end
+ end
+ else
+ for otherunicode, kern in next, data do
+ if not kerns[otherunicode] and kern ~= 0 then
+ kerns[otherunicode] = kern
+ end
+ end
+ end
+ end
+ else
+ for unicode, data in next, steps[i].coverage do
+ local character = characters[unicode]
+ local kerns = character.kerns
+ for otherunicode, kern in next, data do
+ -- kern[2] is true (all zero) or a table
+ local other = kern[2]
+ if other == true or (not other and not (kerns and kerns[otherunicode])) then
+ local kern = kern[1]
+ if kern == true then
+ -- all zero
+ elseif kern[1] ~= 0 or kern[2] ~= 0 or kern[4] ~= 0 then
+ -- a complex pair not suitable for basemode
+ else
+ kern = kern[3]
+ if kern ~= 0 then
+ if kerns then
+ kerns[otherunicode] = kern
+ else
+ kerns = { [otherunicode] = kern }
+ character.kerns = kerns
+ end
+ if traceindeed then
+ report_kern(feature,sequence,descriptions,unicode,otherunicode,kern)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+
+end
+
+local function initializehashes(tfmdata)
+ -- already done
+end
+
+local function checkmathreplacements(tfmdata,fullname,fixitalics)
+ if tfmdata.mathparameters then
+ local characters = tfmdata.characters
+ local changed = tfmdata.changed
+ if next(changed) then
+ if trace_preparing or trace_baseinit then
+ report_prepare("checking math replacements for %a",fullname)
+ end
+ for unicode, replacement in next, changed do
+ local u = characters[unicode]
+ local r = characters[replacement]
+ if u and r then
+ local n = u.next
+ local v = u.vert_variants
+ local h = u.horiz_variants
+ if fixitalics then
+ -- quite some warnings on stix ...
+ local ui = u.italic
+ if ui and not r.italic then
+ if trace_preparing then
+ report_prepare("using %i units of italic correction from %C for %U",ui,unicode,replacement)
+ end
+ r.italic = ui -- print(ui,ri)
+ end
+ end
+ if n and not r.next then
+ if trace_preparing then
+ report_prepare("forcing %s for %C substituted by %U","incremental step",unicode,replacement)
+ end
+ r.next = n
+ end
+ if v and not r.vert_variants then
+ if trace_preparing then
+ report_prepare("forcing %s for %C substituted by %U","vertical variants",unicode,replacement)
+ end
+ r.vert_variants = v
+ end
+ if h and not r.horiz_variants then
+ if trace_preparing then
+ report_prepare("forcing %s for %C substituted by %U","horizontal variants",unicode,replacement)
+ end
+ r.horiz_variants = h
+ end
+ else
+ if trace_preparing then
+ report_prepare("error replacing %C by %U",unicode,replacement)
+ end
+ end
+ end
+ end
+ end
+end
+
+local function featuresinitializer(tfmdata,value)
+ if true then -- value then
+ local starttime = trace_preparing and os.clock()
+ local features = tfmdata.shared.features
+ local fullname = tfmdata.properties.fullname or "?"
+ if features then
+ initializehashes(tfmdata)
+ local collectlookups = otf.collectlookups
+ local rawdata = tfmdata.shared.rawdata
+ local properties = tfmdata.properties
+ local script = properties.script
+ local language = properties.language
+ local rawresources = rawdata.resources
+ local rawfeatures = rawresources and rawresources.features
+ local basesubstitutions = rawfeatures and rawfeatures.gsub
+ local basepositionings = rawfeatures and rawfeatures.gpos
+ local substitutionsdone = false
+ local positioningsdone = false
+ --
+ if basesubstitutions or basepositionings then
+ local sequences = tfmdata.resources.sequences
+ for s=1,#sequences do
+ local sequence = sequences[s]
+ local sfeatures = sequence.features
+ if sfeatures then
+ local order = sequence.order
+ if order then
+ for i=1,#order do --
+ local feature = order[i]
+ local value = features[feature]
+ if value then
+ local validlookups, lookuplist = collectlookups(rawdata,feature,script,language)
+-- if not validlookups and not lookuplist and script == "math" then
+-- validlookups, lookuplist = collectlookups(rawdata,feature,"dflt","dflt")
+-- end
+ if not validlookups then
+ -- skip
+ elseif basesubstitutions and basesubstitutions[feature] then
+ if trace_preparing then
+ report_prepare("filtering base %s feature %a for %a with value %a","sub",feature,fullname,value)
+ end
+ preparesubstitutions(tfmdata,feature,value,validlookups,lookuplist)
+ registerbasefeature(feature,value)
+ substitutionsdone = true
+ elseif basepositionings and basepositionings[feature] then
+ if trace_preparing then
+ report_prepare("filtering base %a feature %a for %a with value %a","pos",feature,fullname,value)
+ end
+ preparepositionings(tfmdata,feature,value,validlookups,lookuplist)
+ registerbasefeature(feature,value)
+ positioningsdone = true
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ --
+ if substitutionsdone then
+ checkmathreplacements(tfmdata,fullname,features.fixitalics)
+ end
+ --
+ registerbasehash(tfmdata)
+ end
+ if trace_preparing then
+ report_prepare("preparation time is %0.3f seconds for %a",os.clock()-starttime,fullname)
+ end
+ end
+end
+
+registerotffeature {
+ name = "features",
+ description = "features",
+ default = true,
+ initializers = {
+ -- position = 1, -- after setscript (temp hack ... we need to force script / language to 1
+ base = featuresinitializer,
+ }
+}
+
+otf.basemodeinitializer = featuresinitializer
diff --git a/tex/context/base/mkxl/font-ots.lmt b/tex/context/base/mkxl/font-ots.lmt
index 0e99de6d1..9e7fdb1ab 100644
--- a/tex/context/base/mkxl/font-ots.lmt
+++ b/tex/context/base/mkxl/font-ots.lmt
@@ -252,8 +252,8 @@ local math_code = nodecodes.math
local dir_code = nodecodes.dir
local par_code = nodecodes.par
-local lefttoright_code = nodes.dirvalues.lefttoright
-local righttoleft_code = nodes.dirvalues.righttoleft
+local lefttoright_code = tex.directioncodes.lefttoright
+local righttoleft_code = tex.directioncodes.righttoleft
local discretionarydisc_code = nodes.disccodes.discretionary
diff --git a/tex/context/base/mkxl/font-txt.lmt b/tex/context/base/mkxl/font-txt.lmt
index aae69ddd3..c42a3a655 100644
--- a/tex/context/base/mkxl/font-txt.lmt
+++ b/tex/context/base/mkxl/font-txt.lmt
@@ -122,7 +122,7 @@ local math_code = nodecodes.math
local dir_code = nodecodes.dir
local par_code = nodecodes.par
-local righttoleft_code = nodes.dirvalues.righttoleft
+local righttoleft_code = tex.directioncodes.righttoleft
local txtdirstate = otf.helpers.txtdirstate
local pardirstate = otf.helpers.pardirstate
diff --git a/tex/context/base/mkxl/lpdf-ano.lmt b/tex/context/base/mkxl/lpdf-ano.lmt
index 2e19ffd5e..4d9af002c 100644
--- a/tex/context/base/mkxl/lpdf-ano.lmt
+++ b/tex/context/base/mkxl/lpdf-ano.lmt
@@ -26,11 +26,12 @@ local rep, format, find = string.rep, string.format, string.find
local min = math.min
local lpegmatch = lpeg.match
local formatters = string.formatters
-local sortedkeys, concat = table.sortedkeys, table.concat
+local sortedkeys, concat, swapped = table.sortedkeys, table.concat, table.swapped
local trace_references = false trackers.register("references.references", function(v) trace_references = v end)
local trace_destinations = false trackers.register("references.destinations", function(v) trace_destinations = v end)
local trace_bookmarks = false trackers.register("references.bookmarks", function(v) trace_bookmarks = v end)
+local trace_externals = false trackers.register("references.externals", function(v) trace_externals = v end)
local log_destinations = false directives.register("destinations.log", function(v) log_destinations = v end)
local untex_urls = true directives.register("references.untexurls", function(v) untex_urls = v end)
@@ -510,59 +511,65 @@ function nodeinjections.destination(width,height,depth,names,view)
if method == v_page then
for n=1,#names do
local name = names[n]
- local used = usedviews[name]
- if used and used ~= true then
- -- already done, maybe a warning
- elseif type(name) == "number" then
- -- if noview then
- -- usedviews[name] = view
- -- names[n] = false
- -- else
+ if name then
+ local used = usedviews[name]
+ if used and used ~= true then
+ -- already done, maybe a warning
+ elseif type(name) == "number" then
+ -- if noview then
+ -- usedviews[name] = view
+ -- names[n] = false
+ -- else
+ usedviews[name] = view
+ names[n] = false
+ -- end
+ else
usedviews[name] = view
- names[n] = false
- -- end
- else
- usedviews[name] = view
+ end
end
end
elseif method == v_name then
for n=1,#names do
local name = names[n]
- local used = usedviews[name]
- if used and used ~= true then
- -- already done, maybe a warning
- elseif type(name) == "number" then
- local used = usedinternals[name]
- usedviews[name] = view
- names[n] = registerautoprefix(name)
- doview = true
- else
- usedviews[name] = view
- doview = true
+ if name then
+ local used = usedviews[name]
+ if used and used ~= true then
+ -- already done, maybe a warning
+ elseif type(name) == "number" then
+ local used = usedinternals[name]
+ usedviews[name] = view
+ names[n] = registerautoprefix(name)
+ doview = true
+ else
+ usedviews[name] = view
+ doview = true
+ end
end
end
else
for n=1,#names do
local name = names[n]
- if usedviews[name] then
- -- already done, maybe a warning
- elseif type(name) == "number" then
- if noview then
- usedviews[name] = view
- names[n] = false
- else
- local used = usedinternals[name]
- if used and used ~= defaultview then
+ if name then
+ if usedviews[name] then
+ -- already done, maybe a warning
+ elseif type(name) == "number" then
+ if noview then
usedviews[name] = view
- names[n] = registerautoprefix(name)
- doview = true
- else
names[n] = false
+ else
+ local used = usedinternals[name]
+ if used and used ~= defaultview then
+ usedviews[name] = view
+ names[n] = registerautoprefix(name)
+ doview = true
+ else
+ names[n] = false
+ end
end
+ else
+ usedviews[name] = view
+ doview = true
end
- else
- usedviews[name] = view
- doview = true
end
end
end
@@ -634,20 +641,95 @@ end
-- annotations
-local function pdffilelink(filename,destination,page,actions)
- if not filename or filename == "" or file.basename(filename) == tex.jobname then
- return false
- end
- filename = file.addsuffix(filename,"pdf")
- if (not destination or destination == "") or (references.outermethod == v_page) then
- destination = pdfarray { (page or 1) - 1, pdf_fit }
+local pdffilelink do
+
+ local valid = table.setmetatableindex(function(t,filename)
+ local found = false
+ if lfs.isfile(filename) then
+ report_destinations("loading destinations from file %a",filename)
+ local pdffile = lpdf.epdf.load(filename)
+ if pdffile then
+ local pages = pdffile.pages
+ local nofpages = pdffile.nofpages
+ local destinations = pdffile.destinations
+ if pages and nofpages > 0 and destinations then
+ local reverse = swapped(pages)
+ local total = 0
+ found = { }
+ for k, v in next, destinations do
+ local D = v.D
+ if D then
+ found[k] = reverse[D[1]]
+ total = total + 1
+ end
+ end
+ t[filename] = found
+ report_destinations("%i destinations on %i pages found",total,nofpages)
+ end
+ end
+ end
+ return found
+ end)
+
+ local pagefromhash = structures.references.pagefromhash
+
+ pdffilelink = function(filename,destination,page,actions)
+ if not filename or filename == "" or file.basename(filename) == tex.jobname then
+ return false
+ end
+ filename = file.addsuffix(filename,"pdf")
+ -- page auto name
+ local forcepage = false
+ if not destination or destination == "" then
+ forcepage = true
+ elseif references.outermethod == v_page then
+ if not page then
+ local hash = valid[filename]
+ page = hash and hash[destination]
+ if not page or trace_externals then
+ report_destinations("no %s destination %a in file %a","page",destination,filename)
+ end
+ end
+ forcepage = true
+ else -- name or auto, maybe only check with auto
+ local hash = valid[filename]
+ if hash then
+ local p = nil
+ p, destination = pagefromhash(hash,destination,page,actions)
+ if p then
+ if references.outermethod == v_name then
+ -- keep destination string
+ elseif page then
+ if p ~= page then
+ report_destinations("page %i for destination %a in %a conflicts, %i expected",page,destination,filename,p)
+ page = p
+ end
+ forcepage = true
+ elseif p then
+ page = p
+ forcepage = true
+ end
+ else
+ if not page or trace_externals then
+ report_destinations("no %s destination %a in file %a","name",destination,filename)
+ end
+ forcepage = true
+ end
+ -- else
+ -- keep destination string
+ end
+ end
+ if forcepage then
+ destination = pdfarray { (page or 1) - 1, pdf_fit }
+ end
+ return pdfdictionary {
+ S = pdf_gotor, -- can also be pdf_launch
+ F = filename,
+ D = destination or defaultdestination,
+ NewWindow = actions.newwindow and true or nil,
+ }
end
- return pdfdictionary {
- S = pdf_gotor, -- can also be pdf_launch
- F = filename,
- D = destination or defaultdestination,
- NewWindow = actions.newwindow and true or nil,
- }
+
end
local untex = references.urls.untex
@@ -981,6 +1063,9 @@ runners["outer"] = function(var,actions)
end
runners["outer with inner"] = function(var,actions)
+ if var.r then
+ actions.realpage = var.r
+ end
return pdffilelink(references.checkedfile(var.outer),var.inner,var.r,actions)
end
diff --git a/tex/context/base/mkxl/lpdf-rul.lmt b/tex/context/base/mkxl/lpdf-rul.lmt
index 4efa17bb0..ce90488bd 100644
--- a/tex/context/base/mkxl/lpdf-rul.lmt
+++ b/tex/context/base/mkxl/lpdf-rul.lmt
@@ -21,7 +21,7 @@ local ruleactions = nuts.rules.ruleactions
local getwhd = nuts.getwhd
-local lefttoright_code = nodes.dirvalues.lefttoright
+local lefttoright_code = tex.directioncodes.lefttoright
local mpcolor = attributes.colors.mpcolor
diff --git a/tex/context/base/mkxl/luat-run.lmt b/tex/context/base/mkxl/luat-run.lmt
index f6b2ea063..c53817697 100644
--- a/tex/context/base/mkxl/luat-run.lmt
+++ b/tex/context/base/mkxl/luat-run.lmt
@@ -211,6 +211,14 @@ function luatex.currentfile()
return stack[#stack] or tex.jobname
end
+function luatex.currentlevel()
+ return level
+end
+
+function luatex.currenttotal()
+ return total
+end
+
local function report_start(name,rest)
if rest then
-- luatex
diff --git a/tex/context/base/mkxl/math-acc.mklx b/tex/context/base/mkxl/math-acc.mklx
index c3c4a5d34..8c5a1adfa 100644
--- a/tex/context/base/mkxl/math-acc.mklx
+++ b/tex/context/base/mkxl/math-acc.mklx
@@ -32,6 +32,35 @@
%D Older implementations are kept in the \MKII\ and \MKIV\ modules for educational
%D purposes.
+%D Only very few fonts provide flat accents but we emulate them for those that don't
+%D have them. We also need to fix the related font parameter for a few fonts like
+%D Lucida and Garamond.
+
+% \startbuffer
+% \im{
+% \dostepwiserecurse{`A}{`Z}{1}{
+% \blackrule[height=\the\Umathflattenedaccentbaseheight\textstyle,depth=0pt,width=0.05ts]
+% \hat{\char#1}
+% }
+% }
+% \stopbuffer
+%
+% \start % TEXpage[offset=1ts]
+% \showglyphs
+% \switchtobodyfont[modern] \getbuffer\par
+% \switchtobodyfont[erewhon] \getbuffer\par
+% \switchtobodyfont[concrete] \getbuffer\par
+% \switchtobodyfont[libertinus] \getbuffer\par
+% \switchtobodyfont[stixtwo] \getbuffer\par
+% \switchtobodyfont[kpfonts] \getbuffer\par
+% \switchtobodyfont[minion] \getbuffer\par
+% \switchtobodyfont[schola] \getbuffer\par
+% \switchtobodyfont[lucida] \getbuffer\par
+% \switchtobodyfont[xcharter] \getbuffer\par
+% \switchtobodyfont[libertinus] \getbuffer\par
+% \switchtobodyfont[termes] \getbuffer\par
+% \stop %TEXpage
+
\installcorenamespace{mathaccents}
\installcommandhandler \??mathaccents {mathaccent} \??mathaccents
@@ -166,7 +195,7 @@
\definemathtopaccent[\v!top][acute] ["0301]
\definemathtopaccent[\v!top][hat] ["0302]
\definemathtopaccent[\v!top][tilde] ["0303]
-\definemathtopaccent[\v!top][bar] ["0304]
+\definemathtopaccent[\v!top][bar] ["0305]
%definemathtopaccent[\v!top][overbar] ["0305]% We expect overbar to stretch, so later
\definemathtopaccent[\v!top][breve] ["0306]
\definemathtopaccent[\v!top][dot] ["0307]
diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt
index 4a46baff9..e8310ef2b 100644
--- a/tex/context/base/mkxl/math-act.lmt
+++ b/tex/context/base/mkxl/math-act.lmt
@@ -296,7 +296,7 @@ local function report_tweak(fmt,target,original,...)
metadata and metadata.fontname or "unknown",
parameters.size or 655360,
parameters.mathsize or 1,
- string.formatters[fmt](...)
+ formatters[fmt](...)
)
else
print("something is wrong")
@@ -1701,7 +1701,8 @@ do
accent = {
[0x0300] = over, -- widegrave
[0x0308] = over, -- wideddot
- [0x0304] = over, -- widebar
+ [0x0304] = over, -- macron (bar)
+ [0x0305] = over, -- widebar
[0x0301] = over, -- wideacute
[0x0302] = over, -- widehat
[0x030C] = over, -- widecheck
@@ -2116,7 +2117,7 @@ do
local force = false experiments.register("math.arrows", function(v) force = v end)
local function tighten(target,unicode,left,right,squeeze,yoffset)
- local name = string.formatters["math tightened %U %.3N %.3N %.3N %.3N"](unicode,left,right,squeeze,yoffset)
+ local name = formatters["math tightened %U %.3N %.3N %.3N %.3N"](unicode,left,right,squeeze,yoffset)
local slot = privateslot(target,name)
if not slot then
local characters = target.characters
@@ -2654,17 +2655,17 @@ do -- see pagella for an extensive example
local nps = fonts.helpers.newprivateslot
local mapping = {
- [0x0300] = { 0x0060, false, nps("flat 0x0060 1") },
- [0x0308] = { 0x00A8, false, nps("flat 0x00A8 1") },
- [0x0304] = { 0x00AF, false, nps("flat 0x00AF 1") },
- [0x0301] = { 0x00B4, false, nps("flat 0x00B4 1") },
- [0x0302] = { 0x02C6, true, nps("flat 0x02C6 1") },
- [0x030C] = { 0x02C7, true, nps("flat 0x02C7 1") },
- [0x0306] = { 0x02D8, false, nps("flat 0x02D8 1") },
- [0x0307] = { 0x02D9, false, nps("flat 0x02D9 1") },
- [0x030A] = { 0x02DA, false, nps("flat 0x02DA 1") },
- [0x0303] = { 0x02DC, true, nps("flat 0x02DC 1") },
- [0x20DB] = { 0x20DB, false, nps("flat 0x20DB 1") },
+ [0x0300] = { 0x0060, false },
+ [0x0308] = { 0x00A8, false },
+ [0x0304] = { 0x00AF, false }, -- 305
+ [0x0301] = { 0x00B4, false },
+ [0x0302] = { 0x02C6, true },
+ [0x030C] = { 0x02C7, true },
+ [0x0306] = { 0x02D8, false },
+ [0x0307] = { 0x02D9, false },
+ [0x030A] = { 0x02DA, false },
+ [0x0303] = { 0x02DC, true },
+ [0x20DB] = { 0x20DB, false },
}
datasets.fixaccents = mapping
@@ -2686,6 +2687,15 @@ do -- see pagella for an extensive example
stretchingdata.advance = 0
stretchingdata.topanchor = topanchor
stretchingdata.commands = { rightcommand[width + topanchor], charcommand[stretching] }
+-- local flat = stretchingdata.flataccent
+-- if flat then
+-- -- Nasty! xoffset needed. Check this when we patch vf.
+-- local flatdata = characters[flat]
+-- flatdata.width = width
+-- flatdata.advance = 0
+-- flatdata.topanchor = topanchor
+-- flatdata.xoffset = width + topanchor
+-- end
if not trace_tweaking then
done = true
elseif done then
@@ -2753,20 +2763,23 @@ do -- see pagella for an extensive example
-- offset factor 0.9|calculated
-- squeeze factor 0.1|calculated
+ local f_flat = formatters["flat accent %05X"]
+
function mathtweaks.flattenaccents(target,original,parameters)
local characters = target.characters
local force = parameters.force
- local squeeze = parameters.squeeze or 0.8
- local ofactor = parameters.offset or (squeeze/2)
+ local squeeze = parameters.squeeze or 0.85
+ local ofactor = parameters.offset or (squeeze/8.5)
local hfactor = parameters.height or (1 - ofactor)
local done = false
for stretching, entry in sortedhash(mapping) do
+ local code = stretching
local last = characters[stretching]
while last do
if force or not last.flataccent then
- local slot = entry[3]
+ local slot = nps(f_flat(code))
local data = copytable(last)
- local height = data.height or 0
+ local height = data.height or 0
data.effect = { squeeze = squeeze }
data.height = hfactor * height
data.yoffset = ofactor * height
@@ -2780,9 +2793,9 @@ do -- see pagella for an extensive example
done = { [stretching] = true }
end
end
- local n = last.next
- if n then
- last = characters[n]
+ code = last.next
+ if code then
+ last = characters[code]
else
break
end
diff --git a/tex/context/base/mkxl/math-fen.mkxl b/tex/context/base/mkxl/math-fen.mkxl
index a69cafb97..a01f589e5 100644
--- a/tex/context/base/mkxl/math-fen.mkxl
+++ b/tex/context/base/mkxl/math-fen.mkxl
@@ -981,7 +981,11 @@
\protected\def\math_choosemathbig_math#1#2% so we accept \big{||} as well
{\math_fenced_force_size\bigmathdelimitervariant{#1}\relax
- \Uvextensible#2\relax
+ \Uvextensible
+ \s!axis
+ \s!exact
+ #2%
+ \relax
\c_attr_mathsize\attributeunsetvalue}
\protected\def\math_choosemathbig_text#1#2% so we accept \big{||} as well
@@ -996,7 +1000,11 @@
\permanent\protected\def\mathdelimiterstep#1#2% not used, only in example
{\begingroup
\math_fenced_force_size\plusone{#1}%
- \Uvextensible#2\relax
+ \Uvextensible
+ \s!axis
+ \s!exact
+ #2%
+ \relax
\endgroup}
\definemathcommand [big] {\choosemathbig1}
diff --git a/tex/context/base/mkxl/math-ini.mkxl b/tex/context/base/mkxl/math-ini.mkxl
index 6f2dfc1c2..2529890d7 100644
--- a/tex/context/base/mkxl/math-ini.mkxl
+++ b/tex/context/base/mkxl/math-ini.mkxl
@@ -1422,20 +1422,20 @@
\inherited\setmathspacing \mathtextpunctuationcode \mathdifferentialcode \allmathstyles \mathinterwordmuskip
\inherited\setmathspacing \mathtextpunctuationcode \mathpunctuationcode \allmathstyles \mathinterwordmuskip
%
- \inherited\setmathspacing \mathordinarycode \mathtextpunctuationcode \allmathstyles \tinymuskip
- \inherited\setmathspacing \mathoperatorcode \mathtextpunctuationcode \allmathstyles \tinymuskip
- \inherited\setmathspacing \mathbinarycode \mathtextpunctuationcode \allmathstyles \tinymuskip
- \inherited\setmathspacing \mathrelationcode \mathtextpunctuationcode \allmathstyles \tinymuskip
- \inherited\setmathspacing \mathopencode \mathtextpunctuationcode \allmathstyles \tinymuskip
- \inherited\setmathspacing \mathmiddlecode \mathtextpunctuationcode \allmathstyles \tinymuskip
- \inherited\setmathspacing \mathclosecode \mathtextpunctuationcode \allmathstyles \tinymuskip
- \inherited\setmathspacing \mathpunctuationcode \mathtextpunctuationcode \allmathstyles \tinymuskip
- \inherited\setmathspacing \mathconstructcode \mathtextpunctuationcode \allmathstyles \tinymuskip
- \inherited\setmathspacing \mathellipsiscode \mathtextpunctuationcode \allmathstyles \tinymuskip
- \inherited\setmathspacing \mathfractioncode \mathtextpunctuationcode \allmathstyles \tinymuskip
- \inherited\setmathspacing \mathradicalcode \mathtextpunctuationcode \allmathstyles \tinymuskip
- \inherited\setmathspacing \mathdifferentialcode \mathtextpunctuationcode \allmathstyles \tinymuskip
- \inherited\setmathspacing \mathpunctuationcode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathordinarycode \mathtextpunctuationcode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathoperatorcode \mathtextpunctuationcode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathbinarycode \mathtextpunctuationcode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathrelationcode \mathtextpunctuationcode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathopencode \mathtextpunctuationcode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathtextpunctuationcode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathclosecode \mathtextpunctuationcode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathtextpunctuationcode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathconstructcode \mathtextpunctuationcode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathellipsiscode \mathtextpunctuationcode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathfractioncode \mathtextpunctuationcode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathradicalcode \mathtextpunctuationcode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathdifferentialcode \mathtextpunctuationcode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathtextpunctuationcode \allmathstyles \pettymuskip
\stopsetups
\directsetup{math:spacing:default}
diff --git a/tex/context/base/mkxl/math-noa.lmt b/tex/context/base/mkxl/math-noa.lmt
index f64783ed9..ef75ac4c4 100644
--- a/tex/context/base/mkxl/math-noa.lmt
+++ b/tex/context/base/mkxl/math-noa.lmt
@@ -881,52 +881,49 @@ do
local method = div(a,100)
local size = a % 100
setattr(pointer,a_mathsize,0)
- local delimiter = getdelimiter(pointer)
- if delimiter then
- local oldchar, font, fam = getcharspec(delimiter)
- if oldchar > 0 and font > 0 then
- local ht = getheight(pointer)
- local dp = getdepth(pointer)
- local data = fontdata[font]
- local characters = data.characters
- local olddata = characters[oldchar]
- if olddata then
--- local oldheight = olddata.height or 0
--- local olddepth = olddata.depth or 0
- local template = olddata.varianttemplate
- local newchar = mathematics.big(data,template or oldchar,size,method)
- local newdata = characters[newchar]
- local newheight = newdata.height or 0
- local newdepth = newdata.depth or 0
- if template then
--- local ratio = (newheight + newdepth) / (oldheight + olddepth)
--- setheight(pointer,ratio * oldheight)
--- setdepth(pointer,ratio * olddepth)
- setheight(pointer,newheight)
- setdepth(pointer,newdepth)
- if not olddata.extensible then
- -- check this on bonum and antykwa
- setoptions(pointer,0)
- end
- if trace_fences then
--- report_fences("replacing %C using method %a, size %a, template %C and ratio %.3f",newchar,method,size,template,ratio)
- report_fences("replacing %C using method %a, size %a and template %C",newchar,method,size,template)
- end
- else
- -- 1 scaled point is a signal, for now
- if ht == 1 then
+ if size ~= 0 then
+ local delimiter = getdelimiter(pointer)
+ if delimiter then
+ local oldchar, font, fam = getcharspec(delimiter)
+ if oldchar > 0 and font > 0 then
+ local ht = getheight(pointer)
+ local dp = getdepth(pointer)
+ local data = fontdata[font]
+ local characters = data.characters
+ local olddata = characters[oldchar]
+ if olddata then
+ local template = olddata.varianttemplate
+ local newchar = mathematics.big(data,template or oldchar,size,method)
+ local newdata = characters[newchar]
+ local newheight = newdata.height or 0
+ local newdepth = newdata.depth or 0
+ if template then
setheight(pointer,newheight)
- end
- if dp == 1 then
setdepth(pointer,newdepth)
+ if not olddata.extensible then
+ -- check this on bonum and antykwa
+ setoptions(pointer,0)
+ end
+ setoptions(pointer,getoptions(pointer)| tex.noadoptioncodes.scale )
+ if trace_fences then
+ report_fences("replacing %C using method %a, size %a and template %C",newchar,method,size,template)
+ end
+ else
+ -- 1 scaled point is a signal, for now
+ if ht == 1 then
+ setheight(pointer,newheight)
+ end
+ if dp == 1 then
+ setdepth(pointer,newdepth)
+ end
+ setchar(delimiter,newchar)
+ if trace_fences then
+ report_fences("replacing %C by %C using method %a and size %a",oldchar,char,method,size)
+ end
end
- setchar(delimiter,newchar)
- if trace_fences then
- report_fences("replacing %C by %C using method %a and size %a",oldchar,char,method,size)
- end
+ elseif trace_fences then
+ report_fences("not replacing %C using method %a and size %a",oldchar,method,size)
end
- elseif trace_fences then
- report_fences("not replacing %C using method %a and size %a",oldchar,method,size)
end
end
end
@@ -1556,18 +1553,22 @@ do
local attributes = mathalternates.attributes
local registered = mathalternates.registered
local hashes = mathalternates.hashes
+ local newchar = nil
for i=1,#registered do
local r = registered[i]
if (a & r) ~= 0 then
- local char = getchar(pointer)
+ local char = newchar or getchar(pointer)
local alt = hashes[i][char]
if alt == nil then
local what = attributes[r]
+local list = what.list
+if not list or list[char] then
alt = otf.getalternate(fontdata[fontid],char,what.feature,what.value) or false
if alt == char then
alt = false
end
hashes[i][char] = alt
+end
end
if alt then
if trace_alternates then
@@ -1575,11 +1576,15 @@ do
report_alternates("alternate %a, value %a, replacing glyph %U by glyph %U",
tostring(what.feature),tostring(what.value),char,alt)
end
- setchar(pointer,alt)
- break
+ -- setchar(pointer,alt)
+ -- break
+ newchar = alt
end
end
end
+ if newchar then
+ setchar(pointer,newchar)
+ end
end
end
end
diff --git a/tex/context/base/mkxl/math-ttv.lmt b/tex/context/base/mkxl/math-ttv.lmt
index 3393ecc03..06d92e8b9 100644
--- a/tex/context/base/mkxl/math-ttv.lmt
+++ b/tex/context/base/mkxl/math-ttv.lmt
@@ -144,7 +144,8 @@ mathencodings["tex-mr"] = {
-- [0x002C7] = 0x14, -- [math]check
-- [0x002D8] = 0x15, -- [math]breve
-- [0x000AF] = 0x16, -- [math]bar
--- [0x00021] = 0x21, -- !
+[0x00021] = 0x21, -- ! -- MS
+[0x00026] = 0x26, -- & -- MS
[0x00028] = 0x28, -- (
[0x00029] = 0x29, -- )
[0x0002B] = 0x2B, -- +
diff --git a/tex/context/base/mkxl/math-vfu.lmt b/tex/context/base/mkxl/math-vfu.lmt
index 1639517b5..237b39d9f 100644
--- a/tex/context/base/mkxl/math-vfu.lmt
+++ b/tex/context/base/mkxl/math-vfu.lmt
@@ -745,6 +745,7 @@ local function copy_glyph(main,target,original,unicode,slot)
kerns = olddata.kerns,
mathkerns = olddata.mathkerns,
tounicode = olddata.tounicode,
+-- smaller = olddata.smaller,
commands = { slotcommand[slot][unicode] },
}
local glyphdata = newdata
@@ -1058,7 +1059,7 @@ function vfmath.define(specification,set,goodies)
mathparameters.axisheight = newparameters[22] or 0 -- axisheight : height of fraction lines above the baseline
-- report_virtual("loading and virtualizing font %a at size %p, setting sy parameters",name,size)
end
- -- We no longer care about kerns and ligatures here. We use backmack because we need to know
+ -- We no longer care about kerns and ligatures here. We use backmap because we need to know
-- the original order and the loader has made a unicode font of it and weird glyph names have
-- spoiled that a bit too.
if ss.overlay then
diff --git a/tex/context/base/mkxl/node-dir.lmt b/tex/context/base/mkxl/node-dir.lmt
index 246bf34e4..5692fddb7 100644
--- a/tex/context/base/mkxl/node-dir.lmt
+++ b/tex/context/base/mkxl/node-dir.lmt
@@ -14,7 +14,8 @@ local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local normaldir_code = nodes.dircodes.normal
local line_code = nodes.listcodes.line
-local lefttoright_code = nodes.dirvalues.lefttoright
+
+local lefttoright_code = tex.directioncodes.lefttoright
local getnext = nuts.getnext
local getlist = nuts.getlist
diff --git a/tex/context/base/mkxl/node-ini.lmt b/tex/context/base/mkxl/node-ini.lmt
index 38f55c160..435f3bf7e 100644
--- a/tex/context/base/mkxl/node-ini.lmt
+++ b/tex/context/base/mkxl/node-ini.lmt
@@ -23,7 +23,7 @@ local allocate = utilities.storage.allocate
local formatcolumns = utilities.formatters.formatcolumns
local getsubtypes = node.subtypes
-local getvalues = node.values
+----- getvalues = node.values
local listcodes = mark(getsubtypes("list"))
local rulecodes = mark(getsubtypes("rule"))
@@ -45,10 +45,6 @@ local choicecodes = mark(getsubtypes("choice"))
local parcodes = mark(getsubtypes("par"))
local attributecodes = mark(getsubtypes("attribute"))
-local fillvalues = mark(getvalues("fill"))
-local dirvalues = mark(getvalues("dir"))
-local mathvalues = mark(getvalues("math"))
-
local function simplified(t)
local r = { }
for k, v in next, t do
@@ -57,17 +53,17 @@ local function simplified(t)
return r
end
-local noadoptions = allocate {
- set = 0x08,
- unused_1 = 0x00 + 0x08,
- unused_2 = 0x01 + 0x08,
- axis = 0x02 + 0x08,
- no_axis = 0x04 + 0x08,
- exact = 0x10 + 0x08,
- left = 0x11 + 0x08,
- middle = 0x12 + 0x08,
- right = 0x14 + 0x08,
-}
+-- local noadoptions = allocate {
+-- set = 0x08,
+-- unused_1 = 0x00 + 0x08,
+-- unused_2 = 0x01 + 0x08,
+-- axis = 0x02 + 0x08,
+-- no_axis = 0x04 + 0x08,
+-- exact = 0x10 + 0x08,
+-- left = 0x11 + 0x08,
+-- middle = 0x12 + 0x08,
+-- right = 0x14 + 0x08,
+-- }
local nodecodes = simplified(node.types())
@@ -90,11 +86,6 @@ choicecodes = allocate(swapped(choicecodes,choicecodes))
parcodes = allocate(swapped(parcodes,parcodes))
attributecodes = allocate(swapped(attributecodes,attributecodes))
rulecodes = allocate(swapped(rulecodes,rulecodes))
-noadoptions = allocate(swapped(noadoptions,noadoptions))
-
-dirvalues = allocate(swapped(dirvalues,dirvalues))
-fillvalues = allocate(swapped(fillvalues,fillvalues))
-mathvalues = allocate(swapped(mathvalues,mathvalues))
nodes.gluecodes = gluecodes
nodes.dircodes = dircodes
@@ -115,24 +106,26 @@ nodes.parcodes = parcodes
nodes.attributecodes = attributecodes
nodes.rulecodes = rulecodes
-nodes.noadoptions = noadoptions
-nodes.fillvalues = fillvalues
-nodes.fillcodes = fillvalues -- for now
-nodes.dirvalues = dirvalues
-nodes.mathvalues = mathvalues
+nodes.nodecodes = nodecodes
+
+-- these are now in tex namespace but we keep them for old times sake
-nodes.nodecodes = nodecodes
+nodes.fillvalues = tex.fillcodes
+nodes.fillcodes = tex.fillcodes
+nodes.dirvalues = tex.directioncodes
+nodes.directionvalues = tex.directioncodes
+nodes.mathvalues = tex.mathparametercodes
-- we will transition to more verbose subtypes (after other math is done)
-noadcodes.ord = noadcodes.ord or noadcodes.ordinary
-noadcodes.operator = noadcodes.op or noadcodes.operator
-noadcodes.bin = noadcodes.bin or noadcodes.binary
-noadcodes.rel = noadcodes.rel or noadcodes.relation
-noadcodes.punct = noadcodes.punct or noadcodes.punctuation
-noadcodes.rad = noadcodes.rad or noadcodes.radical
-noadcodes.frac = noadcodes.frac or noadcodes.fraction
-noadcodes.acc = noadcodes.acc or noadcodes.accent
+noadcodes.ord = noadcodes.ord or noadcodes.ordinary
+noadcodes.operator = noadcodes.op or noadcodes.operator
+noadcodes.bin = noadcodes.bin or noadcodes.binary
+noadcodes.rel = noadcodes.rel or noadcodes.relation
+noadcodes.punct = noadcodes.punct or noadcodes.punctuation
+noadcodes.rad = noadcodes.rad or noadcodes.radical
+noadcodes.frac = noadcodes.frac or noadcodes.fraction
+noadcodes.acc = noadcodes.acc or noadcodes.accent
-- so for now:
@@ -188,8 +181,6 @@ nodes.skipcodes = gluecodes
nodes.directioncodes = dircodes
nodes.discretionarycodes = disccodes
-nodes.directionvalues = dirvalues
-
glyphcodes.glyph = glyphcodes.character
gluecodes.parfillrightskip = gluecodes.parfillrightskip or gluecodes.parfillskip
@@ -201,18 +192,6 @@ listcodes.column = listcodes.alignment
kerncodes.kerning = kerncodes.fontkern
kerncodes.italiccorrection = kerncodes.italiccorrection or 1 -- new
-nodes.noadoptions = {
- set = 0x08,
- unused_1 = 0x00 + 0x08,
- unused_2 = 0x01 + 0x08,
- axis = 0x02 + 0x08,
- no_axis = 0x04 + 0x08,
- exact = 0x10 + 0x08,
- left = 0x11 + 0x08,
- middle = 0x12 + 0x08,
- right = 0x14 + 0x08,
-}
-
-- We use the real node code numbers.
local texsetintegervalue = tex.setintegervalue
diff --git a/tex/context/base/mkxl/node-ref.lmt b/tex/context/base/mkxl/node-ref.lmt
index 15c35cba9..18bda16e9 100644
--- a/tex/context/base/mkxl/node-ref.lmt
+++ b/tex/context/base/mkxl/node-ref.lmt
@@ -96,9 +96,9 @@ local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
local listcodes = nodes.listcodes
-local dirvalues = nodes.dirvalues
-local lefttoright_code = dirvalues.lefttoright
-local righttoleft_code = dirvalues.righttoleft
+local directioncodes = tex.directioncodes
+local lefttoright_code = directioncodes.lefttoright
+local righttoleft_code = directioncodes.righttoleft
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
@@ -689,7 +689,8 @@ do
local function setdestination(n,h,d,name,view) -- n = grouplevel, name == table
topofstack = topofstack + 1
- stack[topofstack] = { n, h, d, name, view }
+ -- stack[topofstack] = { n, h, d, name, view }
+ stack[topofstack] = { n, h or false, d or false, name, view }
return topofstack
end
diff --git a/tex/context/base/mkxl/node-res.lmt b/tex/context/base/mkxl/node-res.lmt
index 2d2c31965..b514a3568 100644
--- a/tex/context/base/mkxl/node-res.lmt
+++ b/tex/context/base/mkxl/node-res.lmt
@@ -174,7 +174,7 @@ local cleader = register_nut(copy_nut(glue)) setsubtype(cleader,glueco
-- the dir field needs to be set otherwise crash:
-local lefttoright_code = nodes.dirvalues.lefttoright
+local lefttoright_code = tex.directioncodes.lefttoright
local rule = register_nut(new_nut(rule_code)) -- setdirection(rule, lefttoright_code)
local emptyrule = register_nut(new_nut(rule_code,rulecodes.empty)) -- setdirection(rule, lefttoright_code)
diff --git a/tex/context/base/mkxl/node-tra.lmt b/tex/context/base/mkxl/node-tra.lmt
index fe212f787..4aa476ce5 100644
--- a/tex/context/base/mkxl/node-tra.lmt
+++ b/tex/context/base/mkxl/node-tra.lmt
@@ -65,7 +65,7 @@ local new_rule = nutpool.rule
local nodecodes = nodes.nodecodes
local whatsitcodes = nodes.whatsitcodes
-local fillcodes = nodes.fillcodes
+local fillcodes = tex.fillcodes
local subtypes = nodes.subtypes
diff --git a/tex/context/base/mkxl/phys-dim.mkxl b/tex/context/base/mkxl/phys-dim.mkxl
index 1d5e7fff6..2dc6e7e1e 100644
--- a/tex/context/base/mkxl/phys-dim.mkxl
+++ b/tex/context/base/mkxl/phys-dim.mkxl
@@ -706,9 +706,16 @@
\fi
:}
+% \permanent\protected\def\unitsSOLIDUS
+% {\ifnum\c_phys_units_state=\plusone % suffix
+% \unitsbackspace
+% \fi
+% {/}%
+% }%\unitsbackspace}
+
\permanent\protected\def\unitsSOLIDUS
{\ifnum\c_phys_units_state=\plusone % suffix
- \unitsbackspace
+ \ifmmode\else\unitsbackspace\fi % we have advanced solidus handling in math
\fi
{/}%
}%\unitsbackspace}
diff --git a/tex/context/base/mkxl/spac-ali.lmt b/tex/context/base/mkxl/spac-ali.lmt
index 9fa024672..0eeda643a 100644
--- a/tex/context/base/mkxl/spac-ali.lmt
+++ b/tex/context/base/mkxl/spac-ali.lmt
@@ -22,7 +22,8 @@ local takeattr = nuts.takeattr
local getwidth = nuts.getwidth
local findtail = nuts.tail
-local righttoleft_code = nodes.dirvalues.righttoleft
+local righttoleft_code = tex.directioncodes.righttoleft
+
local linelist_code = nodes.listcodes.line
local hpack_nodes = nuts.hpack
diff --git a/tex/context/base/mkxl/strc-lst.lmt b/tex/context/base/mkxl/strc-lst.lmt
index d54129f29..312a815cd 100644
--- a/tex/context/base/mkxl/strc-lst.lmt
+++ b/tex/context/base/mkxl/strc-lst.lmt
@@ -37,7 +37,8 @@ local conditionals = tex.conditionals
local ctx_latelua = context.latelua
-local cheat = true
+----- cheat = true -- fragile when we have a multi-component document with cross references
+local cheat = false -- so this will become a directive or maybe even just an experiment
local structures = structures
local lists = structures.lists
@@ -259,27 +260,34 @@ function lists.addto(t) -- maybe more more here (saves parsing at the tex end)
numberdata.numbers = cached[groupindex].numberdata.numbers
end
end
- local setcomponent = references.setcomponent
- if setcomponent then
- setcomponent(t) -- can be inlined
- end
+ --
+-- local setcomponent = references.setcomponent
+-- if setcomponent then
+-- setcomponent(t) -- can be inlined, will be replaced by setstructure below
+-- end
+ --
local r = t.references
- if r and not r.section then
- r.section = structures.sections.currentid()
- end
- local b = r and t.block
- if r and not b then
- local s = r.section
- if s then
- s = structures.sections.tobesaved[s]
- r.block = s and s.block or nil
- end
- end
local i = r and r.internal or 0 -- brrr
- if r and kind and name then
- local tag = tags.getid(kind,name)
- if tag and tag ~= "?" then
- r.tag = tag -- todo: use internal ... is unique enough
+ if r then
+ if not r.section then
+ r.section = structures.sections.currentid()
+ end
+ if not r.structure then
+ r.structure = resolvers.jobs.currentstructure()
+ end
+ local b = r and t.block
+ if not b then
+ local s = r.section
+ if s then
+ s = structures.sections.tobesaved[s]
+ r.block = s and s.block or nil
+ end
+ end
+ if kind and name then
+ local tag = tags.getid(kind,name)
+ if tag and tag ~= "?" then
+ r.tag = tag -- todo: use internal ... is unique enough
+ end
end
end
local p = pushed[i]
@@ -597,7 +605,7 @@ filters[v_intro] = function(specification)
return result
end
-filters[v_reference] = function(specification)
+filters[v_reference] = function(specification) -- this will go away
local collected = specification.collected
local result = { }
local nofresult = 0
@@ -954,7 +962,6 @@ filters[v_default] = function(specification) -- is named
for i=1,#collected do
local v = collected[i]
local r = v.references
--- inspect(v)
if r and (not block or not r.block or pblock == r.block) then
local sectionnumber = sections[r.section]
if sectionnumber then
@@ -1016,10 +1023,9 @@ function lists.process(specification)
local references = listentry.references
local special = specials and numberdata and specials[zerostrippedconcat(numberdata.numbers,".")] or ""
local view = usedviews[i]
- -- if cheat and references then
- -- -- HH: I still need to test this patch:
+-- if cheat and references and cheats[view] then
if cheat and references and view and cheats[view] then
- -- this permits runs=2 with interactivity
+ -- this permits runs=2 with interactivity
local internal = references.internal
usedinternals[internal] = true
usedviews [internal] = references.view
@@ -1591,6 +1597,12 @@ function lists.integrate(utilitydata)
-- references.internal = nil
-- references.realpage = nil
-- references.section = nil
+ if references.view then
+ references.view = nil
+ end
+ if references.used then
+ references.used = nil
+ end
if references.x then
references.x = nil
end
diff --git a/tex/context/base/mkxl/strc-ref.lmt b/tex/context/base/mkxl/strc-ref.lmt
index 945364b18..6a320f141 100644
--- a/tex/context/base/mkxl/strc-ref.lmt
+++ b/tex/context/base/mkxl/strc-ref.lmt
@@ -30,6 +30,7 @@ local trace_referencing = false trackers.register("structures.referencing",
local trace_analyzing = false trackers.register("structures.referencing.analyzing", function(v) trace_analyzing = v end)
local trace_identifying = false trackers.register("structures.referencing.identifying", function(v) trace_identifying = v end)
local trace_importing = false trackers.register("structures.referencing.importing", function(v) trace_importing = v end)
+local trace_external = false trackers.register("structures.referencing.external", function(v) trace_external = v end)
local trace_empty = false trackers.register("structures.referencing.empty", function(v) trace_empty = v end)
local check_duplicates = true
@@ -39,6 +40,7 @@ directives.register("structures.referencing.checkduplicates", function(v) check_
local report_references = logs.reporter("references")
local report_identifying = logs.reporter("references","identifying")
local report_importing = logs.reporter("references","importing")
+local report_external = logs.reporter("references","external")
local report_empty = logs.reporter("references","empty")
local report = report_references
@@ -174,6 +176,11 @@ local function initializer() -- can we use a tobesaved as metatable for collecte
if i then
internals[i] = data
usedinternals[i] = r.used
+ local structure = r.structure
+ if structure then
+ structure = resolvers.jobs.namelist(structure,namestack)
+ r.namestack = structure
+ end
end
end
end
@@ -347,26 +354,37 @@ local function currentorder(kind,name)
return orders[kind] and orders[kind][name] or lastorder
end
-local function setcomponent(data)
- -- we might consider doing this at the tex end, just like prefix
- local component = productcomponent()
- if component then
- local references = data and data.references
- if references then
- references.component = component
- if references.prefix == component then
- references.prefix = nil
- end
- end
- return component
- end
- -- but for the moment we do it here (experiment)
-end
+-- local function setstructure(data)
+-- local structure = resolvers.jobs.currentnamehash()
+-- if structure then
+-- local references = data and data.references
+-- if references then
+-- references.structure = structure
+-- end
+-- end
+-- end
+
+-- local function setcomponent(data)
+-- -- we might consider doing this at the tex end, just like prefix
+-- local component = productcomponent() -- todo: maybe a list
+-- -- local component = resolvers.jobs.currentcomponent()
+-- if component then
+-- local references = data and data.references
+-- if references then
+-- references.component = component
+-- if references.prefix == component then
+-- references.prefix = nil
+-- end
+-- end
+-- return component
+-- end
+-- end
references.setnextorder = setnextorder
references.setnextinternal = setnextinternal
references.currentorder = currentorder
-references.setcomponent = setcomponent
+references.setstructure = resolvers.jobs.currentstructure -- yes or no here
+----------.setcomponent = setcomponent
-- implement {
-- name = "setnextreferenceorder",
@@ -405,6 +423,9 @@ function references.set(data)
-- report_references("invalid reference") -- harmless
return 0
end
+ --
+ references.structure = resolvers.jobs.currentstructure()
+ --
local prefix = references.prefix or ""
local pd = tobesaved[prefix] -- nicer is a metatable
if not pd then
@@ -497,31 +518,82 @@ implement {
-- no metatable here .. better be sparse
-local function register_from_list(collected,derived,external)
+local function register_from_list(collected,derived,external,namestack)
local derived_g = derived[""] -- global
local derived_p = nil
local derived_c = nil
local prefix = nil
- local component = nil
+-- local component = nil
local entry = nil
if not derived_g then
derived_g = { }
derived[""] = derived_g
end
- local function action(s)
- if trace_referencing then
- report_references("list entry %a provides %a reference %a on realpage %a",i,kind,s,realpage)
- end
- if derived_p and not derived_p[s] then
- derived_p[s] = entry
- end
- if derived_c and not derived_c[s] then
- derived_c[s] = entry
+ local action = trace_external and
+ function(s)
+ if structure then
+ for i=1,#structure do
+ local si = structure[i]
+ -- if si == component then
+ -- -- skipped
+ -- elseif si == prefix then
+ -- -- skipped
+ -- else
+ local ds = derived[si]
+ if not ds then
+ derived[si] = { [s] = entry }
+ report_external("reference %a, %s %a",s,"structure",si)
+ elseif not ds[s] then
+ ds[s] = entry
+ report_external("reference %a, %s %a",s,"structure",si)
+ end
+ -- end
+ end
+ end
+ if derived_p and not derived_p[s] then
+ report_external("reference %a, %s %a",s,"prefix",prefix)
+ derived_p[s] = entry
+
+ end
+-- if derived_c and not derived_c[s] then
+-- report_external("reference %a, %s %a",s,"component",component)
+-- derived_c[s] = entry
+-- end
+ if not derived_g[s] then
+ report_external("reference %a, %s %a",s,"global","")
+ derived_g[s] = entry -- first wins
+ end
end
- if not derived_g[s] then
- derived_g[s] = entry -- first wins
+ or
+ function(s)
+ if derived_p and not derived_p[s] then
+ derived_p[s] = entry
+ end
+-- if derived_c and not derived_c[s] then
+-- derived_c[s] = entry
+-- end
+ if not derived_g[s] then
+ derived_g[s] = entry -- first wins
+ end
+ if structure then
+ for i=1,#structure do
+ local si = structure[i]
+ if si == component then
+ -- skipped
+ elseif si == prefix then
+ -- skipped
+ else
+ local ds = derived[si]
+ if not ds then
+ derived[si] = { [s] = entry }
+ elseif not ds[s] then
+ ds[s] = entry
+ end
+ end
+ end
+ end
end
- end
+ --
for i=1,#collected do
entry = collected[i]
local metadata = entry.metadata
@@ -535,20 +607,32 @@ local function register_from_list(collected,derived,external)
local realpage = references.realpage
if realpage then
prefix = references.prefix
- component = references.component
+-- component = references.component
if prefix and prefix ~= "" then
derived_p = derived[prefix]
if not derived_p then
derived_p = { }
derived[prefix] = derived_p
end
+ else
+ derived_p = nil
end
- if component and component ~= "" and component ~= prefix then
- derived_c = derived[component]
- if not derived_c then
- derived_c = { }
- derived[component] = derived_c
- end
+-- if component and component ~= "" and component ~= prefix then
+-- derived_c = derived[component]
+-- if not derived_c then
+-- derived_c = { }
+-- derived[component] = derived_c
+-- end
+-- else
+-- derived_c = nil
+-- end
+ structure = references.structure
+ if structure then
+ structure = resolvers.jobs.namelist(structure,namestack)
+ references.namestack = structure
+ end
+ if trace_referencing or trace_external then
+ report_references("list entry %a provides %a reference %a on realpage %a",i,kind,reference,realpage)
end
process_settings(reference,action)
end
@@ -567,7 +651,7 @@ function references.integrate(utilitydata)
if structures then
local lists = structures.lists.collected
if lists then
- register_from_list(lists,derived,filename)
+ register_from_list(lists,derived,filename,utilitydata)
end
end
end
@@ -575,7 +659,7 @@ end
references.registerinitializer(function()
-- the main document
- register_from_list(lists.collected,derived)
+ register_from_list(lists.collected,derived) -- false, false
end)
-- tracing
@@ -652,10 +736,10 @@ end)
-- urls
-local urls = references.urls or { }
-references.urls = urls
-local urldata = urls.data or { }
-urls.data = urldata
+local urls = references.urls or { }
+references.urls = urls
+local urldata = urls.data or { }
+urls.data = urldata
local p_untexurl = Cs ( (
P("\\")/"" * (P("%")/"%%" + P(1))
@@ -1097,13 +1181,6 @@ local function loadexternalreferences(name,utilitydata)
target = { }
external[prefix] = target
end
- -- for s in gmatch(reference,"%s*([^,]+)") do
- -- if trace_importing then
- -- report_importing("registering %s reference, kind %a, name %a, prefix %a, reference %a",
- -- "external",kind,name,prefix,s)
- -- end
- -- target[s] = target[s] or entry
- -- end
local function action(s)
if trace_importing then
report_importing("registering %s reference, kind %a, name %a, prefix %a, reference %a",
@@ -1147,7 +1224,7 @@ setmetatableindex(externals, function(t,k) -- either or not automatically
return false
end)
-local productdata = allocate {
+local productdata = allocate { -- will go
productreferences = { },
componentreferences = { },
components = { },
@@ -1196,6 +1273,13 @@ local function loadproductreferences(productname,componentname,utilitydata)
if kind and realpage then
local prefix = references.prefix or ""
local component = references.component
+
+ -- local structure = references.structure
+ -- print("!!!!!!!!",structure)
+ -- if structure then
+ -- inspect(resolvers.job.namelist(structure))
+ -- end
+
local ctarget, ptarget
if not component or component == componentname then
-- skip
@@ -1327,7 +1411,7 @@ function references.loadpresets(product,component) -- we can consider a special
loadproductvariables (product,component,utilitydata)
loadproductcomponents(product,component,utilitydata)
loadproductreferences(product,component,utilitydata)
--- loadproductcomponents(product,component,utilitydata)
+ -- loadproductcomponents(product,component,utilitydata)
end
end
end
@@ -1483,11 +1567,20 @@ end
-- foo:bar -> foo == prefix (first we try the global one)
-- -:bar -> ignore prefix
-local function finish_inner(var,p,i)
- var.kind = "inner"
+local function finish_inner(set,var,p,i)
+ local external = i.references.external
+ local realpage = (i.references and i.references.realpage) or (i.pagedata and i.pagedata.realpage) or 1
+ if external then
+ var.kind = "outer with inner"
+ var.external = true
+ var.outer = external
+ set.external = true -- probably not needed
+ else
+ var.kind = "inner"
+ var.p = p
+ end
+ var.r = realpage
var.i = i
- var.p = p
- var.r = (i.references and i.references.realpage) or (i.pagedata and i.pagedata.realpage) or 1
return var
end
@@ -1506,7 +1599,7 @@ local function identify_inner(set,var,prefix,collected,derived)
if i then
i = i[splitinner]
if i then
- return finish_inner(var,"",i)
+ return finish_inner(set,var,"",i)
end
end
end
@@ -1514,7 +1607,7 @@ local function identify_inner(set,var,prefix,collected,derived)
if i then
i = i[splitinner]
if i then
- return finish_inner(var,splitprefix,i)
+ return finish_inner(set,var,splitprefix,i)
end
end
if derived then
@@ -1522,11 +1615,13 @@ local function identify_inner(set,var,prefix,collected,derived)
-- using the prefix that is active at this moment (so we overload the given
-- these are taken from other data structures (like lists)
if splitprefix == "-" then
+-- loop over the current structure list reversed
+-- and end with "" .. needs example
local i = derived[""]
if i then
i = i[splitinner]
if i then
- return finish_inner(var,"",i)
+ return finish_inner(set,var,"",i)
end
end
end
@@ -1534,7 +1629,7 @@ local function identify_inner(set,var,prefix,collected,derived)
if i then
i = i[splitinner]
if i then
- return finish_inner(var,splitprefix,i)
+ return finish_inner(set,var,splitprefix,i)
end
end
end
@@ -1545,7 +1640,7 @@ local function identify_inner(set,var,prefix,collected,derived)
if i then
i = i[inner]
if i then
- return finish_inner(var,prefix,i)
+ return finish_inner(set,var,prefix,i)
end
end
if not i and derived then
@@ -1554,7 +1649,22 @@ local function identify_inner(set,var,prefix,collected,derived)
if i then
i = i[inner]
if i then
- return finish_inner(var,prefix,i)
+ return finish_inner(set,var,prefix,i)
+ end
+ end
+ --
+ local n, list = resolvers.jobs.currentstructure()
+ if list then
+ for i=#list,1,-1 do
+ local l = list[i]
+ local i = derived[l]
+ if i then
+ i = i[inner]
+ if i then
+ -- return finish_inner(set,var,"",i)
+ return finish_inner(set,var,l,i)
+ end
+ end
end
end
end
@@ -1571,10 +1681,7 @@ local function unprefixed_inner(set,var,prefix,collected,derived,tobesaved)
(derived and derived [""] and derived [""][inner]) or
(tobesaved and tobesaved[""] and tobesaved[""][inner])
if i then
- var.kind = "inner"
- var.p = ""
- var.i = i
- var.r = (i.references and i.references.realpage) or (i.pagedata and i.pagedata.realpage) or 1
+ finish_inner(set,var,"",i)
else
var.error = "unknown inner or special"
end
@@ -1611,13 +1718,13 @@ local function identify_auto(set,var,i)
end
end
-- escape from prefix
--- local pdata = odata[""]
--- if pdata then
--- local r = pdata[inner]
--- if r then
--- return okay(o,"2h")
--- end
--- end
+ -- local pdata = odata[""]
+ -- if pdata then
+ -- local r = pdata[inner]
+ -- if r then
+ -- return okay(o,"2h")
+ -- end
+ -- end
else
for p, pdata in sortedhash(odata) do
local r = pdata[inner]
@@ -1765,7 +1872,6 @@ end
local function identify_inner_or_outer(set,var,i)
-- here we fall back on product data
local inner = var.inner
-
if inner and inner ~= "" then
-- first we look up in collected and derived using the current prefix
@@ -1780,7 +1886,8 @@ local function identify_inner_or_outer(set,var,i)
return v
end
- if var.inner == var.reference and identify_auto(set,var,i) and var.outer and var.outer ~= "" then
+-- if var.inner == var.reference and identify_auto(set,var,i) and var.outer and var.outer ~= "" then
+ if var.inner == var.reference and var.outer and var.outer ~= "" then
return identify_outer(set,var,i)
end
@@ -1804,7 +1911,6 @@ local function identify_inner_or_outer(set,var,i)
end
-- as a last resort we will consult the global lists
-
local v = unprefixed_inner(set,var,"",collected,derived,tobesaved)
if v then
if trace_identifying then
@@ -1873,6 +1979,7 @@ local function identify_inner_or_outer(set,var,i)
end
end
end
+
var.error = "unknown inner"
else
var.error = "no inner"
@@ -1896,40 +2003,51 @@ local function identify_inner_component(set,var,i)
return var
end
+local function identify_outer_component_step(set,var,vi,i,component,where)
+ if vi then
+ var.outer = component
+ var.i = vi
+ var.kind = "outer with inner"
+ set.external = true
+ if trace_identifying then
+ report_identify_outer(set,var,i,where)
+ end
+ return true
+ end
+end
+
local function identify_outer_component(set,var,i)
local component = var.component
- local inner = var.inner
+ local inner = var.inner
+ --
local data = productdata.componentreferences[component]
if data then
local d = data[""]
- local vi = d and d[inner]
- if vi then
- var.inner = inner
- var.outer = component
- var.i = vi
- var.kind = "outer with inner"
- set.external = true
- if trace_identifying then
- report_identify_outer(set,var,i,"6a")
- end
+ local d = d and d[inner]
+ if d and identify_outer_component_step(set,var,d,i,component,"6a") then
return var
end
end
+ --
local data = productdata.productreferences[component]
if data then
- local vi = data[inner]
- if vi then
- var.inner = inner
- var.outer = component
- var.i = vi
- var.kind = "outer with inner"
- set.external = true
- if trace_identifying then
- report_identify_outer(set,var,i,"6b")
- end
+ local d = data[inner]
+ if d and identify_outer_component_step(set,var,d,i,component,"6b") then
+ return var
+ end
+ end
+ --
+if texconditionals.autocrossfilereferences then
+ references.loadpresets(component,component)
+ local data = productdata.productreferences[component]
+ if data then
+ local d = data[inner]
+ if d and identify_outer_component_step(set,var,d,i,component,"6c") then
return var
end
end
+end
+ --
var.error = "unknown component"
if trace_identifying then
report_identify_outer(set,var,i,"6c")
@@ -1962,6 +2080,8 @@ local function identify(prefix,reference)
var = identify_outer(set,var,i)
elseif var.arguments then
var = identify_arguments(set,var,i)
+-- else
+-- var = identify_inner_or_outer(set,var,i)
elseif not var.component then
var = identify_inner_or_outer(set,var,i)
elseif productcomponent() then
@@ -2691,6 +2811,7 @@ function references.analyze(actions,position,spread)
actions.pagestate = checkedpagestate(actions.n,realpage,actions,position,spread)
end
end
+-- inspect(actions)
return actions
end
@@ -2698,6 +2819,8 @@ local function referencepagestate(position,detail,spread)
local actions = references.currentset
if not actions then
return 0
+ elseif actions.external then
+ return 0
else
local pagestate = actions.pagestate
for i=1,#actions do
@@ -3067,3 +3190,32 @@ implement {
name = "popreferenceprefix",
actions = { popreferenceprefix, context }, -- we can use setmacro
}
+
+-- a bit weird one, used for checkinh in the backend
+
+function references.pagefromhash(hash,destination,page,actions)
+ local r = actions[1]
+ if type(r) == "table" then
+ r = r.i
+ if r then
+ r = r.references
+ if r then
+ local structure = r.structure
+ if structure then
+ local namestack = r.namestack
+ if namestack then
+ for i=#namestack,1,-1 do
+ local d = namestack[i] .. ":" .. destination
+ page = hash[d]
+ if page then
+ destination = d
+ break
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ return page, destination
+end
diff --git a/tex/context/base/mkxl/strc-reg.lmt b/tex/context/base/mkxl/strc-reg.lmt
index 27d7e2586..a8a7d0a90 100644
--- a/tex/context/base/mkxl/strc-reg.lmt
+++ b/tex/context/base/mkxl/strc-reg.lmt
@@ -585,8 +585,10 @@ local function storeregister(rawdata) -- metadata, references, entries
rawdata.userdata = touserdata(userdata)
end
--
- references.section = currentid()
- metadata.level = currentlevel()
+ references.block = structures.sections.currentblock()
+ references.structure = resolvers.jobs.currentstructure()
+ references.section = currentid()
+ metadata.level = currentlevel()
--
local data = notsaved and collected[name] or tobesaved[name]
local entries = data.entries
diff --git a/tex/context/base/mkxl/supp-box.lmt b/tex/context/base/mkxl/supp-box.lmt
index a5bfe1394..093cac164 100644
--- a/tex/context/base/mkxl/supp-box.lmt
+++ b/tex/context/base/mkxl/supp-box.lmt
@@ -481,9 +481,9 @@ local doifelse = commands.doifelse
do
- local dirvalues = nodes.dirvalues
- local lefttoright_code = dirvalues.lefttoright
- local righttoleft_code = dirvalues.righttoleft
+ local directioncodes = tex.directioncodes
+ local lefttoright_code = directioncodes.lefttoright
+ local righttoleft_code = directioncodes.righttoleft
local function firstdirinbox(n)
local b = getbox(n)
diff --git a/tex/context/base/mkxl/tabl-xtb.lmt b/tex/context/base/mkxl/tabl-xtb.lmt
index c475d6233..50f321c0d 100644
--- a/tex/context/base/mkxl/tabl-xtb.lmt
+++ b/tex/context/base/mkxl/tabl-xtb.lmt
@@ -87,7 +87,7 @@ local new_glue = nodepool.glue
local new_kern = nodepool.kern
local new_hlist = nodepool.hlist
-local lefttoright_code = nodes.dirvalues.lefttoright
+local lefttoright_code = tex.directioncodes.lefttoright
local v_stretch = variables.stretch
local v_normal = variables.normal
diff --git a/tex/context/base/mkxl/toks-aux.lmt b/tex/context/base/mkxl/toks-aux.lmt
index 83e714d77..2027ed78e 100644
--- a/tex/context/base/mkxl/toks-aux.lmt
+++ b/tex/context/base/mkxl/toks-aux.lmt
@@ -197,6 +197,9 @@ tex.listsigncodes = getthem(tex.getlistsignvalues, "listsigncode
tex.classoptioncodes = getthem(tex.getmathclassoptionvalues, "classoptioncode")
---.alignmentcontextcodes = getthem(tex.getalignmentcontextvalues ) -- only at lua end
tex.specialmathclasscodes = getthem(tex.getspecialmathclassvalues ) -- only at lua end
+tex.directioncodes = getthem(tex.getdirectionvalues ) -- only at lua end (todo tex)
+tex.fillcodes = getthem(tex.getfillvalues ) -- only at lua end (todo tex)
+tex.mathparametercodes = getthem(tex.getmathparametervalues ) -- only at lua end (todo tex)
function tex.stringtocodesbitmap(str,codes)
local bitmap = 0
diff --git a/tex/context/base/mkxl/trac-inf.lmt b/tex/context/base/mkxl/trac-inf.lmt
index feef3714f..649fef30b 100644
--- a/tex/context/base/mkxl/trac-inf.lmt
+++ b/tex/context/base/mkxl/trac-inf.lmt
@@ -304,6 +304,9 @@ local registered = false
local enabled = false
local finished = false
+local status = status -- needed for --sandbox
+local mplib = mplib -- needed for --sandbox
+
function statistics.showusage(when)
if finished and when == "finish" then
return
diff --git a/tex/context/base/mkxl/trac-vis.lmt b/tex/context/base/mkxl/trac-vis.lmt
index c9b68b407..9b467de29 100644
--- a/tex/context/base/mkxl/trac-vis.lmt
+++ b/tex/context/base/mkxl/trac-vis.lmt
@@ -760,16 +760,16 @@ end
local ruleddir, ruledpar do
- local dircodes = nodes.dircodes
- local dirvalues = nodes.dirvalues
+ local dircodes = nodes.dircodes
+ local directioncodes = tex.directioncodes -- nodes.dirvalues
- local cancel_code = dircodes.cancel
- local l2r_code = dirvalues.l2r
- local r2l_code = dirvalues.r2l
+ local cancel_code = dircodes.cancel
+ local l2r_code = directioncodes.l2r
+ local r2l_code = directioncodes.r2l
- local d_cache = caches["dir"]
+ local d_cache = caches["dir"]
- local getdirection = nuts.getdirection
+ local getdirection = nuts.getdirection
local tags = {
l2r = "L2R",
@@ -1295,7 +1295,7 @@ local ruledglue, ruledmathglue do
-- we sometimes pass previous as we can have issues in math (not watertight for all)
- local mathvalues = nodes.mathvalues
+ local mathvalues = tex.mathparametercodes -- nodes.mathvalues
mathvalues[-1] = "left"
mathvalues[-2] = "right"
diff --git a/tex/context/base/mkxl/type-set.mkxl b/tex/context/base/mkxl/type-set.mkxl
index 62dd3c9ab..ae1c85ee9 100644
--- a/tex/context/base/mkxl/type-set.mkxl
+++ b/tex/context/base/mkxl/type-set.mkxl
@@ -180,6 +180,6 @@
\definefilesynonym [type-imp-antykwa-light.mkiv] [type-imp-antykwa.mkiv]
\definefilesynonym [type-imp-antykwa-cond.mkiv] [type-imp-antykwa.mkiv]
-\definefilesynonym [type-imp-antykwa-lightcond.mkiv] [type-imp-antykwa.mkiv]
+\definefilesynonym [type-imp-antykwa-light-cond.mkiv] [type-imp-antykwa.mkiv]
\protect \endinput
diff --git a/tex/context/base/mkxl/typo-dha.lmt b/tex/context/base/mkxl/typo-dha.lmt
index e1a6662c4..8671970d8 100644
--- a/tex/context/base/mkxl/typo-dha.lmt
+++ b/tex/context/base/mkxl/typo-dha.lmt
@@ -81,12 +81,12 @@ local glue_code = nodecodes.glue
local dir_code = nodecodes.dir
local par_code = nodecodes.par
-local dirvalues = nodes.dirvalues
-local lefttoright_code = dirvalues.lefttoright
-local righttoleft_code = dirvalues.righttoleft
-
local parfillskip_code = gluecodes.parfillskip
+local directioncodes = tex.directioncodes
+local lefttoright_code = directioncodes.lefttoright
+local righttoleft_code = directioncodes.righttoleft
+
local new_direction = nodepool.direction
local insert = table.insert
diff --git a/tex/context/base/mkxl/typo-duc.lmt b/tex/context/base/mkxl/typo-duc.lmt
index 2e3638946..ecc1396a1 100644
--- a/tex/context/base/mkxl/typo-duc.lmt
+++ b/tex/context/base/mkxl/typo-duc.lmt
@@ -99,9 +99,9 @@ local penalty_code = nodecodes.penalty
local parfillskip_code = gluecodes.parfillskip
local parfillleftskip_code = gluecodes.parfillleftskip
-local dirvalues = nodes.dirvalues
-local lefttoright_code = dirvalues.lefttoright
-local righttoleft_code = dirvalues.righttoleft
+local directioncodes = tex.directioncodes
+local lefttoright_code = directioncodes.lefttoright
+local righttoleft_code = directioncodes.righttoleft
local maximum_stack = 0xFF
@@ -609,23 +609,23 @@ local function resolve_weak(list,size,start,limit,orderbefore,orderafter)
else -- only more efficient when we have es/cs
local runner = start + 2
if runner <= limit then
- local before = list[start]
- local entry = list[start + 1]
- local after = list[runner]
+ local before = list[start]
+ local current = list[start + 1]
+ local after = list[runner]
while after do
- local direction = entry.direction
+ local direction = current.direction
if direction == "es" then
if before.direction == "en" and after.direction == "en" then
- entry.direction = "en"
+ current.direction = "en"
end
elseif direction == "cs" then
local prevdirection = before.direction
if prevdirection == "en" then
if after.direction == "en" then
- entry.direction = "en"
+ current.direction = "en"
end
elseif prevdirection == "an" and after.direction == "an" then
- entry.direction = "an"
+ current.direction = "an"
end
end
before = current
diff --git a/tex/context/base/mkxl/typo-lin.lmt b/tex/context/base/mkxl/typo-lin.lmt
index 42ee5a957..2a0182e28 100644
--- a/tex/context/base/mkxl/typo-lin.lmt
+++ b/tex/context/base/mkxl/typo-lin.lmt
@@ -97,7 +97,7 @@ local new_hlist = nodepool.hlist
local new_rule = nodepool.rule
local new_glue = nodepool.glue
-local righttoleft_code = nodes.dirvalues.righttoleft
+local righttoleft_code = tex.directioncodes.righttoleft
local setmetatableindex = table.setmetatableindex
diff --git a/tex/context/fonts/mkiv/antykwa-math.lfg b/tex/context/fonts/mkiv/antykwa-math.lfg
index 2965332e4..debf5d1ed 100644
--- a/tex/context/fonts/mkiv/antykwa-math.lfg
+++ b/tex/context/fonts/mkiv/antykwa-math.lfg
@@ -147,7 +147,7 @@ return {
{ name = "sy-anttlz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true
{ name = "sy-anttlz.tfm", vector = "extensible-jmn-private", skewchar=0x30 },
{ name = "file:AntykwaTorunskaLight-Regular", vector = "tex-ex-braces", backmap = false },
- { name = "ex-anttl.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyone },
+ { name = "ex-anttl.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones },
},
["antykwa-cond-math"] = {
{ name = "file:LatinModern-Math", features = "virtualmath-antykwa-cond", main = true, parameters = false },
@@ -160,9 +160,9 @@ return {
{ name = "sy-anttcrz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true
{ name = "sy-anttcrz.tfm", vector = "extensible-jmn-private", skewchar=0x30 },
{ name = "file:AntykwaTorunskaCond-Regular", vector = "tex-ex-braces", backmap = false },
- { name = "ex-anttcr.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyone },
+ { name = "ex-anttcr.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones },
},
- ["antykwa-lightcond-math"] = {
+ ["antykwa-light-cond-math"] = {
{ name = "file:LatinModern-Math", features = "virtualmath-antykwa-lightcond", main = true, parameters = false },
--
{ name = "rm-anttcl.tfm", vector = "tex-mr", skewchar=0x7F },
@@ -173,7 +173,7 @@ return {
{ name = "sy-anttclz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true
{ name = "sy-anttclz.tfm", vector = "extensible-jmn-private", skewchar=0x30 },
{ name = "file:AntykwaTorunskaCondLight-Regular", vector = "tex-ex-braces", backmap = false },
- { name = "ex-anttcl.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyone },
+ { name = "ex-anttcl.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones },
}
},
addmissing = helpers.addmissing,
diff --git a/tex/context/fonts/mkiv/bonum-math.lfg b/tex/context/fonts/mkiv/bonum-math.lfg
index aa35c7b5a..2852c6449 100644
--- a/tex/context/fonts/mkiv/bonum-math.lfg
+++ b/tex/context/fonts/mkiv/bonum-math.lfg
@@ -125,10 +125,10 @@ return {
tweak = "extendaccents",
},
{
- tweak = "flattenaccents",
- squeeze = 0.8,
- height = 0.9,
- offset = 0.1,
+ tweak = "flattenaccents",
+ },
+ {
+ tweak = "fixaccents", -- after flatten (zero width intefrerence)
},
{
tweak = "radicaldegreeanchors",
@@ -149,10 +149,9 @@ return {
-- ["0x7C.parts.bottom"] = { bottomright = -0.15 }, -- vertical bar
},
},
-
- {
- tweak = "fixaccents",
- },
+-- {
+-- tweak = "fixaccents",
+-- },
-- First we set the dimensions of the initial accent which started out as zero but we want
-- a proper width.
{
diff --git a/tex/context/fonts/mkiv/cambria-math.lfg b/tex/context/fonts/mkiv/cambria-math.lfg
index 9ad2c3afc..3b8e12cd9 100644
--- a/tex/context/fonts/mkiv/cambria-math.lfg
+++ b/tex/context/fonts/mkiv/cambria-math.lfg
@@ -70,6 +70,9 @@ return {
tweak = "extendaccents",
},
{
+ tweak = "fixaccents",
+ },
+ {
tweak = "radicaldegreeanchors",
list = {
[0x221A] = { location = "left", hfactor = -0.15, vfactor = .75 },
@@ -82,9 +85,6 @@ return {
["0x221A.parts.bottom"] = { location = "left", hfactor = -0.1, vfactor = 0.95 },
}
},
- {
- tweak = "fixaccents",
- },
-- First we set the dimensions of the initial accent which started out as zero but we want
-- a proper width.
{
diff --git a/tex/context/fonts/mkiv/concrete-math.lfg b/tex/context/fonts/mkiv/concrete-math.lfg
index 53972ab05..142778015 100644
--- a/tex/context/fonts/mkiv/concrete-math.lfg
+++ b/tex/context/fonts/mkiv/concrete-math.lfg
@@ -74,6 +74,12 @@ return {
},
},
{
+ tweak = "extendaccents",
+ },
+ {
+ tweak = "flattenaccents",
+ },
+ {
tweak = "radicaldegreeanchors",
list = {
["0x221A.parts.bottom"] = { location = "left", hfactor = .0, vfactor = 1.075 },
diff --git a/tex/context/fonts/mkiv/dejavu-math.lfg b/tex/context/fonts/mkiv/dejavu-math.lfg
index f3e1011ad..c97765122 100644
--- a/tex/context/fonts/mkiv/dejavu-math.lfg
+++ b/tex/context/fonts/mkiv/dejavu-math.lfg
@@ -106,6 +106,9 @@ return {
}
},
{
+ tweak = "flattenaccents",
+ },
+ {
tweak = "fixaccents",
},
-- First we set the dimensions of the initial accent which started out as zero but we want
diff --git a/tex/context/fonts/mkiv/dejavu-text.lfg b/tex/context/fonts/mkiv/dejavu-text.lfg
new file mode 100644
index 000000000..ba6458eaf
--- /dev/null
+++ b/tex/context/fonts/mkiv/dejavu-text.lfg
@@ -0,0 +1,58 @@
+return {
+ name = "dejavu-text",
+ version = "1.00",
+ comment = "Goodies that complement dejavu.",
+ author = "Mikael Sundqvist & Hans Hagen",
+ copyright = "ConTeXt development team",
+ extensions = {
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "DejaVuSerif",
+ "DejaVuSerif-Bold",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 100,
+ ["}"] = 100,
+ ["]"] = 100,
+ ["|"] = 150,
+ ["\\"] = 175,
+ ["!"] = 100,
+ ["?"] = 100,
+ ["*"] = 100,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "DejaVuSerif-Italic",
+ "DejaVuSerif-BoldItalic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 140,
+ ["}"] = 140,
+ ["]"] = 140,
+ ["|"] = 100,
+ ["\\"] = 200,
+ ["!"] = 100,
+ ["?"] = 100,
+ ["*"] = 250,
+ },
+ ["("] = {
+ ["f"] = 100,
+ },
+ ["{"] = {
+ ["f"] = 100,
+ },
+ ["["] = {
+ ["f"] = 100,
+ },
+ }
+ },
+ }
+}
diff --git a/tex/context/fonts/mkiv/ebgaramond-math.lfg b/tex/context/fonts/mkiv/ebgaramond-math.lfg
index bf9a2e027..d2ef73f55 100644
--- a/tex/context/fonts/mkiv/ebgaramond-math.lfg
+++ b/tex/context/fonts/mkiv/ebgaramond-math.lfg
@@ -13,6 +13,7 @@ return {
OverbarRuleThickness = 60,
UnderbarRuleThickness = 60,
AccentTopShiftUp = -25, -- was 075
+ FlattenedAccentBaseHeight = 620, -- 420 in font (maybe some misunderstanding in the font regarding accents and heights)
FlattenedAccentTopShiftUp = -25, -- was 075
AccentBaseDepth = 75,
DelimiterPercent = 90,
@@ -146,8 +147,11 @@ return {
tweak = "extendaccents",
},
{
- tweak = "radicaldegreeanchors",
- list = {
+ tweak = "flattenaccents",
+ },
+ {
+ tweak = "radicaldegreeanchors",
+ list = {
["0x221A.parts.bottom"] = { location = "left", hfactor = .0, vfactor = 1.0 },
}
},
diff --git a/tex/context/fonts/mkiv/ebgaramond-text.lfg b/tex/context/fonts/mkiv/ebgaramond-text.lfg
new file mode 100644
index 000000000..824728460
--- /dev/null
+++ b/tex/context/fonts/mkiv/ebgaramond-text.lfg
@@ -0,0 +1,59 @@
+return {
+ name = "ebgaramond-text",
+ version = "1.00",
+ comment = "Goodies that complement ebgaramond.",
+ author = "Mikael Sundqvist & Hans Hagen",
+ copyright = "ConTeXt development team",
+ extensions = {
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "EBGaramond-Regular",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 80,
+ ["}"] = 100,
+ ["]"] = 100,
+ ["|"] = 100,
+ ["\\"] = 120,
+ ["!"] = 100,
+ ["?"] = 100,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "EBGaramond-Italic",
+ "EBGaramond-BoldItalic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 120,
+ ["}"] = 120,
+ ["]"] = 120,
+ ["|"] = 120,
+ ["\\"] = 120,
+ ["!"] = 75,
+ ["?"] = 75,
+ ["*"] = 120,
+ },
+ ["("] = {
+ ["f"] = 120,
+ },
+ ["{"] = {
+ ["f"] = 120,
+ },
+ ["["] = {
+ ["f"] = 120,
+ },
+ ["|"] = {
+ ["f"] = 120,
+ },
+ }
+ },
+ }
+}
diff --git a/tex/context/fonts/mkiv/erewhon-math.lfg b/tex/context/fonts/mkiv/erewhon-math.lfg
index 68a088d3f..223927184 100644
--- a/tex/context/fonts/mkiv/erewhon-math.lfg
+++ b/tex/context/fonts/mkiv/erewhon-math.lfg
@@ -73,6 +73,9 @@ return {
},
},
{
+ tweak = "flattenaccents",
+ },
+ {
tweak = "radicaldegreeanchors",
list = {
["0x221A.parts.bottom"] = { location = "left", hfactor = .1, vfactor = 1.025 },
diff --git a/tex/context/fonts/mkiv/erewhon-text.lfg b/tex/context/fonts/mkiv/erewhon-text.lfg
new file mode 100644
index 000000000..46a3aa842
--- /dev/null
+++ b/tex/context/fonts/mkiv/erewhon-text.lfg
@@ -0,0 +1,81 @@
+return {
+ name = "erewhon-text",
+ version = "1.00",
+ comment = "Goodies that complement erewhon.",
+ author = "Mikael Sundqvist & Hans Hagen",
+ copyright = "ConTeXt development team",
+ extensions = {
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "Erewhon-Regular",
+ -- "Erewhon-Bold",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 100,
+ ["}"] = 100,
+ ["]"] = 100,
+ ["|"] = 100,
+ ["\\"] = 75,
+ ["!"] = 100,
+ ["?"] = 100,
+ ["*"] = 100,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "Erewhon-Bold",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 25,
+ ["}"] = 50,
+ ["]"] = 25,
+ ["|"] = 50,
+ ["\\"] = 75,
+ ["!"] = 50,
+ ["?"] = 50,
+ ["*"] = 50,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "Erewhon-Italic",
+ "Erewhon-BoldItalic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 50,
+ ["}"] = 50,
+ ["]"] = 50,
+ ["|"] = 125,
+ ["\\"] = 125,
+ ["!"] = 100,
+ ["?"] = 100,
+ ["*"] = 100,
+ ["@"] = 100,
+ },
+ ["("] = {
+ ["f"] = 100,
+ },
+ ["{"] = {
+ ["f"] = 100,
+ },
+ ["["] = {
+ ["f"] = 100,
+ },
+ ["|"] = {
+ ["f"] = 130,
+ },
+ }
+ },
+ }
+}
diff --git a/tex/context/fonts/mkiv/euler-math.lfg b/tex/context/fonts/mkiv/euler-math.lfg
index 1c4659786..23d92b047 100644
--- a/tex/context/fonts/mkiv/euler-math.lfg
+++ b/tex/context/fonts/mkiv/euler-math.lfg
@@ -78,6 +78,9 @@ return {
-- add the accent fixes
-- fixslashes?
{
+ tweak = "flattenaccents",
+ },
+ {
tweak = "checkspacing",
},
{
diff --git a/tex/context/fonts/mkiv/kpfonts-math.lfg b/tex/context/fonts/mkiv/kpfonts-math.lfg
index 5896323b4..1b2eea45f 100644
--- a/tex/context/fonts/mkiv/kpfonts-math.lfg
+++ b/tex/context/fonts/mkiv/kpfonts-math.lfg
@@ -102,7 +102,9 @@ return {
["0x221A.parts.bottom"] = { location = "left", hfactor = .0, vfactor = 0.65 },
}
},
-
+ {
+ tweak = "flattenaccents",
+ },
{
tweak = "addscripts",
},
diff --git a/tex/context/fonts/mkiv/kpfonts-text.lfg b/tex/context/fonts/mkiv/kpfonts-text.lfg
new file mode 100644
index 000000000..6a14bec54
--- /dev/null
+++ b/tex/context/fonts/mkiv/kpfonts-text.lfg
@@ -0,0 +1,57 @@
+return {
+ name = "kpfonts-text",
+ version = "1.00",
+ comment = "Goodies that complement kpfonts.",
+ author = "Mikael Sundqvist & Hans Hagen",
+ copyright = "ConTeXt development team",
+ extensions = {
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "KpRoman-Regular",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 50,
+ ["}"] = 50,
+ ["]"] = 50,
+ ["*"] = 50,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "KpRoman-Italic",
+ "KpRoman-SemiboldItalic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 150,
+ ["}"] = 50,
+ ["]"] = 50,
+ ["|"] = 125,
+ ["\\"] = 125,
+ ["!"] = 100,
+ ["?"] = 100,
+ ["*"] = 100,
+ ["@"] = 100,
+ },
+ ["("] = {
+ ["f"] = 100,
+ },
+ ["{"] = {
+ ["f"] = 100,
+ },
+ ["["] = {
+ ["f"] = 100,
+ },
+ ["|"] = {
+ ["f"] = 130,
+ },
+ }
+ },
+ }
+}
diff --git a/tex/context/fonts/mkiv/libertinus-math.lfg b/tex/context/fonts/mkiv/libertinus-math.lfg
index ac15d6674..0b8ca42ad 100644
--- a/tex/context/fonts/mkiv/libertinus-math.lfg
+++ b/tex/context/fonts/mkiv/libertinus-math.lfg
@@ -87,6 +87,9 @@ return {
tweak = "extendaccents",
},
{
+ tweak = "flattenaccents",
+ },
+ {
tweak = "fixaccents",
},
-- First we set the dimensions of the initial accent which started out as zero but we want
diff --git a/tex/context/fonts/mkiv/libertinus-text.lfg b/tex/context/fonts/mkiv/libertinus-text.lfg
new file mode 100644
index 000000000..76afb51cd
--- /dev/null
+++ b/tex/context/fonts/mkiv/libertinus-text.lfg
@@ -0,0 +1,59 @@
+return {
+ name = "libertinus-text",
+ version = "1.00",
+ comment = "Goodies that complement libertinus.",
+ author = "Mikael Sundqvist & Hans Hagen",
+ copyright = "ConTeXt development team",
+ extensions = {
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "LibertinusSerif-Regular",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 50,
+ ["}"] = 50,
+ ["]"] = 50,
+ ["|"] = 100,
+ ["\\"] = 50,
+ ["*"] = 50,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "LibertinusSerif-Italic",
+ "LibertinusSerif-BoldItalic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 50,
+ ["}"] = 50,
+ ["]"] = 50,
+ ["|"] = 125,
+ ["\\"] = 125,
+ ["!"] = 100,
+ ["?"] = 100,
+ ["*"] = 100,
+ ["@"] = 100,
+ },
+ ["("] = {
+ ["f"] = 100,
+ },
+ ["{"] = {
+ ["f"] = 100,
+ },
+ ["["] = {
+ ["f"] = 100,
+ },
+ ["|"] = {
+ ["f"] = 130,
+ },
+ }
+ },
+ }
+}
diff --git a/tex/context/fonts/mkiv/lucida-math.lfg b/tex/context/fonts/mkiv/lucida-math.lfg
index 50dce6907..1e5391d6a 100644
--- a/tex/context/fonts/mkiv/lucida-math.lfg
+++ b/tex/context/fonts/mkiv/lucida-math.lfg
@@ -15,6 +15,7 @@ return {
parameters = {
FractionRuleThickness = 55,
-- AccentBaseDepth = 250,
+ FlattenedAccentBaseHeight = 710,-- not present in font, set too small by 1.
DelimiterPercent = 90,
DelimiterShortfall = 400,
SuperscriptBottomMaxWithSubscript = 325,
@@ -126,16 +127,19 @@ return {
tweak = "extendaccents",
},
{
- tweak = "radicaldegreeanchors",
- list = {
+ tweak = "flattenaccents",
+ },
+ {
+ tweak = "fixaccents",
+ },
+ {
+ tweak = "radicaldegreeanchors",
+ list = {
["0x221A.variants.3"] = { location = "left", hfactor = 0, vfactor = .55 },
["0x221A.variants.4"] = { location = "left", hfactor = 0, vfactor = .50 },
["0x221A.parts.bottom"] = { location = "left", hfactor = 0, vfactor = .85 },
}
},
- {
- tweak = "fixaccents",
- },
-- First we set the dimensions of the initial accent which started out as zero but we want
-- a proper width. Not in lucida
-- Then we deal with all offsets and heights in one go. So we treat the initial accent
diff --git a/tex/context/fonts/mkiv/lucida-text.lfg b/tex/context/fonts/mkiv/lucida-text.lfg
new file mode 100644
index 000000000..cd32aee2b
--- /dev/null
+++ b/tex/context/fonts/mkiv/lucida-text.lfg
@@ -0,0 +1,69 @@
+return {
+ name = "lucida-text",
+ version = "1.00",
+ comment = "Goodies that complement lucida.",
+ author = "Mikael Sundqvist & Hans Hagen",
+ copyright = "ConTeXt development team",
+ extensions = {
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "LucidaBrightOT",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 70,
+ ["}"] = 70,
+ ["]"] = 70,
+ ["\\"] = 100,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "LucidaBrightOT-Demibold",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 70,
+ ["}"] = 70,
+ ["]"] = 70,
+ ["\\"] = 100,
+ },
+ }
+ },
+ {
+ name = "kern",
+ type = "kern",
+ fonts = {
+ "LucidaBrightOT-Italic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 70,
+ ["}"] = 20,
+ ["]"] = 70,
+ ["\\"] = 100,
+ },
+ }
+ },
+ {
+ name = "kern",
+ type = "kern",
+ fonts = {
+ "LucidaBrightOT-DemiboldItalic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 70,
+ ["}"] = 40,
+ ["]"] = 70,
+ ["\\"] = 100,
+ },
+ }
+ },
+ }
+}
diff --git a/tex/context/fonts/mkiv/modern-math.lfg b/tex/context/fonts/mkiv/modern-math.lfg
index e2560f0f1..fb9c8fd4b 100644
--- a/tex/context/fonts/mkiv/modern-math.lfg
+++ b/tex/context/fonts/mkiv/modern-math.lfg
@@ -144,14 +144,17 @@ return {
tweak = "extendaccents",
},
{
+ tweak = "flattenaccents",
+ },
+ {
+ tweak = "fixaccents",
+ },
+ {
tweak = "radicaldegreeanchors",
list = {
["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.05 },
}
},
- {
- tweak = "fixaccents",
- },
-- First we set the dimensions of the initial accent which started out as zero but we want
-- a proper width.
{
diff --git a/tex/context/fonts/mkiv/modern-text.lfg b/tex/context/fonts/mkiv/modern-text.lfg
new file mode 100644
index 000000000..20bdcc60b
--- /dev/null
+++ b/tex/context/fonts/mkiv/modern-text.lfg
@@ -0,0 +1,62 @@
+return {
+ name = "modern-text",
+ version = "1.00",
+ comment = "Goodies that complement latin modern.",
+ author = "Mikael Sundqvist & Hans Hagen",
+ copyright = "ConTeXt development team",
+ extensions = {
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ -- "LMRoman-Regular",
+ "LMRoman10-Regular",
+ "LMRoman10-Bold",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 50,
+ ["}"] = 50,
+ ["]"] = 50,
+ ["|"] = 100,
+ ["\\"] = 50,
+ ["?"] = 50,
+ ["*"] = 50,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "LMRoman-Italic",
+ "LMRoman-BoldItalic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 50,
+ ["}"] = 50,
+ ["]"] = 50,
+ ["|"] = 125,
+ ["\\"] = 125,
+ ["!"] = 100,
+ ["?"] = 100,
+ ["*"] = 100,
+ ["@"] = 100,
+ },
+ ["("] = {
+ ["f"] = 100,
+ },
+ ["{"] = {
+ ["f"] = 100,
+ },
+ ["["] = {
+ ["f"] = 100,
+ },
+ ["|"] = {
+ ["f"] = 130,
+ },
+ }
+ },
+ }
+}
diff --git a/tex/context/fonts/mkiv/newcomputermodern-math.lfg b/tex/context/fonts/mkiv/newcomputermodern-math.lfg
index bb881eda0..9e5e6ab3a 100644
--- a/tex/context/fonts/mkiv/newcomputermodern-math.lfg
+++ b/tex/context/fonts/mkiv/newcomputermodern-math.lfg
@@ -1,3 +1,5 @@
+local common = fonts.goodies.load("common-math.lfg")
+local presets = common.mathematics.tweaks.presets
-- In order to be able to use beta math fonts, we use our own file name and
-- always remap. As this font is experimental we don't spend too much time
-- on it now. Even then, we migth stick to design sizes only.
@@ -66,10 +68,12 @@ return {
end
return o * target.parameters.factor
end,
- NoLimitSupFactor = 0,
- NoLimitSubFactor = 1200,
- DelimiterPercent = 90,
- DelimiterShortfall = 400,
+ NoLimitSupFactor = 0,
+ NoLimitSubFactor = 1200,
+ DelimiterPercent = 90,
+ DelimiterShortfall = 400,
+ AccentTopShiftUp = -60,
+ FlattenedAccentTopShiftUp = -60,
SubscriptBaselineDropMin = 50, -- 200 in font (multiplied by 0.59999/2.39868)
SubscriptShiftDown = 150, -- 247 in font (multiplied to be consistent with cm)
SubscriptShiftDownWithSuperscript = 247, -- relates to the previous one (see math-act)
@@ -91,6 +95,18 @@ return {
smaller = true,
fake = 0.6,
},
+ presets.scripttocalligraphic { },
+ presets.rsfstoscript { },
+ presets.rsfsuprighttoscript { },
+ presets.moderntocalligraphic { },
+ presets.eulertocalligraphic { },
+ presets.xitsarabic { rscale = 0.80 },
+ presets.fallbacks { },
+ presets.moveitalics { correct = true },
+ presets.moveitalics { correct = true, letters = true },
+ presets.moveintegrals { factor = 1.4, icfactor = 0.8 }, -- the icfactor is due to the very slanted integral.
+ presets.wipeanchors { },
+ presets.wipeitalics { },
{
tweak = "kerns",
list = {
@@ -115,6 +131,9 @@ return {
},
},
{
+ tweak = "flattenaccents",
+ },
+ {
tweak = "checkspacing",
},
{
diff --git a/tex/context/fonts/mkiv/newcomputermodern-text.lfg b/tex/context/fonts/mkiv/newcomputermodern-text.lfg
new file mode 100644
index 000000000..24991642a
--- /dev/null
+++ b/tex/context/fonts/mkiv/newcomputermodern-text.lfg
@@ -0,0 +1,63 @@
+return {
+ name = "newcomputermodern-text",
+ version = "1.00",
+ comment = "Goodies that complement newcomputermodern.",
+ author = "Mikael Sundqvist & Hans Hagen",
+ copyright = "ConTeXt development team",
+ extensions = {
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "NewCM10-Book",
+ "NewCM10",
+ "NewCM10-Bold",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 50,
+ ["}"] = 50,
+ ["]"] = 50,
+ ["|"] = 100,
+ ["\\"] = 75,
+ ["?"] = 50,
+ ["*"] = 50,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "NewCM10-BookItalic",
+ "NewCM10-BoldItalic",
+ "NewCM10-Italic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 50,
+ ["}"] = 50,
+ ["]"] = 50,
+ ["|"] = 125,
+ ["\\"] = 100,
+ ["!"] = 100,
+ ["?"] = 100,
+ ["*"] = 50,
+ ["@"] = 100,
+ },
+ ["("] = {
+ ["f"] = 100,
+ },
+ ["{"] = {
+ ["f"] = 100,
+ },
+ ["["] = {
+ ["f"] = 100,
+ },
+ ["|"] = {
+ ["f"] = 130,
+ },
+ }
+ },
+ }
+}
diff --git a/tex/context/fonts/mkiv/pagella-math.lfg b/tex/context/fonts/mkiv/pagella-math.lfg
index 230f81c9c..a9b3ea4bb 100644
--- a/tex/context/fonts/mkiv/pagella-math.lfg
+++ b/tex/context/fonts/mkiv/pagella-math.lfg
@@ -40,9 +40,26 @@ return {
feature = "euleroverpagella",
filename = "euler-math.otf",
list = {
- { source = { first = 0x02100, last = 0x02BFF } },
- { source = { first = 0x1D400, last = 0x1D7FF } },
- { source = { first = 0x1D538, last = 0x1D550 } },
+ { source = "lowercasenormal", target = "lowercaseitalic" },
+ { source = "lowercasebold", target = "lowercasebolditalic" },
+ { source = "lowercasegreeknormal", target = "lowercasegreekitalic" },
+ { source = "lowercasegreekbold", target = "lowercasegreekbolditalic" },
+ { source = "uppercasenormal", target = "uppercaseitalic" },
+ { source = "uppercasebold", target = "uppercasebolditalic" },
+ { source = "uppercasegreeknormal", target = "uppercasegreekitalic" },
+ { source = "uppercasegreekbold", target = "uppercasegreekbolditalic" },
+ { source = "lowercasenormal", target = "lowercasenormal" },
+ { source = "lowercasebold", target = "lowercasebold" },
+ { source = "lowercasegreeknormal", target = "lowercasegreeknormal" },
+ { source = "lowercasegreekbold", target = "lowercasegreekbold" },
+ { source = "uppercasenormal", target = "uppercasenormal" },
+ { source = "uppercasebold", target = "uppercasebold" },
+ { source = "uppercasegreeknormal", target = "uppercasegreeknormal" },
+ { source = "uppercasegreekbold", target = "uppercasegreekbold" },
+ { source = "digitsnormal", target = "digitsnormal" },
+ --
+ { source = { first = 0x02100, last = 0x02BFF } }, -- symbols
+ { source = { first = 0x1D400, last = 0x1D7FF } }, -- various alphabets
},
},
{
@@ -94,12 +111,15 @@ return {
tweak = "extendaccents",
},
{
- tweak = "radicaldegreeanchors",
- list = {
+ tweak = "radicaldegreeanchors",
+ list = {
["0x221A.parts.bottom"] = { location = "left", hfactor = 0.0, vfactor = 1.1 },
}
},
{
+ tweak = "flattenaccents",
+ },
+ {
tweak = "fixaccents",
},
-- First we set the dimensions of the initial accent which started out as zero but we want
diff --git a/tex/context/fonts/mkiv/schola-math.lfg b/tex/context/fonts/mkiv/schola-math.lfg
index 2e36f0825..58eb1a6ea 100644
--- a/tex/context/fonts/mkiv/schola-math.lfg
+++ b/tex/context/fonts/mkiv/schola-math.lfg
@@ -78,12 +78,15 @@ return {
tweak = "extendaccents",
},
{
- tweak = "radicaldegreeanchors",
- list = {
+ tweak = "radicaldegreeanchors",
+ list = {
["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.1 },
}
},
{
+ tweak = "flattenaccents",
+ },
+ {
tweak = "fixaccents",
},
-- First we set the dimensions of the initial accent which started out as zero but we want
diff --git a/tex/context/fonts/mkiv/stixtwo-math.lfg b/tex/context/fonts/mkiv/stixtwo-math.lfg
index c0c97862f..ebacf7a81 100644
--- a/tex/context/fonts/mkiv/stixtwo-math.lfg
+++ b/tex/context/fonts/mkiv/stixtwo-math.lfg
@@ -13,7 +13,11 @@ return {
copyright = "ConTeXt development team",
mathematics = {
alternates = {
- calligraphic = { feature = 'ss01', value = 1, comment = "Mathematical Alternative Calligraphic Characters" },
+ lambdabar = { feature = 'cv01', value = 1, comment = "Mathematical Alternative Lambda Bar" },
+ ramshorn = { feature = 'cv02', value = 1, comment = "Mathematical Alternative Rams Horn" },
+ emptyset = { feature = 'cv03', value = 1, comment = "Mathematical Alternative Empty Set" },
+ setminus = { feature = 'cv04', value = 1, comment = "Mathematical Alternative Setminus" },
+ calligraphic = { feature = 'ss01', value = 1, comment = "Mathematical Alternative Calligraphic Characters" }, -- We do this differently
italic = { feature = 'ss02', value = 1, comment = "Mathematical Alternative Lowercase Italic" },
barred = { feature = 'ss03', value = 1, comment = "Mathematical Alternative Barred Characters" }, -- hbar, lambdabar etc
primes = { feature = 'ss04', value = 1, comment = "Mathematical Alternative Primes" }, -- larger/lower primes, minute etc
@@ -23,9 +27,26 @@ return {
upright = { feature = 'ss08', value = 1, comment = "Mathematical Alternative Upright Symbols" }, -- upright integrals etc.
negated = { feature = 'ss09', value = 1, comment = "Mathematical Alternative Negated Symbols" },
relation = { feature = 'ss10', value = 1, comment = "Mathematical Alternative Relations" },
- negatedset = { feature = 'ss09', value = 1, comment = "Mathematical Alternative Negated Set Symbols" },
- -- todo = { feature = 'ss14', value = 1, comment = "" },
+ negatedset = { feature = 'ss11', value = 1, comment = "Mathematical Alternative Negated Set Symbols" },
+ propfrown = { feature = 'ss12', value = 1, comment = "Mathematical Alternative Proportional and Frown" },
+ negsine = { feature = 'ss13', value = 1, comment = "Mathematical Alternative Negated Sine Wave" },
+ intprod = { feature = 'ss14', value = 1, comment = "Mathematical Alternative Interior Products" },
+ capcup = { feature = 'ss15', value = 1, comment = "Mathematical Alternative Intersection and Union with serif" },
circled = { feature = 'ss16', value = 1, comment = "Mathematical Alternative Circled Operators" },
+ simvar = { feature = 'ss20', value = 1, comment = "Mathematical Alternative Similar and some more unrelated" },
+ -- demo features:
+ negated8774 = {
+ feature = 'ss09',
+ value = 1,
+ comment = "Mathematical Alternative Negated 8774",
+ list = { [8774] = true },
+ },
+ negated8775 = {
+ feature = 'ss09',
+ value = 1,
+ comment = "Mathematical Alternative Negated 8775",
+ list = { [8775] = true },
+ },
},
parameters = {
AccentBaseDepth = 30,
@@ -115,7 +136,9 @@ return {
["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.00 },
}
},
-
+ {
+ tweak = "flattenaccents",
+ },
{
tweak = "fixaccents",
},
diff --git a/tex/context/fonts/mkiv/stixtwo-text.lfg b/tex/context/fonts/mkiv/stixtwo-text.lfg
new file mode 100644
index 000000000..2a3b46a78
--- /dev/null
+++ b/tex/context/fonts/mkiv/stixtwo-text.lfg
@@ -0,0 +1,60 @@
+return {
+ name = "stixtwo-text",
+ version = "1.00",
+ comment = "Goodies that complement stix two.",
+ author = "Mikael Sundqvist & Hans Hagen",
+ copyright = "ConTeXt development team",
+ extensions = {
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "STIXTwoText-Regular",
+ "STIXTwoText-Bold",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 50,
+ ["}"] = 50,
+ ["]"] = 50,
+ ["|"] = 100,
+ ["\\"] = 100,
+ ["*"] = 50,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "STIXTwoText-Italic",
+ "STIXTwoText-BoldItalic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 50,
+ ["}"] = 50,
+ ["]"] = 50,
+ ["|"] = 125,
+ ["\\"] = 125,
+ ["!"] = 100,
+ ["?"] = 100,
+ ["*"] = 100,
+ ["@"] = 100,
+ },
+ ["("] = {
+ ["f"] = 100,
+ },
+ ["{"] = {
+ ["f"] = 100,
+ },
+ ["["] = {
+ ["f"] = 100,
+ },
+ ["|"] = {
+ ["f"] = 130,
+ },
+ }
+ },
+ }
+}
diff --git a/tex/context/fonts/mkiv/termes-math.lfg b/tex/context/fonts/mkiv/termes-math.lfg
index 364ea8369..504249878 100644
--- a/tex/context/fonts/mkiv/termes-math.lfg
+++ b/tex/context/fonts/mkiv/termes-math.lfg
@@ -81,6 +81,12 @@ return {
tweak = "extendaccents",
},
{
+ tweak = "flattenaccents",
+ },
+ {
+ tweak = "fixaccents",
+ },
+ {
tweak = "radicaldegreeanchors",
list = {
[0x221A] = { location = "left", hfactor = 0.0, vfactor = 0.6 },
@@ -88,9 +94,6 @@ return {
["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.1 },
}
},
- {
- tweak = "fixaccents",
- },
-- First we set the dimensions of the initial accent which started out as zero but we want
-- a proper width.
{
diff --git a/tex/context/fonts/mkiv/texgyre-text.lfg b/tex/context/fonts/mkiv/texgyre-text.lfg
new file mode 100644
index 000000000..947d730cd
--- /dev/null
+++ b/tex/context/fonts/mkiv/texgyre-text.lfg
@@ -0,0 +1,185 @@
+return {
+ name = "texgyre-text",
+ version = "1.00",
+ comment = "Goodies that complement the texgyre fonts.",
+ author = "Mikael Sundqvist & Hans Hagen",
+ copyright = "ConTeXt development team",
+ extensions = {
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ -- we have three optional methods for filtering:
+ fonts = {
+ "TeXGyreBonum-Regular",
+ "TeXGyreBonum-Bold",
+ },
+ -- fonts = {
+ -- ["TeXGyreBonum-Regular"] = true,
+ -- },
+ -- fonts = "TeXGyreBonum-*",
+ data = {
+ ["f"] = {
+ [")"] = 100,
+ ["}"] = 100,
+ ["]"] = 100,
+ ["|"] = 100,
+ ["\\"] = 120,
+ ["!"] = 100,
+ ["?"] = 100,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "TeXGyreBonum-Italic",
+ "TeXGyreBonum-BoldItalic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 140,
+ ["}"] = 140,
+ ["]"] = 140,
+ ["|"] = 100,
+ ["\\"] = 150,
+ ["!"] = 100,
+ ["?"] = 100,
+ },
+ ["("] = {
+ ["f"] = 190,
+ },
+ ["{"] = {
+ ["f"] = 190,
+ },
+ ["["] = {
+ ["f"] = 190,
+ },
+ }
+ },
+ {
+ name = "kern",
+ type = "kern",
+ fonts = {
+ "TeXGyreTermes-Regular",
+ "TeXGyreTermes-Bold",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 75,
+ ["}"] = 75,
+ ["]"] = 75,
+ ["|"] = 75,
+ ["\\"] = 110,
+ ["!"] = 75,
+ ["?"] = 75,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "TeXGyreTermes-Italic",
+ "TeXGyreTermes-BoldItalic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 75,
+ ["}"] = 75,
+ ["]"] = 75,
+ ["|"] = 75,
+ ["\\"] = 200,
+ ["!"] = 75,
+ ["?"] = 75,
+ },
+ ["("] = {
+ ["f"] = 75,
+ },
+ ["{"] = {
+ ["f"] = 75,
+ },
+ ["["] = {
+ ["f"] = 75,
+ },
+ ["|"] = {
+ ["f"] = 150,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "TeXGyrePagella-Italic",
+ "TeXGyrePagella-BoldItalic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 120,
+ ["}"] = 120,
+ ["]"] = 120,
+ ["|"] = 120,
+ ["\\"] = 120,
+ ["!"] = 75,
+ ["?"] = 75,
+ ["*"] = 120,
+ },
+ ["("] = {
+ ["f"] = 120,
+ },
+ ["{"] = {
+ ["f"] = 120,
+ },
+ ["["] = {
+ ["f"] = 120,
+ },
+ ["|"] = {
+ ["f"] = 120,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "TeXGyreSchola-Regular",
+ "TeXGyreSchola-Bold",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 120,
+ ["}"] = 120,
+ ["]"] = 120,
+ -- ["|"] = 50,
+ ["\\"] = 100,
+ ["!"] = 100,
+ ["?"] = 100,
+ ["*"] = 75,
+ ["@"] = 75,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "TeXGyreSchola-Italic",
+ "TeXGyreSchola-BoldItalic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 120,
+ ["}"] = 120,
+ ["]"] = 120,
+ ["|"] = 120,
+ ["\\"] = 120,
+ ["!"] = 75,
+ ["?"] = 75,
+ ["*"] = 120,
+ ["@"] = 75,
+ },
+ }
+ },
+ }
+}
diff --git a/tex/context/fonts/mkiv/type-imp-dejavu.mkiv b/tex/context/fonts/mkiv/type-imp-dejavu.mkiv
index 49b788a73..70fc8ae8d 100644
--- a/tex/context/fonts/mkiv/type-imp-dejavu.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-dejavu.mkiv
@@ -16,16 +16,16 @@
\definefontfeature[dejavu-condensed-mono][extend=.8]
-\starttypescriptcollection[xxdejavu]
+\starttypescriptcollection[dejavu]
\doifunknownfontfeature {dejavu-math-bold} {\definefontfeature[dejavu-math-bold][boldened]}
\starttypescript [\s!serif] [dejavu] [\s!name]
\setups[\s!font:\s!fallback:\s!serif]
- \definefontsynonym [\s!Serif] [\s!name:dejavuserif] [\s!features=\s!default,\s!fallbacks=\s!Serif]
- \definefontsynonym [\s!SerifBold] [\s!name:dejavuserifbold] [\s!features=\s!default,\s!fallbacks=\s!SerifBold]
- \definefontsynonym [\s!SerifItalic] [\s!name:dejavuserifitalic] [\s!features=\s!default,\s!fallbacks=\s!SerifItalic]
- \definefontsynonym [\s!SerifBoldItalic] [\s!name:dejavuserifbolditalic] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic]
+ \definefontsynonym [\s!Serif] [\s!name:dejavuserif] [\s!features=\s!default,\s!fallbacks=\s!Serif,\s!goodies=dejavu-text]
+ \definefontsynonym [\s!SerifBold] [\s!name:dejavuserifbold] [\s!features=\s!default,\s!fallbacks=\s!SerifBold,\s!goodies=dejavu-text]
+ \definefontsynonym [\s!SerifItalic] [\s!name:dejavuserifitalic] [\s!features=\s!default,\s!fallbacks=\s!SerifItalic,\s!goodies=dejavu-text]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!name:dejavuserifbolditalic] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic,\s!goodies=dejavu-text]
\stoptypescript
\starttypescript [\s!sans] [dejavu] [\s!name]
diff --git a/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv b/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv
index 42575a61c..46c73956f 100644
--- a/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv
@@ -73,10 +73,10 @@
\starttypescript [\s!serif] [ebgaramond]
\setups[font:fallback:serif]
- \definefontsynonym [\s!Serif] [\s!file:ebgaramond-regular] [\s!features=eb-garamond-normal]
- \definefontsynonym [\s!SerifItalic] [\s!file:ebgaramond-italic] [\s!features=eb-garamond-normal]
- \definefontsynonym [\s!SerifBold] [\s!file:ebgaramond-bold] [\s!features=eb-garamond-normal]
- \definefontsynonym [\s!SerifBoldItalic][\s!file:ebgaramond-bolditalic][\s!features=eb-garamond-normal]
+ \definefontsynonym [\s!Serif] [\s!file:ebgaramond-regular] [\s!features=eb-garamond-normal,\s!goodies=ebgaramond-text]
+ \definefontsynonym [\s!SerifItalic] [\s!file:ebgaramond-italic] [\s!features=eb-garamond-normal,\s!goodies=ebgaramond-text]
+ \definefontsynonym [\s!SerifBold] [\s!file:ebgaramond-bold] [\s!features=eb-garamond-normal,\s!goodies=ebgaramond-text]
+ \definefontsynonym [\s!SerifBoldItalic][\s!file:ebgaramond-bolditalic][\s!features=eb-garamond-normal,\s!goodies=ebgaramond-text]
\definefontsynonym [\s!SerifCaps] [\s!Serif] [\s!features=eb-garamond-smallcaps]
\stoptypescript
diff --git a/tex/context/fonts/mkiv/type-imp-erewhon.mkiv b/tex/context/fonts/mkiv/type-imp-erewhon.mkiv
index c536caa0e..660b4c58a 100644
--- a/tex/context/fonts/mkiv/type-imp-erewhon.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-erewhon.mkiv
@@ -23,11 +23,11 @@
\doifunknownfontfeature {erewhon-math-bold} {\definefontfeature[erewhon-math-bold][boldened]}
\starttypescript [\s!serif] [erewhon]
- \definefontsynonym [\s!Serif] [\s!file:Erewhon-Regular] [\s!features=\s!default]
- \definefontsynonym [\s!SerifItalic] [\s!file:Erewhon-Italic] [\s!features=\s!default]
+ \definefontsynonym [\s!Serif] [\s!file:Erewhon-Regular] [\s!features=\s!default,\s!goodies=erewhon-text]
+ \definefontsynonym [\s!SerifItalic] [\s!file:Erewhon-Italic] [\s!features=\s!default,\s!goodies=erewhon-text]
\definefontsynonym [\s!SerifSlanted] [\s!file:Erewhon-RegularSlanted][\s!features=\s!default]
- \definefontsynonym [\s!SerifBold] [\s!file:Erewhon-Bold] [\s!features=\s!default]
- \definefontsynonym [\s!SerifBoldItalic] [\s!file:Erewhon-BoldItalic] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifBold] [\s!file:Erewhon-Bold] [\s!features=\s!default,\s!goodies=erewhon-text]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!file:Erewhon-BoldItalic] [\s!features=\s!default,\s!goodies=erewhon-text]
\definefontsynonym [\s!SerifBoldSlanted][\s!file:Erewhon-BoldSlanted] [\s!features=\s!default]
\stoptypescript
diff --git a/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv b/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv
index c8e92d20b..bc7de3ae7 100644
--- a/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv
@@ -34,10 +34,10 @@
\stoptypescript
\starttypescript [\s!serif] [kpfonts,kpfonts-sans,kpfonts-nt]
- \definefontsynonym [\s!Serif] [\s!file:KpRoman-Regular.otf]
- \definefontsynonym [\s!SerifBold] [\s!file:KpRoman-SemiBold.otf]
- \definefontsynonym [\s!SerifItalic] [\s!file:KpRoman-Italic.otf]
- \definefontsynonym [\s!SerifBoldItalic] [\s!file:KpRoman-SemiboldItalic.otf]
+ \definefontsynonym [\s!Serif] [\s!file:KpRoman-Regular.otf][\s!goodies=kpfonts-text]
+ \definefontsynonym [\s!SerifBold] [\s!file:KpRoman-SemiBold.otf][\s!goodies=kpfonts-text]
+ \definefontsynonym [\s!SerifItalic] [\s!file:KpRoman-Italic.otf][\s!goodies=kpfonts-text]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!file:KpRoman-SemiboldItalic.otf][\s!goodies=kpfonts-text]
\definefontsynonym [\s!SerifSlanted] [\s!SerifItalic]
\definefontsynonym [\s!SerifBoldSlanted] [\s!SerifBoldItalic]
\stoptypescript
diff --git a/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv b/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv
index f5082f784..a995bc42f 100644
--- a/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv
@@ -121,12 +121,12 @@
\starttypescript [\s!serif] [modern,latin-modern]
\loadfontgoodies[lm]
- \definefontsynonym [LMRoman-Regular] [\s!file:lmroman10-regular] [\s!features=\s!default]
- \definefontsynonym [LMRoman-Bold] [\s!file:lmroman10-bold] [\s!features=\s!default]
+ \definefontsynonym [LMRoman-Regular] [\s!file:lmroman10-regular] [\s!features=\s!default,\s!goodies=modern-text]
+ \definefontsynonym [LMRoman-Bold] [\s!file:lmroman10-bold] [\s!features=\s!default,\s!goodies=modern-text]
\definefontsynonym [LMRoman-Demi] [\s!file:lmromandemi10-regular] [\s!features=\s!default]
- \definefontsynonym [LMRoman-Italic] [\s!file:lmroman10-italic] [\s!features=\s!default]
+ \definefontsynonym [LMRoman-Italic] [\s!file:lmroman10-italic] [\s!features=\s!default,\s!goodies=modern-text]
\definefontsynonym [LMRoman-Oblique] [\s!file:lmromanslant10-regular] [\s!features=\s!default]
- \definefontsynonym [LMRoman-BoldItalic] [\s!file:lmroman10-bolditalic] [\s!features=\s!default]
+ \definefontsynonym [LMRoman-BoldItalic] [\s!file:lmroman10-bolditalic] [\s!features=\s!default,\s!goodies=modern-text]
\definefontsynonym [LMRoman-BoldOblique] [\s!file:lmromanslant10-bold] [\s!features=\s!default]
\definefontsynonym [LMRoman-DemiOblique] [\s!file:lmromandemi10-oblique] [\s!features=\s!default]
\definefontsynonym [LMRoman-CapsRegular] [\s!file:lmroman10-CapsRegular] [\s!features=\s!default]
diff --git a/tex/context/fonts/mkiv/type-imp-libertinus.mkiv b/tex/context/fonts/mkiv/type-imp-libertinus.mkiv
index 97e3b3493..36d2666f7 100644
--- a/tex/context/fonts/mkiv/type-imp-libertinus.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-libertinus.mkiv
@@ -24,11 +24,11 @@
\doifunknownfontfeature {libertinus-math-bold} {\definefontfeature[libertinus-math-bold][boldened]}
\starttypescript [\s!serif] [libertinus]
- \definefontsynonym [LibertinusSerif-Regular] [\s!file:libertinusserif-regular]
- \definefontsynonym [LibertinusSerif-Italic] [\s!file:libertinusserif-italic]
+ \definefontsynonym [LibertinusSerif-Regular] [\s!file:libertinusserif-regular][\s!goodies=libertinus-text]
+ \definefontsynonym [LibertinusSerif-Italic] [\s!file:libertinusserif-italic][\s!goodies=libertinus-text]
\definefontsynonym [LibertinusSerif-Slanted] [\s!file:libertinusserif-italic]
- \definefontsynonym [LibertinusSerif-Bold] [\s!file:libertinusserif-bold]
- \definefontsynonym [LibertinusSerif-BoldItalic] [\s!file:libertinusserif-bolditalic]
+ \definefontsynonym [LibertinusSerif-Bold] [\s!file:libertinusserif-bold][\s!goodies=libertinus-text]
+ \definefontsynonym [LibertinusSerif-BoldItalic] [\s!file:libertinusserif-bolditalic][\s!goodies=libertinus-text]
\definefontsynonym [LibertinusSerif-BoldSlanted] [\s!file:libertinusserif-bolditalic]
\stoptypescript
diff --git a/tex/context/fonts/mkiv/type-imp-lucida.mkiv b/tex/context/fonts/mkiv/type-imp-lucida.mkiv
index 186854efc..44230b55d 100644
--- a/tex/context/fonts/mkiv/type-imp-lucida.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-lucida.mkiv
@@ -35,10 +35,10 @@
\stoptypescript
\starttypescript [\s!serif] [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt]
- \definefontsynonym [\s!Serif] [\s!file:LucidaBrightOT.otf]
- \definefontsynonym [\s!SerifBold] [\s!file:LucidaBrightOT-Demi.otf]
- \definefontsynonym [\s!SerifItalic] [\s!file:LucidaBrightOT-Italic.otf]
- \definefontsynonym [\s!SerifBoldItalic] [\s!file:LucidaBrightOT-DemiItalic.otf]
+ \definefontsynonym [\s!Serif] [\s!file:LucidaBrightOT.otf][\s!goodies=lucida-text]
+ \definefontsynonym [\s!SerifBold] [\s!file:LucidaBrightOT-Demi.otf][\s!goodies=lucida-text]
+ \definefontsynonym [\s!SerifItalic] [\s!file:LucidaBrightOT-Italic.otf][\s!goodies=lucida-text]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!file:LucidaBrightOT-DemiItalic.otf][\s!goodies=lucida-text]
\definefontsynonym [\s!SerifSlanted] [\s!SerifItalic]
\definefontsynonym [\s!SerifBoldSlanted] [\s!SerifBoldItalic]
\stoptypescript
diff --git a/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv b/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv
index 65a84ec5f..b6bb26c76 100644
--- a/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv
@@ -25,10 +25,10 @@
\starttypescript [\s!serif] [newcomputermodern] [\s!name]
\setups[\s!font:\s!fallback:\s!serif]
- \definefontsynonym [\s!Serif] [\s!file:newcm10-regular.otf] [\s!features=\s!default,\s!fallbacks=\s!Serif]
- \definefontsynonym [\s!SerifBold] [\s!file:newcm10-bold.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBold]
- \definefontsynonym [\s!SerifItalic] [\s!file:newcm10-italic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifItalic]
- \definefontsynonym [\s!SerifBoldItalic] [\s!file:newcm10-bolditalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic]
+ \definefontsynonym [\s!Serif] [\s!file:newcm10-regular.otf] [\s!features=\s!default,\s!fallbacks=\s!Serif,\s!goodies=newcomputermodern-text]
+ \definefontsynonym [\s!SerifBold] [\s!file:newcm10-bold.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBold,\s!goodies=newcomputermodern-text]
+ \definefontsynonym [\s!SerifItalic] [\s!file:newcm10-italic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifItalic,\s!goodies=newcomputermodern-text]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!file:newcm10-bolditalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic,\s!goodies=newcomputermodern-text]
\stoptypescript
\starttypescript [\s!sans] [newcomputermodern] [\s!name]
@@ -55,10 +55,10 @@
\starttypescript [\s!serif] [newcomputermodern-book] [\s!name]
\setups[\s!font:\s!fallback:\s!serif]
- \definefontsynonym [\s!Serif] [\s!file:newcm10-book.otf] [\s!features=\s!default,\s!fallbacks=\s!Serif]
- \definefontsynonym [\s!SerifBold] [\s!file:newcm10-bold.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBold]
- \definefontsynonym [\s!SerifItalic] [\s!file:newcm10-bookitalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifItalic]
- \definefontsynonym [\s!SerifBoldItalic] [\s!file:newcm10-bolditalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic]
+ \definefontsynonym [\s!Serif] [\s!file:newcm10-book.otf] [\s!features=\s!default,\s!fallbacks=\s!Serif,\s!goodies=newcomputermodern-text]
+ \definefontsynonym [\s!SerifBold] [\s!file:newcm10-bold.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBold,\s!goodies=newcomputermodern-text]
+ \definefontsynonym [\s!SerifItalic] [\s!file:newcm10-bookitalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifItalic,\s!goodies=newcomputermodern-text]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!file:newcm10-bolditalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic,\s!goodies=newcomputermodern-text]
\stoptypescript
\starttypescript [\s!sans] [newcomputermodern-book] [\s!name]
diff --git a/tex/context/fonts/mkiv/type-imp-stix.mkiv b/tex/context/fonts/mkiv/type-imp-stix.mkiv
index 3ac0b7257..d1bad9a2e 100644
--- a/tex/context/fonts/mkiv/type-imp-stix.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-stix.mkiv
@@ -58,10 +58,10 @@
\starttypescript [\s!serif] [stix,stixtwo,xits] [\s!name]
\setups[\s!font:\s!fallback:\s!serif]
- \definefontsynonym[\s!Serif] [\s!file:stixtwotext-regular.ttf] [\s!features=\s!default]
- \definefontsynonym[\s!SerifBold] [\s!file:stixtwotext-bold.ttf] [\s!features=\s!default]
- \definefontsynonym[\s!SerifItalic] [\s!file:stixtwotext-italic.ttf] [\s!features=\s!default]
- \definefontsynonym[\s!SerifBoldItalic][\s!file:stixtwotext-bolditalic.ttf][\s!features=\s!default]
+ \definefontsynonym[\s!Serif] [\s!file:stixtwotext-regular.ttf] [\s!features=\s!default,\s!goodies=stixtwo-text]
+ \definefontsynonym[\s!SerifBold] [\s!file:stixtwotext-bold.ttf] [\s!features=\s!default,\s!goodies=stixtwo-text]
+ \definefontsynonym[\s!SerifItalic] [\s!file:stixtwotext-italic.ttf] [\s!features=\s!default,\s!goodies=stixtwo-text]
+ \definefontsynonym[\s!SerifBoldItalic][\s!file:stixtwotext-bolditalic.ttf][\s!features=\s!default,\s!goodies=stixtwo-text]
\stoptypescript
\starttypescript[stix,stixtwo,xits,stix-nt,stixtwo-nt]
diff --git a/tex/context/fonts/mkiv/type-imp-texgyre.mkiv b/tex/context/fonts/mkiv/type-imp-texgyre.mkiv
index a3f3952c7..c4f28fcc4 100644
--- a/tex/context/fonts/mkiv/type-imp-texgyre.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-texgyre.mkiv
@@ -67,10 +67,10 @@
\definetypescriptprefix [n:chancery] [TeXGyreChorus]
\starttypescript [\s!serif,\s!sans] [adventor,bonum,bookman,heros,helvetica,pagella,palatino,schola,schoolbook,termes,times]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-regular] [\s!features=\s!default]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Italic] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-italic] [\s!features=\s!default]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Bold] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bold] [\s!features=\s!default]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalic] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bolditalic] [\s!features=\s!default]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-regular] [\s!features=\s!default,\s!goodies=texgyre-text]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Italic] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-italic] [\s!features=\s!default,\s!goodies=texgyre-text]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Bold] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bold] [\s!features=\s!default,\s!goodies=texgyre-text]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalic] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bolditalic] [\s!features=\s!default,\s!goodies=texgyre-text]
\definefontsynonym [\typescriptprefix{n:\typescripttwo}-Caps] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-regular] [\s!features=\s!smallcaps]
\definefontsynonym [\typescriptprefix{n:\typescripttwo}-ItalicCaps] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-italic] [\s!features=\s!smallcaps]
\definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldCaps] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bold] [\s!features=\s!smallcaps]
diff --git a/tex/context/fonts/mkiv/type-imp-xcharter.mkiv b/tex/context/fonts/mkiv/type-imp-xcharter.mkiv
index 6b6e5fc4e..7d1a88241 100644
--- a/tex/context/fonts/mkiv/type-imp-xcharter.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-xcharter.mkiv
@@ -19,11 +19,11 @@
\doifunknownfontfeature {xcharter-math-bold} {\definefontfeature[xcharter-math-bold][boldened]}
\starttypescript [\s!serif] [xcharter] [\s!name]
- \definefontsynonym [\s!Serif] [\s!file:XCharter-Roman] [\s!features=\s!default]
- \definefontsynonym [\s!SerifItalic] [\s!file:XCharter-Italic] [\s!features=\s!default]
+ \definefontsynonym [\s!Serif] [\s!file:XCharter-Roman] [\s!features=\s!default,\s!goodies=xcharter-text]
+ \definefontsynonym [\s!SerifItalic] [\s!file:XCharter-Italic] [\s!features=\s!default,\s!goodies=xcharter-text]
\definefontsynonym [\s!SerifSlanted] [\s!file:XCharter-Slanted] [\s!features=\s!default]
- \definefontsynonym [\s!SerifBold] [\s!file:XCharter-Bold] [\s!features=\s!default]
- \definefontsynonym [\s!SerifBoldItalic] [\s!file:xcharter-BoldItalic] [\s!features=\s!default]
+ \definefontsynonym [\s!SerifBold] [\s!file:XCharter-Bold] [\s!features=\s!default,\s!goodies=xcharter-text]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!file:xcharter-BoldItalic] [\s!features=\s!default,\s!goodies=xcharter-text]
\definefontsynonym [\s!SerifBoldSlanted][\s!file:XCharter-BoldSlanted][\s!features=\s!default]
\stoptypescript
diff --git a/tex/context/fonts/mkiv/xcharter-math.lfg b/tex/context/fonts/mkiv/xcharter-math.lfg
index 3c349ee88..e2ed3e116 100644
--- a/tex/context/fonts/mkiv/xcharter-math.lfg
+++ b/tex/context/fonts/mkiv/xcharter-math.lfg
@@ -66,6 +66,9 @@ return {
}
},
{
+ tweak = "flattenaccents",
+ },
+ {
tweak = "checkspacing",
},
{
diff --git a/tex/context/fonts/mkiv/xcharter-text.lfg b/tex/context/fonts/mkiv/xcharter-text.lfg
new file mode 100644
index 000000000..a836695fd
--- /dev/null
+++ b/tex/context/fonts/mkiv/xcharter-text.lfg
@@ -0,0 +1,62 @@
+return {
+ name = "xcharter-text",
+ version = "1.00",
+ comment = "Goodies that complement Xcharter.",
+ author = "Mikael Sundqvist & Hans Hagen",
+ copyright = "ConTeXt development team",
+ extensions = {
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "XCharter-Roman",
+ "XCharter-Bold",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 125,
+ ["}"] = 125,
+ ["]"] = 125,
+ -- ["|"] = 100,
+ ["\\"] = 50,
+ ["*"] = 50,
+ ["?"] = 50,
+ ["!"] = 50,
+ ["\\"] = 125,
+ },
+ }
+ },
+ {
+ name = "kern", -- adds to kerns
+ type = "kern",
+ fonts = {
+ "XCharter-Italic",
+ "XCharter-BoldItalic",
+ },
+ data = {
+ ["f"] = {
+ [")"] = 150,
+ ["}"] = 150,
+ ["]"] = 150,
+ ["\\"] = 125,
+ ["!"] = 100,
+ ["?"] = 100,
+ ["*"] = 100,
+ ["@"] = 100,
+ },
+ ["("] = {
+ ["f"] = 100,
+ },
+ ["{"] = {
+ ["f"] = 150,
+ },
+ ["["] = {
+ ["f"] = 100,
+ },
+ ["|"] = {
+ ["f"] = 130,
+ },
+ }
+ },
+ }
+}
diff --git a/tex/context/base/mkxl/type-imp-bengali.mkxl b/tex/context/fonts/mkxl/type-imp-bengali.mkxl
index 84a0b6402..84a0b6402 100644
--- a/tex/context/base/mkxl/type-imp-bengali.mkxl
+++ b/tex/context/fonts/mkxl/type-imp-bengali.mkxl
diff --git a/tex/context/base/mkxl/type-imp-braille.mkxl b/tex/context/fonts/mkxl/type-imp-braille.mkxl
index 17209d50c..17209d50c 100644
--- a/tex/context/base/mkxl/type-imp-braille.mkxl
+++ b/tex/context/fonts/mkxl/type-imp-braille.mkxl
diff --git a/tex/context/base/mkxl/type-imp-devanagari.mkxl b/tex/context/fonts/mkxl/type-imp-devanagari.mkxl
index 4fb082094..4fb082094 100644
--- a/tex/context/base/mkxl/type-imp-devanagari.mkxl
+++ b/tex/context/fonts/mkxl/type-imp-devanagari.mkxl
diff --git a/tex/context/base/mkxl/type-imp-euler.mkxl b/tex/context/fonts/mkxl/type-imp-euler.mkxl
index a2e066f6b..a2e066f6b 100644
--- a/tex/context/base/mkxl/type-imp-euler.mkxl
+++ b/tex/context/fonts/mkxl/type-imp-euler.mkxl
diff --git a/tex/context/base/mkxl/type-imp-gujarati.mkxl b/tex/context/fonts/mkxl/type-imp-gujarati.mkxl
index d7f3f7072..d7f3f7072 100644
--- a/tex/context/base/mkxl/type-imp-gujarati.mkxl
+++ b/tex/context/fonts/mkxl/type-imp-gujarati.mkxl
diff --git a/tex/context/base/mkxl/type-imp-indic.mkxl b/tex/context/fonts/mkxl/type-imp-indic.mkxl
index aeda08337..aeda08337 100644
--- a/tex/context/base/mkxl/type-imp-indic.mkxl
+++ b/tex/context/fonts/mkxl/type-imp-indic.mkxl
diff --git a/tex/context/base/mkxl/type-imp-kannada.mkxl b/tex/context/fonts/mkxl/type-imp-kannada.mkxl
index 4838075b2..4838075b2 100644
--- a/tex/context/base/mkxl/type-imp-kannada.mkxl
+++ b/tex/context/fonts/mkxl/type-imp-kannada.mkxl
diff --git a/tex/context/base/mkxl/type-imp-malayalam.mkxl b/tex/context/fonts/mkxl/type-imp-malayalam.mkxl
index 67a35d472..67a35d472 100644
--- a/tex/context/base/mkxl/type-imp-malayalam.mkxl
+++ b/tex/context/fonts/mkxl/type-imp-malayalam.mkxl
diff --git a/tex/context/base/mkxl/type-imp-tamil.mkxl b/tex/context/fonts/mkxl/type-imp-tamil.mkxl
index 90516365e..90516365e 100644
--- a/tex/context/base/mkxl/type-imp-tamil.mkxl
+++ b/tex/context/fonts/mkxl/type-imp-tamil.mkxl
diff --git a/tex/context/base/mkxl/type-imp-telugu.mkxl b/tex/context/fonts/mkxl/type-imp-telugu.mkxl
index 33d07664c..33d07664c 100644
--- a/tex/context/base/mkxl/type-imp-telugu.mkxl
+++ b/tex/context/fonts/mkxl/type-imp-telugu.mkxl
diff --git a/tex/context/modules/mkiv/m-tikz.mkiv b/tex/context/modules/mkiv/m-tikz.mkiv
index ef1b6b7e3..61df89cfd 100644
--- a/tex/context/modules/mkiv/m-tikz.mkiv
+++ b/tex/context/modules/mkiv/m-tikz.mkiv
@@ -39,10 +39,10 @@
\permanent\protected\def\starttikzinput
{\pushcatcodetable
\setcatcodetable\texcatcodes
- \catcode`\@=11
- \catcode`\|=12
- \catcode`\!=12
- \catcode`\~=12
+ \catcode`\@=11\relax
+ \catcode`\|=12\relax
+ \catcode`\!=12\relax
+ \catcode`\~=13\relax
\relax}
\permanent\protected\def\stoptikzinput
diff --git a/tex/context/modules/mkiv/s-fonts-tables.lua b/tex/context/modules/mkiv/s-fonts-tables.lua
index 65725594b..ed034b882 100644
--- a/tex/context/modules/mkiv/s-fonts-tables.lua
+++ b/tex/context/modules/mkiv/s-fonts-tables.lua
@@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['s-fonts-tables'] = {
license = "see context related readme files"
}
+-- Thsi file needs to be updated to LMTX!
+
moduledata.fonts = moduledata.fonts or { }
moduledata.fonts.tables = moduledata.fonts.tables or { }
@@ -29,7 +31,7 @@ local setlink = nodes.setlink
local hpack = nodes.hpack
local applyvisuals = nodes.applyvisuals
-local lefttoright_code = nodes.dirvalues.lefttoright
+local lefttoright_code = (tex.directioncodes and tex.directioncodes.lefttoright) or nodes.dirvalues.lefttoright -- LMTX
local handle_positions = fonts.handlers.otf.datasetpositionprocessor
local handle_injections = nodes.injections.handler
diff --git a/tex/context/modules/mkxl/m-tikz-pgfplots.tex b/tex/context/modules/mkxl/m-tikz-pgfplots.tex
index 1dd06b8b2..666f6b00b 100644
--- a/tex/context/modules/mkxl/m-tikz-pgfplots.tex
+++ b/tex/context/modules/mkxl/m-tikz-pgfplots.tex
@@ -4,6 +4,8 @@
\writestatus{loading}{ConTeXt User Module / Pgfplots}
+\usemodule[tikz]
+
\tikzinputfile{pgfplots.revision.tex}
\usetikzlibrary[plotmarks]
diff --git a/tex/context/modules/mkxl/m-tikz.mkxl b/tex/context/modules/mkxl/m-tikz.mkxl
index 6b173227c..e79806ca9 100644
--- a/tex/context/modules/mkxl/m-tikz.mkxl
+++ b/tex/context/modules/mkxl/m-tikz.mkxl
@@ -42,10 +42,11 @@
\setcatcodetable\texcatcodes
\pushmacro\meaning
\let\meaning\meaningless
- \catcode`\@=11
- \catcode`\|=12
- \catcode`\!=12
- \catcode`\~=13
+ \catcode`\@=11\relax
+ \catcode`\|=13\relax % was 12 < texlive 2023
+ \catcode`\!=12\relax
+ \catcode`\~=13\relax % needed >= texlive 2023
+ % \catcode`\$= 3\relax
\autoparagraphmode\zerocount}
\permanent\protected\def\stoptikzinput
diff --git a/tex/context/modules/mkxl/s-math-atoms.mkxl b/tex/context/modules/mkxl/s-math-atoms.mkxl
index 1b5ebed41..ab54dd291 100644
--- a/tex/context/modules/mkxl/s-math-atoms.mkxl
+++ b/tex/context/modules/mkxl/s-math-atoms.mkxl
@@ -1,5 +1,5 @@
%D \module
-%D [ file=s-math-atoms.mksl,
+%D [ file=s-math-atoms.mkxl,
%D version=2022.02.13,
%D title=\CONTEXT\ Style File,
%D subtitle=Show Math Atom Spacing,
diff --git a/tex/context/modules/mkxl/s-math-tests.mkxl b/tex/context/modules/mkxl/s-math-tests.mkxl
new file mode 100644
index 000000000..35f2a6248
--- /dev/null
+++ b/tex/context/modules/mkxl/s-math-tests.mkxl
@@ -0,0 +1,112 @@
+%D \module
+%D [ file=s-math-tests.mkxl,
+%D version=2023.04.03,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Some Math Tests,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\continueifinputfile{s-math-tests.mkxl}
+
+%D Here we collect some tests that later will become proper macros.
+
+\starttext
+
+\startbuffer
+ \ruledhbox \bgroup \im {
+ \dostepwiserecurse{`A}{`Z}{1}{
+ \blackrule[color=darkgray,height=\the\Umathflattenedaccentbaseheight\textstyle,depth=0pt,width=0.05ts]
+ \hat{\char#1}
+ }
+ }\egroup
+\stopbuffer
+
+\startTEXpage[offset=1ts]
+ \showglyphs
+% \switchtobodyfont[modern] \getbuffer\par
+% \blank
+% \switchtobodyfont[pagella] \getbuffer\par
+% \switchtobodyfont[termes] \getbuffer\par
+% \switchtobodyfont[schola] \getbuffer\par
+% \blank
+% \switchtobodyfont[ebgaramon-nt]\getbuffer\par
+% \switchtobodyfont[ebgaramond] \getbuffer\par
+% \blank
+% \switchtobodyfont[erewhon] \getbuffer\par
+% \switchtobodyfont[kpfonts] \getbuffer\par
+% \switchtobodyfont[xcharter] \getbuffer\par
+% \switchtobodyfont[concrete] \getbuffer\par
+% \switchtobodyfont[libertinus] \getbuffer\par
+% \switchtobodyfont[stixtwo] \getbuffer\par
+% \switchtobodyfont[lucida-nt] \getbuffer\par
+ \switchtobodyfont[lucida]
+ % 8.67123pt default
+ \bgroup
+ \bitwiseflip\mathfontcontrol\ignoreflataccentsmathcontrolcode
+ \appendtoks
+ \Umathflattenedaccentbaseheight\textstyle8.67123pt
+ \to\everymathematics
+ \getbuffer\par
+ \egroup
+ \bgroup
+ \appendtoks
+ \Umathflattenedaccentbaseheight\textstyle8.67123pt
+ \to\everymathematics
+ \getbuffer\par
+ \egroup
+ % 8.51532pt fixed
+ \bgroup
+ \appendtoks
+ \Umathflattenedaccentbaseheight\textstyle8.51532pt
+ \to\everymathematics
+ \getbuffer\par
+ \egroup
+% \switchtobodyfont[libertinus] \getbuffer\par
+\stopTEXpage
+
+\startTEXpage[offset=1ts]
+
+ \definefontfeature[mathextra][]
+% \definefontfeature[mathextra][ss10=yes,ss06=yes]
+
+ \setupbodyfont[ebgaramond]
+
+ \bgroup
+ \setupmathematics[stylealternative=]
+ \im{\hbar^{\hbar^{\hbar}}}
+ \egroup
+ \bgroup
+ \setupmathematics[stylealternative={hbar}]
+ \im{\hbar^{\hbar^{\hbar}}}
+ \egroup
+ \bgroup
+ \setupmathematics[stylealternative={hbar,outbendingh}]
+ \im{\hbar^{\hbar^{\hbar}}}
+ \egroup
+ \bgroup
+ \setupmathematics[stylealternative={outbendingh}]
+ \im{\hbar^{\hbar^{\hbar}}}
+ \egroup
+
+ \definefontfeature[mathextra][]
+% \definefontfeature[mathextra][cv03=yes]
+
+ \setupbodyfont[stixtwo]
+
+ \bgroup
+ \setupmathematics[stylealternative=]
+ \im{\emptyset^{\emptyset^{\emptyset}}}
+ \egroup
+ \bgroup
+ \setupmathematics[stylealternative={emptyset}]
+ \im{\emptyset^{\emptyset^{\emptyset}}}
+ \egroup
+
+\stopTEXpage
+
+\stoptext
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 7d9befa51..2e71a19d3 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.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 : 2023-04-01 09:28
+-- merge date : 2023-04-11 22:45
do -- begin closure to overcome local limits and interference
@@ -21334,7 +21334,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.132
+otf.version=3.133
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)
@@ -31740,7 +31740,11 @@ local function addfeature(data,feature,specifications,prepareonly)
local list=askedsteps[i]
local coverage=nil
local format=nil
- if featuretype=="substitution" then
+if type(list)=="function" then
+ list=list(data,specification,list,i)
+end
+ if not list then
+ elseif featuretype=="substitution" then
category="gsub"
coverage=(mapping and list) or prepare_substitution(list,featuretype,nocheck)
elseif featuretype=="ligature" then