summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-11-16 22:58:54 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-11-16 22:58:54 +0100
commit91379fa891f786d5e25909680b0d62933e581bd0 (patch)
tree87bdc4487eb0899ee13808dc509bd9a84c88859c
parenta1b3f047bf4bc1043366fc8556099cda37e83dab (diff)
downloadcontext-91379fa891f786d5e25909680b0d62933e581bd0.tar.gz
2021-11-16 22:35:00
-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/mkii/mult-cs.mkii2
-rw-r--r--tex/context/base/mkiv/buff-ver.lua4
-rw-r--r--tex/context/base/mkiv/cldf-ini.lua12
-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/lang-txt.lua43
-rw-r--r--tex/context/base/mkiv/page-app.mkiv2
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin24761 -> 24773 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin256671 -> 256660 bytes
-rw-r--r--tex/context/base/mkxl/cont-new.mkxl2
-rw-r--r--tex/context/base/mkxl/context.mkxl6
-rw-r--r--tex/context/base/mkxl/driv-shp.lmt119
-rw-r--r--tex/context/base/mkxl/font-col.mklx6
-rw-r--r--tex/context/base/mkxl/font-imp-scripts.lmt188
-rw-r--r--tex/context/base/mkxl/font-ini.mklx28
-rw-r--r--tex/context/base/mkxl/font-lib.mklx9
-rw-r--r--tex/context/base/mkxl/good-gen.lmt218
-rw-r--r--tex/context/base/mkxl/lpdf-lmt.lmt66
-rw-r--r--tex/context/base/mkxl/lpdf-pde.lmt10
-rw-r--r--tex/context/base/mkxl/math-act.lmt192
-rw-r--r--tex/context/base/mkxl/pack-mrl.mkxl3
-rw-r--r--tex/context/base/mkxl/page-app.mkxl2
-rw-r--r--tex/context/base/mkxl/page-sid.mkxl170
-rw-r--r--tex/context/base/mkxl/strc-flt.mklx4
-rw-r--r--tex/context/base/mkxl/typo-lbx.mkxl10
-rw-r--r--tex/context/fonts/mkiv/bonum-math.lfg1
-rw-r--r--tex/context/fonts/mkiv/dejavu-math.lfg1
-rw-r--r--tex/context/fonts/mkiv/ebgaramond.lfg1
-rw-r--r--tex/context/fonts/mkiv/kpfonts-math.lfg38
-rw-r--r--tex/context/fonts/mkiv/libertinus-math.lfg1
-rw-r--r--tex/context/fonts/mkiv/lm.lfg6
-rw-r--r--tex/context/fonts/mkiv/lucida-opentype-math.lfg12
-rw-r--r--tex/context/fonts/mkiv/minion-math.lfg1
-rw-r--r--tex/context/fonts/mkiv/pagella-math.lfg6
-rw-r--r--tex/context/fonts/mkiv/schola-math.lfg1
-rw-r--r--tex/context/fonts/mkiv/stix-two-math.lfg1
-rw-r--r--tex/context/fonts/mkiv/termes-math.lfg1
-rw-r--r--tex/context/fonts/mkiv/type-imp-kpfonts.mkiv101
-rw-r--r--tex/context/fonts/mkiv/xits-math.lfg1
-rw-r--r--tex/context/interface/mkii/keys-cs.xml2
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
43 files changed, 1025 insertions, 255 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index ca7fb128c..f6aaf8f9b 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{2021.11.13 20:33}
+\newcontextversion{2021.11.16 22:33}
%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 1bf322dc6..d28904c5d 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{2021.11.13 20:33}
+\edef\contextversion{2021.11.16 22:33}
%D For those who want to use this:
diff --git a/tex/context/base/mkii/mult-cs.mkii b/tex/context/base/mkii/mult-cs.mkii
index 2c7f8e197..c30105a23 100644
--- a/tex/context/base/mkii/mult-cs.mkii
+++ b/tex/context/base/mkii/mult-cs.mkii
@@ -315,6 +315,7 @@
\setinterfacevariable{lefthanging}{lefthanging}
\setinterfacevariable{leftmargin}{levyokraj}
\setinterfacevariable{leftpage}{levastranka}
+\setinterfacevariable{lefttext}{textvlevo}
\setinterfacevariable{lefttoright}{lefttoright}
\setinterfacevariable{legend}{legenda}
\setinterfacevariable{less}{less}
@@ -476,6 +477,7 @@
\setinterfacevariable{righthanging}{righthanging}
\setinterfacevariable{rightmargin}{pravyokraj}
\setinterfacevariable{rightpage}{pravastranka}
+\setinterfacevariable{righttext}{textvpravo}
\setinterfacevariable{righttoleft}{righttoleft}
\setinterfacevariable{roman}{antikva}
\setinterfacevariable{romannumerals}{rimskecislice}
diff --git a/tex/context/base/mkiv/buff-ver.lua b/tex/context/base/mkiv/buff-ver.lua
index ccb8ab0df..2a8e3b8c2 100644
--- a/tex/context/base/mkiv/buff-ver.lua
+++ b/tex/context/base/mkiv/buff-ver.lua
@@ -807,8 +807,8 @@ local nospace = space^1/""
local endstring = P(-1)
local compactors = {
- [v_all] = Cs((backslash * (1-backslash-space)^1 * nospace * (endstring+fences) + 1)^0),
- [v_absolute] = Cs((backslash * (1-symbols -space)^1 * nospace * (symbols+backslash) + 1)^0),
+ [v_all] = Cs((backslash * (1-backslash-space)^1 * nospace * (endstring + fences + #backslash) + 1)^0),
+ [v_absolute] = Cs((backslash * (1-symbols -space)^1 * nospace * (symbols + backslash ) + 1)^0),
[v_last] = Cs((space^1 * endstring/"" + 1)^0),
}
diff --git a/tex/context/base/mkiv/cldf-ini.lua b/tex/context/base/mkiv/cldf-ini.lua
index a69b2d707..0748635ef 100644
--- a/tex/context/base/mkiv/cldf-ini.lua
+++ b/tex/context/base/mkiv/cldf-ini.lua
@@ -1140,10 +1140,12 @@ end)
-- The cmd names were synchronized with the normal call cmd names.
-local luacalls = { -- luatex luametatex
- lua_expandable_call = true, -- normal
- lua_call = true, -- protected normal
- lua_protected_call = true, -- protected
+local luacalls = {
+ lua_function_call = true,
+ lua_protected_call = true,
+ lua_value = true,
+ lua_local_call = true,
+ lua_call = true,
}
local function userdata(argument)
@@ -1155,7 +1157,7 @@ local function userdata(argument)
-- return formatters["<<\\%s>>"](csname)
return formatters["\\%s"](csname)
end
- if luacall[argument.cmdname] then
+ if luacalls[argument.cmdname] then
return "<<function>>" -- argument.mode
end
return "<<token>>"
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 3925a3fce..9f2246e2a 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{2021.11.13 20:33}
+\newcontextversion{2021.11.16 22:33}
%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 cd2f873c5..bfb631798 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{2021.11.13 20:33}
+\edef\contextversion{2021.11.16 22:33}
%D Kind of special:
diff --git a/tex/context/base/mkiv/lang-txt.lua b/tex/context/base/mkiv/lang-txt.lua
index faef79625..3bd50246e 100644
--- a/tex/context/base/mkiv/lang-txt.lua
+++ b/tex/context/base/mkiv/lang-txt.lua
@@ -16,8 +16,8 @@ if not modules then modules = { } end modules ['lang-txt'] = {
-- completed by numerous users. The following list is incomplete so feel
-- free to send me corrections.
--
--- In 2020+ Tomas Hala and his students added some more languages and did
--- some extensive checking of the entries in this file.
+-- In 2020+ Tomas Hala and his students added some more languages and did
+-- some extensive checking of the entries in this file.
--
-- af Afrikaans ...
-- ar Arabic Idris Samawi Hamid, Khaled Hosny
@@ -82,6 +82,7 @@ data.labels={
["labels"]={
["be"]="У",
["bg"]="в",
+ ["de"]="In",
["en"]="In",
["eo"]="En",
["es"]="En",
@@ -96,7 +97,7 @@ data.labels={
["labels"]={
["be"]="Нумар",
["bg"]="номер",
- ["de"]="Numer",
+ ["de"]="Nummer",
["en"]="Number",
["eo"]="Nombro",
["fa"]="شماره",
@@ -194,6 +195,7 @@ data.labels={
["labels"]={
["be"]="у",
["bg"]="в",
+ ["de"]="in",
["en"]="in",
["eo"]="en",
["es"]="en",
@@ -226,7 +228,7 @@ data.labels={
["labels"]={
["be"]="нумар",
["bg"]="номер",
- ["de"]="Numer",
+ ["de"]="Nummer",
["en"]="number",
["eo"]="numero",
["fa"]="شماره",
@@ -253,6 +255,7 @@ data.labels={
},
["others"]={
["labels"]={
+ ["de"]="et al.",
["en"]="et al.",
["eo"]="aliaj",
["et"]="jt",
@@ -640,6 +643,7 @@ data.labels={
["gcd"]={
["labels"]={
["cs"]="NSD",
+ ["de"]="ggT",
["en"]="gcd",
["eo"]="",
["es"]="mcd",
@@ -697,6 +701,7 @@ data.labels={
["lcm"]={
["labels"]={
["cs"]="NSN",
+ ["de"]="kgV",
["en"]="lcm",
["eo"]="",
["es"]="MCM",
@@ -711,6 +716,7 @@ data.labels={
["lg"]={
["labels"]={
["cs"]="log",
+ ["de"]="log",
["en"]="lg",
["eo"]="log",
["es"]="log",
@@ -970,7 +976,7 @@ data.labels={
["fa"]="پیوست ",
["fi"]="",
["fr"]="Annexe ",
- ["gr"]="Παράρτημα",
+ ["gr"]="Παράρτημα ",
["hr"]="Dodatak ",
["hu"]="Melléklet ",
["it"]="",
@@ -991,7 +997,7 @@ data.labels={
["sr"]="Додатак ",
["sr-latn"]="Dodatak ",
["sv"]="",
- ["tk"]="Goşmaça",
+ ["tk"]="Goşmaça ",
["tr"]="",
["ua"]="",
["vi"]="",
@@ -1276,7 +1282,7 @@ data.labels={
["ca"]="",
["cs"]=" (pokračování)",
["da"]="",
- ["de"]="",
+ ["de"]=" (Fortsetzung)",
["en"]=" (continued)",
["eo"]=" (daŭrigota)",
["es"]=" (continúa)",
@@ -1312,6 +1318,7 @@ data.labels={
["day"]={
["labels"]={
["bg"]="ден",
+ ["de"]="Tag",
["en"]="day",
["eo"]="tago",
["et"]="päev",
@@ -1554,6 +1561,7 @@ data.labels={
},
["following:plural"]={
["labels"]={
+ ["de"]="ff.",
["en"]="ff.",
["eo"]="sekvv",
["fr"]=hairspace .. "sqq",
@@ -1561,6 +1569,7 @@ data.labels={
},
["following:singular"]={
["labels"]={
+ ["de"]="f.",
["en"]="f.",
["eo"]="sekv",
["fr"]=hairspace .. "sq",
@@ -1568,6 +1577,7 @@ data.labels={
},
["followingpage"]={
["labels"]={
+ ["de"]="auf einer Folgeseite",
["en"]="on a following page",
["eo"]="je sekvanta paĝo",
["et"]="järgmisel leheküljel",
@@ -1645,7 +1655,7 @@ data.labels={
["cn"]="插图",
["cs"]="Graf ",
["da"]="Grafik ",
- ["de"]="Graphik ",
+ ["de"]="Grafik ",
["en"]="Graphic ",
["eo"]="Grafiko",
["es"]="Gráfico ",
@@ -1688,7 +1698,7 @@ data.labels={
["ca"]="",
["cs"]="viz výše",
["da"]="se foroven",
- ["de"]="siehe oben",
+ ["de"]="siehe oben", -- better "oben"?
["en"]="as we show above",
["eo"]="laŭsupre",
["es"]="como se muestra arriba",
@@ -1731,7 +1741,7 @@ data.labels={
["ca"]="",
["cs"]="viz níže",
["da"]="se forneden",
- ["de"]="siehe unten",
+ ["de"]="siehe unten", -- better "nachstehend"?
["en"]="as we show below",
["eo"]="laŭsube",
["es"]="como se muestra abajo",
@@ -2421,6 +2431,7 @@ data.labels={
["labels"]={
["be"]="месяц",
["bg"]="месец",
+ ["de"]="Monat",
["en"]="month",
["eo"]="monato",
["et"]="kuu",
@@ -2705,6 +2716,7 @@ data.labels={
},
["precedingpage"]={
["labels"]={
+ ["de"]="oben", -- "auf der vorigen Seite" ok, but not "auf einer vorigen Seite"
["en"]="on a preceding page",
["eo"]="sur antaŭa paĝo",
["et"]="eelmisel lehel",
@@ -2782,7 +2794,7 @@ data.labels={
["cn"]={ "第", "节" },
["cs"]="Sekce ",
["da"]="",
- ["de"]="",
+ ["de"]="Abschnitt ",
["en"]="Section",
["eo"]="Sekcio ",
["es"]="Sección ",
@@ -2962,7 +2974,7 @@ data.labels={
["cn"]="",
["cs"]="Podsekce ",
["da"]="",
- ["de"]="",
+ ["de"]="Unterabschnitt ",
["en"]="Subsection",
["eo"]="Subsekcio ",
["es"]="Subsección ",
@@ -3006,7 +3018,7 @@ data.labels={
["cn"]="",
["cs"]="Podpodsekce ",
["da"]="",
- ["de"]="",
+ ["de"]="Unterunterabschnitt ",
["en"]="Subsubsection",
["eo"]="Subsubsekcio ",
["es"]="Subsubsección ",
@@ -3050,7 +3062,7 @@ data.labels={
["cn"]="",
["cs"]="Podpodpodsekce ",
["da"]="",
- ["de"]="",
+ ["de"]="Unterunterunterabschnitt",
["en"]="Subsubsubsection",
["eo"]="Subsubsubsekcio ",
["es"]="Subsubsubsección ",
@@ -3360,6 +3372,7 @@ data.labels={
["year"]={
["labels"]={
["bg"]="година",
+ ["de"]="Jahr",
["en"]="year",
["eo"]="jaro",
["et"]="aasta",
@@ -3517,7 +3530,7 @@ data.labels={
["cn"]="图",
["cs"]="Seznam grafů",
["da"]="Grafik",
- ["de"]="Graphiken",
+ ["de"]="Grafiken",
["en"]="Graphics",
["eo"]="Grafikoj",
["es"]="Gráficos",
diff --git a/tex/context/base/mkiv/page-app.mkiv b/tex/context/base/mkiv/page-app.mkiv
index cdb964ab0..1a82e178d 100644
--- a/tex/context/base/mkiv/page-app.mkiv
+++ b/tex/context/base/mkiv/page-app.mkiv
@@ -204,7 +204,7 @@
{\bgroup
\setupexternalfigure[\v!page:\v!figure][\c!offset=\v!overlay,#2]%
\startTEXpage[\c!offset=\namedexternalfigureparameter{\v!page:\v!figure}\c!offset]%
- \externalfigure[#1]\ignorespaces} % so we can put some text below the graphic
+ \externalfigure[#1][\v!page:\v!figure]\ignorespaces} % so we can put some text below the graphic
\unexpanded\def\stoppagefigure
{\stopTEXpage
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 5124f23cf..51963794b 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 896b8856a..e71ef63f0 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/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl
index a3b960aa0..67637b1a4 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{2021.11.13 20:33}
+\newcontextversion{2021.11.16 22:33}
%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 b52808856..f02e0eac8 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{2021.11.13 20:33}
+\immutable\edef\contextversion{2021.11.16 22:33}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
@@ -305,6 +305,8 @@
\loadmkxlfile{page-lay}
\loadmklxfile{page-box}
\loadmklxfile{page-txt}
+
+\loadmkxlfile{typo-lbx}
\loadmkxlfile{page-sid}
\loadmklxfile{strc-flt}
@@ -387,7 +389,7 @@
\loadmkxlfile{typo-tal}
\loadmkxlfile{typo-par} % par builders (uses fonts)
-\loadmkxlfile{typo-lbx}
+%loadmkxlfile{typo-lbx}
\loadmkxlfile{typo-adj}
\loadmkxlfile{tabl-com}
diff --git a/tex/context/base/mkxl/driv-shp.lmt b/tex/context/base/mkxl/driv-shp.lmt
index 5e3bfd703..eb2ec63c9 100644
--- a/tex/context/base/mkxl/driv-shp.lmt
+++ b/tex/context/base/mkxl/driv-shp.lmt
@@ -151,7 +151,7 @@ local flush_character do
-- current can go
- local function flush_vf_packet(current,pos_h,pos_v,pos_r,font,char,data,factor,vfcommands,sx,sy)
+ local function flush_vf_packet(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy,vfcommands)
if nesting > 100 then
return
elseif nesting == 0 then
@@ -165,13 +165,10 @@ local flush_character do
local saved_r = pos_r
pos_r = lefttoright_code
- local xoffset = data.xoffset
- local yoffset = data.yoffset
-
- local data = fontdata[font] -- offsets etc
+ local fdata = fontdata[font] -- offsets etc
local fnt = font
- local fonts = data.fonts
- local siz = (data.parameters.factor or 1)/65536
+ local fonts = fdata.fonts
+ local siz = (fdata.parameters.factor or 1)/65536
-- An alternative where we (here) locally define handlers like this:
--
@@ -185,26 +182,53 @@ local flush_character do
-- work as expected (so we end up in a nesting loop). I remember hitting this somewhat
-- unexpected feature before.
-if xoffset and xoffset ~= 0 then
- if factor ~= 0 then
- xoffset = xoffset + xoffset * factor / refactored -- expansion
- end
- pos_h = pos_h + xoffset * sx
-end
-if yoffset and yoffset ~= 0 then
- pos_v = pos_v + yoffset * sy
-end
+ local scale = data.scale
+ local xoffset = data.xoffset
+ local yoffset = data.yoffset
+
+ if scale then
+ sx = scale * sx
+ sy = scale * sy
+ end
+
+ -- -- example of usage needed (nested vf)
+
+ if csx then
+ sx = sx * csx
+ csx = 1
+ end
+ if csy then
+ sy = sy * csy
+ csy = 1
+ end
+
+ if xoffset and xoffset ~= 0 then
+ if factor ~= 0 then
+ xoffset = xoffset + xoffset * factor / refactored -- expansion
+ end
+ pos_h = pos_h + xoffset * sx
+ end
+
+ if yoffset and yoffset ~= 0 then
+ pos_v = pos_v + yoffset * sy
+ end
-- we assume resolved fonts: id mandate but maybe also size
- local function flushchar(fnt,chr,f,e) -- can't be moved out of the function due to binding locals
- if fnt then -- to the function variables etc etc ... kind of messy
+ local function flushchar(fnt,chr,csx,csy) -- can't be moved out of the function due to binding locals
+ if fnt then -- to the function variables etc etc ... kind of messy
local nest = char ~= chr or font ~= fnt
if fnt == 0 then
fnt = main
end
+ if csx then
+ csx = csx * sx
+ end
+ if csy then
+ csy = csy * sy
+ end
-- here no current!
- return flush_character(false,fnt,chr,factor,nest,pos_h,pos_v,pos_r,f,e)
+ return flush_character(false,fnt,chr,factor,nest,pos_h,pos_v,pos_r,csx,csy)
else
return 0
end
@@ -216,26 +240,26 @@ end
local command = packet[1]
if command == "char" then
local chr = packet[2]
- local f = packet[3]
- local e = packet[4]
- pos_h = pos_h + flushchar(fnt,chr,f,e)
+ local csx = packet[3]
+ local csy = packet[4] or csx
+ pos_h = pos_h + flushchar(fnt,chr,csx,csy)
elseif command == "slot" then
local index = packet[2]
local chr = packet[3]
- local f = packet[4]
- local e = packet[5]
+ local csx = packet[4]
+ local csy = packet[5] or csx
if index == 0 then
- pos_h = pos_h + flushchar(font,chr,f,e)
+ pos_h = pos_h + flushchar(font,chr,csx,csy)
else
local okay = fonts and fonts[index]
if okay then
local fnt = okay.id
if fnt then
- pos_h = pos_h + flushchar(fnt,chr,f,e)
+ pos_h = pos_h + flushchar(fnt,chr,csx,csy)
end
else
-- safeguard, we assume the font itself (often index 1)
- pos_h = pos_h + flushchar(font,chr,f,e)
+ pos_h = pos_h + flushchar(font,chr,csx,csy)
end
end
elseif command == "use" then
@@ -291,22 +315,24 @@ end
pos_v = pos_v + v * sy
end
elseif command == "offset" then
- local ph = pos_h
- local pv = pos_v
- local h = packet[2] or 0
- local v = packet[3] or 0
local c = packet[4]
- if h ~= 0 then
- if factor ~= 0 then
- h = h + h * factor / refactored -- expansion
- end
- pos_h = pos_h + h * sx
- end
- if v and v ~= 0 then
- pos_v = pos_v + v * sy
- end
if c then
- flushchar(fnt,c) -- todo: e f !
+ local ph = pos_h
+ local pv = pos_v
+ local csx = packet[5]
+ local csy = packet[6] or csx
+ local h = packet[2]
+ local v = packet[3]
+ if h and h ~= 0 then
+ if factor ~= 0 then
+ h = h + h * factor / refactored -- expansion
+ end
+ pos_h = pos_h + h * sx
+ end
+ if v and v ~= 0 then
+ pos_v = pos_v + v * sy
+ end
+ flushchar(fnt,c,csx,csy)
pos_h = ph
pos_v = pv
end
@@ -483,7 +509,7 @@ end
local onetimemessage -- could be defined later (todo: make plug for this)
- flush_character = function(current,font,char,factor,vfcommands,pos_h,pos_v,pos_r,f,e)
+ flush_character = function(current,font,char,factor,vfcommands,pos_h,pos_v,pos_r,csx,csy)
if font ~= lastfont then
lastfont = font
@@ -532,24 +558,21 @@ end
sx = 1
sy = 1
end
--- print(width, height, depth, factor, sx, sy)
if pos_r == righttoleft_code then
pos_h = pos_h - width -- here ?
end
if vfcommands then
- flush_vf_packet(current,pos_h,pos_v,pos_r,font,char,data,factor,vfcommands,sx,sy) -- also f ?
+ flush_vf_packet(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy,vfcommands)
else
- -- kind of messy that we do orientation here and offsets elsewhere .. this might change
local orientation = data.orientation -- 0 (none), 1, 2, 3 or 4 (none)
if orientation and (orientation == 1 or orientation == 3) then
-- we can get weird charactersbox tracing here
pushorientation(orientation,pos_h,pos_v)
- flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,f,e,factor,sx,sy) -- ,naturalwidth,width)
+ flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy)
poporientation(orientation,pos_h,pos_v)
else
- flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,f,e,factor,sx,sy) -- ,naturalwidth,width)
+ flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy)
end
- -- we use the real width so we have to go back again
end
return width, height, depth
end
diff --git a/tex/context/base/mkxl/font-col.mklx b/tex/context/base/mkxl/font-col.mklx
index e6500dd76..0e2f302b2 100644
--- a/tex/context/base/mkxl/font-col.mklx
+++ b/tex/context/base/mkxl/font-col.mklx
@@ -97,10 +97,14 @@
\def\font_fallbacks_register_math#1#2#3#4%
{\doifelsenothing{#3}%
- {\definedfont[#2 at #4sp]}%
+ {\definedfont[#2 at #4\scaledpoint]}%
{\definedfont[#2*#3\space at #4\scaledpoint]}%
\clf_registerfontfallbackid#1\space\fontid\font\space{#2}}
+% \def\font_fallbacks_register_math#1#2#3#4%
+% {\definedfont[#2\iftok{#3}\emptytoks\else*#3 \fi at #4\scaledpoint]%
+% \clf_registerfontfallbackid#1\space\fontid\font\space{#2}}
+
% \def\font_fallbacks_finish_math
% {\ctxlua{mathematics.finishfallbacks()}}
diff --git a/tex/context/base/mkxl/font-imp-scripts.lmt b/tex/context/base/mkxl/font-imp-scripts.lmt
new file mode 100644
index 000000000..3e5eaa596
--- /dev/null
+++ b/tex/context/base/mkxl/font-imp-scripts.lmt
@@ -0,0 +1,188 @@
+if not modules then modules = { } end modules ['font-imp-scripts'] = {
+ 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 getrange = characters.getrange
+
+local settings_to_hash = utilities.parsers.settings_to_hash
+
+if not context then return end
+
+-- the defaults are not yet ok
+
+local next, type, tonumber = next, type, tonumber
+local gmatch = string.gmatch
+local max = math.max
+
+local fonts = fonts
+local utilities = utilities
+
+local helpers = fonts.helpers
+local charcommand = helpers.commands.char
+local downcommand = helpers.commands.down
+local upcommand = helpers.commands.up
+
+local handlers = fonts.handlers
+local otf = handlers.otf
+local afm = handlers.afm
+local registerotffeature = otf.features.register
+local registerafmfeature = afm.features.register
+
+local settings_to_hash = utilities.parsers.settings_to_hash
+local sortedhash = table.sortedhash
+
+local handlers = fonts.handlers
+
+local sup = nil
+local sub = nil
+
+local function initialize(tfmdata,key,value)
+ --
+ if not sup then
+ sup = { }
+ sub = { }
+ for unicode, data in next, characters.data do
+ local specials = data.specials
+ if specials then
+ local what = specials[1]
+ if what == "super" then
+ sup[unicode] = specials[2]
+ elseif what == "sub" then
+ sub[unicode] = specials[2]
+ end
+ end
+ end
+ end
+ --
+ local spec
+ if value == true then
+ spec = { factor = 3/5, up = 5/4, down = 1/4 }
+ elseif type(value) == "number" then
+ spec = { factor = value, up = 5/4, down = 1/4 }
+ else
+ spec = settings_to_hash(value)
+ end
+ local factor = tonumber(spec.factor) or 3/5
+ local up = tonumber(spec.up) or 5/4
+ local down = tonumber(spec.down) or 1/4
+ --
+ local characters = tfmdata.characters
+ local parameters = tfmdata.parameters
+ local up = parameters.xheight * up
+ local down = -parameters.xheight * down
+ -- disable sups/subs
+ local function add(unicode,other,go_up)
+ local old = characters[other]
+ if old then
+ local shift = go_up and up or down
+ local width = (old.width or 0) * factor
+ local height = (old.height or 0) * factor + shift
+ local depth = go_up and 0 or max((old.depth or 0) * factor + down,0)
+ characters[unicode] = {
+ width = width,
+ height = height,
+ depth = depth,
+ commands = { { "offset", 0, shift, other, factor, factor } },
+ -- yoffset = shift,
+ -- xscale = factor,
+ -- yscale = factor,
+ -- commands = { { "slot", 0, other } },
+ }
+ end
+ end
+ for unicode, other in sortedhash(sup) do
+ add(unicode,other,true)
+ end
+ for unicode, other in sortedhash(sub) do
+ add(unicode,other,false)
+ end
+end
+
+local specification = {
+ name = "scripts",
+ description = "add superiors and inferiors",
+ manipulators = {
+ base = initialize,
+ node = initialize,
+ }
+}
+
+registerotffeature(specification)
+registerafmfeature(specification)
+
+-- a different kind of scripts support
+
+local function initialize(tfmdata,key,value)
+ if value then
+ local detail = type(value) == "string" and settings_to_hash(value) or { }
+ local orientation = tonumber(detail.orientation) or 0
+ if orientation == 1 or orientation == 3 then
+ local characters = tfmdata.characters
+ local parameters = tfmdata.parameters
+ local emwidth = parameters.quad
+ local exheight = parameters.xheight
+ local ranges = detail.ranges
+ local downshift = exheight * (tonumber(detail.down) or 0)
+ local rightshift = exheight * (tonumber(detail.right) or 0)
+ local orientate
+ if orientation == 1 then
+ orientate = function(character)
+ local width = character.width or 0
+ local height = character.height or 0
+ local depth = character.depth or 0
+ character.width = height + depth + rightshift + rightshift
+ character.height = width - downshift
+ character.depth = shift
+ character.xoffset = depth + rightshift
+ character.yoffset = width - downshift
+ character.orientation = orientation
+ end
+ else
+ orientate = function(character)
+ local width = character.width or 0
+ local height = character.height or 0
+ local depth = character.depth or 0
+ character.width = height + depth + rightshift + rightshift
+ character.height = width - downshift
+ character.depth = shift
+ character.xoffset = height + rightshift
+ character.yoffset = - downshift
+ character.orientation = orientation
+ end
+ end
+ if ranges then
+ for s in gmatch(ranges,"[^, ]+") do
+ local start, stop, description, gaps = getrange(s,true)
+ if start and stop then
+ for unicode=start,stop do
+ local character = characters[unicode]
+ if character then
+ orientate(character)
+ end
+ end
+ end
+ end
+ else
+ for unicode, character in next, characters do
+ orientate(character)
+ end
+ end
+ end
+ end
+end
+
+local specification = {
+ name = "vertical",
+ description = "vertical",
+ manipulators = {
+ base = initialize,
+ node = initialize,
+ }
+}
+
+registerotffeature(specification)
+registerafmfeature(specification)
diff --git a/tex/context/base/mkxl/font-ini.mklx b/tex/context/base/mkxl/font-ini.mklx
index 85e253e17..0e2ddb3f7 100644
--- a/tex/context/base/mkxl/font-ini.mklx
+++ b/tex/context/base/mkxl/font-ini.mklx
@@ -872,7 +872,8 @@
\scaledfontmode\zerocount
\fi
\c_font_future_glyph_scale\numexpr\plushundred*\d_font_scaled_font_size/\maxcard\relax
- \glyphscale\numexpr\plushundred*\d_font_scaled_font_size/\maxcard\relax % needed ? for math i guess
+ % \glyphscale\numexpr\plushundred*\d_font_scaled_font_size/\maxcard\relax % needed ? for math i guess
+ \glyphscale\numexpr\c_font_future_glyph_scale % needed ? for math i guess
% \d_font_scaled_font_size\d_font_scaled_default
% \d_font_scaled_text_face\d_font_scaled_default
%
@@ -924,15 +925,24 @@
\ifempty\somefontsizey\else
\edef\somefontsizey{\glyphyscale\somefontsizey\relax}%
\fi
- \ifempty\fontclass\else\global\fi
- \mutable\protected\edefcsname#csname\endcsname
- {\setfontid\the\fontid\csname#csname\endcsname\relax
- \glyphscale\the\glyphscale\relax
- \somefontsizex
- \somefontsizey}%
- %
\expandafter\let\expandafter\lastrawfontcall\csname#csname\endcsname
- \the\everydefinefont
+ \ifrelax\lastrawfontcall
+ \let\somefontspec\empty
+ \else
+% \ifempty\fontclass\else\global\fi
+% \mutable\protected\edefcsname#csname\endcsname
+% {\setfontid\the\fontid\csname#csname\endcsname\relax
+% \glyphscale\the\glyphscale\relax
+% \somefontsizex
+% \somefontsizey}%
+% \expandafter\let\expandafter\lastrawfontcall\csname#csname\endcsname
+ \mutable\protected\edef\lastrawfontcall
+ {\setfontid\the\fontid\csname#csname\endcsname\relax
+ \glyphscale\the\glyphscale\relax
+ \somefontsizex
+ \somefontsizey}%
+ \ifempty\fontclass\letcsname\else\gletcsname\fi#csname\endcsname\lastrawfontcall
+ \fi
\fi
\c_font_feature_inheritance_mode\c_font_feature_inheritance_default}
diff --git a/tex/context/base/mkxl/font-lib.mklx b/tex/context/base/mkxl/font-lib.mklx
index 9985df105..e8c5ad246 100644
--- a/tex/context/base/mkxl/font-lib.mklx
+++ b/tex/context/base/mkxl/font-lib.mklx
@@ -88,7 +88,7 @@
\registerctxluafile{font-enh}{autosuffix}
\registerctxluafile{good-ini}{}
-\registerctxluafile{good-gen}{}
+\registerctxluafile{good-gen}{autosuffix}
\registerctxluafile{good-ctx}{}
\registerctxluafile{good-mth}{autosuffix}
@@ -112,12 +112,7 @@
\registerctxluafile{font-imp-spacekerns}{}
\registerctxluafile{font-imp-tweaks}{}
\registerctxluafile{font-imp-combining}{}
-
-\doifelsefileexists{font-imp-scripts.lua} {
- \registerctxluafile{font-imp-scripts}{}
-} {
- % not yet, lmtx feature
-}
+\registerctxluafile{font-imp-scripts}{autosuffix}
\registerctxluafile{font-imp-tracing}{autosuffix} % comes last!
diff --git a/tex/context/base/mkxl/good-gen.lmt b/tex/context/base/mkxl/good-gen.lmt
new file mode 100644
index 000000000..33147260d
--- /dev/null
+++ b/tex/context/base/mkxl/good-gen.lmt
@@ -0,0 +1,218 @@
+if not modules then modules = { } end modules ['good-gen'] = {
+ version = 1.000,
+ comment = "companion to font-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- depends on ctx
+
+local type, next = type, next
+local lower = string.lower
+local filesuffix, replacesuffix = file.suffix, file.replacesuffix
+local fonts = fonts
+
+----- trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end)
+----- report_goodies = logs.reporter("fonts","goodies")
+
+local allocate = utilities.storage.allocate
+local texsp = tex.sp
+local fontgoodies = fonts.goodies or { }
+local findfile = resolvers.findfile
+
+
+local typefaces = fonts.typefaces or { }
+fonts.typefaces = typefaces
+
+-- the following takes care of explicit file specifications
+--
+-- files = {
+-- name = "antykwapoltawskiego",
+-- list = {
+-- ["AntPoltLtCond-Regular.otf"] = {
+-- -- name = "antykwapoltawskiego",
+-- style = "regular",
+-- weight = "light",
+-- width = "condensed",
+-- },
+-- },
+-- }
+
+-- files
+
+local function initialize(goodies)
+ local files = goodies.files
+ if files then
+ fonts.names.register(files)
+ end
+end
+
+fontgoodies.register("files", initialize)
+
+-- some day we will have a define command and then we can also do some
+-- proper tracing
+--
+-- fonts.typefaces["antykwapoltawskiego-condensed"] = {
+-- shortcut = "rm",
+-- shape = "serif",
+-- fontname = "antykwapoltawskiego",
+-- normalweight = "light",
+-- boldweight = "medium",
+-- width = "condensed",
+-- size = "default",
+-- features = "default",
+-- }
+
+local function initialize(goodies)
+ local typefaces = goodies.typefaces
+ if typefaces then
+ local ft = fonts.typefaces
+ for k, v in next, typefaces do
+ ft[k] = v
+ end
+ end
+end
+
+fontgoodies.register("typefaces", initialize)
+
+local compositions = { }
+
+function fontgoodies.getcompositions(tfmdata)
+ return compositions[file.nameonly(tfmdata.properties.filename or "")]
+end
+
+local function initialize(goodies)
+ local gc = goodies.compositions
+ if gc then
+ for k, v in next, gc do
+ compositions[k] = v
+ end
+ end
+end
+
+fontgoodies.register("compositions", initialize)
+
+-- extra treatments (on top of defaults): \loadfontgoodies[mytreatments]
+
+local treatmentdata = fonts.treatments.data
+
+local function initialize(goodies)
+ local treatments = goodies.treatments
+ if treatments then
+ for name, data in next, treatments do
+ treatmentdata[name] = data -- always wins
+ end
+ end
+end
+
+fontgoodies.register("treatments", initialize)
+
+local filenames = fontgoodies.filenames or allocate()
+fontgoodies.filenames = filenames
+
+local filedata = filenames.data or allocate()
+filenames.data = filedata
+
+local function initialize(goodies) -- design sizes are registered global
+ local fn = goodies.filenames
+ if fn then
+ for usedname, alternativenames in next, fn do
+ filedata[usedname] = alternativenames
+ end
+ end
+end
+
+fontgoodies.register("filenames", initialize)
+
+function fontgoodies.filenames.resolve(name)
+ local fd = filedata[name]
+ if fd and findfile(name) == "" then
+ for i=1,#fd do
+ local fn = fd[i]
+ if findfile(fn) ~= "" then
+ return fn
+ end
+ end
+ elseif filesuffix(name) == "any" then
+ -- This is a bit weird place but it's a kind of fallback option in case
+ -- we can't resolve due to a name conflict.
+ local sequence = fonts.readers.sequence
+ for i=1,#sequence do
+ local fn = replacesuffix(name,sequence[i])
+ if findfile(fn) ~= "" then
+ return fn
+ end
+ end
+ else
+ -- no lookup, just use the regular mechanism
+ end
+ return name
+end
+
+local designsizes = fontgoodies.designsizes or allocate()
+fontgoodies.designsizes = designsizes
+
+local designdata = designsizes.data or allocate()
+designsizes.data = designdata
+
+local function initialize(goodies) -- design sizes are registered global
+ local gd = goodies.designsizes
+ if gd then
+ for name, data in next, gd do
+ local ranges = { }
+ for size, file in next, data do
+ if size ~= "default" then
+ ranges[#ranges+1] = { texsp(size), file } -- also lower(file)
+ end
+ end
+ table.sort(ranges,function(a,b) return a[1] < b[1] end)
+ designdata[lower(name)] = { -- overloads, doesn't merge!
+ default = data.default,
+ ranges = ranges,
+ }
+ end
+ end
+end
+
+fontgoodies.register("designsizes", initialize)
+
+function fontgoodies.designsizes.register(name,size,specification)
+ local d = designdata[name]
+ if not d then
+ d = {
+ ranges = { },
+ default = nil, -- so we have no default set
+ }
+ designdata[name] = d
+ end
+ if size == "default" then
+ d.default = specification
+ else
+ if type(size) == "string" then
+ size = texsp(size) -- hm
+ end
+ local ranges = d.ranges
+ ranges[#ranges+1] = { size, specification }
+ end
+end
+
+function fontgoodies.designsizes.filename(name,spec,size) -- returns nil of no match
+ local data = designdata[lower(name)]
+ if data then
+ if not spec or spec == "" or spec == "default" or texconditionals["c_font_compact"] then
+ return data.default
+ elseif spec == "auto" then
+ local ranges = data.ranges
+ if ranges then
+ for i=1,#ranges do
+ local r = ranges[i]
+ if r[1] >= size then -- todo: rounding so maybe size - 100
+ return r[2]
+ end
+ end
+ end
+ return data.default or (ranges and ranges[#ranges][2])
+ end
+ end
+end
diff --git a/tex/context/base/mkxl/lpdf-lmt.lmt b/tex/context/base/mkxl/lpdf-lmt.lmt
index 6e6812d81..61eac9517 100644
--- a/tex/context/base/mkxl/lpdf-lmt.lmt
+++ b/tex/context/base/mkxl/lpdf-lmt.lmt
@@ -117,7 +117,7 @@ local flushers = { }
-- used variables
local pdf_h, pdf_v
-local need_tm, need_tf, need_font, cur_tmrx, cur_factor, cur_f, cur_e
+local need_tm, need_tf, need_font, cur_tmrx, cur_factor
local need_width, need_mode, done_width, done_mode
local mode
local f_pdf_cur, f_pdf, fs_cur, fs, f_cur, f_x_scale, f_y_scale
@@ -164,8 +164,6 @@ local function reset_variables(specification)
f_x_scale = 1.0
f_y_scale = 1.0
cur_factor = 0
- cur_f = false -- todo: check for nil vs false
- cur_e = false -- todo: check for nil vs false
tj_delta = 0.0
cw = 0.0
usedfonts = setmetatableindex(usefont)
@@ -547,15 +545,12 @@ do
collapse = v
end)
- local function setup_fontparameters(where,font,factor,f,e,sx,sy)
+ local function setup_fontparameters(font,factor,sx,sy)
local slant = fontparameters.slantfactor or 0
local extend = fontparameters.extendfactor or 1
local squeeze = fontparameters.squeezefactor or 1
local expand = 1 + factor / 1000000
local format = fontproperties.format
- if e then
- extend = extend * e
- end
tmef = expand
tmrx = expand * extend
tmsy = slant
@@ -565,21 +560,12 @@ do
f_cur = font
f_pdf = usedfonts[font] -- cache
cur_factor = factor
- cur_f = f
- cur_e = e
tj_delta = 0
cw = 0
--
- -- print("setup font",where)
- --
fs = fontparameters.size * bpfactor
if collapse then
local sc = fs / 10
- if f then
--- sc = sc * f
-sx = sx * f
-sy = sy * f
- end
-- kind of special:
if format == "opentype" or format == "type1" then
sc = sc * 1000 / fontparameters.units -- can we avoid this ?
@@ -590,11 +576,6 @@ sy = sy * f
tmrx = tmrx * sc
tmry = tmry * sc
else
- if f then
--- fs = fs * f
-sx = sx * f
-sy = sy * f
- end
-- kind of special:
if format == "opentype" or format == "type1" then
fs = fs * 1000 / fontparameters.units -- can we avoid this ?
@@ -700,27 +681,40 @@ sy = sy * f
-- luatex (a precursor to lmtx and also for comparison) but only in lmtx now so ...
-- time to move on I guess.
- flushers.character = function(current,pos_h,pos_v,pos_r,font,char,data,f,e,factor,sx,sy) -- ,naturalwidth,width)
+ -- factor is for hz
+
+ flushers.character = function(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy) -- ,naturalwidth,width)
+
+ local s = data.scale
+ local x = data.xoffset
+ local y = data.yoffset
+
+ if s then
+ sx = s * sx
+ sy = s * sy
+ end
+ if csx then
+ sx = sx * csx
+ csx = 1
+ end
+ if csy then
+ sy = sy * csy
+ csy = 1
+ end
+
+ -- if sx ~= f_x_scale or sy ~= f_y_scale or need_tf or font ~= f_cur or f_pdf ~= f_pdf_cur or fs ~= fs_cur then
if sx ~= f_x_scale or sy ~= f_y_scale or need_tf or font ~= f_cur or f_pdf ~= f_pdf_cur or fs ~= fs_cur or mode == "page" then
--- if sx ~= f_x_scale or sy ~= f_y_scale or need_tf or font ~= f_cur or f_pdf ~= f_pdf_cur or fs ~= fs_cur then
pdf_goto_textmode()
- setup_fontparameters(1,font,factor,f,e,sx,sy) -- too often due to page
- set_font()
--- elseif mode == "page" then
--- pdf_goto_textmode()
+ setup_fontparameters(font,factor,sx,sy) -- too often due to page
set_font()
- elseif cur_f ~= f then -- when ok move up (maybe no longer needed)
- pdf_goto_textmode()
- setup_fontparameters(2,font,factor,f,e,sx,sy)
- set_font()
- -- elseif cur_tmrx ~= tmrx or cur_factor ~= factor or cur_f ~= f or cur_e ~= e then
- elseif cur_tmrx ~= tmrx or cur_factor ~= factor or cur_e ~= e then
- setup_fontparameters(3,font,factor,f,e,sx,sy)
+ -- elseif mode == "page" then
+ -- pdf_goto_textmode()
+ -- set_font()
+ elseif cur_tmrx ~= tmrx or cur_factor ~= factor then
+ setup_fontparameters(font,factor,sx,sy)
need_tm = true
end
- local x = data.xoffset
- local y = data.yoffset
if x then
pos_h = pos_h + x * tmef * f_x_scale
end
diff --git a/tex/context/base/mkxl/lpdf-pde.lmt b/tex/context/base/mkxl/lpdf-pde.lmt
index 4483510d0..0732529dd 100644
--- a/tex/context/base/mkxl/lpdf-pde.lmt
+++ b/tex/context/base/mkxl/lpdf-pde.lmt
@@ -362,10 +362,14 @@ some_reference = function(r,document)
elseif kind == array_object_code then
cached = some_array(object,document)
elseif kind == stream_object_code then
+ -- optionally not cached
cached = some_stream(object,b,document)
- else
- cached = { kind, object, b, c }
- -- really cache this?
+ else -- if kind == string_object_code then
+ return object
+-- return some_string(object[2],object[3])
+-- else
+-- cached = { kind, object, b, c }
+-- -- really cache this?
end
document.__cache__[objnum] = cached
document.__xrefs__[cached] = objnum
diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt
index afaf79593..96057ec02 100644
--- a/tex/context/base/mkxl/math-act.lmt
+++ b/tex/context/base/mkxl/math-act.lmt
@@ -256,83 +256,143 @@ end
do
+ -- see changed hack in math-fbk
+
+ local copytable = table.copy
+ local nps = fonts.helpers.newprivateslot
+
local list = {
- { 0x2032, true, },
- { 0x2033, true, 0x2032, 2 },
- { 0x2034, true, 0x2032, 3 },
- { 0x2057, true, 0x2032, 4 },
- { 0x2035, false, },
- { 0x2036, false, 0x2035, 2 },
- { 0x2037, false, 0x2035, 3 },
+ { 0x2032, { nps("prime 0x2032 1"), nps("prime 0x2032 2"), nps("prime 0x2032 3") }, 1 },
+ { 0x2033, { nps("prime 0x2033 1"), nps("prime 0x2033 2"), nps("prime 0x2033 3") }, 2 },
+ { 0x2034, { nps("prime 0x2034 1"), nps("prime 0x2034 2"), nps("prime 0x2034 3") }, 3 },
+ { 0x2057, { nps("prime 0x2057 1"), nps("prime 0x2057 2"), nps("prime 0x2057 3") }, 4 },
+ { 0x2035, { nps("prime 0x2035 1"), nps("prime 0x2035 2"), nps("prime 0x2035 3") }, 1 },
+ { 0x2036, { nps("prime 0x2036 1"), nps("prime 0x2036 2"), nps("prime 0x2036 3") }, 2 },
+ { 0x2037, { nps("prime 0x2037 1"), nps("prime 0x2037 2"), nps("prime 0x2037 3") }, 3 },
}
- local function fix(target,original,characters,factor,scale,newheight,code,mandate)
- local char = characters[code]
- if char then
- local oldheight = scale * char.height
- char.yoffset = newheight - oldheight
- char.height = newheight
- if scale ~= 1 then
- char.width = scale * char.width
- char.commands = {
- { "slot", 0, code, scale }
- }
- end
+ local function copytable(t)
+ return {
+ width = t.width,
+ height = t.height,
+ depth = t.depth,
+ index = t.index,
+ unicode = t.unicode,
+ }
+ end
+
+ local lastprivate
+
+ local function use(target,original,targetcharacters,charcode,private,newheight,scale,fake,keep,count,smaller)
+ if count == 1 then
+ lastprivate = private
+ end
+ local olddata = targetcharacters[lastprivate]
+ if keep then
if trace_tweaking then
- report_tweak("fixing prime %U ",target,original,code)
+ report_tweak("keeping primt %U",target,original,charcode)
end
- local small = char.smaller
- if small then
- fix(target,original,characters,factor,scale,newheight,small,false)
+ elseif olddata then
+ local oldheight = scale * olddata.height
+ local oldwidth = scale * olddata.width
+ local yoffset = (newheight - oldheight) / scale
+ local unicode = olddata.unicode
+ local newwidth = oldwidth
+ if fake and count > 1 then
+ -- todo: when keep
+ local xoffset = fake * oldwidth
+ local newwidth = newwidth + (count - 1) * xoffset
+ targetcharacters[charcode] = {
+ yoffset = yoffset,
+ width = newwidth,
+ height = newheight,
+ smaller = smaller,
+ unicode = unicode,
+ commands = {
+ { "offset", 0, 0, lastprivate, scale, scale },
+ { "offset", xoffset, 0, lastprivate, scale, scale },
+ count > 2 and { "offset", 2 * xoffset, 0, lastprivate, scale, scale } or nil,
+ count > 3 and { "offset", 3 * xoffset, 0, lastprivate, scale, scale } or nil,
+ },
+ }
+ if trace_tweaking then
+ report_tweak("faking %U with %i primes",target,original,charcode,count)
+ end
+ else
+ targetcharacters[charcode] = {
+ yoffset = yoffset,
+ width = newwidth,
+ height = newheight,
+ smaller = smaller,
+ unicode = unicode,
+ commands = {
+ { "offset", 0, 0, lastprivate, scale, scale }
+ },
+ }
+ if trace_tweaking then
+ report_tweak("fixing prime %U",target,original,charcode)
+ end
end
- elseif mandate then
- report_math("missing %U prime in font %a",code,original.properties.fullname)
+ elseif trace_tweaking then
+ report_tweak("unable to fix prime %U",target,original,charcode)
end
end
function mathtweaks.fixprimes(target,original,parameters)
- local characters = target.characters
- local factor = parameters.factor or 0.85
- local scale = parameters.scale or 1
- local newheight = factor * target.mathparameters.AccentBaseHeight
+ local targetcharacters = target.characters
+ local targetparameters = target.parameters
+ local originalcharacters = original.characters
+ local factor = parameters.factor or 0.85
+ local scale = parameters.scale or 1
+ local smaller = parameters.smaller
+ local fake = parameters.fake
+ local keep = parameters.keep and targetparameters.mathsize == 1
+ local newheight = factor * target.mathparameters.AccentBaseHeight
+ local compact = targetparameters.textscale and true or false
+ --
+ lastprivate = false
+ -- make virtual copies (just all of them, also for tracing)
for i=1,#list do
local entry = list[i]
- fix(target,original,characters,factor,scale,newheight,entry[1],entry[2])
- end
- end
-
- local function fake(target,original,characters,factor,n,single,multiple)
- local csingle = characters[single]
- local cmultiple = characters[multiple]
- local width = csingle.width
- local hoffset = factor * width
- cmultiple.width = width + (n - 1) * hoffset
- cmultiple.commands = {
- { "offset", 0, 0, single },
- { "offset", hoffset, 0, single },
- n > 2 and { "offset", 2 * hoffset, 0, single } or nil,
- n > 3 and { "offset", 3 * hoffset, 0, single } or nil,
- }
- if trace_tweaking then
- report_tweak("faking %U with %i primes",target,original,multiple,n)
- end
- local ssingle = csingle.smaller
- local smultiple = cmultiple.smaller
- if ssingle and smultiple then
- fake(target,original,characters,factor,n,ssingle,smultiple)
- else
- --weird font
+ local count = entry[3]
+ if not fake or count == 1 then
+ local c1 = entry[1]
+ local d1 = targetcharacters[c1]
+ if d1 then
+ local pc = entry[2]
+ local c2 = d1.smaller or c1
+ local d2 = targetcharacters[c2]
+ local c3 = d2.smaller or c2
+ local d3 = targetcharacters[c3]
+ if smaller then
+ d1 = d2
+ d2 = d3
+ end
+ targetcharacters[pc[1]] = copytable(d1)
+ targetcharacters[pc[2]] = copytable(d2)
+ targetcharacters[pc[3]] = copytable(d3)
+ end
+ end
end
- end
-
- function mathtweaks.fakeprimes(target,original,parameters)
- local characters = target.characters
- local factor = parameters.factor or .75
+ -- replace
for i=1,#list do
local entry = list[i]
- local n = entry[4]
- if n then
- fake(target,original,characters,factor,n,entry[3],entry[1])
+ local count = entry[3]
+ local c1 = entry[1]
+ local pc = entry[2]
+ local s1 = pc[1]
+ local d1 = targetcharacters[c1]
+ if compact and d1 then
+ local c2 = d1.smaller or c1
+ local d2 = targetcharacters[c2]
+ local c3 = d2.smaller or c2
+ local s2 = pc[2]
+ local s3 = pc[3]
+ use(target,original,targetcharacters,c1,s1,newheight,scale,fake,keep, count,c2)
+ use(target,original,targetcharacters,c2,s2,newheight,scale,fake,false,count,c3)
+ use(target,original,targetcharacters,c3,s3,newheight,scale,fake,false,count)
+ else
+ use(target,original,targetcharacters,c1,s1,newheight,scale,fake,keep,count)
end
end
end
@@ -455,13 +515,9 @@ do
width = width,
height = height + offset,
depth = depth - offset,
- yoffset = offset,
unicode = unicode,
- -- index = origdata.index,
- -- scale = scale,
commands = {
- -- { "up", yoffset },
- { "slot", 0, template, scale }
+ { "offset", 0, offset, template, scale, scale }
},
}
if trace_tweaking then
@@ -723,6 +779,7 @@ function mathematics.resolvefallbacks(target,specification,fallbacks)
local name = definition.font
local features = definition.features or ""
local size = size * (definition.rscale or 1)
+-- compact: size = 655360
context.font_fallbacks_register_math(i,name,features,size)
if trace_collecting then
report_math("registering fallback font %i, name %a, size %a, features %a",i,name,size,features)
@@ -745,6 +802,7 @@ function mathematics.finishfallbacks(target,specification,fallbacks)
local fonts = target.fonts
local size = specification.size -- target.size
local characters = target.characters
+-- compact: size = 655360
if not fonts then
fonts = { }
target.fonts = fonts
diff --git a/tex/context/base/mkxl/pack-mrl.mkxl b/tex/context/base/mkxl/pack-mrl.mkxl
index bd574be07..ce25fe1dd 100644
--- a/tex/context/base/mkxl/pack-mrl.mkxl
+++ b/tex/context/base/mkxl/pack-mrl.mkxl
@@ -838,7 +838,8 @@
\endgroup}
\permanent\tolerant\protected\def\fillinline[#1]%
- {\registerparwrapper
+ {\dontleavehmode
+ \registerparwrapper
{fillinline}%
{\pack_fillinline_before{#1}}%
{\pack_fillinline_after {#1}%
diff --git a/tex/context/base/mkxl/page-app.mkxl b/tex/context/base/mkxl/page-app.mkxl
index 67699143a..660dcb879 100644
--- a/tex/context/base/mkxl/page-app.mkxl
+++ b/tex/context/base/mkxl/page-app.mkxl
@@ -194,7 +194,7 @@
{\bgroup
\setupexternalfigure[\v!page:\v!figure][\c!offset=\v!overlay,#2]%
\startTEXpage[\c!offset=\namedexternalfigureparameter{\v!page:\v!figure}\c!offset,\c!align=\v!normal]%
- \externalfigure[#1]\ignorespaces} % so we can put some text below the graphic
+ \externalfigure[#1][\v!page:\v!figure]\ignorespaces} % so we can put some text below the graphic
\permanent\protected\def\stoppagefigure
{\stopTEXpage
diff --git a/tex/context/base/mkxl/page-sid.mkxl b/tex/context/base/mkxl/page-sid.mkxl
index 37bea4fb3..052b3ee11 100644
--- a/tex/context/base/mkxl/page-sid.mkxl
+++ b/tex/context/base/mkxl/page-sid.mkxl
@@ -40,6 +40,7 @@
\newdimen \d_page_sides_vsize_reset
\newdimen \d_page_sides_progress
\newdimen \d_page_sides_page_total
+\newdimen \d_page_sides_shape_down_shift
\newdimen \d_page_sides_leftoffset
\newdimen \d_page_sides_rightoffset
@@ -55,6 +56,7 @@
\newconditional \c_page_sides_short
\newconditional \c_page_sides_flag
+\newconditional \c_page_sides_shape_down
\newdimen \d_page_sides_shift
\newdimen \d_page_sides_extrashift
@@ -331,6 +333,7 @@
\page_sides_force_depth
\ht\floatbox\privatescratchdimen
\dp\floatbox\zeropoint
+ \else
\fi
\ifcase\c_page_sides_align \else
\global\d_page_sides_toptotal\zeropoint
@@ -360,7 +363,16 @@
\fi
% new
\global\c_page_sides_lines_done\zerocount
- \ifnum\c_page_sides_n_of_lines>\zerocount
+ \ifconditional\c_page_sides_shape_down
+ \global\d_page_sides_shape_down_shift\dimexpr
+ \privatescratchdimen
+ +\htdp\floatbox
+% -\lineheight
+ \relax
+ \advance\privatescratchdimen\c_page_sides_n_of_lines\lineheight
+\advance\privatescratchdimen2\lineheight
+ \else
+ \global\d_page_sides_shape_down_shift\zeropoint
\advance\privatescratchdimen\c_page_sides_n_of_lines\lineheight
\fi
\iftracesidefloats
@@ -375,6 +387,7 @@
\fi
\global\d_page_sides_downshift\zeropoint}
+
%D We have a few virtual dimensions. I'm not sure what to do with \type
%D {\pagedepth} and \type {\pageshrink} in the next two. If we ever need
%D that it will become options.
@@ -429,7 +442,9 @@
\page_otr_command_set_vsize} % new, no longer really needed
\def\page_sides_flush_floats
- {\par
+ {\ifconditional\c_page_sides_shape_down\else
+ \par
+ \fi
\ifdim\d_page_sides_flush_criterium>\zeropoint
\page_sides_flush_floats_progress
\page_sides_flush_floats_after_next
@@ -635,15 +650,19 @@
\def\page_sides_place_float
{\ifnum\c_page_sides_float_type=\plusfour \kern\d_page_sides_toptotal \fi
\ifnum\c_page_sides_float_type=\plusfive \kern\d_page_sides_toptotal \fi
- \ifgridsnapping
- \page_sides_place_float_grid
- \else
+ \ifconditional\c_page_sides_shape_down
\page_sides_place_float_normal
- \fi
- \par
- \kern-\d_page_sides_height
- \penalty10001 % oeps, this will change
- \normalbaselines}
+ \else
+ \ifgridsnapping
+ \page_sides_place_float_grid
+ \else
+ \page_sides_place_float_normal
+ \fi
+ \par
+ \kern-\d_page_sides_height
+ \penalty10001 % oeps, this will change
+ \normalbaselines
+ \fi}
\def\page_sides_place_float_normal
{\page_sides_push_float_inline\firstofoneargument}
@@ -665,17 +684,39 @@
\let\strc_floats_mark_par_as_free\relax
-\def\page_sides_push_float_inline#1%
- {\begingroup
- \reseteverypar % needed !
- \parskip\zeropoint % needed !
- \nointerlineskip
- \page_sides_set_skips
- \page_floats_report_total
- \relax
- %\lefttoright % not needed in lmtx
- \strc_floats_mark_par_as_free
- \ifcase\c_page_sides_float_type
+% \def\page_sides_push_float_inline#1%
+% {\begingroup
+% \reseteverypar % needed !
+% \parskip\zeropoint % needed !
+% \nointerlineskip
+% \page_sides_set_skips
+% \page_floats_report_total
+% \relax
+% %\lefttoright % not needed in lmtx
+% \strc_floats_mark_par_as_free
+% \ifcase\c_page_sides_float_type
+% % invalid
+% \or % backspace
+% \noindent#1{\llap{\rlap{\box\floatbox}\kern\d_page_sides_leftskip}}\hfill
+% \or % leftedge
+% \noindent#1{\llap{\box\floatbox\kern\d_page_sides_leftskip}}\hfill
+% \or % leftmargin
+% \noindent#1{\llap{\box\floatbox\kern\d_page_sides_leftskip}}\hfill
+% \or % leftside
+% \noindent#1{\box\floatbox}\hfill
+% \or % rightside
+% \hfill#1{\box\floatbox}%
+% \or % rightmargin
+% \hfill#1{\rlap{\kern\d_page_sides_rightskip\box\floatbox}}%
+% \or % rightedge
+% \hfill#1{\rlap{\kern\d_page_sides_rightskip\box\floatbox}}%
+% \or % cutspace
+% \hfill#1{\rlap{\kern\d_page_sides_rightskip\llap{\box\floatbox}}}%
+% \fi
+% \endgroup}
+
+\def\page_sides_push_float_inline_indeed#1%
+ {\ifcase\c_page_sides_float_type
% invalid
\or % backspace
\noindent#1{\llap{\rlap{\box\floatbox}\kern\d_page_sides_leftskip}}\hfill
@@ -693,8 +734,28 @@
\hfill#1{\rlap{\kern\d_page_sides_rightskip\box\floatbox}}%
\or % cutspace
\hfill#1{\rlap{\kern\d_page_sides_rightskip\llap{\box\floatbox}}}%
- \fi
- \endgroup}
+ \fi}
+
+\def\page_sides_push_float_inline#1%
+ {\ifconditional\c_page_sides_shape_down
+ \page_sides_set_skips
+ \page_floats_report_total
+ \global\setbox\floatbox\hbox to \hsize\bgroup
+ \page_sides_push_float_inline_indeed#1%
+ \egroup
+ \else
+ \begingroup
+ \reseteverypar % needed !
+ \parskip\zeropoint % needed !
+ \nointerlineskip
+ \page_sides_set_skips
+ \page_floats_report_total
+ \relax
+ %\lefttoright % not needed in lmtx
+ \strc_floats_mark_par_as_free
+ \page_sides_push_float_inline_indeed#1%
+ \endgroup
+ \fi}
% \def\page_sides_analyse_progress
% {\d_page_sides_progress\d_page_sides_vsize
@@ -793,19 +854,22 @@
\def\page_sides_analyse_space
{\page_sides_analyse_space_stage_one
- % \ifconditional\c_page_sides_check_same_page
- % \ifdim\d_spac_prevcontent>\zeropoint
- % \ifdim\dimexpr\scratchdimenone+\d_spac_prevcontent>\scratchdimentwo
- % \clf_pushatsame
- % \setbox\scratchbox\vpack{\clf_popatsame}%
- % \page
- % \box\scratchbox
- % \vskip-\lineskip
- % \page_sides_analyse_space_stage_one
- % \fi
- % \fi
- % \fi
- \page_sides_analyse_space_stage_two}
+% \ifconditional\c_page_sides_check_same_page
+% \ifdim\d_spac_prevcontent>\zeropoint
+% \ifdim\dimexpr\scratchdimenone+\d_spac_prevcontent>\scratchdimentwo
+% \clf_pushatsame
+% \setbox\scratchbox\vpack{\clf_popatsame}%
+% \page
+% \box\scratchbox
+% \vskip-\lineskip
+% \page_sides_analyse_space_stage_one
+% \fi
+% \fi
+% \fi
+ \page_sides_analyse_space_stage_two
+ \ifconditional\c_page_sides_shape_down
+ \global\settrue\c_page_floats_room
+ \fi}
%D As we have no clear end of one or more paragraphs we only have pre float
%D skips.
@@ -857,7 +921,39 @@
{% we need to do this aftergroup
\aftergroup\par
\aftergroup\ignoreparskip
- \aftergroup\ignorespaces}
+ \aftergroup\ignorespaces
+ \aftergroup\page_sizes_delay_float}%
+
+\def\page_sides_local_float_flush
+ {\ifconditional\c_page_sides_shape_down
+ \ifnum\localboxlinenumber=\c_page_sides_n_of_lines\relax
+ \hpack to \localboxlinewidth
+ xoffset -\the\localboxlinewidth
+ yoffset -\d_page_sides_shape_down_shift
+ {\box\floatbox}%
+ \fi
+ \fi}
+
+%D Experimental and tricky:
+%D
+%D \starttext
+%D \samplefile{lorem} \blank[20*line]
+%D \startplacefigure[location={right,15*hang,force}]
+%D %\startplacefigure[location={right,15*hang}]
+%D \framed[width=30mm,height=20mm]{!!}
+%D \stopplacefigure
+%D \dorecurse{10}{\samplefile{lorem}}
+%D \stoptext
+
+\definelocalboxes
+ [\v!left:\v!float]
+ [\c!command=\page_sides_local_float_flush,
+ \c!location=\v!middle]
+
+\def\page_sizes_delay_float
+ {\ifconditional\c_page_sides_shape_down
+ \localbox[\v!left:\v!float]{}%
+ \fi}%
\def\page_sides_check_floats_indeed
{\page_sides_analyse_progress
diff --git a/tex/context/base/mkxl/strc-flt.mklx b/tex/context/base/mkxl/strc-flt.mklx
index 81ce4401e..2559e897b 100644
--- a/tex/context/base/mkxl/strc-flt.mklx
+++ b/tex/context/base/mkxl/strc-flt.mklx
@@ -931,6 +931,7 @@
\global\c_page_floats_n_of_top \rootfloatparameter\c!ntop
\global\c_page_floats_n_of_bottom\rootfloatparameter\c!nbottom
\global\d_strc_floats_overflow \zeropoint
+ \global\setfalse\c_page_sides_shape_down
\ifconditional\c_strc_floats_par_float
\global\d_strc_floats_top \zeropoint
\global\d_strc_floats_bottom \zeropoint
@@ -973,6 +974,9 @@
180=>\global\c_strc_floats_rotation\commalistelement\relax,%
270=>\global\c_strc_floats_rotation\commalistelement\relax]%
\fi
+ \doifelseinset\v!force\floatlocation
+ {\global\settrue\c_page_sides_shape_down}
+ {\global\setfalse\c_page_sides_shape_down}%
\doifelseinset\v!nonumber\floatlocation
{\global\nofloatnumbertrue}%
{\doifelse{\floatcaptionparameter\c!number}\v!yes
diff --git a/tex/context/base/mkxl/typo-lbx.mkxl b/tex/context/base/mkxl/typo-lbx.mkxl
index bf296dac4..61060362d 100644
--- a/tex/context/base/mkxl/typo-lbx.mkxl
+++ b/tex/context/base/mkxl/typo-lbx.mkxl
@@ -74,11 +74,13 @@
%D Todo: reserve index 1 for this:
-\def\typo_paragraphs_l#1{\localleftbox \ifcstok{#1}\v!global par\fi}
-\def\typo_paragraphs_r#1{\localrightbox\ifcstok{#1}\v!global par\fi}
+\def\typo_paragraphs_l#1{\localleftbox \ifcstok{#1}\v!global par\fi}
+\def\typo_paragraphs_r#1{\localrightbox \ifcstok{#1}\v!global par\fi}
+\def\typo_paragraphs_m#1{\localmiddlebox\ifcstok{#1}\v!global par\fi}
-\permanent\tolerant\protected\def\leftparbox [#1]{\typo_paragraphs_l{#1}\bgroup\enforced\let\leftparbox \relax\let\next}
-\permanent\tolerant\protected\def\rightparbox[#1]{\typo_paragraphs_r{#1}\bgroup\enforced\let\rightparbox\relax\let\next}
+\permanent\tolerant\protected\def\leftparbox [#1]{\typo_paragraphs_l{#1}\bgroup\enforced\let\leftparbox \relax\let\next}
+\permanent\tolerant\protected\def\rightparbox [#1]{\typo_paragraphs_r{#1}\bgroup\enforced\let\rightparbox\relax\let\next}
+\permanent\tolerant\protected\def\middleparbox[#1]{\typo_paragraphs_m{#1}\bgroup\enforced\let\rightparbox\relax\let\next}
% called back:
diff --git a/tex/context/fonts/mkiv/bonum-math.lfg b/tex/context/fonts/mkiv/bonum-math.lfg
index 8daa047fb..2b35612e6 100644
--- a/tex/context/fonts/mkiv/bonum-math.lfg
+++ b/tex/context/fonts/mkiv/bonum-math.lfg
@@ -34,6 +34,7 @@ return {
},
{
tweak = "fixprimes",
+ -- smaller = true,
factor = 0.85,
},
{
diff --git a/tex/context/fonts/mkiv/dejavu-math.lfg b/tex/context/fonts/mkiv/dejavu-math.lfg
index 44b5327de..a610b8596 100644
--- a/tex/context/fonts/mkiv/dejavu-math.lfg
+++ b/tex/context/fonts/mkiv/dejavu-math.lfg
@@ -29,6 +29,7 @@ return {
},
{
tweak = "fixprimes",
+ -- smaller = true,
factor = 0.85,
},
{
diff --git a/tex/context/fonts/mkiv/ebgaramond.lfg b/tex/context/fonts/mkiv/ebgaramond.lfg
index 7a509893d..83459c68d 100644
--- a/tex/context/fonts/mkiv/ebgaramond.lfg
+++ b/tex/context/fonts/mkiv/ebgaramond.lfg
@@ -15,6 +15,7 @@ return {
},
{
tweak = "fixprimes",
+ -- smaller = true,
factor = 0.85,
},
{
diff --git a/tex/context/fonts/mkiv/kpfonts-math.lfg b/tex/context/fonts/mkiv/kpfonts-math.lfg
new file mode 100644
index 000000000..f47cb6bb5
--- /dev/null
+++ b/tex/context/fonts/mkiv/kpfonts-math.lfg
@@ -0,0 +1,38 @@
+return {
+ name = "kpfonts-math",
+ version = "1.00",
+ comment = "KP Fonts.",
+ author = "Hans Hagen",
+ copyright = "ConTeXt development team",
+ mathematics = {
+ tweaks = {
+ aftercopying = {
+ {
+ tweak = "dimensions",
+ list = {
+ -- whatever
+ },
+ },
+ {
+ tweak = "fixprimes",
+ factor = 0.85, -- accent base height
+ smaller = true, -- replace multiples
+ scale = 0.75, -- glyph scale
+ fake = 0.75, -- replace multiples with this width proportion
+ -- keep = true, -- keep the text size prime (aka minute)
+ },
+ {
+ tweak = "checkspacing",
+ },
+ {
+ tweak = "addscripts",
+ },
+ },
+ },
+ parameters = {
+ },
+ alternates = {
+ -- italic = { feature = 'ss01', value = 1, comment = "Mathematical Alternative Lowercase Italic" },
+ },
+ },
+}
diff --git a/tex/context/fonts/mkiv/libertinus-math.lfg b/tex/context/fonts/mkiv/libertinus-math.lfg
index a0e9b5c23..b1ac2f894 100644
--- a/tex/context/fonts/mkiv/libertinus-math.lfg
+++ b/tex/context/fonts/mkiv/libertinus-math.lfg
@@ -21,6 +21,7 @@ return {
},
{
tweak = "fixprimes",
+ -- smaller = true,
factor = 0.85,
},
{
diff --git a/tex/context/fonts/mkiv/lm.lfg b/tex/context/fonts/mkiv/lm.lfg
index 6039471e3..fe6f73659 100644
--- a/tex/context/fonts/mkiv/lm.lfg
+++ b/tex/context/fonts/mkiv/lm.lfg
@@ -64,8 +64,10 @@ return {
},
},
{
- tweak = "fixprimes",
- factor = 0.85,
+ tweak = "fixprimes",
+ factor = 0.85,
+ smaller = true,
+ -- scale = 0.70,
},
{
tweak = "checkspacing",
diff --git a/tex/context/fonts/mkiv/lucida-opentype-math.lfg b/tex/context/fonts/mkiv/lucida-opentype-math.lfg
index 024284bd2..1c126c92c 100644
--- a/tex/context/fonts/mkiv/lucida-opentype-math.lfg
+++ b/tex/context/fonts/mkiv/lucida-opentype-math.lfg
@@ -52,12 +52,12 @@ return {
},
},
{
- tweak = "fixprimes",
- factor = 0.85,
- },
- {
- tweak = "fakeprimes",
- factor = 0.75,
+ tweak = "fixprimes",
+ factor = 0.85, -- accent base height
+ smaller = true, -- replace multiples
+ scale = 0.75, -- glyph scale
+ fake = 0.75, -- replace multiples with this width proportion
+ -- keep = true, -- keep the text size prime (aka minute)
},
{
tweak = "checkspacing",
diff --git a/tex/context/fonts/mkiv/minion-math.lfg b/tex/context/fonts/mkiv/minion-math.lfg
index 13d11edc6..064c567f4 100644
--- a/tex/context/fonts/mkiv/minion-math.lfg
+++ b/tex/context/fonts/mkiv/minion-math.lfg
@@ -34,6 +34,7 @@ return {
aftercopying = {
{
tweak = "dimensions",
+ -- smaller = true,
list = dimensions,
},
{
diff --git a/tex/context/fonts/mkiv/pagella-math.lfg b/tex/context/fonts/mkiv/pagella-math.lfg
index 3926ae95b..7e0bb0b9d 100644
--- a/tex/context/fonts/mkiv/pagella-math.lfg
+++ b/tex/context/fonts/mkiv/pagella-math.lfg
@@ -59,8 +59,10 @@ return {
},
},
{
- tweak = "fixprimes",
- factor = 0.85,
+ tweak = "fixprimes",
+ factor = 0.85,
+ smaller = true,
+ scale = 0.70,
},
{
tweak = "checkspacing",
diff --git a/tex/context/fonts/mkiv/schola-math.lfg b/tex/context/fonts/mkiv/schola-math.lfg
index 0a4d66892..9e1a014dd 100644
--- a/tex/context/fonts/mkiv/schola-math.lfg
+++ b/tex/context/fonts/mkiv/schola-math.lfg
@@ -27,6 +27,7 @@ return {
},
{
tweak = "fixprimes",
+ -- smaller = true,
factor = 0.85,
},
{
diff --git a/tex/context/fonts/mkiv/stix-two-math.lfg b/tex/context/fonts/mkiv/stix-two-math.lfg
index cc09da04b..06427281c 100644
--- a/tex/context/fonts/mkiv/stix-two-math.lfg
+++ b/tex/context/fonts/mkiv/stix-two-math.lfg
@@ -30,6 +30,7 @@ return {
},
{
tweak = "fixprimes",
+ -- smaller = true,
factor = 0.85,
},
{
diff --git a/tex/context/fonts/mkiv/termes-math.lfg b/tex/context/fonts/mkiv/termes-math.lfg
index 8752f0a3b..41d535ada 100644
--- a/tex/context/fonts/mkiv/termes-math.lfg
+++ b/tex/context/fonts/mkiv/termes-math.lfg
@@ -35,6 +35,7 @@ return {
},
{
tweak = "fixprimes",
+ -- smaller = true,
factor = 0.85,
},
{
diff --git a/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv b/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv
new file mode 100644
index 000000000..77a7a0bb2
--- /dev/null
+++ b/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv
@@ -0,0 +1,101 @@
+%D \module
+%D [ file=type-kepler,
+%D version=2021.11.16,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Kepler Opentype,
+%D author=Mikael Sundqvist & 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.
+
+% NOTA BENE: class features and goodies get expanded!
+
+\starttypescriptcollection[kpfonts-opentype]
+
+ \doifunknownfontfeature {kp-sans-bold} {\definefontfeature[kp-sans-bold][boldened]}
+
+ \starttypescript [kpfonts,kpfonts-light,kpfonts-bold,kpfonts-sans]
+ \loadfontgoodies[kpfonts-math]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] [\s!features=\s!default]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] [\s!features=\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [\typescriptone] [\s!default] [\s!features=\s!none]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [\typescriptone] [\s!default]
+ % for the moment here:
+ % \setupmathrendering[\typescriptone][\s!it=\s!italic]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [\s!serif] [kpfonts,kpfonts-sans]
+ \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!SerifSlanted] [\s!SerifItalic]
+ \definefontsynonym [\s!SerifBoldSlanted] [\s!SerifBoldItalic]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [kpfonts-light]
+ \definefontsynonym [\s!Serif] [\s!file:KpRoman-Light.otf]
+ \definefontsynonym [\s!SerifBold] [\s!file:KpRoman-Semibold.otf]
+ \definefontsynonym [\s!SerifItalic] [\s!file:KpRoman-LightItalic.otf]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!file:KpRoman-SemiboldItalic.otf]
+ \definefontsynonym [\s!SerifSlanted] [\s!SerifItalic]
+ \definefontsynonym [\s!SerifBoldSlanted] [\s!SerifBoldItalic]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [kpfonts-bold]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [\s!file:KpRoman-Regular.otf]
+ \definefontsynonym [\s!SerifBold] [\s!file:KpRoman-Bold.otf]
+ \definefontsynonym [\s!SerifItalic] [\s!file:KpRoman-Italic.otf]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!file:KpRoman-BoldItalic.otf]
+ % \definefontsynonym [\s!SerifSlanted] [\s!SerifItalic]
+ % \definefontsynonym [\s!SerifBoldSlanted] [\s!SerifBoldItalic]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [kpfonts,kpfonts-sans,kpfonts-light,kpfonts-bold]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [\s!file:KpSans-Regular.otf]
+ \definefontsynonym [\s!SansBold] [\s!file:KpSans-Bold.otf]
+ \definefontsynonym [\s!SansItalic] [\s!file:KpSans-Italic.otf]
+ \definefontsynonym [\s!SansBoldItalic] [\s!file:KpSans-BoldItalic.otf]
+ % \definefontsynonym [\s!SansSlanted] [\s!SansItalic]
+ % \definefontsynonym [\s!SansBoldSlanted] [\s!SansBoldItalic]
+ \stoptypescript
+
+ \starttypescript [\s!mono] [kpfonts,kpfonts-sans,kpfonts-light,kpfonts-bold]
+ \setups[\s!font:\s!fallback:\s!mono]
+ \definefontsynonym [\s!Mono] [\s!file:KpMono-Regular.otf]
+ \definefontsynonym [\s!MonoBold] [\s!file:KpMono-Bold.otf]
+ \definefontsynonym [\s!MonoItalic] [\s!file:KpMono-Italic.otf]
+ \definefontsynonym [\s!MonoBoldItalic] [\s!file:KpMono-BoldItalic.otf]
+ % \definefontsynonym [\s!MonoSlanted] [\s!MonoItalic]
+ % \definefontsynonym [\s!MonoBoldSlanted] [\s!MonoBoldItalic]
+ \stoptypescript
+
+ \starttypescript [\s!math] [kpfonts,kpfonts-bold]
+ \definefontsynonym [\s!MathRoman] [\s!file:KpMath-Regular.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=kpfonts-math]
+ \definefontsynonym [\s!MathRomanBold] [\s!file:KpMath-Semibold.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=kpfonts-math]
+ \stoptypescript
+
+ \starttypescript [\s!math] [kpfonts-bold]
+ \definefontsynonym [\s!MathRoman] [\s!file:KpMath-Regular.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=kpfonts-math]
+ \definefontsynonym [\s!MathRomanBold] [\s!file:KpMath-Bold.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=kpfonts-math]
+ \stoptypescript
+
+ \starttypescript [\s!math] [kpfonts-light]
+ \definefontsynonym [\s!MathRoman] [\s!file:KpMath-Light.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=kpfonts-math]
+ \definefontsynonym [\s!MathRomanBold] [\s!file:KpMath-Regular.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=kpfonts-math]
+ \stoptypescript
+
+ \starttypescript [\s!math] [kpfonts-sans]
+ \definefontsynonym [\s!MathRoman] [\s!file:KpMath-Sans.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=kpfonts-math]
+ \definefontsynonym [\s!MathRomanBold] [\s!file:KpMath-Sans.otf] [\s!features={\s!math\mathsizesuffix,lm-math-bold,mathextra},\s!goodies=kpfonts-math]
+ \stoptypescript
+
+\stoptypescriptcollection
+
+\endinput
diff --git a/tex/context/fonts/mkiv/xits-math.lfg b/tex/context/fonts/mkiv/xits-math.lfg
index f166afc80..f1f88705e 100644
--- a/tex/context/fonts/mkiv/xits-math.lfg
+++ b/tex/context/fonts/mkiv/xits-math.lfg
@@ -25,6 +25,7 @@ return {
},
{
tweak = "fixprimes",
+ -- smaller = true,
factor = 0.85,
},
{
diff --git a/tex/context/interface/mkii/keys-cs.xml b/tex/context/interface/mkii/keys-cs.xml
index 89702c0c7..4bb31bbb5 100644
--- a/tex/context/interface/mkii/keys-cs.xml
+++ b/tex/context/interface/mkii/keys-cs.xml
@@ -318,6 +318,7 @@
<cd:variable name='lefthanging' value='lefthanging'/>
<cd:variable name='leftmargin' value='levyokraj'/>
<cd:variable name='leftpage' value='levastranka'/>
+ <cd:variable name='lefttext' value='textvlevo'/>
<cd:variable name='lefttoright' value='lefttoright'/>
<cd:variable name='legend' value='legenda'/>
<cd:variable name='less' value='less'/>
@@ -479,6 +480,7 @@
<cd:variable name='righthanging' value='righthanging'/>
<cd:variable name='rightmargin' value='pravyokraj'/>
<cd:variable name='rightpage' value='pravastranka'/>
+ <cd:variable name='righttext' value='textvpravo'/>
<cd:variable name='righttoleft' value='righttoleft'/>
<cd:variable name='roman' value='antikva'/>
<cd:variable name='romannumerals' value='rimskecislice'/>
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 77d72f75b..c35e203ba 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 : 2021-11-13 20:33
+-- merge date : 2021-11-16 22:33
do -- begin closure to overcome local limits and interference