summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-01-08 12:27:53 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-01-08 12:27:53 +0100
commit3a048d406386e8b8eb5c1315e57d271237da89be (patch)
tree1355dd8258152085a5225318e2932d7a406da9c5 /tex
parent91a47fa6fbfacd23d2802c41d3c908569070bdf2 (diff)
downloadcontext-3a048d406386e8b8eb5c1315e57d271237da89be.tar.gz
2021-01-08 11: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/status-files.pdfbin26130 -> 26128 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin253886 -> 253881 bytes
-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/font-ctx.lmt42
-rw-r--r--tex/context/base/mkxl/font-glf.mklx50
-rw-r--r--tex/context/base/mkxl/font-ini.mklx22
-rw-r--r--tex/context/base/mkxl/font-ots.lmt50
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
13 files changed, 88 insertions, 90 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index d4a5fdb76..ea233b8d2 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.01.07 16:56}
+\newcontextversion{2021.01.08 11:44}
%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 1d1031281..ea64e263e 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.01.07 16:56}
+\edef\contextversion{2021.01.08 11:44}
%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 cf07d5340..da0388cf0 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.01.07 16:56}
+\newcontextversion{2021.01.08 11:44}
%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 10c8b1fdf..23eabed71 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -45,7 +45,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2021.01.07 16:56}
+\edef\contextversion{2021.01.08 11:44}
%D Kind of special:
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 154b18975..74deffd1f 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 9434bf9cd..27cd2367e 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 700283051..376101d29 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.01.07 16:56}
+\newcontextversion{2021.01.08 11:44}
%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 1a20d3a85..10674b4ee 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.01.07 16:56}
+\immutable\edef\contextversion{2021.01.08 11:44}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
diff --git a/tex/context/base/mkxl/font-ctx.lmt b/tex/context/base/mkxl/font-ctx.lmt
index c59f4c9e7..3dbf7bbbd 100644
--- a/tex/context/base/mkxl/font-ctx.lmt
+++ b/tex/context/base/mkxl/font-ctx.lmt
@@ -31,7 +31,7 @@ local round = math.round
local context, commands = context, commands
-local P, S, C, Cc, Cf, Cg, Ct, lpegmatch = lpeg.P, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Cf, lpeg.Cg, lpeg.Ct, lpeg.match
+local P, R, S, C, Cc, Cf, Cg, Ct, Cs, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Cf, lpeg.Cg, lpeg.Ct, lpeg.Cs, lpeg.match
local trace_features = false trackers.register("fonts.features", function(v) trace_features = v end)
local trace_defining = false trackers.register("fonts.defining", function(v) trace_defining = v end)
@@ -1038,8 +1038,12 @@ definers.registersplit(":",colonized,"direct")
local sizepattern, splitpattern, specialscale do
+ -- todo: use lpeg.patterns
+
----- space = P(" ")
----- spaces = space^0
+ local digit = R('09')
+ local period = P(".")
local leftparent = (P"(")
local rightparent = (P")")
local leftbrace = (P"{")
@@ -1047,27 +1051,31 @@ local sizepattern, splitpattern, specialscale do
local withinparents = leftparent * (1-rightparent)^0 * rightparent
local withinbraces = leftbrace * (1-rightbrace )^0 * rightbrace
local value = C((withinparents + withinbraces + (1-space))^1)
- local dimension = C((space/"" + P(1))^1)
+ -- local dimension = C((space/"" + P(1))^1)
+ local dimension = Cs((digit+period)^1 * (spaces/"") * (P(1)-digit)^0)
+-- local scaler = C((digit+period)^1)
+ local scaler = lpeg.patterns.unsigned/function(s) return round(tonumber(s)*1000) end
+ + C(lpeg.patterns.cardinal)
local rest = C(P(1)^0)
- local scale_none = Cc(0)
- local scale_at = (P("at") +P("@")) * Cc(1) * spaces * dimension -- dimension
- local scale_sa = P("sa") * Cc(2) * spaces * dimension -- number
- local scale_mo = P("mo") * Cc(3) * spaces * dimension -- number
- local scale_scaled = P("scaled") * Cc(4) * spaces * dimension -- number
- local scale_ht = P("ht") * Cc(5) * spaces * dimension -- dimension
- local scale_cp = P("cp") * Cc(6) * spaces * dimension -- dimension
+ local scale_none = Cc(0)
+ local scale_at = (P("at") + P("@")) * Cc(1) * spaces * dimension -- dimension
+ local scale_sa = P("sa") * Cc(2) * spaces * dimension -- number
+ local scale_mo = P("mo") * Cc(3) * spaces * dimension -- number
+ local scale_scaled = P("scaled") * Cc(4) * spaces * dimension -- number
+ local scale_ht = P("ht") * Cc(5) * spaces * dimension -- dimension
+ local scale_cp = P("cp") * Cc(6) * spaces * dimension -- dimension
specialscale = { [5] = "ht", [6] = "cp" }
- sizepattern = spaces * (scale_at + scale_sa + scale_mo + scale_ht + scale_cp + scale_scaled + scale_none)
+ sizepattern = spaces * ((scale_at + scale_sa + scale_mo + scale_ht + scale_cp + scale_scaled) * (spaces * scaler)^0 + scale_none)
splitpattern = spaces * value * spaces * rest
end
function helpers.splitfontpattern(str)
local name, size = lpegmatch(splitpattern,str)
- local kind, size = lpegmatch(sizepattern,size)
- return name, kind, size
+ local kind, size = lpegmatch(sizepattern,size) -- sx, sy
+ return name, kind, size -- sx, sy
end
function helpers.fontpatternhassize(str)
@@ -1124,13 +1132,19 @@ do -- else too many locals
end
-- we can also use a count for the size
if size and size ~= "" then
- local mode, size = lpegmatch(sizepattern,size)
- if size and mode then
+ local mode, size, sx, sy = lpegmatch(sizepattern,size)
+ if mode and size and size ~= "" then
texsetcount("scaledfontmode",mode)
-- ctx_setsomefontsize(size)
-- We use a catcodetable, just in case it's 1.2\exheight (a corner case that showed
-- up in the lmtx manual: marking that changed size in the mids of some verbatim).
setmacro(ctxcatcodes,"somefontsize",size)
+ if sx then
+ setmacro("somefontsizex",sx)
+ end
+ if sy then
+ setmacro("somefontsizey",sy)
+ end
else
texsetcount("scaledfontmode",0)
-- ctx_setemptyfontsize()
diff --git a/tex/context/base/mkxl/font-glf.mklx b/tex/context/base/mkxl/font-glf.mklx
index ba950feea..023c632dc 100644
--- a/tex/context/base/mkxl/font-glf.mklx
+++ b/tex/context/base/mkxl/font-glf.mklx
@@ -17,43 +17,25 @@
%D Experiment:
-\installcorenamespace{scaledfont}
-\installcorenamespace{scaledfontxscale}
-\installcorenamespace{scaledfontyscale}
+\installcorenamespace{tweakedfont}
-\installcommandhandler \??scaledfont {scaledfont} \??scaledfont
+\installcommandhandler \??tweakedfont {tweakedfont} \??tweakedfont
\appendtoks
- \ifempty\currentscaledfont\else
- \expandafter\integerdef\csname\??scaledfontxscale\currentscaledfont\endcsname\numericscale\scaledfontparameter\c!xscale\relax
- \expandafter\integerdef\csname\??scaledfontyscale\currentscaledfont\endcsname\numericscale\scaledfontparameter\c!yscale\relax
- \fi
-\to \everysetupscaledfont
-
-\integerdef\bodyglyphscale\plusthousand
-
-\appendtoks
- \expandafter\integerdef\csname\??scaledfontxscale\currentscaledfont\endcsname\numericscale\scaledfontparameter\c!xscale\relax
- \expandafter\integerdef\csname\??scaledfontyscale\currentscaledfont\endcsname\numericscale\scaledfontparameter\c!yscale\relax
- \overloaded\frozen\protected\edefcsname\currentscaledfont\endcsname
- {\glyphxscale\numexpr\csname\??scaledfontxscale\currentscaledfont\endcsname*\bodyglyphscale/\plusthousand\relax
- \glyphyscale\numexpr\csname\??scaledfontyscale\currentscaledfont\endcsname*\bodyglyphscale/\plusthousand\relax
- \begincsname\scaledfontparameter\c!style\endcsname}%
-\to \everydefinescaledfont
-
-\setupscaledfont
+ % we can optimize for zero and 1000 .. maybe also options?
+ \overloaded\frozen\protected\edefcsname\currenttweakedfont\endcsname
+ {\begincsname\tweakedfontparameter\c!style\endcsname
+ \glyphxscale \numexpr\glyphxscale *\numericscale\tweakedfontparameter\c!xscale /\plusthousand\relax
+ \glyphyscale \numexpr\glyphyscale *\numericscale\tweakedfontparameter\c!yscale /\plusthousand\relax
+ \glyphxoffset\dimexpr\glyphxoffset+\tweakedfontparameter\c!xoffset\relax
+ \glyphyoffset\dimexpr\glyphyoffset+\tweakedfontparameter\c!yoffset\relax}%
+\to \everydefinetweakedfont
+
+\setuptweakedfont
[\c!scale=\plusthousand,
- \c!xscale=\scaledfontparameter\c!scale,
- \c!yscale=\scaledfontparameter\c!scale]
-
-% \installcorenamespace{scaledfontbody}
-%
-% \permanent\protected\def\definescaledfontbody[#1]#*[#2]% only for testing
-% {%\expandafter\integerdef\csname\??scaledfontbody#1\endcsname\integerdef\bodyglyphscale\numericscale#2\relax
-% \frozen\protected\defcsname#1\endcsname%
-% {\integerdef\bodyglyphscale\numericscale#2\relax
-% \glyphxscale\bodyglyphscale
-% \glyphyscale\bodyglyphscale
-% \the\everybodyfont}}
+ \c!xscale=\tweakedfontparameter\c!scale,
+ \c!yscale=\tweakedfontparameter\c!scale,
+ \c!xoffset=\zeropoint,
+ \c!yoffset=\zeropoint]
\protect \endinput
diff --git a/tex/context/base/mkxl/font-ini.mklx b/tex/context/base/mkxl/font-ini.mklx
index ea049bc38..764fbfdab 100644
--- a/tex/context/base/mkxl/font-ini.mklx
+++ b/tex/context/base/mkxl/font-ini.mklx
@@ -657,9 +657,11 @@
\permanent\def\safontscale{\number\dimexpr\v_font_size_absolute\relax}
\permanent\def\mofontscale{\number\dimexpr\font_basics_set_mapped_fontsize\v_font_size_absolute\relax}
-\mutable\let\somefontname\s!unknown
-\mutable\let\somefontspec\s!unknown
-\mutable\let\somefontsize\zerocount
+\mutable\let\somefontname \s!unknown
+\mutable\let\somefontspec \s!unknown
+\mutable\let\somefontsize \zerocount
+\mutable\let\somefontsizey\empty
+\mutable\let\somefontsizey\empty
\newcount\scaledfontmode % also used at the lua end
\newcount\scaledfontsize % also used at the lua end
@@ -705,6 +707,8 @@
{% we can now set more at the lua end
\glet\somefontname\defaultfontfile
\let\somefontsize\empty
+ \let\somefontsizex\empty
+ \let\somefontsizey\empty
\clf_definefont_one{\detokenize\expandafter{\normalexpanded{#specification}}}% the escapestring catches at \somedimen
% sets \scaledfontmode and \somefontname and \somefontsize
\ifcase\fontface\relax
@@ -818,6 +822,8 @@
{% we can now set more at the lua end
\glet\somefontname\defaultfontfile
\let\somefontsize\empty
+ \let\somefontsizex\empty
+ \let\somefontsizey\empty
\clf_definefont_one{\detokenize\expandafter{\normalexpanded{#specification}}}% the escapestring catches at \somedimen
% sets \scaledfontmode and \somefontname and \somefontsize
\ifcase\fontface\relax
@@ -941,10 +947,18 @@
\else
\c_font_future_glyph_scale
\fi
+ \ifempty\somefontsizex\else
+ \edef\somefontsizex{\glyphxscale\somefontsizex\relax}% todo: inserts relax
+ \fi
+ \ifempty\somefontsizey\else
+ \edef\somefontsizey{\glyphyscale\somefontsizey\relax}%
+ \fi
\ifempty\fontclass\else\global\fi
\protected\edefcsname#csname\endcsname
{\setfontid\the\fontid\csname#csname\endcsname\relax
- \glyphscale\the\glyphscale\relax}%
+ \glyphscale\the\glyphscale\relax
+ \somefontsizex
+ \somefontsizey}%
%
\expandafter\let\expandafter\lastrawfontcall\csname#csname\endcsname
\the\everydefinefont
diff --git a/tex/context/base/mkxl/font-ots.lmt b/tex/context/base/mkxl/font-ots.lmt
index 578e661eb..37f76b258 100644
--- a/tex/context/base/mkxl/font-ots.lmt
+++ b/tex/context/base/mkxl/font-ots.lmt
@@ -792,7 +792,6 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
if lg then
stop = current
ligature = lg
- -- current = getnext(current)
current = nxt
else
break
@@ -869,7 +868,8 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
match = true
end
end
- if not match and (not pre or not replace) then
+ -- is this test ok:
+ if not match and not pre or not replace then
local nxt, char = isnextchar(getnext(discfound),currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
if char and ligature[char] then
match = true
@@ -1540,7 +1540,7 @@ function chainprocs.gsub_ligature(head,start,stop,dataset,sequence,currentlookup
-- else
current = nxt
-- end
- else
+ else
local lg = ligatures[schar]
if lg then
ligatures = lg
@@ -2515,10 +2515,10 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
end
checkdisc = getprev(head)
end
- local currentfont = currentfont -- really ?
- local currentscale = currentscale -- really ?
- local currentxscale = currentxscale -- really ?
- local currentyscale = currentyscale -- really ?
+ -- local currentfont = currentfont -- really ?
+ -- local currentscale = currentscale -- really ?
+ -- local currentxscale = currentxscale -- really ?
+ -- local currentyscale = currentyscale -- really ?
local skipped -- = false
@@ -2576,11 +2576,9 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
if trace_skips then
show_skip(dataset,sequence,char,ck,classes[char])
end
- -- last = getnext(last)
last = nxt
elseif seq[n][char] then
if n < l then
- -- last = getnext(last)
last = nxt
end
n = n + 1
@@ -2657,7 +2655,6 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
end
end
-- maybe only if match
- -- last = getnext(last)
last = nxt
else
goto next
@@ -2688,11 +2685,9 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
if trace_skips then
show_skip(dataset,sequence,char,ck,classes[char])
end
- -- prev = getprev(prev)
prev = prv
elseif seq[n][char] then
if n > 1 then
- -- prev = getprev(prev)
prev = prv
end
n = n - 1
@@ -2776,20 +2771,17 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
-- elseif id == glue_code and seq[n][32] and isspace(prev,threshold,id) then
-- elseif seq[n][32] and spaces[prev] then
-- n = n - 1
- -- -- prev = getprev(prev)
-- prev = prv
elseif id == glue_code then
local sn = seq[n]
if (sn[32] and spaces[prev]) or sn[0xFFFC] then
n = n - 1
- -- prev = getprev(prev)
prev = prv
else
goto next
end
elseif seq[n][0xFFFC] then
n = n - 1
- -- prev = getprev(prev)
prev = prv
else
goto next
@@ -2825,11 +2817,10 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
if trace_skips then
show_skip(dataset,sequence,char,ck,classes[char])
end
- -- current = getnext(current) -- was absent
current = nxt -- was absent
elseif seq[n][char] then
if n < s then -- new test
- current = getnext(current) -- was absent
+ current = nxt -- was absent
end
n = n + 1
elseif discfound then
@@ -2861,6 +2852,7 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
notmatchpost[current] = true
notmatchreplace[current] = nil
local pre, post, replace = getdisc(current)
+ -- no detailed checking here, todo ?
if pre then
local n = n
while pre do
@@ -2909,14 +2901,12 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
local sn = seq[n]
if (sn[32] and spaces[current]) or sn[0xFFFC] then
n = n + 1
- -- current = getnext(current)
current = nxt
else
goto next
end
elseif seq[n][0xFFFC] then
n = n + 1
- -- current = getnext(current)
current = nxt
else
goto next
@@ -3435,9 +3425,11 @@ local function c_run_single(head,lookupcache,step,dataset,sequence,rlmode,skipha
if ok then
done = true
end
- end
- if start then
- start = getnext(start)
+ if start then
+ start = getnext(start)
+ end
+ else
+ start = nxt
end
elseif char == false then
return head, done
@@ -3445,7 +3437,7 @@ local function c_run_single(head,lookupcache,step,dataset,sequence,rlmode,skipha
-- else we loose the rest
return head, done
else
- -- in disc component
+ -- in disc component ... really?
start = nxt
end
end
@@ -3460,7 +3452,7 @@ local function t_run_single(start,stop,lookupcache)
local lookupmatch = lookupcache[char]
if lookupmatch then -- hm, hyphens can match (tlig) so we need to really check
-- if we need more than ligatures we can outline the code and use functions
- local s = startnext
+ local s = nxt
local ss = nil
local sstop = s == stop
if not s then
@@ -3519,7 +3511,7 @@ local function t_run_single(start,stop,lookupcache)
if lastd then
return lastd
else
- start = startnext
+ start = nxt
end
else
break
@@ -4091,13 +4083,12 @@ do
local position = 0
while start do
- local nxt, char, id = isnextchar(start,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
+ local nxt, char, id = isnextchar(start,currentfont,currentdynamic)
if char then
position = position + 1
local m = merged[char]
if m then
if skiphash and skiphash[char] then -- we never needed it here but let's try
- -- start = getnext(start)
start = nxt
else
for i=m[1],m[2] do
@@ -4105,6 +4096,7 @@ do
local lookupcache = step.coverage
local lookupmatch = lookupcache[char]
if lookupmatch then
+ currentscale, currentxscale, currentyscale = getscales(start)
local ok
head, start, ok = handler(head,start,dataset,sequence,lookupmatch,rlmode,skiphash,step)
if ok then
@@ -4129,20 +4121,16 @@ do
end
elseif char == false or id == glue_code then
-- a different font|state or glue (happens often)
- -- start = getnext(start)
start = nxt
elseif id == math_code then
start = getnext(end_of_math(start))
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
- -- start = getnext(start)
start = nxt
-- elseif id == par_code and start_of_par(start) then
-- rlparmode, rlmode = pardirstate(start)
- -- -- start = getnext(start)
-- start = nxt
else
- -- start = getnext(start)
start = nxt
end
end
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index dde25ac75..f987a7c06 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-01-07 16:56
+-- merge date : 2021-01-08 11:44
do -- begin closure to overcome local limits and interference