summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkxl')
-rw-r--r--tex/context/base/mkxl/back-exp.lmt4
-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/driv-shp.lmt16
-rw-r--r--tex/context/base/mkxl/lpdf-emb.lmt9
-rw-r--r--tex/context/base/mkxl/lpdf-lmt.lmt25
-rw-r--r--tex/context/base/mkxl/math-act.lmt89
-rw-r--r--tex/context/base/mkxl/math-dld.mklx30
-rw-r--r--tex/context/base/mkxl/math-fnt.lmt19
-rw-r--r--tex/context/base/mkxl/publ-ini.mkxl2
10 files changed, 90 insertions, 108 deletions
diff --git a/tex/context/base/mkxl/back-exp.lmt b/tex/context/base/mkxl/back-exp.lmt
index e5e2e9dab..ada1fe98c 100644
--- a/tex/context/base/mkxl/back-exp.lmt
+++ b/tex/context/base/mkxl/back-exp.lmt
@@ -1576,9 +1576,9 @@ local collectresults do -- too many locals otherwise
if s then
c = s
end
- if c == 0 then
+ if c == 0 or c == 0xFFFD then
if trace_export then
- report_export("%w<!-- skipping last glyph -->",currentdepth)
+ report_export("%w<!-- skipping glyph %U -->",currentdepth,c)
end
elseif c == 0x20 then
local a = getattr(n,a_characters)
diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl
index 030a373aa..1e3f06e43 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.05.05 18:36}
+\newcontextversion{2023.05.07 16:25}
%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 4cfa73091..292118662 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.05.05 18:36}
+\immutable\edef\contextversion{2023.05.07 16:25}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
diff --git a/tex/context/base/mkxl/driv-shp.lmt b/tex/context/base/mkxl/driv-shp.lmt
index 0048f4bb8..be156affb 100644
--- a/tex/context/base/mkxl/driv-shp.lmt
+++ b/tex/context/base/mkxl/driv-shp.lmt
@@ -289,6 +289,8 @@ local flush_character do
end
end
+ -- virtual t3 fonts have negative font index
+
for i=1,#vfcommands do
local packet = vfcommands[i]
if packet then
@@ -297,16 +299,14 @@ local flush_character do
local chr = packet[2]
local csx = packet[3]
local csy = packet[4] or csx
- pos_h = pos_h + flushchar(fnt,chr,csx,csy)
-* sx
+ pos_h = pos_h + flushchar(fnt,chr,csx,csy) * sx
elseif command == "slot" then
local index = packet[2]
local chr = packet[3]
local csx = packet[4]
local csy = packet[5] or csx
if index == 0 then
- pos_h = pos_h + flushchar(font,chr,csx,csy)
-* sx
+ pos_h = pos_h + flushchar(font,chr,csx,csy) * sx
else
local okay = fonts and fonts[index]
if okay then
@@ -315,13 +315,11 @@ local flush_character do
if fnt == 0 then
fnt = font
end
- pos_h = pos_h + flushchar(fnt,chr,csx,csy)
-* sx
+ pos_h = pos_h + flushchar(fnt,chr,csx,csy) * sx
end
else
-- safeguard, we assume the font itself (often index 1)
- pos_h = pos_h + flushchar(font,chr,csx,csy)
-* sx
+ pos_h = pos_h + flushchar(font,chr,csx,csy) * sx
end
end
elseif command == "use" then
@@ -394,6 +392,7 @@ local flush_character do
if v and v ~= 0 then
pos_v = pos_v + v * sy
end
+print("6>",fnt)
flushchar(fnt,c,csx,csy)
pos_h = ph
pos_v = pv
@@ -525,6 +524,7 @@ local flush_character do
local okay = fonts and fonts[index]
if okay then
fnt = okay.id or fnt -- or maybe just return
+print("7>",fnt)
end
elseif command == "lua" then
local code = packet[2]
diff --git a/tex/context/base/mkxl/lpdf-emb.lmt b/tex/context/base/mkxl/lpdf-emb.lmt
index f63dcf6ef..303704aa7 100644
--- a/tex/context/base/mkxl/lpdf-emb.lmt
+++ b/tex/context/base/mkxl/lpdf-emb.lmt
@@ -2173,8 +2173,6 @@ local noffonts = 0
local getstreamhash = fonts.handlers.otf.getstreamhash
local loadstreamdata = fonts.handlers.otf.loadstreamdata
--- we can actually now number upwards (so not use fontid in /F)
-
local objects = setmetatableindex(lpdf.usedfontobjects,function(t,k) -- defined in lpdf-lmt.lmt
local v
if type(k) == "number" then
@@ -2227,13 +2225,13 @@ function lpdf.flushfonts()
-- don't have the id.
-- we can combine the two for loops .. todo
+
-- inspect(lpdf.usedcharacters)
for fontid, used in sortedhash(lpdf.usedcharacters) do
-- for a bitmap we need a different hash unless we stick to a fixed high
-- resolution which makes much sense
-
local hash = getstreamhash(fontid)
if hash then
local parent = mainfonts[hash]
@@ -2263,7 +2261,7 @@ function lpdf.flushfonts()
end
end
end
- if rawdata then
+-- if rawdata then -- we don't have these when we nest vf's (as in antykwa)
parent = {
hash = hash,
fontdata = fontdata,
@@ -2281,7 +2279,7 @@ function lpdf.flushfonts()
}
mainfonts[hash] = parent
noffonts = noffonts + 1
- end
+-- end
end
-- print("after ",fontid,hash,parent)
if parent then
@@ -2297,6 +2295,7 @@ function lpdf.flushfonts()
-- this is no not yet ok for tfm / type 1 .. we need to move the nested blobs ourside the loop
for hash, details in sortedhash(mainfonts) do
+ -- the filename can be somewhat weird if we have a virtual font that starts out with some
local filename = details.filename
if next(details.indices) then
local properties = details.properties
diff --git a/tex/context/base/mkxl/lpdf-lmt.lmt b/tex/context/base/mkxl/lpdf-lmt.lmt
index 7f3e53f28..5f900fc35 100644
--- a/tex/context/base/mkxl/lpdf-lmt.lmt
+++ b/tex/context/base/mkxl/lpdf-lmt.lmt
@@ -243,6 +243,7 @@ local threshold = 655360
local tjfactor = 100 / 65536
function flushers.updatefontstate(font)
+ -- virtual t3 fonts have negative font index
fontcharacters = characters[font]
-- fontdescriptions = descriptions[font]
fontparameters = parameters[font]
@@ -2227,25 +2228,25 @@ local finalize do
-- resources can be indirect
-if state == "ignore" or state == false then
+ if state == "ignore" or state == false then
-else
+ else
- registerpage(pageattributes)
+ registerpage(pageattributes)
- lpdf.finalizepage(true)
+ lpdf.finalizepage(true)
- local TrimBox = pageattributes.TrimBox
- local CropBox = pageattributes.CropBox
- local BleedBox = pageattributes.BleedBox
+ local TrimBox = pageattributes.TrimBox
+ local CropBox = pageattributes.CropBox
+ local BleedBox = pageattributes.BleedBox
- -- Indirect objects don't work in all viewers.
+ -- Indirect objects don't work in all viewers.
- if TrimBox then pageattributes.TrimBox = pdfsharedobject(checkedbox(bbox,TrimBox,"TrimBox")) end
- if CropBox then pageattributes.CropBox = pdfsharedobject(checkedbox(bbox,CropBox,"CropBox")) end
- if BleedBox then pageattributes.BleedBox = pdfsharedobject(checkedbox(bbox,BleedBox,"BleedBox")) end
+ if TrimBox then pageattributes.TrimBox = pdfsharedobject(checkedbox(bbox,TrimBox,"TrimBox")) end
+ if CropBox then pageattributes.CropBox = pdfsharedobject(checkedbox(bbox,CropBox,"CropBox")) end
+ if BleedBox then pageattributes.BleedBox = pdfsharedobject(checkedbox(bbox,BleedBox,"BleedBox")) end
-end
+ end
else
diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt
index ee9e56f8f..a5ad102ec 100644
--- a/tex/context/base/mkxl/math-act.lmt
+++ b/tex/context/base/mkxl/math-act.lmt
@@ -922,16 +922,14 @@ end
do
- local nps = fonts.helpers.newprivateslot
-
local list = {
- { 0x2032, nps("delimited ghost 0x2032"), 1 },
- { 0x2033, nps("delimited ghost 0x2033"), 2, 0x2032 },
- { 0x2034, nps("delimited ghost 0x2034"), 3, 0x2032 },
- { 0x2057, nps("delimited ghost 0x2057"), 4, 0x2032 },
- { 0x2035, nps("delimited ghost 0x2035"), 1 },
- { 0x2036, nps("delimited ghost 0x2036"), 2, 0x2035 },
- { 0x2037, nps("delimited ghost 0x2037"), 3, 0x2035 },
+ { 0x2032, 1 },
+ { 0x2033, 2, 0x2032 },
+ { 0x2034, 3, 0x2032 },
+ { 0x2057, 4, 0x2032 },
+ { 0x2035, 1 },
+ { 0x2036, 2, 0x2035 },
+ { 0x2037, 3, 0x2035 },
}
datasets.fixprimes = list
@@ -943,7 +941,7 @@ do
for i=1,#list do
local entry = list[i]
local unicode = entry[1]
- local count = entry[3]
+ local count = entry[2]
local used = fonts.handlers.otf.getsubstitution(target,unicode,"ssty",true,"math","dflt") or unicode
local data = targetcharacters[used]
if data then
@@ -960,10 +958,10 @@ do
if fake then
for i=1,#list do
local entry = list[i]
- local count = entry[3]
+ local count = entry[2]
if count > 1 then
local unicode = entry[1]
- local original = entry[4]
+ local original = entry[3]
local data = targetcharacters[original]
if data then
local oldwidth = data.width
@@ -986,51 +984,6 @@ do
end
end
- function mathtweaks.addprimed(target,original,parameters)
- local characters = target.characters
- for i=1,#list do
- local entry = list[i]
- local basecode = entry[1]
- local movecode = entry[2]
- local basedata = characters[basecode]
- if basedata then
- local baseheight = basedata.height or 0
- local basewidth = basedata.width or 0
- local used = baseheight
- local total = baseheight
- characters[movecode] = { -- todo:share
- width = basewidth,
- height = used,
- unicode = basecode, -- 0xFFFD or space or so
- -- callback = "devirtualize",
- commands = {
- downcommand[used],
- { "rule", used, 0 },
- },
- }
- basedata.partsorientation = "vertical"
- basedata.parts = {
- {
- advance = used,
- ["end"] = used,
- extender = 1,
- glyph = movecode,
- start = used,
- },
- {
- advance = total,
- ["end"] = 0,
- glyph = basecode,
- start = total,
- },
- }
- if trace_tweaking then
- report_tweak("primed %U added",target,original,basecode)
- end
- end
- end
- end
-
end
do
@@ -3246,6 +3199,14 @@ do
{ 0x0303, nps("delimited right tilde"), nps("delimited ghost tilde") },
{ 0x20DB, nps("delimited right dddot"), nps("delimited ghost dddot") },
+ { 0x2032, nps("delimited right prime"), nps("delimited ghost prime"), false, 1 },
+ { 0x2033, nps("delimited right dprime"), nps("delimited ghost dprime"), false, 1 },
+ { 0x2034, nps("delimited right tprime"), nps("delimited ghost tprime"), false, 1 },
+ { 0x2057, nps("delimited right qprime"), nps("delimited ghost qprime"), false, 1 },
+ { 0x2035, nps("delimited right rprime"), nps("delimited ghost rprime"), false, 1 },
+ { 0x2036, nps("delimited right drprime"), nps("delimited ghost rdprime"), false, 1 },
+ { 0x2037, nps("delimited right dtprime"), nps("delimited ghost rtprime"), false, 1 },
+
{ 0x231C, nps("delimited left upper corner"), nps("delimited ghost upper corner") },
{ 0x231D, nps("delimited right upper corner"), nps("delimited ghost upper corner") },
{ 0x231E, nps("delimited left lower corner"), nps("delimited ghost lower corner"), true },
@@ -3307,8 +3268,7 @@ do
characters[movecode] = {
width = basewidth,
height = used,
- unicode = basecode,
- -- callback = "devirtualize",
+ unicode = 0xFFFD,
commands = {
downcommand[used],
{ "rule", used, 0 },
@@ -3319,13 +3279,13 @@ do
advance = used,
["end"] = used,
extender = 1,
- glyph = movecode,
+ glyph = movecode, -- bottom
start = used,
},
{
advance = total,
["end"] = 0,
- glyph = fouriercode,
+ glyph = fouriercode, -- top
start = total,
},
}
@@ -3334,15 +3294,16 @@ do
end
characters[fouriercode] = {
width = basewidth,
- height = baseheight,
+ height = baseheight, -- somehow no \primed antykwa (unless we double the height)
depth = basedepth,
unicode = basecode,
- -- callback = "devirtualize",
commands = {
scale == 1 and charcommand[basecode] or { "slot", 0, basecode, scale, scale },
},
partsorientation = "vertical",
- parts = parts,
+ parts = parts,
+-- keepvirtual = basechar.commands and true or false,
+ -- callback = "devirtualize",
}
if trace_tweaking then
report_tweak("fourier %U added using %U",target,original,basecode,fouriercode)
diff --git a/tex/context/base/mkxl/math-dld.mklx b/tex/context/base/mkxl/math-dld.mklx
index 281ccedb2..4f8cf8fb4 100644
--- a/tex/context/base/mkxl/math-dld.mklx
+++ b/tex/context/base/mkxl/math-dld.mklx
@@ -250,13 +250,29 @@
% $ \autofences \fourier{(z+\frac12)} + \courier{(z+\frac12)} + \xourier{(z+\frac12)} $
-\definemathdelimited [primed] [\c!right="2032,\c!size=1,\c!topoffset=.2\exheight]
-\definemathdelimited [doubleprimed] [primed] [\c!right="2033]
-\definemathdelimited [tripleprimed] [primed] [\c!right="2034]
-\definemathdelimited [quadrupleprimed] [primed] [\c!right="2057]
-\definemathdelimited [reverseprimed] [primed] [\c!right="2035]
-\definemathdelimited [doublereverseprimed] [primed] [\c!right="2036]
-\definemathdelimited [triplereverseprimed] [primed] [\c!right="2037]
+\integerdef\delimitedrightprimeuc \privatecharactercode{delimited right prime}
+\integerdef\delimitedrightdprimeuc \privatecharactercode{delimited right dprime}
+\integerdef\delimitedrighttprimeuc \privatecharactercode{delimited right tprime}
+\integerdef\delimitedrightqprimeuc \privatecharactercode{delimited right qprime}
+\integerdef\delimitedrightrprimeuc \privatecharactercode{delimited right rprime}
+\integerdef\delimitedrightrdprimeuc \privatecharactercode{delimited right rdprime}
+\integerdef\delimitedrightrtprimeuc \privatecharactercode{delimited right rtprime}
+
+%definemathdelimited [primed] [\c!right="2032,\c!size=1,\c!topoffset=.2\exheight]
+%definemathdelimited [doubleprimed] [primed] [\c!right="2033]
+%definemathdelimited [tripleprimed] [primed] [\c!right="2034]
+%definemathdelimited [quadrupleprimed] [primed] [\c!right="2057]
+%definemathdelimited [reverseprimed] [primed] [\c!right="2035]
+%definemathdelimited [doublereverseprimed] [primed] [\c!right="2036]
+%definemathdelimited [triplereverseprimed] [primed] [\c!right="2037]
+
+\definemathdelimited [primed] [\c!right=\delimitedrightprimeuc,\c!topoffset=.2\exheight,\c!size=1]
+\definemathdelimited [doubleprimed] [primed] [\c!right=\delimitedrightdprimeuc]
+\definemathdelimited [tripleprimed] [primed] [\c!right=\delimitedrighttprimeuc]
+\definemathdelimited [quadrupleprimed] [primed] [\c!right=\delimitedrightqprimeuc]
+\definemathdelimited [reverseprimed] [primed] [\c!right=\delimitedrightrprimeuc]
+\definemathdelimited [doublereverseprimed] [primed] [\c!right=\delimitedrightrdprimeuc]
+\definemathdelimited [triplereverseprimed] [primed] [\c!right=\delimitedrightrtprimeuc]
%
diff --git a/tex/context/base/mkxl/math-fnt.lmt b/tex/context/base/mkxl/math-fnt.lmt
index 87dfe16e5..d829c342e 100644
--- a/tex/context/base/mkxl/math-fnt.lmt
+++ b/tex/context/base/mkxl/math-fnt.lmt
@@ -6,6 +6,9 @@ if not modules then modules = { } end modules ['math-fnt'] = {
license = "see context related readme files"
}
+-- It is a pitty that we don't have a unicode character that can be used but that never
+-- gets copied when we cut and paste. Not all pdf viewers ignore 0xFFFD for instance.
+
local round = math.round
local setmetatableindex = table.setmetatableindex
@@ -62,11 +65,11 @@ local function register_extensible(font,char,style,box)
local fontdata = chardata[font]
local oldchar = fontdata[char]
if oldchar and not oldchar.keepvirtual then
-if enabled == true or enabled == "both" or oldchar.partsorientation == enabled then
- -- we're okay
-else
- return
-end
+ if enabled == true or enabled == "both" or oldchar.partsorientation == enabled then
+ -- we're okay
+ else
+ return
+ end
local bx = tonut(box)
-- actually we don't want colors and such so if we do finalize we
-- should be more selctive:
@@ -76,8 +79,8 @@ end
local id = getid(bx)
local al = getattrlst(bx)
local wd, ht, dp = getwhd(bx)
- local unicode = oldchar.unicode or char
- -- we cannot have self referencing t3 fonts
+ local unicode = oldchar.unicode or char
+ -- we cannot have self referencing t3 fonts .. see devirtualize code
local oldcommands = oldchar.oldcommands
local newcommands = oldchar.commands
if oldcommands then
@@ -123,7 +126,7 @@ end
-- height = ht,
-- depth = dp,
-- }
- -- local p = oldchar.vparts
+ -- local p = oldchar.parts
-- if p then
-- local first = fontdata[p[#p].glyph]
-- local last = fontdata[p[ 1].glyph]
diff --git a/tex/context/base/mkxl/publ-ini.mkxl b/tex/context/base/mkxl/publ-ini.mkxl
index f120c55fb..3ed15ad98 100644
--- a/tex/context/base/mkxl/publ-ini.mkxl
+++ b/tex/context/base/mkxl/publ-ini.mkxl
@@ -438,6 +438,7 @@
\permanent\protected\def\btxrightbracket {\removeunwantedspaces]\space}
\permanent\protected\def\btxrightbracketperiod {\removeunwantedspaces].\space}
\permanent\protected\def\btxrightbracketcomma {\removeunwantedspaces],\space}
+\permanent\protected\def\btxhyphen {\removeunwantedspaces-}
%D Variables:
@@ -1995,6 +1996,7 @@
\c!separator:juniors={\btxspace},
\c!separator:vons={\btxspace},
\c!separator:initials={\btxspace},
+ \c!connector:initials={\btxhyphen},
\c!stopper:initials={.},
%\c!surnamesep={\btxcomma}, % is this used anywhere?
\c!separator:invertedinitials={\btxcomma},