diff options
author | Hans Hagen <pragma@wxs.nl> | 2023-04-27 00:04:07 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2023-04-27 00:04:07 +0200 |
commit | 6b25a7a970ba9553adf8077ef2eecb50a5d77818 (patch) | |
tree | f06e40077ba9e55af4bf6cab52313f79f8ea84a8 /tex | |
parent | 657457ef4a08c1f000f272e00f654f4064cc37bd (diff) | |
download | context-6b25a7a970ba9553adf8077ef2eecb50a5d77818.tar.gz |
2023-04-26 23:31:00
Diffstat (limited to 'tex')
132 files changed, 2386 insertions, 989 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 37528b541..b6135582e 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2023.04.15 00:19} +\newcontextversion{2023.04.26 23:28} %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 6996d0e72..e073a5e09 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2023.04.15 00:19} +\edef\contextversion{2023.04.26 23:28} %D For those who want to use this: diff --git a/tex/context/base/mkiv/cldf-ini.lua b/tex/context/base/mkiv/cldf-ini.lua index 9b5e705ca..b7f162862 100644 --- a/tex/context/base/mkiv/cldf-ini.lua +++ b/tex/context/base/mkiv/cldf-ini.lua @@ -455,11 +455,11 @@ end if CONTEXTLMTXMODE > 0 then - callback.register("show_lua_call", function(what, slot) + callbacks.register("show_lua_call", function(what, slot) local name = namesofscanners[slot] -- return name and formatters["%s: \\%s, slot: %i"](what,name,slot) or "" return name and formatters["%s \\%s"](what,name) or "" - end) + end, "provide lua call details") end diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 0623da6c5..1e887573a 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2023.04.15 00:19} +\newcontextversion{2023.04.26 23:28} %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 78fbb2605..2656c4376 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -49,7 +49,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2023.04.15 00:19} +\edef\contextversion{2023.04.26 23:28} %D Kind of special: diff --git a/tex/context/base/mkiv/lang-txt.lua b/tex/context/base/mkiv/lang-txt.lua index af1f42c47..668d48eb6 100644 --- a/tex/context/base/mkiv/lang-txt.lua +++ b/tex/context/base/mkiv/lang-txt.lua @@ -189,7 +189,7 @@ data.labels={ ["be"]="Рэдактар", ["bg"]="редактор", ["ca"]="Editor", - ["cs"]={ "Editor", "Editorka" }, + ["cs"]="Editor", ["de"]="Herausgeber", ["en"]="editor", ["eo"]="eldonisto", @@ -200,11 +200,23 @@ data.labels={ ["hy"]="խմբագիր", ["it"]="a cura di", ["mk"]="уредник", - ["sk"]={ "Editor", "Editorka" }, + ["sk"]="Editor", ["sr"]="уредник", ["sr-latn"]="urednik", }, }, + ["editor:f"]={ + ["labels"]={ + ["cs"]="Editorka", + ["sk"]="Editorka", + }, + }, + ["editor:m"]={ + ["labels"]={ + ["cs"]="Editor", + ["sk"]="Editor", + }, + }, ["editors"]={ ["labels"]={ ["be"]="Рэдактары", @@ -1146,6 +1158,11 @@ data.labels={ }, }, ["texts"]={ + ["demo-texts"]={ + ["labels"]={ + ["en"]={ "demo-1", "demo-2" }, + }, + }, ["and"]={ ["labels"]={ ["af"]="", diff --git a/tex/context/base/mkiv/luat-fmt.lua b/tex/context/base/mkiv/luat-fmt.lua index fe97cf604..191721332 100644 --- a/tex/context/base/mkiv/luat-fmt.lua +++ b/tex/context/base/mkiv/luat-fmt.lua @@ -15,6 +15,11 @@ if not modules then modules = { } end modules ['luat-fmt'] = { -- I'll strip the code here because something generic will never take of and we -- moved on to luametatex anyway. +-- Per 2023-04-25 we need to explicitly pass --socket and --shell-escape because +-- other macro packages need these libraries to be disabled due to lack of control. +-- So a quite drastic break of downward compatibility (context could not generate a +-- format otherwise). Yet another reason to move on to luametatex. + local format = string.format local concat = table.concat local quoted = string.quoted @@ -64,7 +69,7 @@ end -- The silent option is for Taco. It's a bit of a hack because we cannot yet mess -- with directives. In fact, I could probably clean up the maker a bit by now. -local template = [[--ini %primaryflags% --lua=%luafile% %texfile% %secondaryflags% %redirect%]] +local template = [[--ini %primaryflags% --socket --shell-escape --lua=%luafile% %texfile% %secondaryflags% %redirect%]] local checkers = { primaryflags = "verbose", -- "flags" @@ -225,7 +230,7 @@ function environment.make_format(formatname) lfs.chdir(startupdir) end -local template = [[%primaryflags% --fmt=%fmtfile% --lua=%luafile% %texfile% %secondaryflags%]] +local template = [[%primaryflags% --socket --shell-escape --fmt=%fmtfile% --lua=%luafile% %texfile% %secondaryflags%]] local checkers = { primaryflags = "verbose", diff --git a/tex/context/base/mkiv/math-def.mkiv b/tex/context/base/mkiv/math-def.mkiv index 901f075d3..14da40a4a 100644 --- a/tex/context/base/mkiv/math-def.mkiv +++ b/tex/context/base/mkiv/math-def.mkiv @@ -47,6 +47,9 @@ \definemathcommand [deg] [nolop] {\mfunctionlabeltext{deg}} \definemathcommand [det] [limop] {\mfunctionlabeltext{det}} \definemathcommand [dim] [nolop] {\mfunctionlabeltext{dim}} +%definemathcommand [erf] [nolop] {\mfunctionlabeltext{erf}} +%definemathcommand [erfc] [nolop] {\mfunctionlabeltext{erfc}} +%definemathcommand [erfi] [nolop] {\mfunctionlabeltext{erfi}} \definemathcommand [exp] [nolop] {\mfunctionlabeltext{exp}} \definemathcommand [gcd] [limop] {\mfunctionlabeltext{gcd}} \definemathcommand [hom] [nolop] {\mfunctionlabeltext{hom}} diff --git a/tex/context/base/mkiv/math-vfu.lua b/tex/context/base/mkiv/math-vfu.lua index 5fe9738a2..be1402cdf 100644 --- a/tex/context/base/mkiv/math-vfu.lua +++ b/tex/context/base/mkiv/math-vfu.lua @@ -620,8 +620,10 @@ setmetatableindex(reverse, function(t,name) end local m = mathencodings[name] local r = { } - for u, i in next, m do - r[i] = u + if type(m) == "table" then + for u, i in next, m do + r[i] = u + end end reverse[name] = r return r @@ -714,8 +716,9 @@ function vfmath.define(specification,set,goodies) local start = (trace_virtual or trace_timings) and os.clock() local okset = { } local n = 0 - for s=1,#set do - local ss = set[s] + local setlist = set.recipe or set + for s=1,#setlist do + local ss = setlist[s] local ssname = ss.name if add_optional and ss.optional then if trace_virtual then diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua index 8cc781034..69655ee38 100644 --- a/tex/context/base/mkiv/mult-low.lua +++ b/tex/context/base/mkiv/mult-low.lua @@ -259,11 +259,11 @@ return { "globalsetmode", "globalresetmode", "globalsetsystemmode", "globalresetsystemmode", "booleanmodevalue", -- - "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", + "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newfloat", "newlanguage", "newfamily", "newfam", "newhelp", -- not used -- - "newinteger", "newdimension", "newgluespec", "newmugluespec", - "aliasinteger", "aliasdimension", + "newinteger", "newdimension", "newgluespec", "newmugluespec", "newposit", + "aliasinteger", "aliasdimension", "aliasposit", -- "then", "begcsname", diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua index 72da89718..239e97a04 100644 --- a/tex/context/base/mkiv/mult-prm.lua +++ b/tex/context/base/mkiv/mult-prm.lua @@ -99,6 +99,7 @@ return { "Umathcode", "Umathconnectoroverlapmin", "Umathdegreevariant", + "Umathdelimiterextendmargin", "Umathdelimiterovervariant", "Umathdelimiterpercent", "Umathdelimitershortfall", @@ -318,6 +319,7 @@ return { "currentmarks", "dbox", "defcsname", + "deferred", "detokenized", "dimensiondef", "dimexpression", @@ -333,6 +335,7 @@ return { "etoks", "etoksapp", "etokspre", + "eufactor", "everybeforepar", "everymathatom", "everytab", @@ -349,7 +352,10 @@ return { "explicitdiscretionary", "explicithyphenpenalty", "firstvalidlanguage", + "float", + "floatdef", "flushmarks", + "fontcharba", "fontcharta", "fontid", "fontmathcontrol", @@ -399,6 +405,7 @@ return { "hyphenationmin", "hyphenationmode", "ifabsdim", + "ifabsfloat", "ifabsnum", "ifarguments", "ifboolean", @@ -414,6 +421,7 @@ return { "ifdimval", "ifempty", "ifflags", + "iffloat", "ifhaschar", "ifhastok", "ifhastoks", @@ -429,6 +437,7 @@ return { "ifrelax", "iftok", "ifzerodim", + "ifzerofloat", "ifzeronum", "ignorearguments", "ignoredepthcriterium", @@ -556,7 +565,9 @@ return { "maththreshold", "mathunderline", "meaningasis", + "meaningful", "meaningfull", + "meaningles", "meaningless", "mugluespecdef", "mutable", @@ -588,6 +599,8 @@ return { "pardirection", "permanent", "pettymuskip", + "posexpr", + "positdef", "postexhyphenchar", "posthyphenchar", "postinlinepenalty", diff --git a/tex/context/base/mkiv/publ-imp-apa.mkvi b/tex/context/base/mkiv/publ-imp-apa.mkvi index b4ac74258..c4ea0a7f0 100644 --- a/tex/context/base/mkiv/publ-imp-apa.mkvi +++ b/tex/context/base/mkiv/publ-imp-apa.mkvi @@ -888,7 +888,7 @@ \setmode{btx:apa:title-placed} % we make the title active, opening "file" \btxdoifelse {file} { - \texdefinition{btx:format:inject} + \texdefinition{btx:format:goto} {url(file:\btxflush{file})} { \texdefinition{btx:apa:composed-title}{title} @@ -1050,8 +1050,7 @@ \starttexdefinition mutable protected btx:apa:authoryear % we make the authoryear active, pointing to the citation - \texdefinition{btx:format:inject} - {internal(\currentbtxinternal)} + \texdefinition{btx:format:gotointernal} { \doifelsesetups{apa:list:sameauthor} { \btxdoifelsesameasprevious {author} { @@ -1261,15 +1260,11 @@ \starttexdefinition mutable protected btx:apa:url \begingroup \setbreakpoints[doi] - \ifconditional\btxinteractive - \goto { - \hyphenatedurl{\btxflush{url}} - } [ - url(\btxflush{url}) - ] - \else + \texdefinition {btx:format:goto} { + url(\btxflush{url}) + } { \hyphenatedurl{\btxflush{url}} - \fi + } \endgroup \stoptexdefinition @@ -1278,15 +1273,11 @@ \starttexdefinition mutable protected btx:apa:doi \begingroup \setbreakpoints[doi] - \ifconditional\btxinteractive - \goto { - \hyphenatedurl{doi:\btxflush{doi}} - } [ - url(http://dx.doi.org/\btxflush{doi}) - ] - \else + \texdefinition {btx:format:goto} { + url(http://dx.doi.org/\btxflush{doi}) + } { \hyphenatedurl{doi:\btxflush{doi}} - \fi + } \endgroup \stoptexdefinition diff --git a/tex/context/base/mkiv/publ-imp-aps.mkvi b/tex/context/base/mkiv/publ-imp-aps.mkvi index e16279222..f6f118ada 100644 --- a/tex/context/base/mkiv/publ-imp-aps.mkvi +++ b/tex/context/base/mkiv/publ-imp-aps.mkvi @@ -807,6 +807,7 @@ \stoptexdefinition \starttexdefinition mutable protected btx:aps:doi-url #text + % no: \texdefinition {btx:format:goto} because different test \ifconditional\btxinteractive \btxdoifelse {doi} { \goto {#text} [url(http://dx.doi.org/\btxflush{doi})] diff --git a/tex/context/base/mkiv/publ-imp-chicago.mkvi b/tex/context/base/mkiv/publ-imp-chicago.mkvi index 315d68612..152891d88 100644 --- a/tex/context/base/mkiv/publ-imp-chicago.mkvi +++ b/tex/context/base/mkiv/publ-imp-chicago.mkvi @@ -887,11 +887,11 @@ \setmode{btx:chicago:title-placed} % we make the title active, opening "file" \btxdoifelse {file} { - \texdefinition{btx:format:inject} - {url(file:\btxflush{file})} - { - \texdefinition{btx:chicago:composed-title}{title} - } + \texdefinition{btx:format:goto} { + url(file:\btxflush{file}) + } { + \texdefinition{btx:chicago:composed-title}{title} + } } { \texdefinition{btx:chicago:composed-title}{title} } @@ -1049,8 +1049,7 @@ \starttexdefinition mutable protected btx:chicago:authoryear % we make the authoryear active, pointing to the citation - \texdefinition{btx:format:inject} - {internal(\currentbtxinternal)} + \texdefinition{btx:format:gotointernal} { \doifelsesetups{chicago:list:sameauthor} { \btxdoifelsesameasprevious {author} { @@ -1256,15 +1255,11 @@ \starttexdefinition mutable protected btx:chicago:url \begingroup \setbreakpoints[doi] - \ifconditional\btxinteractive - \goto { - \hyphenatedurl{\btxflush{url}} - } [ - url(\btxflush{url}) - ] - \else + \texdefinition {btx:format:goto} { + url(\btxflush{url}) + } { \hyphenatedurl{\btxflush{url}} - \fi + } \endgroup \stoptexdefinition @@ -1273,15 +1268,11 @@ \starttexdefinition mutable protected btx:chicago:doi \begingroup \setbreakpoints[doi] - \ifconditional\btxinteractive - \goto { - \hyphenatedurl{doi:\btxflush{doi}} - } [ - url(http://dx.doi.org/\btxflush{doi}) - ] - \else + \texdefinition {btx:format:goto} { + url(http://dx.doi.org/\btxflush{doi}) + } { \hyphenatedurl{doi:\btxflush{doi}} - \fi + } \endgroup \stoptexdefinition diff --git a/tex/context/base/mkiv/publ-imp-cite.mkvi b/tex/context/base/mkiv/publ-imp-cite.mkvi index c9afdbf42..5336c146e 100644 --- a/tex/context/base/mkiv/publ-imp-cite.mkvi +++ b/tex/context/base/mkiv/publ-imp-cite.mkvi @@ -14,19 +14,9 @@ \unprotect \starttexdefinition mutable protected btx:cite:inject #content - \ifconditional\btxinteractive - \ifx\currentbtxinternal\empty - #content - \else - \goto { - #content - } [ - \s!internal(\currentbtxinternal) - ] - \fi - \else + \texdefinition{btx:format:gotointernal} { #content - \fi + } \stoptexdefinition \starttexdefinition mutable protected btx:cite:checkconcat @@ -252,33 +242,27 @@ \startsetups btx:cite:url \ifx\currentbtxfirst\empty \fastsetup{\s!btx:\s!cite:\s!empty} - \else\ifconditional\btxinteractive - \goto { + \else + \texdefinition {btx:format:goto} { + url(\currentbtxfirst) + } { \btxcitereference \hyphenatedurl{\currentbtxfirst} - } [ - url(\currentbtxfirst) - ] - \else - \btxcitereference - \hyphenatedurl{\currentbtxfirst} - \fi\fi + } + \fi \stopsetups \startsetups btx:cite:doi \ifx\currentbtxfirst\empty \fastsetup{\s!btx:\s!cite:\s!empty} - \else\ifconditional\btxinteractive - \goto { + \else + \texdefinition {btx:format:goto} { + url(http://dx.doi.org/\currentbtxfirst) + } { \btxcitereference \hyphenatedurl{doi:\currentbtxfirst} - } [ - url(http://dx.doi.org/\currentbtxfirst) - ] - \else - \btxcitereference - \hyphenatedurl{doi:\currentbtxfirst} - \fi\fi + } + \fi \stopsetups \protect diff --git a/tex/context/base/mkiv/publ-imp-definitions.mkvi b/tex/context/base/mkiv/publ-imp-definitions.mkvi index 1e9f8ea9b..4b6e8d6ae 100644 --- a/tex/context/base/mkiv/publ-imp-definitions.mkvi +++ b/tex/context/base/mkiv/publ-imp-definitions.mkvi @@ -27,36 +27,50 @@ \btxfield{short} \stopxmlsetups -\starttexdefinition mutable protected btx:format:inject #link #content +\starttexdefinition mutable protected btx:format:gotointernal #content \ifx\currentbtxinternal\empty #content + \else\ifnum\currentbtxinternal=\zerocount + #content \else\ifconditional\btxinteractive + \goto {#content} [\s!internal(\currentbtxinternal)] + \else + #content + \fi\fi\fi +\stoptexdefinition + +\starttexdefinition mutable protected btx:format:goto #link #content + \ifconditional\btxinteractive \goto {#content} [#link] \else #content - \fi\fi + \fi \stoptexdefinition \startxmlsetups btx:format:doi \edef\currentbtxfielddoi{\btxfield{doi}} \ifx\currentbtxfielddoi\empty {\tttf no-doi} - \else\ifconditional\btxinteractive - \goto{\hyphenatedurl{\currentbtxfielddoi}}[url(http://dx.doi.org/\currentbtxfielddoi)] \else - \hyphenatedurl{\currentbtxfielddoi} - \fi\fi + \texdefinition {btx:format:goto} { + url(http://dx.doi.org/\currentbtxfielddoi) + } { + \hyphenatedurl{\currentbtxfielddoi} + } + \fi \stopxmlsetups \startxmlsetups btx:format:url \edef\currentbtxfieldurl{\btxfield{url}} \ifx\currentbtxfieldurl\empty {\tttf no-url} - \else\ifconditional\btxinteractive - \goto{\hyphenatedurl{\currentbtxfieldurl}}[url(\currentbtxfieldurl)] \else - \hyphenatedurl{\currentbtxfieldurl} - \fi\fi + \texdefinition {btx:format:goto} { + url(\currentbtxfieldurl) + } { + \hyphenatedurl{\currentbtxfieldurl} + } + \fi \stopxmlsetups \startxmlsetups btx:format:year diff --git a/tex/context/base/mkiv/publ-imp-list.mkvi b/tex/context/base/mkiv/publ-imp-list.mkvi index eec63e515..5b4331eed 100644 --- a/tex/context/base/mkiv/publ-imp-list.mkvi +++ b/tex/context/base/mkiv/publ-imp-list.mkvi @@ -14,19 +14,9 @@ \unprotect \starttexdefinition mutable protected btx:list:inject:text #content - \ifconditional\btxinteractivetext - \ifx\currentbtxinternal\empty - #content - \else - \goto { - #content - } [ - \s!internal(\currentbtxinternal) - ] - \fi - \else + \texdefinition{btx:format:gotointernal} { #content - \fi + } \stoptexdefinition \startsetups \s!btx:\s!list:text @@ -40,19 +30,9 @@ \stopsetups \starttexdefinition mutable protected btx:list:inject:number #content - \ifconditional\btxinteractivenumber - \ifx\currentbtxinternal\empty - #content - \else - \goto { - #content - } [ - \s!internal(\currentbtxinternal) - ] - \fi - \else + \texdefinition{btx:format:gotointernal} { #content - \fi + } \stoptexdefinition \starttexdefinition mutable protected btx:list:helpers:concat diff --git a/tex/context/base/mkiv/publ-imp-page.mkvi b/tex/context/base/mkiv/publ-imp-page.mkvi index 5bcfe6ea3..feec4f107 100644 --- a/tex/context/base/mkiv/publ-imp-page.mkvi +++ b/tex/context/base/mkiv/publ-imp-page.mkvi @@ -25,6 +25,17 @@ \fastsetup{\s!btx:\s!list:\s!page:concat} \fastsetup{\s!btx:\currentbtxspecification:\s!list:page-or-pages} \ifconditional\btxinteractivepage + \ifx\currentbtxfirstinternal\empty + \donefalse + \else\ifnum\currentbtxfirstinternal=\zerocount + \donefalse + \else + \donetrue + \fi\fi + \else + \donefalse + \fi + \ifdone \goto { \currentbtxfirstpage } [ diff --git a/tex/context/base/mkiv/publ-ini.lua b/tex/context/base/mkiv/publ-ini.lua index aa96dd8bc..a7d1a6bb5 100644 --- a/tex/context/base/mkiv/publ-ini.lua +++ b/tex/context/base/mkiv/publ-ini.lua @@ -1804,10 +1804,14 @@ do -- todo: names = { "btx" } + local function collectresult(rendering) + return structures.lists.filter(rendering.specifications) or { } + end + methods[v_force] = function (dataset,rendering,keyword) -- only for checking, can have duplicates, todo: collapse page numbers, although -- we then also needs deferred writes - local result = structures.lists.filter(rendering.specifications) or { } + local result = collectresult(rendering) local list = rendering.list local current = datasets[dataset] local luadata = current.luadata @@ -1832,7 +1836,7 @@ do -- global : if tag and not alldone[tag] and done[tag] ~= section then ... methods[v_local] = function(dataset,rendering,keyword) - local result = structures.lists.filter(rendering.specifications) or { } + local result = collectresult(rendering) local section = sections.currentid() local list = rendering.list local repeated = rendering.repeated == v_yes @@ -1904,7 +1908,7 @@ do if not dataset then return end - local rendering = renderings[dataset] + local rendering = renderings[dataset] if not rendering then return end @@ -1920,6 +1924,7 @@ do rendering.repeated = specification.repeated or v_no rendering.group = specification.group or "" rendering.specifications = specification + rendering.collected = false local filtermethod = methods[method] if not filtermethod then report_list("invalid method %a",method or "") @@ -1933,6 +1938,16 @@ do else keyword = nil end + local filename = specification.filename + if filename and filename ~= "" then + local utilitydata = job.loadother(filename) + local lists = utilitydata and utilitydata.structures.lists + if lists then + rendering.collected = lists.collected + else + return + end + end filtermethod(dataset,rendering,keyword) local list = rendering.list if list and filter ~= "" then @@ -2095,15 +2110,20 @@ do flush() end local nofranges = #ranges +local interactive = not rendering.collected for i=1,nofranges do local r = ranges[i] ctx_btxsetconcat(concatstate(i,nofranges)) local first = r[1] local last = r[2] +if interactive then ctx_btxsetfirstinternal(first[2].internal) +end ctx_btxsetfirstpage(first[1]) if last then +if interactive then ctx_btxsetlastinternal(last[2].internal) +end ctx_btxsetlastpage(last[1]) end if trace_details then @@ -2262,14 +2282,16 @@ do local list = rendering.list local li = list[i] if li then - local data = datasets[dataset] - local luadata = data.luadata - local details = data.details - local tag = li[1] - local listindex = li[2] - local n = li[3] - local entry = luadata[tag] - local detail = details[tag] + local data = datasets[dataset] + local luadata = data.luadata + local details = data.details + local tag = li[1] + local listindex = li[2] + local n = li[3] + local entry = luadata[tag] + local detail = details[tag] + -- + local interactive = not rendering.collected -- ctx_btxstartlistentry() ctx_btxsetcurrentlistentry(i) -- redundant @@ -2283,6 +2305,7 @@ do ctx_btxsettag(tag) ctx_btxsetnumber(n) -- +if interactive then local citation = citetolist[n] if citation then local references = citation.references @@ -2292,6 +2315,7 @@ do ctx_btxsetinternal(internal) end end +end end -- if language then @@ -2385,6 +2409,7 @@ do { "ignored" }, { "group" }, { "filter" }, + { "filename" }, } } } @@ -2806,6 +2831,7 @@ do -- we refer to a previous list entry bl = entry.internal end + -- no check for external (yet) ctx_btxsetinternal(bl and bl > 0 and bl or "") end local language = entry.language @@ -3256,7 +3282,7 @@ do ctx_btxsettag(tag) ctx_btxsetbacklink(currentcitation) local bl = listtocite[currentcitation] - ctx_btxsetinternal(bl and bl.references.internal or "") +-- ctx_btxsetinternal(bl and bl.references.internal or "") if first then ctx_btxsetfirst(first[key] or "") -- f_missing(first.tag)) local suffix = entry.suffix diff --git a/tex/context/base/mkiv/publ-ini.mkiv b/tex/context/base/mkiv/publ-ini.mkiv index 05d93ef85..fafefa781 100644 --- a/tex/context/base/mkiv/publ-ini.mkiv +++ b/tex/context/base/mkiv/publ-ini.mkiv @@ -1143,7 +1143,7 @@ {\the\t_btx_reference_inject \strc_lists_inject_direct % todo: make like \btx_list_reference_inject_now with { } [\s!btx]% - [\c!type=\s!btx]% \c!location=\v!none + [\c!type=\s!btx,\c!location=\v!here]% [\ifx\currentbtxdataset\v!default\else\s!btxset=\currentbtxdataset,\fi% \s!btxref=\currentbtxtag,% %\ifx\currentbtxcombis \empty\else\s!btxcom={\currentbtxcombis},\fi% diff --git a/tex/context/base/mkiv/scrn-fld.lua b/tex/context/base/mkiv/scrn-fld.lua index 046b7864f..856457871 100644 --- a/tex/context/base/mkiv/scrn-fld.lua +++ b/tex/context/base/mkiv/scrn-fld.lua @@ -183,7 +183,7 @@ implement { } implement { - name = "doiffieldsetelse", + name = "doifelsefieldset", arguments = "string", actions = function(name) ctx_doifelse(codeinjections.validfieldset(name)) diff --git a/tex/context/base/mkiv/scrn-fld.mkvi b/tex/context/base/mkiv/scrn-fld.mkvi index 6c0e97a9a..ac5d28e9e 100644 --- a/tex/context/base/mkiv/scrn-fld.mkvi +++ b/tex/context/base/mkiv/scrn-fld.mkvi @@ -275,7 +275,7 @@ %D A few testing macros: -\def\doifelsefieldbody #tag{\clf_doifelsefield{#tag}} +\def\doifelsefieldbody #tag{\clf_doifelsefieldset{#tag}} \def\doifelsefieldcategory#tag{\clf_doifelsefieldcategory{#tag}} \let\doiffieldbodyelse \doifelsefieldbody diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 3c36f07cf..4e1f43daf 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 12f91518e..89f494fb5 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/toks-scn.mkiv b/tex/context/base/mkiv/toks-scn.mkiv index 12abf0cb8..0fdb9cca6 100644 --- a/tex/context/base/mkiv/toks-scn.mkiv +++ b/tex/context/base/mkiv/toks-scn.mkiv @@ -18,9 +18,6 @@ \registerctxluafile{toks-scn}{} \registerctxluafile{cldf-scn}{} \registerctxluafile{cldf-stp}{} - -\ifcase \contextlmtxmode \else - \registerctxluafile{cldf-lmt}{} -\fi +%registerctxluafile{cldf-lmt}{} \protect \endinput diff --git a/tex/context/base/mkxl/anch-box.mkxl b/tex/context/base/mkxl/anch-box.mkxl index d480b2214..e1ab5662c 100644 --- a/tex/context/base/mkxl/anch-box.mkxl +++ b/tex/context/base/mkxl/anch-box.mkxl @@ -32,6 +32,11 @@ linecolor=\namedboxanchorcontentparameter{#1}{\c!rulecolor}, #2} +\mutable\lettonothing\boxanchorone +\mutable\lettonothing\boxanchortwo +\mutable\lettonothing\boxanchorposone +\mutable\lettonothing\boxanchorpostwo + \tolerant\permanent\protected\def\connectboxanchors[#1]#*[#2]#*[#3]#*[#4]#*#:#5#6% {\begingroup % diff --git a/tex/context/base/mkxl/catc-ini.mkxl b/tex/context/base/mkxl/catc-ini.mkxl index d8c4da040..4a473b476 100644 --- a/tex/context/base/mkxl/catc-ini.mkxl +++ b/tex/context/base/mkxl/catc-ini.mkxl @@ -236,8 +236,10 @@ %\letcsname\Uchar"FFFF\Uchar\expandafter`\string#1\endcsname\m_active \letcsname\csactive#1\endcsname\m_active} +\mutable\integerdef\c_active_char_code\zerocount + \permanent\protected\def\pushactivecharcode{\afterassignment\syst_active_push\integerdef\c_active_char_code} -\permanent\protected\def\popactivecharcode {\afterassignment\syst_active_pop\integerdef \c_active_char_code} +\permanent\protected\def\popactivecharcode {\afterassignment\syst_active_pop \integerdef\c_active_char_code} \permanent\protected\def\syst_active_push {\expandafter\let\expandafter\m_active\csname\csactive\Uchar\c_active_char_code\endcsname diff --git a/tex/context/base/mkxl/cldf-ini.mkxl b/tex/context/base/mkxl/cldf-ini.mkxl index 0c5788bb2..b9620ff1c 100644 --- a/tex/context/base/mkxl/cldf-ini.mkxl +++ b/tex/context/base/mkxl/cldf-ini.mkxl @@ -1,5 +1,5 @@ %D \module -%D [ file=cldf-int, +%D [ file=cldf-ini, %D version=2019.01.01, %D title=\CONTEXT\ Data Macros, %D subtitle=Integer, diff --git a/tex/context/base/mkxl/cldf-lmt.lmt b/tex/context/base/mkxl/cldf-lmt.lmt index aba3dacda..1eb80ac60 100644 --- a/tex/context/base/mkxl/cldf-lmt.lmt +++ b/tex/context/base/mkxl/cldf-lmt.lmt @@ -1008,6 +1008,7 @@ do return integer_code, code[n] else local v = scaninteger(true) + -- local v = scancardinal(true) -- if isglobal(what) then if what and (tonumber(what) & global_code) then setsparse(code,"global",n,v) diff --git a/tex/context/base/mkxl/cldf-pos.lmt b/tex/context/base/mkxl/cldf-pos.lmt new file mode 100644 index 000000000..40c88c716 --- /dev/null +++ b/tex/context/base/mkxl/cldf-pos.lmt @@ -0,0 +1,137 @@ +if not modules then modules = { } end modules ['cldf-pos'] = { + version = 1.001, + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- https://cse512-19s.github.io/FP-Well-Rounded/ + +local tostring, load, type, tonumber = tostring, load, type, tonumber +local lpegmatch = lpeg.match +local context = context + +local setmetatableindex = table.setmetatableindex + +local implement = interfaces.implement + +local fromposit = posit.fromposit +local toposit = posit.toposit +local posittonumber = posit.tonumber + +local values = tokens.values +local boolean_code = values.boolean + +do + + local scanners = tokens.scanners + local scanfloat = scanners.float + local scaninteger = scanners.integer + local scancsname = scanners.csname + + local codes = tex.codes + + local global_code = tex.flagcodes.global + + local savelua = token.savelua + ----- isdefined = token.isdefined + + local newsparse = sparse.new + local setsparse = sparse.set + ----- wipesparse = sparse.wipe + local restoresparse = sparse.restore + + local registerfunction = context.functions.register + + implement { + name = "positunumdef", + public = true, + untraced = true, + protected = true, + actions = function(what) + local name = scancsname(true) + local code = newsparse() + local restore = registerfunction(function() restoresparse(code) end) + implement { + name = name, + public = true, + protected = true, + usage = "value", + actions = function(what) + local n = scaninteger() + if what == "value" then + local v = fromposit(code[n]) + -- return float_code, v + context("%.99g",v) + else + local v = toposit(scanfloat()) + if what and (tonumber(what) & global_code) then + setsparse(code,"global",n,v) + else + savelua(restore,true) -- only once + setsparse(code,n,v) + end + end + end, + } + codes[name] = code + end, + } + +end + +do + + local p_number = lpeg.patterns.number + local p = lpeg.Cs( + lpeg.Cc("local new = new ; return ") + * ( + lpeg.C(p_number) / function(s) + return "new(" .. s .. ")" + end + + lpeg.P(1) + )^0 + ) + + local t = setmetatableindex({ new = posit.new }, posit) + + local function calculate(s) + local new = lpegmatch(p,s) + new = load(new,nil,nil,t) + if new then + new = new() + if new then + return new + end + end + return old + end + + implement { + name = "positunum", + public = true, + arguments = "string", + actions = function(s) + local r = calculate(s) + local t = type(r) + if t == "boolean" then + context(tostring(r)) + elseif t == "string" then + context(r) + else + context("%N",posittonumber(r)) + end + end + } + + implement { + name = "ifpositunum", + public = true, + usage = "condition", + arguments = "string", + actions = function(s) + return boolean_code, calculate(s) and true or false + end, + } + +end diff --git a/tex/context/base/mkxl/cldf-pos.mkxl b/tex/context/base/mkxl/cldf-pos.mkxl new file mode 100644 index 000000000..e8868eece --- /dev/null +++ b/tex/context/base/mkxl/cldf-pos.mkxl @@ -0,0 +1,20 @@ +%D \module +%D [ file=cldf-pos, +%D version=2023.04.21, +%D title=\CONTEXT\ Data Macros, +%D subtitle=Posit, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Posit Numbers / Initialization} + +% \newcount\trialtypesettingstate % gets aliased at the Lua end + +\registerctxluafile{cldf-pos}{autosuffix} + +\endinput diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index cc8a43777..ccac058fa 100644 --- a/tex/context/base/mkxl/cont-new.mkxl +++ b/tex/context/base/mkxl/cont-new.mkxl @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2023.04.15 00:19} +\newcontextversion{2023.04.26 23:28} %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 d866f4b94..d9dc5e9d1 100644 --- a/tex/context/base/mkxl/context.mkxl +++ b/tex/context/base/mkxl/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \immutable\edef\contextformat {\jobname} -\immutable\edef\contextversion{2023.04.15 00:19} +\immutable\edef\contextversion{2023.04.26 23:28} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error @@ -104,6 +104,7 @@ \loadmkxlfile{luat-ini} \loadmkxlfile{toks-scn} +\loadmkxlfile{cldf-pos} \loadmkxlfile{syst-aux} \loadmkxlfile{syst-lua} @@ -162,7 +163,7 @@ \loadmkxlfile{node-fin} \loadmkxlfile{node-mig} -%loadmkxlfile{node-pag} +\loadmkxlfile{node-pag} \loadmkxlfile{driv-ini} % after node-ini (ext) diff --git a/tex/context/base/mkxl/driv-shp.lmt b/tex/context/base/mkxl/driv-shp.lmt index 18a12eff7..0048f4bb8 100644 --- a/tex/context/base/mkxl/driv-shp.lmt +++ b/tex/context/base/mkxl/driv-shp.lmt @@ -1804,7 +1804,7 @@ do literal = showdetails, } - callback.register("show_whatsit",function(n,what,l,tlp,l1,l2) + callbacks.register("show_whatsit",function(n,what,l,tlp,l1,l2) local s = nodes.whatsitcodes[n.subtype] if what == 1 then return s or "unknown" @@ -1815,12 +1815,10 @@ do w(n,l,tlp,l1,l2) end end - end) + end,"provide whatsit details") - local names = attributes.names + local names = attributes.names -- we show the name and number - callback.register("get_attribute",function(k,v) - return attributes.names[k], nil -- we show the name and number - end) + callbacks.register("get_attribute",function(k,v) return attributes.names[k], nil end,"provide verbose attrbute name") end diff --git a/tex/context/base/mkxl/font-chk.lmt b/tex/context/base/mkxl/font-chk.lmt index 05a3611cc..e70e9083d 100644 --- a/tex/context/base/mkxl/font-chk.lmt +++ b/tex/context/base/mkxl/font-chk.lmt @@ -487,7 +487,7 @@ do local cache = table.setmetatableindex("table") - callback.register("missing_character", function(n,f,c) + callbacks.register("missing_character", function(n,f,c) local cached = cache[f] local found = cached[c] if found == nil then @@ -530,7 +530,7 @@ do n.font = found[1] n.scale = found[2] end - end) + end,"report details about a missing character") function definers.registerfallbackfont(style,list) local l = fallbacks[style] diff --git a/tex/context/base/mkxl/font-ctx.lmt b/tex/context/base/mkxl/font-ctx.lmt index 1d59ad728..113cade52 100644 --- a/tex/context/base/mkxl/font-ctx.lmt +++ b/tex/context/base/mkxl/font-ctx.lmt @@ -1597,7 +1597,7 @@ do -- else too many locals return (define { name = name, size = size } or 0) end - callbacks.register('define_font', read, "definition of fonts (tfmdata preparation)") + callbacks.register("define_font",read,"define and/or load a font") -- here diff --git a/tex/context/base/mkxl/font-fil.mklx b/tex/context/base/mkxl/font-fil.mklx index 73348645d..89ec2f5c4 100644 --- a/tex/context/base/mkxl/font-fil.mklx +++ b/tex/context/base/mkxl/font-fil.mklx @@ -104,6 +104,11 @@ {\letcsname\??fontfile\fontclass\m_font_name\endcsname\m_font_file \normalexpanded{\font_basics_define_font_synonym_yes_opt[#spec]}} +\let\p_features \undefined +\let\p_fallbacks \undefined +\let\p_goodies \undefined +\let\p_designsize\undefined + \protected\def\font_basics_define_font_synonym_nop_opt[#specification]% {\let\p_features \undefined \let\p_fallbacks \undefined diff --git a/tex/context/base/mkxl/font-tex.lmt b/tex/context/base/mkxl/font-tex.lmt index 2d21687df..c8727de72 100644 --- a/tex/context/base/mkxl/font-tex.lmt +++ b/tex/context/base/mkxl/font-tex.lmt @@ -186,10 +186,10 @@ fonts.handlers.otf.features.register { -- fonts.helpers.registerboxglyph { category = "demo", unicode = 105 } -- fonts.helpers.registerboxglyph { category = "demo", unicode = 106 } -local callbacks = fonts.callbacks or { } -fonts.callbacks = callbacks +local fontcallbacks = fonts.callbacks or { } +fonts.callbacks = fontcallbacks -function callbacks.devirtualize(chardata,f,c) +function fontcallbacks.devirtualize(chardata,f,c) if chardata.commands then local h = node.hpack(nodes.pool.glyph(f,c)) local p = setboxdirectly(f,c,h) @@ -205,7 +205,7 @@ local function processcallback(f,c) if chardata then local callback = chardata.callback if callback then - local action = type(callback) == "function" and callback or callbacks[callback] + local action = type(callback) == "function" and callback or fontcallbacks[callback] if action then action(chardata,f,c) end @@ -213,6 +213,6 @@ local function processcallback(f,c) end end -callback.register("process_character",processcallback) +callbacks.register("process_character",processcallback,"apply an action to a character in a font") -callbacks.callback = processcallback +fontcallbacks.callback = processcallback diff --git a/tex/context/base/mkxl/lang-lab.mkxl b/tex/context/base/mkxl/lang-lab.mkxl index 6152d2874..c8dc33ccc 100644 --- a/tex/context/base/mkxl/lang-lab.mkxl +++ b/tex/context/base/mkxl/lang-lab.mkxl @@ -375,4 +375,27 @@ \permanent\protected\def\LABELTEXT#1{\WORD{\labeltext{#1}}} % only for simple cases! +%D For publications we have gender specific ones (one could use the main one for a +%D gender neutral one). +%D +%D \startbuffer +%D \startlines +%D (\labeltext {demo-texts}) +%D (\labeltexts {demo-texts}{ TEST }) +%D (\leftlabeltext {demo-texts}) +%D (\rightlabeltext{demo-texts}) +%D \stoplines +%D +%D \startlines \mainlanguage[cs] +%D test \btxlabeltext{editor} \par +%D test \btxlabeltext{editor:f} \par +%D test \btxlabeltext{editor:m} \par +%D test \btxlabeltext{editors} \par +%D test \btxlabeltext{editors:f} \par +%D test \btxlabeltext{editors:m} \par +%D \stoplines +%D \stopbuffer +%D +%D \typebuffer \getbuffer + \protect \endinput diff --git a/tex/context/base/mkxl/lpdf-lmt.lmt b/tex/context/base/mkxl/lpdf-lmt.lmt index f443632b8..7f3e53f28 100644 --- a/tex/context/base/mkxl/lpdf-lmt.lmt +++ b/tex/context/base/mkxl/lpdf-lmt.lmt @@ -38,6 +38,7 @@ local formatters, splitupstring = string.formatters, string.splitup local concat, sortedhash = table.concat, table.sortedhash local setmetatableindex = table.setmetatableindex local loaddata = io.loaddata +local ceil = math.ceil local bpfactor <const> = number.dimenfactors.bp @@ -2272,11 +2273,16 @@ end } end if xformtype == 0 or xformtype == 1 or xformtype == 3 then +-- wrapper.BBox = pdfarray { +-- -margin * bpfactor, +-- -margin * bpfactor, +-- (boundingbox[3] + margin) * bpfactor, +-- (boundingbox[4] + margin) * bpfactor, wrapper.BBox = pdfarray { - -margin * bpfactor, - -margin * bpfactor, - (boundingbox[3] + margin) * bpfactor, - (boundingbox[4] + margin) * bpfactor, + -ceil( margin * bpfactor), + -ceil( margin * bpfactor), + ceil((boundingbox[3] + margin) * bpfactor), + ceil((boundingbox[4] + margin) * bpfactor), } end if xformtype == 0 or xformtype == 2 or xformtype == 3 then diff --git a/tex/context/base/mkxl/luat-cbk.lmt b/tex/context/base/mkxl/luat-cbk.lmt index 2a3a58b04..1726f1e5a 100644 --- a/tex/context/base/mkxl/luat-cbk.lmt +++ b/tex/context/base/mkxl/luat-cbk.lmt @@ -166,12 +166,15 @@ function callbacks.known(name) end function callbacks.report() + local usage = list_callbacks() for name, _ in sortedhash(list) do local str = frozen[name] + local sta = state(name) + local use = usage[name] and "+" or "-" if str then - report_callbacks("%s: %s -> %s",state(name),name,str) + report_callbacks("%-9s : %s : %-22s -> %s",sta,use,name,str) else - report_callbacks("%s: %s",state(name),name) + report_callbacks("%-9s : %s : %-22s", sta,use,name) end end end diff --git a/tex/context/base/mkxl/luat-run.lmt b/tex/context/base/mkxl/luat-run.lmt index c53817697..7796bb4b9 100644 --- a/tex/context/base/mkxl/luat-run.lmt +++ b/tex/context/base/mkxl/luat-run.lmt @@ -156,10 +156,10 @@ appendaction(wrapupactions,"system",synctex.wrapup) -- this can be done later -callbacks.register('start_run', start_run, "actions performed at the beginning of a run") -callbacks.register('stop_run', stop_run, "actions performed at the end of a run") +callbacks.register("start_run", start_run, "actions performed at the beginning of a run") +callbacks.register("stop_run", stop_run, "actions performed at the end of a run") callbacks.register("pre_dump", pre_dump_actions, "lua related finalizers called before we dump the format") -- comes after \everydump -callbacks.register('wrapup_run', wrapup_run, "actions performed after closing files") +callbacks.register("wrapup_run", wrapup_run, "actions performed after closing files") -- an example: @@ -201,8 +201,6 @@ local report_open = logs.reporter("open source") local report_close = logs.reporter("close source") local report_load = logs.reporter("load resource") -local register = callbacks.register - local level = 0 local total = 0 local stack = { } @@ -219,56 +217,49 @@ function luatex.currenttotal() return total end +local enabled = true directives.register("system.reportfiles", function(v) enabled = v end) + local function report_start(name,rest) - if rest then - -- luatex - if name ~= 1 then + if enabled then + if rest then + -- luatex + if name ~= 1 then + insert(stack,false) + return + end + name = rest + end + if find(name,"virtual://",1,true) then insert(stack,false) - return + else + insert(stack,name) + total = total + 1 + level = level + 1 + -- report_open("%i > %i > %s",level,total,name or "?") + report_open("level %i, order %i, name %a",level,total,name or "?") + synctex.setfilename(name) end - name = rest - end - if find(name,"virtual://",1,true) then - insert(stack,false) - else - insert(stack,name) - total = total + 1 - level = level + 1 - -- report_open("%i > %i > %s",level,total,name or "?") - report_open("level %i, order %i, name %a",level,total,name or "?") - synctex.setfilename(name) end end local function report_stop() - local name = remove(stack) - if name then - -- report_close("%i > %i > %s",level,total,name or "?") - report_close("level %i, order %i, name %a",level,total,name or "?") - level = level - 1 - name = stack[#stack] --- synctex.setfilename(stack[#stack] or tex.jobname) + if enabled then + local name = remove(stack) if name then - synctex.setfilename(name) + -- report_close("%i > %i > %s",level,total,name or "?") + report_close("level %i, order %i, name %a",level,total,name or "?") + level = level - 1 + name = stack[#stack] + -- synctex.setfilename(stack[#stack] or tex.jobname) + if name then + synctex.setfilename(name) + end end end end -local function report_none() -end - -register("start_file",report_start) -register("stop_file", report_stop) - -directives.register("system.reportfiles", function(v) - if v then - register("start_file",report_start) - register("stop_file", report_stop) - else - register("start_file",report_none) - register("stop_file", report_none) - end -end) +callbacks.register("start_file",report_start,"report opening of a file") +callbacks.register("stop_file", report_stop, "report closing of a file") -- start_run doesn't work @@ -281,7 +272,7 @@ end) local report = logs.reporter("csname overload") local reported = { } -callback.register("handle_overload", function(fatal,overload,csname,flags) +callbacks.register("handle_overload", function(fatal,overload,csname,flags) if not reported[csname] then logs.newline() local readstate = status.readstate @@ -303,7 +294,7 @@ callback.register("handle_overload", function(fatal,overload,csname,flags) osexit(1) end end -end) +end,"handle primitive and macro overload protection") -- bonus diff --git a/tex/context/base/mkxl/lxml-ini.mkxl b/tex/context/base/mkxl/lxml-ini.mkxl index be249c1f3..a185efd12 100644 --- a/tex/context/base/mkxl/lxml-ini.mkxl +++ b/tex/context/base/mkxl/lxml-ini.mkxl @@ -83,7 +83,7 @@ \immutable\def\xmltempbuffername{xml-temp} \permanent\protected\def\prettyprintbuffer#1#2% only used here - {\ifdefined\scitebuffer + {\ifdefined\scitebuffer % we could predefine to relax \scitebuffer[#2][#1]% \else \typebuffer[#1][\c!option=#2]% diff --git a/tex/context/base/mkxl/math-acc.mklx b/tex/context/base/mkxl/math-acc.mklx index 8c5a1adfa..2201ed886 100644 --- a/tex/context/base/mkxl/math-acc.mklx +++ b/tex/context/base/mkxl/math-acc.mklx @@ -61,6 +61,20 @@ % \switchtobodyfont[termes] \getbuffer\par % \stop %TEXpage +% scale: +% +% no : only use base +% yes : use base, variants and extensible, stretch and shrink when set +% keep : use base, variants and extensible, stretch and shrink when set, but keep base +% +% alignsymbol: +% +% center when accent is wider than base +% +% stretch|shrink: +% +% scale accent to fit (base and variants depending on 'scale' value) + \installcorenamespace{mathaccents} \installcommandhandler \??mathaccents {mathaccent} \??mathaccents @@ -72,7 +86,10 @@ \c!bottom=, \c!mathstyle=, \c!color=, - \c!stretch=\v!no, + \c!scale=\v!no, + \c!alignsymbol=\v!yes, + %\c!stretch=\v!no, + %\c!shrink=\v!no, \c!define=\v!yes] % not used \definemathaccent @@ -135,20 +152,37 @@ \setlocalmathaccentcurrent{#class}% \edef\currentmathaccent{#class}% \startusemathstyleparameter\mathaccentparameter\c!mathstyle \setupcurrentmathaccent[#settings]% - \edef\m_fixed {\ifcstok{\mathaccentparameter\c!stretch}\v!yes \else\s!fixed \space\fi}% - \edef\m_center{\ifcstok{\mathaccentparameter\c!align }\v!middle \s!center\space\fi}% + \edef\p_scale{\mathaccentparameter\c!scale}% + \ifx\p_scale\v!keep + \lettonothing\m_fixed + \orelse\ifx\p_scale\v!yes + \lettonothing\m_fixed + \else + \let\m_fixed\s!fixed + \fi \Umathaccent \usedcolorparameterattributes{\mathaccentparameter\c!color}% - % nooverflow % there is never na overflow anyway but we do accept thekey - \m_center + % nooverflow % there is never na overflow anyway but we do accept the key + \ifcstok{\mathaccentparameter\c!align }\v!middle\s!center \space\fi + \ifcstok{\mathaccentparameter\c!stretch}\v!yes \s!stretch\space\fi + \ifcstok{\mathaccentparameter\c!shrink }\v!yes \s!shrink \space\fi + \ifx\p_scale\v!keep + \s!keepbase\space + \fi + \ifcstok{\mathaccentparameter\c!alignsymbol}\v!yes + \s!nooverflow\space + \fi \ifcase#kind\or - top \m_fixed + \s!top\space + \m_fixed \fam\zerocount#top \or - bottom \m_fixed + \s!bottom\space + \m_fixed \fam\zerocount#bottom \or - both \m_fixed + \s!both\space + \m_fixed \fam\zerocount#bottom \fam\zerocount#top \fi @@ -175,7 +209,7 @@ \pushoverloadmode % These retain the given unicode values ... but can stretch when configured -% to do so: \setupmathaccent[\v!top][\c!stretch=\v!yes] +% to do so: \setupmathaccent[\v!top][\c!scale=\v!yes] % Extended/modified below % @@ -229,17 +263,17 @@ \definemathaccent [\v!top:\v!stretch] [\v!top] - [\c!stretch=\v!yes] + [\c!scale=\v!keep,\c!stretch=\v!yes,\c!shrink=\v!yes] \definemathaccent [\v!bottom:\v!stretch] [\v!bottom] - [\c!stretch=\v!yes] + [\c!scale=\v!keep,\c!stretch=\v!yes,\c!shrink=\v!yes] \definemathaccent [\v!both:\v!stretch] [\v!both] - [\c!stretch=\v!yes] + [\c!scale=\v!keep,\c!stretch=\v!yes,\c!shrink=\v!yes] %D We have a problem. We can use stackers but then we need to adapt the dimensions %D which is font dependent. So, for now we keep them as accents. diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt index f6fd5dab5..ee9e56f8f 100644 --- a/tex/context/base/mkxl/math-act.lmt +++ b/tex/context/base/mkxl/math-act.lmt @@ -433,6 +433,8 @@ local detail do return nxt end end + elseif list == "flataccent" then + return c.flataccent end end end @@ -1951,6 +1953,7 @@ do } local rrp = { + newprivateslot("radical rule left piece"), newprivateslot("radical rule middle piece"), newprivateslot("radical rule right piece"), } @@ -1968,14 +1971,21 @@ do parameters = { } end if parts then + what = copytable(what) parts = copytable(parts) - local xscale = parameters.xscale or 1 - local yscale = parameters.yscale or 1 - local mheight = minus.height - local height = (parameters.height or 1) * mheight - local yshift = (parameters.yoffset or 0) * mheight + local xscale = parameters.xscale or 1 -- why not applied to width ? + local yscale = parameters.yscale or 1 + local mwidth = minus.width + local mheight = minus.height + local height = (parameters.height or 1) * mheight + local yshift = (parameters.yoffset or 0) * mheight + local loverlap = parameters.leftoverlap or 0 + local roverlap = parameters.rightoverlap or 0 + local loffset = parameters.leftoffset or 0 + local roffset = parameters.rightoffset or 0 if skipfirst then - table.remove(parts,1) + remove(parts,1) + remove(what,1) end height = height / 2 yshift = yshift + height @@ -1985,36 +1995,46 @@ do local gdata = characters[glyph] local width = gdata.width local xshift = 0 - if i == 1 and parameters.leftoffset then - xshift = (parameters.leftoffset) * width + if i == 1 and loverlap ~= 0 then + xshift = loverlap * width width = width - xshift - elseif i == #parts and parameters.rightoffset then - width = (1 + parameters.rightoffset) * width + elseif i == #parts and roverlap ~= 0 then + width = width + roverlap * width end characters[what[i]] = { height = height, depth = height, width = width, + advance = gdata.width, commands = { leftcommand[xshift], downcommand[yshift], --- slotcommand[0][glyph], { "slot", 0, glyph, xscale, yscale }, }, } +if part["start"] >= width then + part["start"] = width +end +if part["end"] >= width then + part["end"] = width +end +part.advance = width part.glyph = what[i] - part.advance = width end + xshift = loffset * mwidth + loverlap * mwidth + width = mwidth - xshift - roffset * mwidth - roverlap * mwidth characters[unicode] = { + -- base character height = height, depth = height, - width = advance, + width = width, commands = { + leftcommand[xshift], downcommand[yshift], --- slotcommand[0][0x2212], { "slot", 0, 0x2212, xscale, yscale }, }, unicode = tounicode or unicode, + -- extensibles parts = parts, partsorientation = "horizontal", } @@ -2065,6 +2085,7 @@ do commands = { leftcommand[lshift], slotcommand[0][glyph], +-- { "offset", lshift, 0, glyph }, }, } part.glyph = what[i] @@ -2085,9 +2106,11 @@ do leftcommand[lshift], slotcommand[0][unicode], pop, +-- { "offset", lshift, 0, unicode }, }, }) - local step = width/2 +-- local step = width/2 + local step = .8*width minus.parts = { { extender = 0, glyph = p_normal, ["end"] = step, start = 0, advance = width }, { extender = 1, glyph = p_normal, ["end"] = step, start = step, advance = width }, @@ -2111,7 +2134,13 @@ do useminus(target,fbe,characters,fraction,false,frp,0x2044) -- division slash end if radical then - useminus(target,rbe,characters,radical,true,rrp,0x2061) -- apply function +if not characters[rbe] then + local skipfirst = true + if radical.skipfirst == false then -- explicit + skipfirst = false + end + useminus(target,rbe,characters,radical,skipfirst,rrp,0x2061) -- apply function +end end if stacker then useminus(target,0x203E,characters,stacker,false,frp) @@ -2739,15 +2768,31 @@ end if width == 0 then local d = chardata[data.unicode or unicode] local c = d and d.category - if c == "mn" then + if c == "mn" or c == "sk" or c == "lm" then -- we can probably can go local b = target.descriptions[unicode].boundingbox if b then - local llx = b[1] * factor - local urx = b[3] * factor - width = urx - llx + local topanchor = data.topanchor or 0 + local llx = b[1] * factor + local urx = b[3] * factor +-- if topanchor < 0 then +if true then + -- width = - topanchor + width = 2 * (topanchor - llx) +-- data.commands = { +-- -- rightcommand[width+width/2], +-- rightcommand[-llx], +-- slotcommand[0][unicode] +-- } +data.xoffset = -llx +else + width = urx - llx + -- data.advance = urx + data.commands = { + leftcommand[llx], + slotcommand[0][unicode] + } +end data.width = width - data.xoffset = - llx - data.advance = urx data.topanchor = width/2 data.bottomanchor = width/2 end @@ -2826,20 +2871,33 @@ end local force = parameters.force local squeeze = parameters.squeeze or 0.85 local ofactor = parameters.offset or (squeeze/8.5) - local hfactor = parameters.height or (1 - ofactor) + local hfactor = parameters.height or 0.95 -- (1 - ofactor) local done = false for stretching, entry in sortedhash(mapping) do - local code = stretching - local last = characters[stretching] + local code = stretching + local last = characters[stretching] while last do if force or not last.flataccent then local slot = nps(f_flat(code)) - local data = copytable(last) - local height = data.height or 0 - data.effect = { squeeze = squeeze } - data.height = hfactor * height - data.yoffset = ofactor * height - characters[slot] = data + local height = last.height or 0 +-- print(last.width/65536,code,slot) +-- data.effect = { squeeze = squeeze } +characters[slot] = { + width = last.width, + depth = last.depth, + height = last.height * hfactor, + topanchor = last.topanchor, + bottomanchor = last.bottomanchor, + commands = { { "offset", 0, ofactor * height, code, 1, squeeze } }, +-- commands = { slotcommand[0][code] }, +-- effect = { squeeze = squeeze }, +-- next = last.next, + unicode = last.unicode, +} +-- if code == 770 then +-- inspect(last) +-- end + last.flataccent = slot if not trace_tweaking then done = true @@ -2874,7 +2932,8 @@ end height = stretchingdata.height, depth = stretchingdata.depth, next = stretchingdata.next, - commands = { charcommand[stretching] }, +-- commands = { charcommand[stretching] }, + commands = stretchingdata.commands or { charcommand[stretching] }, topanchor = stretchingdata.topanchor, -- unicode = stretching, -- when we alias to combiners unicode = alias, -- when we keep the original @@ -2892,6 +2951,34 @@ end feedback_tweak("copyaccents",target,original,done) end + function mathtweaks.keepbases(target,original,parameters) + local characters = target.characters + local done = false + local list = parameters.list + if list == "default" then + list = sortedkeys(mapping) + end + if list and #list > 0 then + for i=1,#list do -- assumes sorting + local unicode = list[i] + local chardata = characters[unicode] + if chardata then + chardata.keepbase = true + if not trace_tweaking then + done = true + elseif done then + done[unicode] = true + else + done = { [unicode] = true } + end + end + end + else + -- maybe also hash + end + feedback_tweak("keepbases",target,original,done) + end + end do @@ -3782,7 +3869,7 @@ do end end - -- there is no real need for thios but let's play nice with memory anyway + -- there is no real need for this but let's play nice with memory anyway local efindex = 0 local effects = setmetatableindex (function (t,k) diff --git a/tex/context/base/mkxl/math-ali.mkxl b/tex/context/base/mkxl/math-ali.mkxl index b90bad174..7b61fd234 100644 --- a/tex/context/base/mkxl/math-ali.mkxl +++ b/tex/context/base/mkxl/math-ali.mkxl @@ -938,13 +938,18 @@ \def\math_cases_NC_two {\ifmmode\stopimath\fi} -\def\math_cases_TC_zero +\def\math_cases_TC_zero % needs checking + %{\ifmmode\else\startimath\fi} {} \def\math_cases_TC_one {\ifmmode\stopimath\fi \aligntab} +\def\math_cases_TC_two + %{\ifmmode\stopimath\fi} % needs checking + {} + \permanent\protected\def\math_cases_NC {\ifcase\c_math_cases_nc \expandafter\math_cases_NC_zero @@ -1268,6 +1273,7 @@ \newconditional\c_math_matrix_first \newconstant \c_math_matrix_anchor_mode +\newconditional\c_math_matrix_sl_seen % enabled : 1 % left/both : 2 @@ -1502,7 +1508,7 @@ \protected\def\math_matrix_horizontal_rule_indeed#1#2% {\math_matrix_check_rule[#2]% \global\setfalse\c_math_matrix_first - \global\settrue\c_math_matrix_sl_seen + \global\settrue \c_math_matrix_sl_seen \enablematrixrules \leaders#1% \s!attr \mathalignmenthruleattribute\plusone @@ -2886,6 +2892,8 @@ {\unskip \strc_formulas_place_number_nested{#1}{#2}\crcr} +\aliased\let\math_align_strut\relax + \permanent\tolerant\protected\def\math_simplealign_start[#1]#*[#2]% {\begingroup \edef\currentmathsimplealign{#1}% diff --git a/tex/context/base/mkxl/math-def.mkxl b/tex/context/base/mkxl/math-def.mkxl index b2b8d776f..3e4d724ae 100644 --- a/tex/context/base/mkxl/math-def.mkxl +++ b/tex/context/base/mkxl/math-def.mkxl @@ -46,6 +46,9 @@ \definemathfunction [deg] \definemathfunction [det] [\c!mathlimits=\v!yes] \definemathfunction [dim] +\definemathfunction [erf] +\definemathfunction [erfc] +\definemathfunction [erfi] \definemathfunction [exp] \definemathfunction [gcd] [\c!mathlimits=\v!yes] \definemathfunction [hom] @@ -185,8 +188,7 @@ \permanent\protected\def\amedian {\csname \ifcsname\currentmainlanguage:amedian\endcsname - \currentmainlanguage\else - \s!en + \currentmainlanguage\else\s!en \fi :amedian% \endcsname} diff --git a/tex/context/base/mkxl/math-dif.mkxl b/tex/context/base/mkxl/math-dif.mkxl index ad53ee25a..4c1117726 100644 --- a/tex/context/base/mkxl/math-dif.mkxl +++ b/tex/context/base/mkxl/math-dif.mkxl @@ -19,8 +19,8 @@ % For new times sake: - \let\normal_math_dd\dd - \let\normal_math_DD\DD + \ifdefined\dd \aliased\let\normal_math_dd\dd \else \lettonothing\normal_math_dd \fi + \ifdefined\DD \aliased\let\normal_math_DD\DD \else \lettonothing\normal_math_DD \fi \def\c!differentiald{differentiald} % for now diff --git a/tex/context/base/mkxl/math-fen.mkxl b/tex/context/base/mkxl/math-fen.mkxl index a01f589e5..53c34c567 100644 --- a/tex/context/base/mkxl/math-fen.mkxl +++ b/tex/context/base/mkxl/math-fen.mkxl @@ -305,6 +305,9 @@ \directsetup{math:fence:set:bar} \stopsetups +\mutable\lettonothing\suchthat +% \fastsetup{math:fence:set} + \protected\def\math_fenced_middle_common {\math_fenced_middle} % redefined inside atom @@ -717,6 +720,10 @@ % \im { \left\{ \frac{1}{2} \right\} } % \im { \left\lbrace \frac{1}{2} \right\rbrace } +\lettonothing\math_fenced_x_p_left +\lettonothing\math_fenced_x_p_right +\lettonothing\math_fenced_x_p_middle + \def\math_fenced_x_left {\advanceby\c_math_fence_nesting\plusone \ifx\math_fenced_x_p_left\bgroup\let\math_fenced_x_p_left\letterleftbrace\fi @@ -1046,7 +1053,7 @@ \let\math_fences_normal_left \left \let\math_fences_normal_right \right \let\math_fences_normal_middle\middle -\let\math_fences_normal_both \leftorright +\let\math_fences_normal_both \relax % undefined \protected\def\math_fences_auto_left #1{\c_attr_mathautofence\plusone #1\c_attr_mathautofence\attributeunsetvalue} \protected\def\math_fences_auto_right #1{\c_attr_mathautofence\plustwo #1\c_attr_mathautofence\attributeunsetvalue} @@ -1219,6 +1226,8 @@ {\let\math_fenced_trace\math_fenced_trace_indeed} {\let\math_fenced_trace\donothing} +\mutable\integerdef\c_math_fence_level\minusone + \appendtoks \integerdef\c_math_fence_level\minusone \c_math_fence_nesting\zerocount diff --git a/tex/context/base/mkxl/math-fnt.lmt b/tex/context/base/mkxl/math-fnt.lmt index 7e2c0c75c..87dfe16e5 100644 --- a/tex/context/base/mkxl/math-fnt.lmt +++ b/tex/context/base/mkxl/math-fnt.lmt @@ -54,100 +54,100 @@ local cache = setmetatableindex(function(t,width) return v end) +local enabled = "vertical" directives.register("math.extensibles", function(v) enabled = v end) -- default per 2022-08-25 + local function register_extensible(font,char,style,box) - -- We don't share (yet)! - local fontdata = chardata[font] - local oldchar = fontdata[char] - if oldchar and oldchar.keepvirtual then - -- for now, needed for iwona etc - return nil - else - local bx = tonut(box) - -- actually we don't want colors and such so if we do finalize we - -- should be more selctive: --- updaters.apply("tagging.state.disable") --- nodes.handlers.finalizelist(bx) --- updaters.apply("tagging.state.enable") - 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 oldcommands = oldchar.oldcommands - local newcommands = oldchar.commands - if oldcommands then - oldchar.commands = oldcommands - end - -- - local p = fonts.hashes.parameters[font] - local sx = round(1000/p.extendfactor) - local sy = round(1000/p.squeezefactor) - -- we saved a scaled glyph stream so we now use an unscaled one ... horrible hack: - if sx ~= 1000 then - wd = wd * 7200/7227 - end - if sy ~= 1000 then - ht = ht * 7200/7227 - dp = dp * 7200/7227 - end - -- - -- local private = fonts.helpers.setboxdirectly(font,unicode,box) - local private = cache[wd][ht][dp][font][unicode] - if not private then - private = fonts.helpers.setboxdirectly(font,unicode,box) - cache[wd][ht][dp][font][unicode] = private - end - local glyph = new_glyph(font,private,al) - nuts.setscales(glyph,1000,sx,sy) - -- - -- if fonts.hashes.properties[font].compactmath then - -- nuts.setscales(g,1000,1000,1000) - -- end - -- - -- nasty, testcase: bold math sqrt extensible - -- - local n = new_hlist(glyph) - -- - if newcommands then - oldchar.commands = newcommands - end - -- - -- local newchar = { - -- unicode = unicode, - -- width = wd, - -- height = ht, - -- depth = dp, - -- } - -- local p = oldchar.vparts - -- if p then - -- local first = fontdata[p[#p].glyph] - -- local last = fontdata[p[ 1].glyph] - -- if first then - -- newchar.topleft = first.topleft - -- newchar.topright = first.topright - -- end - -- if last then - -- newchar.bottomleft = last.bottomleft - -- newchar.bottomright = last.bottomright - -- end - -- end - -- addcharacters(font, { [private] = newchar }) - -- so the dimensions of the box don't match the glyph scale! - setwhd(n,wd,ht,dp) - setattrlst(n,al) - if id == vlist_code then - n = new_vlist(n) + if enabled then + -- We don't share (yet)! + 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 + local bx = tonut(box) + -- actually we don't want colors and such so if we do finalize we + -- should be more selctive: + -- updaters.apply("tagging.state.disable") + -- nodes.handlers.finalizelist(bx) + -- updaters.apply("tagging.state.enable") + 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 oldcommands = oldchar.oldcommands + local newcommands = oldchar.commands + if oldcommands then + oldchar.commands = oldcommands + end + -- + local p = fonts.hashes.parameters[font] + local sx = round(1000/p.extendfactor) + local sy = round(1000/p.squeezefactor) + -- we saved a scaled glyph stream so we now use an unscaled one ... horrible hack: + if sx ~= 1000 then + wd = wd * 7200/7227 + end + if sy ~= 1000 then + ht = ht * 7200/7227 + dp = dp * 7200/7227 + end + -- + -- local private = fonts.helpers.setboxdirectly(font,unicode,box) + local private = cache[wd][ht][dp][font][unicode] + if not private then + private = fonts.helpers.setboxdirectly(font,unicode,box) + cache[wd][ht][dp][font][unicode] = private + end + local glyph = new_glyph(font,private,al) + nuts.setscales(glyph,1000,sx,sy) + -- + -- if fonts.hashes.properties[font].compactmath then + -- nuts.setscales(g,1000,1000,1000) + -- end + -- + -- nasty, testcase: bold math sqrt extensible + -- + local n = new_hlist(glyph) + -- + if newcommands then + oldchar.commands = newcommands + end + -- + -- local newchar = { + -- unicode = unicode, + -- width = wd, + -- height = ht, + -- depth = dp, + -- } + -- local p = oldchar.vparts + -- if p then + -- local first = fontdata[p[#p].glyph] + -- local last = fontdata[p[ 1].glyph] + -- if first then + -- newchar.topleft = first.topleft + -- newchar.topright = first.topright + -- end + -- if last then + -- newchar.bottomleft = last.bottomleft + -- newchar.bottomright = last.bottomright + -- end + -- end + -- addcharacters(font, { [private] = newchar }) + -- so the dimensions of the box don't match the glyph scale! setwhd(n,wd,ht,dp) setattrlst(n,al) + if id == vlist_code then + n = new_vlist(n) + setwhd(n,wd,ht,dp) + setattrlst(n,al) + end + return tonode(n) end - return tonode(n) end end -directives.register("math.extensibles", function(v) - callback.register("register_extensible", v and register_extensible or nil) -end) - --- Default per 2022-08-25 - -callback.register("register_extensible", register_extensible) +callbacks.register("register_extensible",register_extensible,"register math extensible construct") diff --git a/tex/context/base/mkxl/math-frc.mkxl b/tex/context/base/mkxl/math-frc.mkxl index 5c1eab8dd..7e6f7c5ce 100644 --- a/tex/context/base/mkxl/math-frc.mkxl +++ b/tex/context/base/mkxl/math-frc.mkxl @@ -110,7 +110,7 @@ \setupmathfractions [\c!rule=\v!symbol, - \c!middle=\fractionbarextenderuc] + \c!symbol=\fractionbarextenderuc] \appendtoks \instance\frozen\protected\edefcsname\currentmathfraction\endcsname{\math_frac{\currentmathfraction}}% @@ -311,15 +311,23 @@ {\edef\p_method {\mathfractionparameter\c!method}% \edef\p_rule {\mathfractionparameter\c!rule}% \edef\p_thickness{\mathfractionparameter\c!rulethickness}% - \scratchcounterone \mathfractionparameter\c!left \relax - \scratchcountertwo \mathfractionparameter\c!right \relax - \scratchcounterthree \mathfractionparameter\c!middle \relax + \scratchcounterone \mathfractionparameter\c!left \relax + \scratchcountertwo \mathfractionparameter\c!right \relax + \scratchcounterthree + \ifx\p_method\v!horizontal + \mathfractionparameter\c!middle + \orelse\ifx\p_method\v!line + \mathfractionparameter\c!middle + \else + \mathfractionparameter\c!symbol + \fi + \relax \ifcsname \??fractionmethods \p_method \ifx\p_method\v!horizontal \orelse\ifx\p_method\v!line - \orelse\ifcsname\??fractionmethods\p_method\p_rule\endcsname + \orelse\ifcsname\??fractionmethods\p_method\p_rule\endcsname % \v!vertical \p_rule \else \v!auto diff --git a/tex/context/base/mkxl/math-ini.lmt b/tex/context/base/mkxl/math-ini.lmt index f26f24c93..904b98d79 100644 --- a/tex/context/base/mkxl/math-ini.lmt +++ b/tex/context/base/mkxl/math-ini.lmt @@ -169,12 +169,11 @@ do local fontchardata = fonts.hashes.characters local f_dictionary = false - local register = callback.register local whatdetail = "all" local function trace(n,properties,group,index,font,char) -- local properties, group, index, font, char = nodes.nuts.getchardict(nodes.nuts.tonut(n)) - if properties ~= 0 or group ~= 0 or index ~= 0 then + if whatdetail and (properties ~= 0 or group ~= 0 or index ~= 0) then local char = fontchardata[font][char] if char or whatdetail == "all" then local unicode = char and char.unicode @@ -199,16 +198,9 @@ do end end - trackers.register("math.dictionaries",function(v) - whatdetail = v - if whatdetail then - register("get_math_dictionary",trace) - else - register("get_math_dictionary") - end - end) + trackers.register("math.dictionaries",function(v) whatdetail = v end) - register("get_math_dictionary",trace) + callbacks.register("get_math_dictionary",trace,"provide math dictionary details") -- This is experimental and a prelude to the long pending "relate math rendering to -- some field" wish. In TeX characters and symbols are grouped by class but that is @@ -410,7 +402,7 @@ classes["all"] = specialclasses["all"] classnames[specialclasses["all"] ] classes["begin"] = specialclasses["begin"] classnames[specialclasses["begin"]] = "beg" classes["end"] = specialclasses["end"] classnames[specialclasses["end"] ] = "end" -callback.register("get_noad_class", function(n) return classnames[n] end) +callbacks.register("get_noad_class", function(n) return classnames[n] end,"provide math class name") local function registerprivateclass(name,parent) local class = parent and classes[parent] or classes[name] diff --git a/tex/context/base/mkxl/math-noa.lmt b/tex/context/base/mkxl/math-noa.lmt index ef75ac4c4..cbcf6164d 100644 --- a/tex/context/base/mkxl/math-noa.lmt +++ b/tex/context/base/mkxl/math-noa.lmt @@ -2983,7 +2983,7 @@ function processors.mlisttohlist(head,style,penalties,beginclass,endclass,level) return head end -callbacks.register('mlist_to_hlist',processors.mlisttohlist,"preprocessing math list") +callbacks.register("mlist_to_hlist",processors.mlisttohlist,"convert a noad list into a node list") -- tracing diff --git a/tex/context/base/mkxl/math-stc.mklx b/tex/context/base/mkxl/math-stc.mklx index 5a701426a..1e488af2c 100644 --- a/tex/context/base/mkxl/math-stc.mklx +++ b/tex/context/base/mkxl/math-stc.mklx @@ -1022,7 +1022,7 @@ \immutable\protected\def\normaldoublebrace {\Umathaccent \s!both \zerocount \zerocount "23DE \zerocount \zerocount "23DF } \immutable\protected\def\normaldoubleparent{\Umathaccent \s!both \zerocount \zerocount "23DC \zerocount \zerocount "23DD } -% let's keep this +% let's keep this .. some are not defined so there's nothing normal \aliased\let\normaloverbrace \overbrace \aliased\let\normalunderbrace \underbrace @@ -1030,10 +1030,11 @@ \aliased\let\normalunderparent \underparent \aliased\let\normaloverbracket \overbracket \aliased\let\normalunderbracket \underbracket -\aliased\let\normalunderleftarrow \underleftarrow -\aliased\let\normaloverleftarrow \overleftarrow -\aliased\let\normalunderrightarrow\underrightarrow -\aliased\let\normaloverrightarrow \overrightarrow + +%aliased\let\normalunderleftarrow \underleftarrow +%aliased\let\normaloverleftarrow \overleftarrow +%aliased\let\normalunderrightarrow\underrightarrow +%aliased\let\normaloverrightarrow \overrightarrow %D Here come the new ones: diff --git a/tex/context/base/mkxl/math-ttv.lmt b/tex/context/base/mkxl/math-ttv.lmt index 06d92e8b9..3484d6c80 100644 --- a/tex/context/base/mkxl/math-ttv.lmt +++ b/tex/context/base/mkxl/math-ttv.lmt @@ -130,6 +130,7 @@ mathencodings["tex-ex"] = { mathencodings["tex-mr"] = { [0x00393] = 0x00, -- Gamma [0x00394] = 0x01, -- Delta + [0x02206] = 0x01, -- Laplace [0x00398] = 0x02, -- Theta [0x0039B] = 0x03, -- Lambda [0x0039E] = 0x04, -- Xi @@ -486,7 +487,8 @@ mathencodings["tex-sy"] = { [0x02240] = 0x6F, -- wr [0x0221A] = 0x70, -- sqrt. AM: Check surd?? [0x02A3F] = 0x71, -- amalg - [0x1D6FB] = 0x72, -- nabla + [0x02207] = 0x72, -- nabla (upright) + [0x1D6FB] = 0x72, -- nabla (italic) -- [0x0222B] = 0x73, -- smallint (TODO: what about intop?) [0x02294] = 0x74, -- sqcup [0x02293] = 0x75, -- sqcap diff --git a/tex/context/base/mkxl/math-vfu.lmt b/tex/context/base/mkxl/math-vfu.lmt index 237b39d9f..c29e16766 100644 --- a/tex/context/base/mkxl/math-vfu.lmt +++ b/tex/context/base/mkxl/math-vfu.lmt @@ -880,7 +880,7 @@ local function virtualize(s,uni,fci,skewchar,move,mathparameters,unicode,paramet end end -function vfmath.define(specification,set,goodies) +function vfmath.define(specification,virtual,goodies) local name = specification.name -- symbolic name local size = specification.size -- given size local loaded = { } @@ -891,8 +891,9 @@ function vfmath.define(specification,set,goodies) local okset = { } local n = 0 local f_extra = formatters["virtual.extra.%05X"] - for s=1,#set do - local ss = set[s] + local setlist = virtual.recipe or virtual + for s=1,#setlist do + local ss = setlist[s] local ssname = ss.name if add_optional and ss.optional then if trace_virtual then @@ -906,6 +907,8 @@ function vfmath.define(specification,set,goodies) main = s end local alreadyloaded = names[ssname] -- for px we load one twice (saves .04 sec) +-- local sshash = name .. ":" .. ssname +-- local alreadyloaded = names[sshash] -- for px we load one twice (saves .04 sec) local f, id if alreadyloaded then f, id = alreadyloaded.f, alreadyloaded.id @@ -915,6 +918,7 @@ function vfmath.define(specification,set,goodies) else f, id = fonts.constructors.readanddefine(ssname,size) names[ssname] = { +-- names[sshash] = { f = f, id = id, fontname = ssname, -- diagnostics @@ -1212,9 +1216,32 @@ function vfmath.define(specification,set,goodies) fontname = name, -- diagnostics } -- - local addmissing = goodies.mathematics.addmissing - if type(addmissing) == "function" then - addmissing(main) + local virtualtweaks = virtual.tweaks + if virtualtweaks then + -- + local mathtweaks = mathematics.tweaks + local knowntweaks = { + addmissing = function(main,specification) + local action = specification.action + if action then + action(main,specification) -- source == target + end + end + } + -- + for i=1,#virtualtweaks do + local specification = virtualtweaks[i] + local tweak = specification.tweak + local action = knowntweaks[tweak] + if action then + action(main,specification) + else + action = mathtweaks[tweak] + if action then + action(main,main,specification) + end + end + end end -- mathematics.addfallbacks(main) @@ -1227,27 +1254,6 @@ function vfmath.define(specification,set,goodies) main.MathConstants = main.mathconstants main.nomath = false -- - mathematics.tweaks.setoptions(main,main,{ - tweak = "setoptions", - set = { "ignorekerndimensions" } - }) -- we have dp > ht fences - -- - mathematics.tweaks.fixprimes(main, main, { - tweak = "fixprimes", - factor = 1, -- accent base height - fake = 0.9, -- replace multiples with this width proportion - }) - -- - mathematics.tweaks.addequals(main, main, { - tweak = "addequals", - force = true, - }) - -- --- mathematics.tweaks.addbars(main,main,{ --- tweak = "addbars", --- advance = 0.52, --- }) - -- if trace_virtual or trace_timings then report_virtual("loading and virtualizing font %a at size %p took %0.3f seconds",name,size,os.clock()-start) end diff --git a/tex/context/base/mkxl/meta-imp-kaktovik.mkxl b/tex/context/base/mkxl/meta-imp-kaktovik.mkxl new file mode 100644 index 000000000..40e9f826c --- /dev/null +++ b/tex/context/base/mkxl/meta-imp-kaktovik.mkxl @@ -0,0 +1,251 @@ +%D \module +%D [ file=meta-imp-kaktovik, +%D version=2023.04.18, +%D title=\METAPOST\ Graphics, +%D subtitle=Kaktovik Numbers, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Just a quick hack for Hraban (after a post on the mailing list). + +\startMPcalculation{simplefun} + + path kaktovik_glyphs[] ; + + def InitializeKaktovik = + + save p, d, u ; + + pair p[] ; numeric d ; d := .1 ; numeric u ; u := .15 ; + + % d := getparameterdefault "mpsfont" "d" .10 ; + % u := getparameterdefault "mpsfont" "u" .15 ; + + p[0] := (0,1) ; + p[1] := (1,0) ; + p[2] := (2,1 - d) ; + p[3] := (3,0) ; + p[4] := (4,1 - 2d) ; + + p[5] := (4,1 + u) ; + p[6] := (0,1 + 2u) ; + p[7] := (4,1 + 4u) ; + + kaktovik_glyphs[0] := (1,1) { right } .. { left } (2,1/2) { left } .. { right } (3,1); + + for i= 1 upto 4 : + kaktovik_glyphs[i] := p[0] for j=1 upto i : -- p[j] endfor ; + endfor ; + + kaktovik_glyphs[ 5] := p[5] -- p[0] ; for i= 6 upto 9 : kaktovik_glyphs[i] := p[5] -- kaktovik_glyphs[i-5] ; endfor ; + kaktovik_glyphs[10] := p[6] -- kaktovik_glyphs[ 5] ; for i=11 upto 14 : kaktovik_glyphs[i] := p[6] -- kaktovik_glyphs[i-5] ; endfor ; + kaktovik_glyphs[15] := p[7] -- kaktovik_glyphs[10] ; for i=16 upto 19 : kaktovik_glyphs[i] := p[7] -- kaktovik_glyphs[i-5] ; endfor ; + + enddef ; + + vardef Kaktovik(expr i) = + draw image ( + draw kaktovik_glyphs[i] + xscaled (10/20 -1/20) + yscaled (25/20 -2/20) + withpen (pencircle xscaled 1/20 yscaled 5/20) rotated -(2*20) + % withpen (pencircle xscaled 1/40 yscaled 5/40) rotated -(2*20) + % withpen (pencircle xscaled 2.5/40 yscaled 5/40) rotated -(2*20) + ; + ) shifted (2/20,2/20) + enddef ; + + lmt_registerglyphs [ + name = "kaktovik", + units = 2, + usecolor = true, + width = 2, + height = 2, + depth = 0, + preamble = "InitializeKaktovik" + ] ; + + for i=0 upto 19 : + lmt_registerglyph [ + category = "kaktovik", + unicode = 119488 + i, % "0x1D2C0" + code = "Kaktovik(" & decimal i & ")" + ] ; + endfor ; + +\stopMPcalculation + +\startluacode + local kaktovik = moduledata.kaktovik or { } + moduledata.kaktovik = kaktovik + + local tonumber = tonumber + local load = load + local reverse = table.reverse + local utfchar = utf.char + local gsub = string.gsub + local concat = table.concat + local utfvalues = string.utfvalues + local lpegmatch = lpeg.match + + function kaktovik.tointeger(s) + local n = 0 + for b in utfvalues(s) do + local k = b - 0x1D2C0 + n = n * 20 + k + end + return n + end + +-- function kaktovik.tostring(n) +-- local digits = { } +-- local count = 1 +-- while true do +-- digits[count] = utfchar(0x1D2C0 + (n % 20)) +-- n = n // 20 +-- if n == 0 then +-- break; +-- end +-- count = count + 1 +-- end +-- return concat(reverse(digits)) +-- end + + local f = string.formatters["%N"] + + function kaktovik.tostring(n) + if n >= 0 and n <= 19 then + return utfchar(0x1D2C0 + n) + else + -- no need to optimize + local result = gsub(f(n),"(%d+)",function(s) + local digits = { } + local count = 1 + local n = tonumber(s) + while true do + digits[count] = utfchar(0x1D2C0 + (n % 20)) + n = n // 20 + if n == 0 then + break; + end + count = count + 1 + end + return concat(reverse(digits)) + end) + return result + end + end + + do + + local k = { } + local n = 0 + for i=0x1D2C0,0x1D2C0+19 do + k[utf.char(i)] = n + n = n + 1 + end + + local p = lpeg.Cs ( + lpeg.Cc("return ") + * ( + lpeg.utfchartabletopattern(k) / k + + lpeg.P(1) + )^0 + ) + + local t = setmetatable({ },{ __index = math }) + + function kaktovik.calculate(old) + local new = lpegmatch(p,old) + if new then + new = load(new,nil,nil,t) + if type(new) == "function" then + new = new() + if new then + return new + end + end + end + return old + end + + end + + interfaces.implement { + name = "kaktoviknumerals", + arguments = "integer", + actions = { kaktovik.tostring, context } + } + interfaces.implement { + name = "kaktovikcalculate", + public = true, + arguments = "string", + actions = { kaktovik.calculate, kaktovik.tostring, context } + } +\stopluacode + +\unprotect + +\permanent\def\kaktoviknumerals#1{\clf_kaktoviknumerals\numexpr#1\relax} + +\defineconversion [kaktoviknumerals] [\kaktoviknumerals] +\defineconversion [K] [\kaktoviknumerals] + +\definefontfeature + [kaktovik] + [metapost=kaktovik] + +\protect + +\continueifinputfile{meta-imp-kaktovik.mkxl} + +\definefontfeature + [default] + [default] + [metapost=kaktovik] +% [metapost={category=kaktovik,u=.25,d=.20,x=}] + +\setupbodyfont[dejavu] + +% \nopdfcompression + +\startTEXpage[offset=1ts,width=3es] + + \start + \showglyphs + KAKTOVIK + \dostepwiserecurse{0}{19}{1}{\kaktoviknumerals{#1}\space } + \stop + + kaktovik \start + \red\glyphxscale 700 + \dostepwiserecurse{0}{19}{1}{\kaktoviknumerals{#1}\space } + \stop + + \startitemize[packed,K][color=orange,stopper=] + \startitem first \stopitem + \startitem second \stopitem + \startitem third \stopitem + \stopitemize + + KAKTOVIK \start + \red \kaktoviknumerals{2023} -- + \green\kaktoviknumerals{4} -- + \blue \kaktoviknumerals{18} + \stop + + KAKTOVIK + + 𝋂 + 𝋂 = \kaktovikcalculate{𝋂 + 𝋂} = \kaktoviknumerals{4} + + \protected\def\ForWilli#1{#1 = \kaktovikcalculate{#1}} + + \ForWilli{(𝋂 + 𝋂) ^ (𝋂 + 𝋂)} + + \ForWilli{(sin ( 𝋂𝋓 ) )} +\stopTEXpage diff --git a/tex/context/base/mkxl/meta-imp-threesix.mkxl b/tex/context/base/mkxl/meta-imp-threesix.mkxl index 56a400b45..872d0b3e8 100644 --- a/tex/context/base/mkxl/meta-imp-threesix.mkxl +++ b/tex/context/base/mkxl/meta-imp-threesix.mkxl @@ -56,6 +56,15 @@ ["X"] = [[1111001110 1111000110 0001101000 0000110000 0000110000 0001011000 0110001111 0111001111]], ["Y"] = [[111100011 111100011 011000010 001110100 000111000 000011000 001111110 001111110]], ["Z"] = [[11111111 10000111 00001110 00011100 00111000 01110000 11100001 11111111]], + + [","] = [[0000 0000 0000 0000 0000 0011 0111 0111]], + [";"] = [[0011 0011 0011 0000 0000 0011 0111 0111]], + ["."] = [[0000 0000 0000 0000 0000 0111 0111 0111]], + [":"] = [[0111 0111 0111 0000 0000 0111 0111 0111]], + ["!"] = [[0111 0111 0111 0111 0111 0000 0111 0111]], + ["?"] = [[11111 10111 00111 01110 01110 00000 01110 01110]], + + [utf.char(0xAD)] = [[00000 00000 00000 11111 11111 00000 00000 00000]], -- hyphen } local f_code = string.formatters["ThreeSix(%s);"] @@ -206,41 +215,24 @@ [metapost={category=fontthreesix,shape=diamond,color=random,pen=fancy,spread=.1,random=yes}] \definefont[DEKFontA][Serif*fontthreesix-color @ 200pt] -\definefont[DEKFontB][Serif*fontthreesix-color @ 60pt] +\definefont[DEKFontB][Serif*fontthreesix-color @ 12pt] % Or course: -\startTEXpage +\startTEXpage[offset=1dk] \DEKFontA TEX \stopTEXpage -\startTEXpage +\startTEXpage[offset=1dk] \DEKFontA T\kern-0.05em\lower.75\exheight\hbox{E}\kern-.05emX \stopTEXpage -% One of the \CONTEXT\ 2020 posters (inspired by NewYork State AC's press -% conferences as these keywords apply quite well to the audience of the -% meeting): - -% \startTEXpage[align={lohi,middle,nothyphenated},offset=20pt] -% \offinterlineskip \vskip10pt -% \DEKFontA T\kern-0.05em\lower.75\exheight\hbox{E}\kern-.05emX \vskip60pt -% \DEKFontB TOUGH \vskip20pt -% SMART \vskip20pt -% UNITED \vskip20pt -% DISCIPLINED \vskip20pt -% LOVING \vskip10pt -% \stopTEXpage - -\startpagemakeup - \setupalign[middle,nothyphenated] - \offinterlineskip \vfil\vfil - \DEKFontA T\kern-0.05em\lower.75\exheight\hbox{E}\kern-.05emX \vfil\vfil\vfil - \DEKFontB TOUGH \vfil - SMART \vfil - UNITED \vfil - DISCIPLINED \vfil - LOVING \vfil -\stoppagemakeup +% We only have uppercase characters! But I added a few punctuation symbols so that +% we can do the following. Actually we can consider lowercase to be just smaller and +% another shape. + +\startTEXpage[offset=1dk,align=flushleft,foregroundstyle=\DEKFontB] + \WORD{\input{knuth}} +\stopTEXpage \stoptext diff --git a/tex/context/base/mkxl/meta-ini.mkxl b/tex/context/base/mkxl/meta-ini.mkxl index 16b97e8cc..c5d86e2af 100644 --- a/tex/context/base/mkxl/meta-ini.mkxl +++ b/tex/context/base/mkxl/meta-ini.mkxl @@ -211,6 +211,7 @@ \defineMPinstance[doublefun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!double] \defineMPinstance[binaryfun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!binary] \defineMPinstance[decimalfun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!decimal] +\defineMPinstance[positfun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!posit] \defineMPinstance[mprun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes] diff --git a/tex/context/base/mkxl/mlib-run.lmt b/tex/context/base/mkxl/mlib-run.lmt index de5ceb1db..dc71eefab 100644 --- a/tex/context/base/mkxl/mlib-run.lmt +++ b/tex/context/base/mkxl/mlib-run.lmt @@ -152,6 +152,7 @@ local methods = { -- binary = "binary", binary = "double", decimal = "decimal", + posit = "posit", default = "scaled", } diff --git a/tex/context/base/mkxl/mult-sys.mkxl b/tex/context/base/mkxl/mult-sys.mkxl index 47119ad20..b0df8703b 100644 --- a/tex/context/base/mkxl/mult-sys.mkxl +++ b/tex/context/base/mkxl/mult-sys.mkxl @@ -257,6 +257,7 @@ \definesystemconstant {italic} %definesystemconstant {it} \definesystemconstant {itemgroupcolumns} +\definesystemconstant {keepbase} \definesystemconstant {kernpairs} \definesystemconstant {language} \definesystemconstant {lcgreek} @@ -312,6 +313,7 @@ \definesystemconstant {noheight} \definesystemconstant {nomath} \definesystemconstant {none} +\definesystemconstant {nooverflow} \definesystemconstant {noskips} \definesystemconstant {normal} \definesystemconstant {Normal} @@ -333,6 +335,7 @@ \definesystemconstant {pickup} \definesystemconstant {plural} \definesystemconstant {plus} +\definesystemconstant {posit} %definesystemconstant {pt} \definesystemconstant {realpage} \definesystemconstant {register} @@ -375,6 +378,7 @@ \definesystemconstant {setup} \definesystemconstant {set} \definesystemconstant {themaintextcolor} +\definesystemconstant {shrink} \definesystemconstant {simple} \definesystemconstant {Simple} \definesystemconstant {single} @@ -395,6 +399,7 @@ \definesystemconstant {ss} \definesystemconstant {start} \definesystemconstant {stop} +\definesystemconstant {stretch} \definesystemconstant {subpage} \definesystemconstant {subtype} \definesystemconstant {sub} diff --git a/tex/context/base/mkxl/node-pag.mkxl b/tex/context/base/mkxl/node-pag.mkxl new file mode 100644 index 000000000..970939dcf --- /dev/null +++ b/tex/context/base/mkxl/node-pag.mkxl @@ -0,0 +1,20 @@ +%D \module +%D [ file=node-pag, +%D version=2008.09.30, +%D title=\CONTEXT\ Node Macros, +%D subtitle=Page Building, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Node Macros / Page Building} + +\unprotect + +\registerctxluafile{node-pag}{} + +\protect \endinput diff --git a/tex/context/base/mkxl/node-tsk.lmt b/tex/context/base/mkxl/node-tsk.lmt index c4871b568..edc435836 100644 --- a/tex/context/base/mkxl/node-tsk.lmt +++ b/tex/context/base/mkxl/node-tsk.lmt @@ -1016,6 +1016,56 @@ nonut = [[ -- } -- } +tasks.new { + name = "pagebuilders", + processor = nodeprocessor, + sequence = { + "before", -- for users + "normalizers", + "after", -- for users + }, + templates = { + +default = [[ +return function(head) + return head +end +]], + +process = [[ +local tonut = nodes.tonut +local tonode = nodes.nuts.tonode + +%localize% + +return function(head,groupcode,size,packtype,maxdepth,direction) + local nuthead = tonut(head) + +%actions% + return tonode(nuthead) +end +]], + +step = [[ + nuthead = tonut((%action%(tonode(nuthead),groupcode,size,packtype,maxdepth,direction))) +]], + +nut = [[ + nuthead = %action%(nuthead,groupcode,size,packtype,maxdepth,direction) +]], + +nohead = [[ + %action%(tonode(nuthead),groupcode,size,packtype,maxdepth,direction) +]], + +nonut = [[ + %action%(nuthead,groupcode,size,packtype,maxdepth,direction) +]], + + } + +} + -- for now quite useless (too fuzzy) -- -- tasks.new { @@ -1135,3 +1185,106 @@ nonut = [[ } } + +-- -- quality -- -- + +tasks.new { + name = "hquality", + processor = nodeprocessor, + sequence = { + "before", -- for users + "system", + "after", -- for users + }, + templates = { + +default = [[ +return function(how,detail,nod,first,last,filename) + -- nil +end +]], + +process = [[ +local tonut = nodes.tonut +local tonode = nodes.nuts.tonode + +%localize% + +return function(how,detail,nod,first,last,filename) + local nut = tonut(nod) + local rul = nil + +%actions% + + return rul and tonode(rul) +end +]], + +step = [[ + rul = tonut((%action%(how,detail,nod,first,last,filename,rul and tonode(rul)))) +]], + +nut = [[ + rul = %action%(how,detail,nut,first,last,filename,rul) +]], + +nohead = [[ + %action%(how,detail,nod,first,last,filename,rul and tonode(rul)) +]], + +nonut = [[ + %action%(how,detail,nut,first,last,filename,rul) +]], + + } +} + +tasks.new { + name = "vquality", + processor = nodeprocessor, + sequence = { + "before", -- for users + "system", + "after", -- for users + }, + templates = { + +default = [[ +return function(how,detail,nod,first,last,filename) + -- nil +end +]], + +process = [[ +local tonut = nodes.tonut +local tonode = nodes.nuts.tonode + +%localize% + +return function(how,detail,nod,first,last,filename) + local nut = tonut(nod) + local rul = nil + +%actions% + return rul and tonode(rul) +end +]], + +step = [[ + rul = tonut((%action%(how,detail,nod,first,last,filename,tonode(rul)))) +]], + +nut = [[ + rul = %action%(how,detail,nut,first,last,filename,rul) +]], + +nohead = [[ + %action%(how,detail,nod,first,last,filename,rul and tonode(rul)) +]], + +nonut = [[ + %action%(how,detail,nut,first,last,filename,rul) +]], + + } +} diff --git a/tex/context/base/mkxl/pack-box.mkxl b/tex/context/base/mkxl/pack-box.mkxl index 5a66d3945..ea270f88b 100644 --- a/tex/context/base/mkxl/pack-box.mkxl +++ b/tex/context/base/mkxl/pack-box.mkxl @@ -1165,6 +1165,8 @@ \fi \endgroup} +\mutable\lettonothing\currentanchorbox + \permanent\tolerant\protected\def\setanchorbox[#1]#*[#2]% {\begingroup \dowithnextbox diff --git a/tex/context/base/mkxl/pack-com.mkxl b/tex/context/base/mkxl/pack-com.mkxl index 0fff4ca1b..e07e0ff8d 100644 --- a/tex/context/base/mkxl/pack-com.mkxl +++ b/tex/context/base/mkxl/pack-com.mkxl @@ -501,17 +501,24 @@ \def\pack_combinations_caption_second {\ifx\nexttoken\egroup % the caption is empty - \orelse\ifx\nexttoken\stopcaption + \orelse\ifx\nexttoken\stopcaption % language % the caption is empty (new per 2014-05-24) + \orelse\ifx\nexttoken\pack_combinations_float_hack_b + % make sure we honor empty captions (new per 2023-04-20) \else % todo: \p_pack_combinations_alternative\v!none: no style, strut etc \hsize\wd\b_pack_combinations_content \usealignparameter\combinationparameter \usecombinationstyleandcolor\c!style\c!color \bgroup - \aftergroup\endstrut - \aftergroup\egroup - \begstrut + \ifcstok{\combinationparameter\c!strut}\v!no + % make sure we have empty captions (new per 2023-04-20) + \aftergroup\egroup + \else + \aftergroup\endstrut + \aftergroup\egroup + \begstrut + \fi \fi} \def\pack_combinations_pickup_package_pair % we need to store the caption row @@ -624,6 +631,10 @@ %D %D \typebuffer \getbuffer +\definecombination + [\v!float] +% [\c!strut=\v!no] % not needed, we intercept anyway + \protected\def\pack_combinations_float_hack_a#1% {\strc_floats_build_box_separate_split{#1}% \box\b_strc_floats_separate_content} @@ -657,7 +668,8 @@ {\pack_combinations_float_hack_b{\recurselevel}}% \to\scratchtoks}% brrr \let\pack_combinations_check_x_y\pack_combinations_float_check_x_y - \normalexpanded{\startcombination[#1]\the\scratchtoks}\stopcombination + % \normalexpanded{\startcombination[#1]\the\scratchtoks}\stopcombination + \normalexpanded{\startcombination[\v!float][#1]\the\scratchtoks}\stopcombination \resetlocalfloats \egroup} diff --git a/tex/context/base/mkxl/pack-lyr.mkxl b/tex/context/base/mkxl/pack-lyr.mkxl index b93d32960..cc4a7381f 100644 --- a/tex/context/base/mkxl/pack-lyr.mkxl +++ b/tex/context/base/mkxl/pack-lyr.mkxl @@ -97,35 +97,35 @@ \permanent\def\layeranchor{\currentlayer:\the\realpageno} +\lettonothing\m_pack_layers_anchor +\lettonothing\m_pack_layers_page +\lettonothing\m_pack_layers_region +\lettonothing\m_pack_layers_target +\lettonothing\p_pack_layers_column +\lettonothing\p_pack_layers_corner +\lettonothing\p_pack_layers_direction \lettonothing\p_pack_layers_doublesided -\lettonothing\p_pack_layers_state -\lettonothing\p_pack_layers_option +\lettonothing\p_pack_layers_dx +\lettonothing\p_pack_layers_dy +\lettonothing\p_pack_layers_height +\lettonothing\p_pack_layers_hoffset +\lettonothing\p_pack_layers_line +\lettonothing\p_pack_layers_location \lettonothing\p_pack_layers_method +\lettonothing\p_pack_layers_offset +\lettonothing\p_pack_layers_option +\lettonothing\p_pack_layers_position \lettonothing\p_pack_layers_preset +\lettonothing\p_pack_layers_region +\lettonothing\p_pack_layers_repeat \lettonothing\p_pack_layers_rotation -\lettonothing\p_pack_layers_position -\lettonothing\p_pack_layers_hoffset -\lettonothing\p_pack_layers_voffset -\lettonothing\p_pack_layers_offset -\lettonothing\p_pack_layers_dx -\lettonothing\p_pack_layers_dy +\lettonothing\p_pack_layers_state \lettonothing\p_pack_layers_sx \lettonothing\p_pack_layers_sy +\lettonothing\p_pack_layers_voffset +\lettonothing\p_pack_layers_width \lettonothing\p_pack_layers_x \lettonothing\p_pack_layers_y -\lettonothing\p_pack_layers_corner -\lettonothing\p_pack_layers_location -\lettonothing\p_pack_layers_line -\lettonothing\p_pack_layers_column -\lettonothing\p_pack_layers_width -\lettonothing\p_pack_layers_height -\lettonothing\p_pack_layers_direction -\lettonothing\p_pack_layers_region - -\lettonothing\m_pack_layers_page -\lettonothing\m_pack_layers_target -\lettonothing\m_pack_layers_region -\lettonothing\m_pack_layers_anchor \newconditional\c_pack_layers_repeated \newconditional\c_pack_layers_trace diff --git a/tex/context/base/mkxl/pack-rul.mkxl b/tex/context/base/mkxl/pack-rul.mkxl index 36b4fc7b0..1daa8bcf7 100644 --- a/tex/context/base/mkxl/pack-rul.mkxl +++ b/tex/context/base/mkxl/pack-rul.mkxl @@ -237,30 +237,34 @@ %newdimen \d_framed_linewidth \aliased\let \ruledlinewidth\d_framed_linewidth % needed at lua end \newdimension\d_framed_linewidth \aliasdimension\ruledlinewidth\d_framed_linewidth % needed at lua end -\lettonothing\p_framed_frame % \framedparameter\c!frame -\lettonothing\p_framed_backgroundoffset -\lettonothing\p_framed_foregroundstyle -\lettonothing\p_framed_autostrut -\lettonothing\p_framed_location -\lettonothing\p_framed_orientation +\lettonothing\p_frame +\lettonothing\p_framed_adaptive \lettonothing\p_framed_anchoring -\lettonothing\p_framed_synchronize +\lettonothing\p_framed_autostrut \lettonothing\p_framed_autowidth -\lettonothing\p_framed_franalyze +\lettonothing\p_framed_background +\lettonothing\p_framed_backgroundcolor \lettonothing\p_framed_backgroundcorner +\lettonothing\p_framed_backgroundoffset \lettonothing\p_framed_backgroundradius +\lettonothing\p_framed_component +\lettonothing\p_framed_empty +\lettonothing\p_framed_foregroundcolor +\lettonothing\p_framed_foregroundstyle +\lettonothing\p_framed_frame % \framedparameter\c!frame +\lettonothing\p_framed_framecolor \lettonothing\p_framed_framecorner \lettonothing\p_framed_frameradius +\lettonothing\p_framed_franalyze \lettonothing\p_framed_lines -\lettonothing\p_framed_empty -\lettonothing\p_framed_backgroundcolor -\lettonothing\p_framed_framecolor -\lettonothing\p_framed_component -\lettonothing\p_framed_background +\lettonothing\p_framed_location +\lettonothing\p_framed_minheight +\lettonothing\p_framed_orientation \lettonothing\p_framed_rulethickness -\lettonothing\p_framed_foregroundcolor \lettonothing\p_framed_setups \lettonothing\p_framed_synchronize +\lettonothing\p_framed_text_depthcorrection +\lettonothing\p_framed_text_strut %D We don't have to stick to a \TEX\ drawn rule, but also can use rounded %D or even fancier shapes, as we will see later on. diff --git a/tex/context/base/mkxl/page-flt.mkxl b/tex/context/base/mkxl/page-flt.mkxl index ae2bd4cf8..fb6996264 100644 --- a/tex/context/base/mkxl/page-flt.mkxl +++ b/tex/context/base/mkxl/page-flt.mkxl @@ -297,7 +297,31 @@ \newtoks\everybeforeflushedpagefloat -\def\page_floats_flush_page_floats_indeed#1% future releases can do more clever things +\let\m_page_otr_checked_page_float\relax + +\newconditional\c_page_floats_flushed + +% \def\page_floats_flush_page_floats_indeed#1% future releases can do more clever things +% {\page_floats_flush{#1}\plusone +% \edef\floatspecification{\clf_getfloatvariable{specification}}% Is this okay? +% \the\everybeforeflushedpagefloat +% \vpack to \textheight +% {\doifnotinset\v!high\floatspecification\vfill +% \box\floatbox +% \doifnotinset\v!low\floatspecification\vfill}% +% \page_otr_fill_and_eject_page} + +% \protected\def\page_floats_flush_page_floats % used in postpone +% {\edef\m_page_otr_checked_page_float{\clf_checkedpagefloat}% +% \ifempty\m_page_otr_checked_page_float +% % nothing +% \orelse\ifx\m_page_otr_checked_page_float\v!empty +% \emptyhbox \page_otr_fill_and_eject_page % why not dummy_page +% \else +% \page_floats_flush_page_floats_indeed\m_page_otr_checked_page_float +% \fi} + +\def\page_floats_flush_page_floats_inject#1% future releases can do more clever things {\page_floats_flush{#1}\plusone \edef\floatspecification{\clf_getfloatvariable{specification}}% Is this okay? \the\everybeforeflushedpagefloat @@ -305,18 +329,26 @@ {\doifnotinset\v!high\floatspecification\vfill \box\floatbox \doifnotinset\v!low\floatspecification\vfill}% - \page_otr_fill_and_eject_page} - -\let\m_page_otr_checked_page_float\relax + % \page_otr_fill_and_eject_page + \global\settrue\c_page_floats_flushed} \protected\def\page_floats_flush_page_floats % used in postpone + {\global\setfalse\c_page_floats_flushed + \page_floats_flush_page_floats_indeed + \ifconditional\c_page_floats_flushed + \page_otr_fill_and_eject_page + \fi} + +\protected\def\page_floats_flush_page_floats_indeed % used in postpone {\edef\m_page_otr_checked_page_float{\clf_checkedpagefloat}% \ifempty\m_page_otr_checked_page_float % nothing \orelse\ifx\m_page_otr_checked_page_float\v!empty \emptyhbox \page_otr_fill_and_eject_page % why not dummy_page + \expandafter\page_floats_flush_page_floats \else - \page_floats_flush_page_floats_indeed\m_page_otr_checked_page_float + \page_floats_flush_page_floats_inject\m_page_otr_checked_page_float + \expandafter\page_floats_flush_page_floats \fi} % temp hack, needed to prevent floatbox being forgotten during diff --git a/tex/context/base/mkxl/page-imp.mkxl b/tex/context/base/mkxl/page-imp.mkxl index 00a0430e6..4c192c554 100644 --- a/tex/context/base/mkxl/page-imp.mkxl +++ b/tex/context/base/mkxl/page-imp.mkxl @@ -1264,7 +1264,7 @@ % % \starttext \dorecurse{30}{test \recurselevel \page} \stoptext -\permanent\protected\protected\def\pusharrangedpageXY#1% +\permanent\protected\def\pusharrangedpageXY#1% {\advancearrangedpageN \global\advanceby\arrangedpageM\plusone \reportarrangedpage\arrangedpageN @@ -1300,7 +1300,7 @@ \poparrangedpages \fi} -\permanent\protected\protected\def\poparrangedpagesXY +\permanent\protected\def\poparrangedpagesXY {\ifnum\arrangedpageN>\zerocount \paperwidth \arrangedpageX\paperwidth \paperheight\arrangedpageY\paperheight diff --git a/tex/context/base/mkxl/page-inj.mklx b/tex/context/base/mkxl/page-inj.mklx index 02f853c55..2e245fd8b 100644 --- a/tex/context/base/mkxl/page-inj.mklx +++ b/tex/context/base/mkxl/page-inj.mklx @@ -32,6 +32,12 @@ \let\page_boxes_flush_before\clf_flushpageinjectionsbefore \let\page_boxes_flush_after \clf_flushpageinjectionsafter +\lettonothing\p_page_injections_delay +\lettonothing\p_page_injections_n +\lettonothing\p_page_injections_page +\lettonothing\p_page_injections_pagestate +\lettonothing\p_page_injections_state + \def\page_injections_flush_indeed {\begingroup \setbox\scratchbox\normalhpack diff --git a/tex/context/base/mkxl/page-mbk.mklx b/tex/context/base/mkxl/page-mbk.mklx index 57c23abc6..3dc1c4e7c 100644 --- a/tex/context/base/mkxl/page-mbk.mklx +++ b/tex/context/base/mkxl/page-mbk.mklx @@ -75,12 +75,16 @@ \setfalse\c_page_margin_blocks_enabled +\let\page_margin_blocks_stop_block\relax + \permanent\tolerant\protected\def\startmarginblock[#tag]% {\begingroup \edef\currentmarginblock{#tag}% - \doifelse{\marginblockparameter\c!state}\v!start - \page_margin_blocks_start_block_yes - \page_margin_blocks_start_block_nop} + \ifcstok{\marginblockparameter\c!state}\v!start + \expandafter\page_margin_blocks_start_block_yes + \else + \expandafter\page_margin_blocks_start_block_nop + \fi} \permanent\protected\def\stopmarginblock {\page_margin_blocks_stop_block diff --git a/tex/context/base/mkxl/phys-dim.mkxl b/tex/context/base/mkxl/phys-dim.mkxl index 2dc6e7e1e..e085ba844 100644 --- a/tex/context/base/mkxl/phys-dim.mkxl +++ b/tex/context/base/mkxl/phys-dim.mkxl @@ -531,10 +531,10 @@ \permanent\protected\def\unitsR #1#2{% todo: tagging \ifmmode #2% - \orelse\ifnum#1=\plusone + \orelse\ifnum#1=\plusone % why this test if we do the same in both cases \digitstextbinop{#2}% before and after \else - \digitstextbinnop{#2}% after + \digitstextbinop{#2}% after \fi \c_phys_units_state\zerocount \setfalse\c_phys_units_dospace diff --git a/tex/context/base/mkxl/publ-ini.mkxl b/tex/context/base/mkxl/publ-ini.mkxl index 802768a8c..f120c55fb 100644 --- a/tex/context/base/mkxl/publ-ini.mkxl +++ b/tex/context/base/mkxl/publ-ini.mkxl @@ -876,6 +876,7 @@ ignored {\btxrenderingparameter\c!ignore}% group {\btxrenderingparameter\c!group}% filter {\btxrenderingparameter\c!filter}% + filename {\btxrenderingparameter\c!file}% for now \relax \ifnum\nofbtxlistentries>\zerocount \clf_btxpreparelistentries{\currentbtxdataset}% could be put in collect @@ -1155,7 +1156,7 @@ {\the\t_btx_reference_inject \strc_lists_inject_direct % todo: make like \btx_list_reference_inject_now with { } [\s!btx]% - [\c!type=\s!btx]% \c!location=\v!none + [\c!type=\s!btx,\c!location=\v!here]% [\ifx\currentbtxdataset\v!default\else\s!btxset=\currentbtxdataset,\fi% \s!btxref=\currentbtxtag,% %\ifempty\currentbtxcombis \else\s!btxcom={\currentbtxcombis},\fi% diff --git a/tex/context/base/mkxl/scrn-fld.mklx b/tex/context/base/mkxl/scrn-fld.mklx index d5dadcb78..e3bde47c6 100644 --- a/tex/context/base/mkxl/scrn-fld.mklx +++ b/tex/context/base/mkxl/scrn-fld.mklx @@ -274,7 +274,7 @@ %D A few testing macros (expandable for historic reasons): -\permanent\def\doifelsefieldbody #tag{\clf_doifelsefield{#tag}} +\permanent\def\doifelsefieldbody #tag{\clf_doifelsefieldset{#tag}} \permanent\def\doifelsefieldcategory#tag{\clf_doifelsefieldcategory{#tag}} \aliased\let\doiffieldbodyelse \doifelsefieldbody diff --git a/tex/context/base/mkxl/scrn-ref.lmt b/tex/context/base/mkxl/scrn-ref.lmt index be298e2d1..43c3a0276 100644 --- a/tex/context/base/mkxl/scrn-ref.lmt +++ b/tex/context/base/mkxl/scrn-ref.lmt @@ -51,7 +51,26 @@ function references.setclosepageaction(close) end end -implement { name = "setopendocumentaction", arguments = "string", actions = references.setopendocumentaction } -implement { name = "setclosedocumentaction", arguments = "string", actions = references.setclosedocumentaction } -implement { name = "setopenpageaction", arguments = "string", actions = references.setopenpageaction } -implement { name = "setclosepageaction", arguments = "string", actions = references.setclosepageaction } +implement { + name = "setopendocumentaction", + arguments = "string", + actions = references.setopendocumentaction +} + +implement { + name = "setclosedocumentaction", + arguments = "string", + actions = references.setclosedocumentaction +} + +implement { + name = "setopenpageaction", + arguments = "string", + actions = references.setopenpageaction +} + +implement { + name = "setclosepageaction", + arguments = "string", + actions = references.setclosepageaction +} diff --git a/tex/context/base/mkxl/spac-ali.mkxl b/tex/context/base/mkxl/spac-ali.mkxl index f5b0e2fb8..9d9feab9b 100644 --- a/tex/context/base/mkxl/spac-ali.mkxl +++ b/tex/context/base/mkxl/spac-ali.mkxl @@ -1325,4 +1325,17 @@ \permanent\protected\def\spaceorpar{\endgraf\ifhmode\space\fi} +%D Kind of documenting: +%D +%D \starttyping +%D \disabletrackers[builders.hpack.quality] % enabled by default +%D \enabletrackers[builders.hpack.collect] +%D \enabletrackers[builders.hpack.overflow] +%D +%D \starttext +%D {\hsize 4cm \input tufte \par} \page +%D {\hsize 8cm \input tufte \par} \page +%D \stoptext +%D \stoptyping + \protect \endinput diff --git a/tex/context/base/mkxl/spac-hor.mkxl b/tex/context/base/mkxl/spac-hor.mkxl index 3c4fd1eb4..ab15e7a6e 100644 --- a/tex/context/base/mkxl/spac-hor.mkxl +++ b/tex/context/base/mkxl/spac-hor.mkxl @@ -269,9 +269,15 @@ \aliased\let\dorechecknextindentation\relax % public (in macros) -\permanent\protected\protected\def\spac_indentation_check_next_indentation +% \permanent\protected\def\spac_indentation_check_next_indentation +% {\global\enforced\let\dorechecknextindentation\relax +% \doifelsenextchar\par\donothing\spac_indentation_variant_no} % messy check as next is seldom \par + +\permanent\protected\def\spac_indentation_check_next_indentation {\global\enforced\let\dorechecknextindentation\relax - \doifelsenextchar\par\donothing\spac_indentation_variant_no} % messy check as next is seldom \par + \begingroup + \autoparagraphmode\zerocount + \doifelsenextchar\par\endgroup{\endgroup\spac_indentation_variant_no}} % messy check as next is seldom \par \def\spac_indentation_variant_auto {\global\enforced\let\dorechecknextindentation\spac_indentation_check_next_indentation} diff --git a/tex/context/base/mkxl/strc-doc.mkxl b/tex/context/base/mkxl/strc-doc.mkxl index 11c96f9c1..e85d222c2 100644 --- a/tex/context/base/mkxl/strc-doc.mkxl +++ b/tex/context/base/mkxl/strc-doc.mkxl @@ -47,6 +47,7 @@ \mutable\lettonothing\currentstructurecomponentbookmark \mutable\lettonothing\currentstructurecomponentcatcodes \mutable\lettonothing\currentstructurecomponentcoding +\mutable\lettonothing\currentstructurecomponentcounter \mutable\lettonothing\currentstructurecomponentexpansion \mutable\lettonothing\currentstructurecomponentlabel \mutable\lettonothing\currentstructurecomponentlevel diff --git a/tex/context/base/mkxl/strc-flt.mklx b/tex/context/base/mkxl/strc-flt.mklx index c96fb02d0..b3f33734e 100644 --- a/tex/context/base/mkxl/strc-flt.mklx +++ b/tex/context/base/mkxl/strc-flt.mklx @@ -742,7 +742,7 @@ \edef\p_location {\floatcaptionparameter\c!location}% \edef\p_topoffset {\floatcaptionparameter\c!topoffset}% \edef\p_bottomoffset{\floatcaptionparameter\c!bottomoffset}% - \edef\P_freeregion {\floatcaptionparameter\c!freeregion}% + \edef\p_freeregion {\floatcaptionparameter\c!freeregion}% % preset \resetfloatcaptionparameter \c!location \setexpandedfloatcaptionparameter\c!topoffset {\floatparameter\c!topoffset}% @@ -778,7 +778,7 @@ \letfloatcaptionparameter\c!location \p_location \letfloatcaptionparameter\c!topoffset \p_topoffset \letfloatcaptionparameter\c!bottomoffset\p_bottomoffset - \letfloatcaptionparameter\c!freeregion \P_freeregion + \letfloatcaptionparameter\c!freeregion \p_freeregion % \strc_floats_analyze_location \doifelseinset\v!split\floatlocation\strc_floats_place_next_box_split\strc_floats_place_next_box_normal diff --git a/tex/context/base/mkxl/strc-itm.mklx b/tex/context/base/mkxl/strc-itm.mklx index 737580a27..a7dda8fdd 100644 --- a/tex/context/base/mkxl/strc-itm.mklx +++ b/tex/context/base/mkxl/strc-itm.mklx @@ -1325,7 +1325,7 @@ \strc_itemgroups_stop_head_indeed \strc_itemgroups_head_body_indeed} -\protected\permanent\def\stopitemgrouphead +\permanent\protected\def\stopitemgrouphead {\dostoptagged \stopitemgroupitem} diff --git a/tex/context/base/mkxl/strc-lst.mklx b/tex/context/base/mkxl/strc-lst.mklx index dd9f1fb4d..3fd0e979e 100644 --- a/tex/context/base/mkxl/strc-lst.mklx +++ b/tex/context/base/mkxl/strc-lst.mklx @@ -1257,8 +1257,8 @@ \noindent % otherwise annotations are mirrored up \typo_injectors_mark_list \hbox \strc_lists_get_reference_attribute\v!all \strc_lists_get_destination_attribute { - \letlistparameter \c!depth\zeropoint - \resettlistparameter\c!color + \letlistparameter \c!depth\zeropoint + \resetlistparameter\c!color \inheritedlistframed { \letinteractionparameter\c!strut\v!no % still needed? \strc_lists_set_style_color\c!style\c!color\v!all diff --git a/tex/context/base/mkxl/strc-mar.lmt b/tex/context/base/mkxl/strc-mar.lmt index e5266daf0..61972009c 100644 --- a/tex/context/base/mkxl/strc-mar.lmt +++ b/tex/context/base/mkxl/strc-mar.lmt @@ -109,7 +109,7 @@ implement { } implement { - name = "getsynchronizedmarking", + name = "getsynchronizemarking", arguments = { "integer", "string", "string" }, actions = function(class,category,what) local category, n = lpegmatch(pattern,category) @@ -136,7 +136,7 @@ implement { } implement { - name = "resetsynchronizedmarking", + name = "resetsynchronizemarking", arguments = "argument", actions = function(category) local category, n = lpegmatch(pattern,category) diff --git a/tex/context/base/mkxl/strc-mar.mkxl b/tex/context/base/mkxl/strc-mar.mkxl index 4c279f6dd..6dbb0e207 100644 --- a/tex/context/base/mkxl/strc-mar.mkxl +++ b/tex/context/base/mkxl/strc-mar.mkxl @@ -169,7 +169,7 @@ \ifcstok{#2}\v!page \markingcommand{#1}{\csname\??markingfilter#3\endcsname{#1}}% \else - \markingcommand{#1}{\clf_getsynchronizedmarking\begincsname\??markingclass#1\endcsname{#2}{#3}}% + \markingcommand{#1}{\clf_getsynchronizemarking\begincsname\??markingclass#1\endcsname{#2}{#3}}% \fi \orelse\ifparameter#2\or \markingcommand{#1}{\csname\??markingfilter#2\endcsname{#1}}% @@ -208,7 +208,7 @@ \ifcstok{#2}\v!page \markingcommand{#1}{\begincsname\??markingfilter#3\endcsname{#1}}% \else - \markingcommand{#1}{\clf_getsynchronizedmarking{#1}{#2}}% + \markingcommand{#1}{\clf_getsynchronizemarking{#1}{#2}}% \fi \fi \fi} @@ -221,9 +221,9 @@ \markingseparator{#1}% \markingcommand{#1}{\begincsname\??markingfilter\v!last\endcsname{#1}}% \else - \markingcommand{#1}{\clf_getsynchronizedmarking{#1}\v!first}% + \markingcommand{#1}{\clf_getsynchronizemarking{#1}\v!first}% \markingseparator{#1}% - \markingcommand{#1}{\clf_getsynchronizedmarking{#1}\v!last}% + \markingcommand{#1}{\clf_getsynchronizemarking{#1}\v!last}% \fi \fi \fi} @@ -240,9 +240,9 @@ \else %\markingcommand{#1}{\begincsname\??markclass:\v!previous\endcsname{#1}}% %\markingseparator{#1}% - \markingcommand{#1}{\clf_getsynchronizedmarking{#1}\v!first}% + \markingcommand{#1}{\clf_getsynchronizemarking{#1}\v!first}% \markingseparator{#1}% - \markingcommand{#1}{\clf_getsynchronizedmarking{#1}\v!last}% + \markingcommand{#1}{\clf_getsynchronizemarking{#1}\v!last}% \fi \fi \fi} diff --git a/tex/context/base/mkxl/strc-mat.mkxl b/tex/context/base/mkxl/strc-mat.mkxl index 2e6c21ad2..6c639bb1f 100644 --- a/tex/context/base/mkxl/strc-mat.mkxl +++ b/tex/context/base/mkxl/strc-mat.mkxl @@ -1035,6 +1035,28 @@ \boundary\c_bndr_mathalign \fi} +% \tolerant\protected\def\strc_math_skip_here[#1]% +% {% no strut as it will influence fences +% \ifconditional\c_strc_math_trace_hang +% \strc_math_trace_okay{darkblue}{S #1}% +% \fi +% \scratchdimen\dimexpr\formulaparameter\c!textmargin\relax +% \ifchkdim#1\or +% \d_strc_math_hang_state#1% +% \orelse\ifchknum#1\or +% \d_strc_math_hang_state#1\scratchdimen +% \orelse\iftok{#1}{+}% +% \advanceby\d_strc_math_hang_state\scratchdimen +% \orelse\iftok{#1}{-}% +% \advanceby\d_strc_math_hang_state-\scratchdimen +% \else +% \d_strc_math_hang_state\scratchdimen +% \fi +% \kern\d_strc_math_hang_state +% \strc_math_pickup_again} + +\newboundary\c_bndr_skiphere + \tolerant\protected\def\strc_math_skip_here[#1]% {% no strut as it will influence fences \ifconditional\c_strc_math_trace_hang @@ -1052,6 +1074,7 @@ \else \d_strc_math_hang_state\scratchdimen \fi + \boundary\c_bndr_skiphere \kern\d_strc_math_hang_state \strc_math_pickup_again} diff --git a/tex/context/base/mkxl/strc-not.lmt b/tex/context/base/mkxl/strc-not.lmt index e05228b2b..2c68cc599 100644 --- a/tex/context/base/mkxl/strc-not.lmt +++ b/tex/context/base/mkxl/strc-not.lmt @@ -520,11 +520,13 @@ notes.check_spacing = check_spacing -- only notes, kind of hardcoded .. bah -callback.register("build_page_insert", function(index,slot) +local function action(index,slot) local state = notes.numbers[index] if state then return tonode(newgluespec(check_spacing(index,slot))) else return tonode(newgluespec()) end -end) +end + +callbacks.register("build_page_insert",action,"check spacing around inserts") diff --git a/tex/context/base/mkxl/strc-ref.lmt b/tex/context/base/mkxl/strc-ref.lmt index 6a320f141..272e7e992 100644 --- a/tex/context/base/mkxl/strc-ref.lmt +++ b/tex/context/base/mkxl/strc-ref.lmt @@ -386,12 +386,12 @@ references.currentorder = currentorder references.setstructure = resolvers.jobs.currentstructure -- yes or no here ----------.setcomponent = setcomponent --- implement { --- name = "setnextreferenceorder", --- actions = setnextorder, --- arguments = "2 strings", --- } --- +implement { + name = "setnextreferenceorder", -- used in strc-enu + actions = setnextorder, + arguments = "2 strings", +} + -- implement { -- name = "currentreferenceorder", -- actions = { currentorder, context }, @@ -2484,6 +2484,7 @@ local function filterreference(name,prefixspec,numberspec) -- number page title if data then if name == "realpage" then local cs = references.analyze() -- normally already analyzed but also sets state + -- or just get from references.realpage when present context(tonumber(cs.realpage) or 0) else -- assumes data is table local kind = false @@ -2519,6 +2520,26 @@ local function filterreferencedefault() return filterreference("default",getcurrentprefixspec("default")) end +local function getreferencesectionnumber(reference) + if references.valid("",reference,{},false) then + local data = currentreference and currentreference.i + if type(data) == "table" then + local metadata = data.metadata + if metadata and metadata.kind == "section" then + local numberdata = data.numberdata + if numberdata then + numberdata = numberdata.numbers + context(numberdata[#numberdata] or 0) + return + end + end + elseif trace_referencing then + report_references("name %a, no reference",reference) + end + end + context(0) +end + references.filter = filterreference references.filterdefault = filterreferencedefault @@ -2538,6 +2559,13 @@ implement { } } +implement { + name = "getreferencesectionnumber", + actions = getreferencesectionnumber, + arguments = "string", + public = true, +} + function genericfilters.title(data) if data then local titledata = data.titledata or data.useddata diff --git a/tex/context/base/mkxl/strc-ref.mklx b/tex/context/base/mkxl/strc-ref.mklx index a1b6ac22d..8619d084e 100644 --- a/tex/context/base/mkxl/strc-ref.mklx +++ b/tex/context/base/mkxl/strc-ref.mklx @@ -994,6 +994,8 @@ \aliased\let\from \strc_references_from \to \everydump +% can be defined visible at lua end + \permanent \def\filterreference #key{\clf_filterreference{#key}} % no checking, expandable \permanent\protected\def\getreferenceentry#key{\clf_filterreference{#key}} % no checking, not expandable @@ -1005,7 +1007,6 @@ \permanent\def\currentreferencerealpage{\clf_filterreference{realpage}} \aliased \let\currentreferenceorder \getinternalorderreference - %D The most straightforward way of retrieving references is using \type {\ref}. \permanent\tolerant\protected\def\getreference[#key]#spacer[#label]% #key = number page title text default realpage ... @@ -1017,6 +1018,25 @@ \aliased\let\ref\getreference +% setnumber-001.tex +% +% \starttext +% \chapter[one]{One} see setnumber-002 +% \chapter[two]{Two} see setnumber-002 +% \stoptext +% +% setnumber-002.tex +% +% \setupreferencing[autofile=yes] +% \useexternaldocument[foo] [setnumber-001] [{TEST 1}] +% \setupheadnumber[chapter][\getreferencesectionnumber{foo::two}] +% \starttext +% \chapter[three]{Three} from setnumber-001, one: \getreferencesectionnumber{foo::one}\par +% \chapter[four] {Four} from setnumber-001, two: \getreferencesectionnumber{foo::two}\par +% \stoptext +% +% \getreferencesectionnumber{reference} : defined at the lua end + %D Special cases: \permanent\protected\def\strc_references_about[#label]% diff --git a/tex/context/base/mkxl/strc-reg.lmt b/tex/context/base/mkxl/strc-reg.lmt index a8a7d0a90..6affc02f8 100644 --- a/tex/context/base/mkxl/strc-reg.lmt +++ b/tex/context/base/mkxl/strc-reg.lmt @@ -536,7 +536,13 @@ local function preprocessentries(rawdata) end local seeword = rawdata.seeword if seeword then - seeword.processor, seeword.text = splitprocessor(seeword.text or "") + local text = seeword.text or "" + local sp, st = splitprocessor(text) + seeword.text = text + -- seeword.list = lpegmatch(coding == "xml" and entrysplitter_xml or entrysplitter_tex,st) + if sp then + seeword.processor = sp + end end end @@ -1131,9 +1137,11 @@ local function analyzeregister(class,options) -- local u = u and { u.prefix } or nil local u = multiple and { string.formatters["%03i"](i) } or nil -- maybe prefix but then how about main for i=1,#e do + -- see has no pagedata local ei = e[i] -if multiple and ei.metadata.kind == "see" then - -- skip see, can become an option + local external = ei.external +if multiple and ei.metadata.kind == "see" and external then + -- too messy, could be an option but useless else nofentries = nofentries + 1 @@ -1141,7 +1149,9 @@ else if u then local eil = ei.list eil[#eil+1] = u +if external then ei.external = l -- this is the (current) abstract tag, used for prefix +end end end end @@ -1587,6 +1597,10 @@ function registers.flush(data,options,prefixspec,pagespec) local seetext = seeword.text or "" local processor = seeword.processor or (entry.processors and entry.processors[1]) or "" local seeindex = entry.external or entry.references.seeindex or "" + local seelist = lpegmatch(coding == "xml" and entrysplitter_xml or entrysplitter_tex,seetext) + if #seelist > 1 then + seetext = concat(seelist,", ") + end ctx_registerseeword( metadata.name or "", i, @@ -1821,6 +1835,7 @@ function registers.integrate(utilitydata) end references.external = filename -- not really needed end + entry.external = true end end end diff --git a/tex/context/base/mkxl/strc-reg.mkxl b/tex/context/base/mkxl/strc-reg.mkxl index 464ac4eb1..7dd07b2e2 100644 --- a/tex/context/base/mkxl/strc-reg.mkxl +++ b/tex/context/base/mkxl/strc-reg.mkxl @@ -155,16 +155,17 @@ \mutable\lettonothing\currentregisternumber \mutable\lettonothing\currentregisterownnumber \mutable\lettonothing\currentregisterpageindex +\mutable\lettonothing\currentregisterpageprefix \mutable\lettonothing\currentregisterpagesymbol +\mutable\lettonothing\currentregisterprocessors +\mutable\lettonothing\currentregisterprocessorsa +\mutable\lettonothing\currentregisterprocessorsb +\mutable\lettonothing\currentregisterprocessorsc \mutable\lettonothing\currentregistersectionindex \mutable\lettonothing\currentregisterseeindex \mutable\lettonothing\currentregisterseeword \mutable\lettonothing\currentregistersynchronize \mutable\lettonothing\currentregisterxmlsetup -\mutable\lettonothing\currentregisterprocessors -\mutable\lettonothing\currentregisterprocessorsa -\mutable\lettonothing\currentregisterprocessorsb -\mutable\lettonothing\currentregisterprocessorsc \newconditional\c_strc_registers_defining \setnewconstant\c_strc_registers_maxlevel \plusfive @@ -994,6 +995,8 @@ \setfalse\settrue\c_strc_registers_vertical \to \everysetupregister +\mutable\lettonothing\currentnestedregister + \permanent\protected\def\usenestedregisterstyleandcolor#1#2% will change {\useregisterstyleandcolor#1#2% % how about style diff --git a/tex/context/base/mkxl/strc-sec.mkxl b/tex/context/base/mkxl/strc-sec.mkxl index 227d24704..db100f0dd 100644 --- a/tex/context/base/mkxl/strc-sec.mkxl +++ b/tex/context/base/mkxl/strc-sec.mkxl @@ -704,7 +704,8 @@ \ifcsname\??headincrement\currentheadincrement\endcsname \lastnamedcs \else - \settrue \c_strc_sectioning_increment\settrue \c_strc_sectioning_to_list + \settrue\c_strc_sectioning_increment + \settrue\c_strc_sectioning_to_list % \filterheadnumber \fi} diff --git a/tex/context/base/mkxl/strc-syn.mkxl b/tex/context/base/mkxl/strc-syn.mkxl index 9b4c37ceb..9b4d410e1 100644 --- a/tex/context/base/mkxl/strc-syn.mkxl +++ b/tex/context/base/mkxl/strc-syn.mkxl @@ -266,6 +266,7 @@ \mutable\lettonothing\currentsynonym \mutable\lettonothing\currentsynonymtag \mutable\lettonothing\currentsynonymtext +\mutable\lettonothing\currentsynonymsortkey \permanent\tolerant\protected\def\definesynonyms[#1]#*[#2]#*[#3]#*[#4]% name plural \meaning \use {\ifnum\lastarguments=\plusfour @@ -626,7 +627,6 @@ \permanent\protected\def\currentsortingname {\clf_synonymname\currentsimplelist\currentsortingtag} \permanent\protected\def\currentsortingpages {\clf_synonympages\currentsimplelist\currentsortingtag} \permanent\protected\def\doifelsecurrentsortingused {\clf_doifelsesynonymused\currentsimplelist\currentsortingtag} -\permanent\protected\def\resetusedsortings [#1]{\clf_resetusedsynonyms{#1}} \permanent\protected\def\sortingname [#1]#*[#2]{\clf_synonymname {#1}{#2}} \permanent\protected\def\sortingpages[#1]#*[#2]{\clf_synonympages{#1}{#2}} diff --git a/tex/context/base/mkxl/supp-box.lmt b/tex/context/base/mkxl/supp-box.lmt index 093cac164..a26f77ae2 100644 --- a/tex/context/base/mkxl/supp-box.lmt +++ b/tex/context/base/mkxl/supp-box.lmt @@ -1395,6 +1395,8 @@ do actions = boxlinecount, } + -- todoL: just inline so that s-system-macros can find them + define_one("boxline", "get") define_one("setboxline", "set") define_one("copyboxline", "copy") diff --git a/tex/context/base/mkxl/symb-emj.lmt b/tex/context/base/mkxl/symb-emj.lmt index b043d835d..1bcb237f6 100644 --- a/tex/context/base/mkxl/symb-emj.lmt +++ b/tex/context/base/mkxl/symb-emj.lmt @@ -6,8 +6,6 @@ if not modules then modules = { } end modules ['symb-emj'] = { license = "see context related readme files" } --- processors.hpack_filter does it all - local symbols = fonts.symbols local resolvedemoji = characters.emoji.resolve diff --git a/tex/context/base/mkxl/syst-aux.mkxl b/tex/context/base/mkxl/syst-aux.mkxl index c3a4a97b2..58678f9f3 100644 --- a/tex/context/base/mkxl/syst-aux.mkxl +++ b/tex/context/base/mkxl/syst-aux.mkxl @@ -6854,6 +6854,8 @@ %D %D \typebuffer \startpacked \getbuffer \stoppacked +\lettonothing\syst_helpers_wipe_tokens_yes + \def\syst_helpers_wipe_tokens_nop#-^^04{}% \permanent\def\wipetokens#1#2% diff --git a/tex/context/base/mkxl/syst-ini.mkxl b/tex/context/base/mkxl/syst-ini.mkxl index 46f02653a..d55a82175 100644 --- a/tex/context/base/mkxl/syst-ini.mkxl +++ b/tex/context/base/mkxl/syst-ini.mkxl @@ -322,6 +322,7 @@ \permanent\countdef\c_syst_max_allocated_toks = 216 \c_syst_max_allocated_toks = \directlua{tex.write(tex.magicconstants.max_toks_register_index)} % idem \permanent\countdef\c_syst_max_allocated_read = 217 \c_syst_max_allocated_read = \c_syst_max_allocated_iohandle \permanent\countdef\c_syst_max_allocated_write = 218 \c_syst_max_allocated_write = \c_syst_max_allocated_iohandle +\permanent\countdef\c_syst_max_allocated_float = 220 \c_syst_max_allocated_float = \directlua{tex.write(tex.magicconstants.max_float_register_index or 0)} % idem \permanent\countdef\c_syst_last_allocated_count = 221 \c_syst_last_allocated_count = \c_syst_min_allocated_register \permanent\countdef\c_syst_last_allocated_dimen = 222 \c_syst_last_allocated_dimen = \c_syst_min_allocated_register @@ -332,6 +333,7 @@ \permanent\countdef\c_syst_last_allocated_read = 227 \c_syst_last_allocated_read = \c_syst_min_allocated_iohandle \permanent\countdef\c_syst_last_allocated_write = 228 \c_syst_last_allocated_write = \c_syst_min_allocated_iohandle \permanent\countdef\c_syst_last_allocated_marks = 229 \c_syst_last_allocated_marks = \c_syst_min_allocated_mark +\permanent\countdef\c_syst_last_allocated_float = 230 \c_syst_last_allocated_float = \c_syst_min_allocated_register \permanent\countdef\c_syst_min_counter_value = 253 \c_syst_min_counter_value = -"7FFFFFFF \permanent\countdef\c_syst_max_counter_value = 254 \c_syst_max_counter_value = "7FFFFFFF @@ -358,6 +360,7 @@ \permanent\protected\def\newdimension #1{\dimensiondef #1\zeropoint} \permanent\protected\def\newgluespec #1{\gluespecdef #1\zeropoint} \permanent\protected\def\newmugluespec#1{\mugluespecdef#1\zeropoint} +\permanent\protected\def\newposit #1{\positdef #1\zerocount} %D The aliasing here is tricky: we need to make sure the alias is not let to the %D current value but behaves dynamic. Instead we can use just \newcount, unless of @@ -366,6 +369,7 @@ \protected\def\aliasinteger #1#2{\untraced\protected\def#1{#2}}% name parent \protected\def\aliasdimension#1#2{\untraced\protected\def#1{#2}}% name parent +\protected\def\aliasposit #1#2{\untraced\protected\def#1{#2}}% name parent %D So, effectively we start allocating from 256 and upwards. The inserts sit in the %D range 128 upto 254. Page numbers use the counters 0 upto 9 and the pagebox is @@ -386,6 +390,7 @@ \permanent\protected\def\newread {\syst_basics_allocate\c_syst_last_allocated_read \read \integerdef\c_syst_max_allocated_read} \permanent\protected\def\newwrite {\syst_basics_allocate\c_syst_last_allocated_write \write \integerdef\c_syst_max_allocated_write} \permanent\protected\def\newmarks {\syst_basics_allocate\c_syst_last_allocated_marks \marks \integerdef\c_syst_max_allocated_mark} +\permanent\protected\def\newfloat {\syst_basics_allocate\c_syst_last_allocated_float \float \floatdef \c_syst_max_allocated_float} \firstvalidlanguage \plusone % so zero is ignored in hyphenation, this might become the default diff --git a/tex/context/base/mkxl/syst-lua.lmt b/tex/context/base/mkxl/syst-lua.lmt index d8e06d4fd..0f80f57d3 100644 --- a/tex/context/base/mkxl/syst-lua.lmt +++ b/tex/context/base/mkxl/syst-lua.lmt @@ -58,6 +58,9 @@ local ctx_secondoftwoarguments = context.secondoftwoarguments local ctx_firstofoneargument = context.firstofoneargument local ctx_gobbleoneargument = context.gobbleoneargument +local values = tokens.values +local boolean_code = values.boolean + implement { -- will be overloaded later name = "writestatus", arguments = "2 arguments", @@ -309,6 +312,21 @@ end do + interfaces.implement { + name = "iflua", + public = true, + usage = "condition", + arguments = "string", + actions = function(s) + local c = load("return(" .. s .. ")") + return boolean_code, (c and c()) and true or false + end, + } + +end + +do + -- This is some 20% slower than native but we only provide this for compatibility -- reasons so we don't care that much about it. Eventually we can drop the built-in -- method. diff --git a/tex/context/base/mkxl/tabl-tab.mkxl b/tex/context/base/mkxl/tabl-tab.mkxl index c680a4474..ff0d201cf 100644 --- a/tex/context/base/mkxl/tabl-tab.mkxl +++ b/tex/context/base/mkxl/tabl-tab.mkxl @@ -58,7 +58,7 @@ \tabl_table_restore_lineskips \normalbaselines % \enforced\let~\fixedspace -` \enforced\letcharcode\tildeasciicode\fixedspace % why + \enforced\letcharcode\tildeasciicode\fixedspace % why \inhibitblank % \blank[\v!disable]% % added \the\everytableparbox} diff --git a/tex/context/base/mkxl/tabl-tbl.mkxl b/tex/context/base/mkxl/tabl-tbl.mkxl index 6b5e38f3a..b2e4f5090 100644 --- a/tex/context/base/mkxl/tabl-tbl.mkxl +++ b/tex/context/base/mkxl/tabl-tbl.mkxl @@ -791,6 +791,7 @@ \defcsname\??tabulatewidth\v!auto\endcsname {\c_tabl_tabulate_modus\plusthree\settrue\c_tabl_tabulate_reshape} +\lettonothing\tabl_tabulate_hook_box \lettonothing\tabl_tabulate_hook_box_begin \lettonothing\tabl_tabulate_hook_box_end @@ -2228,6 +2229,8 @@ % \fi % \fi} +\newconditional\c_tabl_tabulate_split_done + \protected\def\tabl_tabulate_flush_second_indeed {\glettonothing\tabl_tabulate_flush_collected_indeed \global\c_tabl_tabulate_column\zerocount @@ -3031,7 +3034,7 @@ \lettonothing\m_table_current_row_background \lettonothing\m_table_current_row_background_default \lettonothing\m_table_current_row_background_filler -\lettonothing\m_table_current_row_background_defaultfiller +\lettonothing\m_table_current_row_background_default_filler \lettonothing\m_table_current_row_background_auto \protected\def\tabl_register_row_background#1% diff --git a/tex/context/base/mkxl/task-ini.lmt b/tex/context/base/mkxl/task-ini.lmt index 57376ae2b..962a7ef9a 100644 --- a/tex/context/base/mkxl/task-ini.lmt +++ b/tex/context/base/mkxl/task-ini.lmt @@ -176,11 +176,20 @@ appendaction("alignments", "normalizers", "nodes.handlers.mathmatrixrules", appendaction("localboxes", "lists", "typesetters.localboxes.handler", nil, "nut", "enabled" ) +appendaction("hquality", "system", "builders.hpack.report", nil, "nonut", "enabled" ) +appendaction("hquality", "system", "builders.hpack.show", nil, "nut", "enabled" ) +appendaction("vquality", "system", "builders.vpack.report", nil, "nonut", "enabled" ) +------------("vquality", "system", "builders.vpack.show", nil, "nut", "enabled" ) + -- some protection -freezecallbacks("find_.*_file", "find file using resolver") -freezecallbacks("read_.*_file", "read file at once") -freezecallbacks("open_.*_file", "open file for reading") +freezecallbacks("find_log_file", "provide the log file name") +freezecallbacks("find_format_file", "locate the format file") +freezecallbacks("open_data_file", "open the given file for reading") +freezecallbacks("process_jobname", "manipulate jobname") +freezecallbacks("trace_memory", "show memory usage details") + +freezecallbacks("hpack_filter", "hlist processing (not used, replaced)") -- no need to add more overhead -- experimental (needs to be updated): @@ -197,6 +206,9 @@ freezegroup("finalizers", "lists") freezegroup("math", "normalizers") freezegroup("math", "builders") +freezegroup("hquality", "system") +freezegroup("vquality", "system") + freezegroup("shipouts", "normalizers") freezegroup("shipouts", "finishers") freezegroup("shipouts", "wrapup") @@ -204,8 +216,8 @@ freezegroup("shipouts", "wrapup") freezegroup("mvlbuilders", "normalizers") freezegroup("vboxbuilders", "normalizers") ------------("parbuilders", "lists") ------------("pagebuilders", "lists") +-----------("parbuilders", "normalizers") +freezegroup("pagebuilders", "normalizers") freezegroup("math", "normalizers") freezegroup("math", "builders") diff --git a/tex/context/base/mkxl/toks-scn.lmt b/tex/context/base/mkxl/toks-scn.lmt index ab531a462..c08e8415a 100644 --- a/tex/context/base/mkxl/toks-scn.lmt +++ b/tex/context/base/mkxl/toks-scn.lmt @@ -262,6 +262,7 @@ local shortcuts = { toboolean = toboolean, inspect = inspect, report = report_scan, + posit = posit, } tokens.shortcuts = shortcuts diff --git a/tex/context/base/mkxl/trac-deb.lmt b/tex/context/base/mkxl/trac-deb.lmt index caa5464f8..83603ef59 100644 --- a/tex/context/base/mkxl/trac-deb.lmt +++ b/tex/context/base/mkxl/trac-deb.lmt @@ -289,15 +289,15 @@ end directives.register("system.errorcontext", function(v) local register = callback.register if v then - register('show_error_message', nop) - register('show_warning_message', function() processwarning(v) end) - register('intercept_lua_error', function() processerror(v) end) - register('intercept_tex_error', function(mode,eof) processerror(v,eof) return mode end) + register("show_error_message", nop) + register("show_warning_message", function() processwarning(v) end) + register("intercept_lua_error", function() processerror(v) end) + register("intercept_tex_error", function(mode,eof) processerror(v,eof) return mode end) else - register('show_error_message', nil) - register('show_warning_message', nil) - register('intercept_lua_error', nil) - register('intercept_tex_error', nil) + register("show_error_message", nil) + register("show_warning_message", nil) + register("intercept_lua_error", nil) + register("intercept_tex_error", nil) end end) diff --git a/tex/context/base/mkxl/typo-bld.lmt b/tex/context/base/mkxl/typo-bld.lmt index 00ff9f267..c0b42001e 100644 --- a/tex/context/base/mkxl/typo-bld.lmt +++ b/tex/context/base/mkxl/typo-bld.lmt @@ -19,6 +19,12 @@ local parbuilders = builders.paragraphs parbuilders.constructors = parbuilders.constructors or { } local constructors = parbuilders.constructors +builders.hpack = builders.hpack or { } +builders.vpack = builders.vpack or { } + +local hpackbuilders = builders.hpack +local vpackbuilders = builders.vpack + constructors.names = constructors.names or { } local names = constructors.names @@ -52,6 +58,7 @@ local nuts = nodes.nuts local tonode = nodes.tonode local tonut = nodes.tonut local getattr = nuts.getattr +local flush = nuts.flush local starttiming = statistics.starttiming local stoptiming = statistics.stoptiming @@ -200,13 +207,12 @@ local builders = nodes.builders local vpackactions = nodes.tasks.actions("vboxbuilders") function builders.vpack_filter(head,groupcode,size,packtype,maxdepth,direction) - local done = false if head then starttiming(builders) - head, done = vpackactions(head,groupcode) + head = vpackactions(head,groupcode) stoptiming(builders) end - return head, done + return head end -- This one is special in the sense that it has no head and we operate on the mlv. Also, @@ -244,8 +250,8 @@ function builders.buildpage_filter(pagecontext) end end -registercallback('vpack_filter', builders.vpack_filter, "vertical spacing etc") -registercallback('buildpage_filter', builders.buildpage_filter, "vertical spacing etc (mvl)") +registercallback("vpack_filter", builders.vpack_filter, "vertical spacing etc") +registercallback("buildpage_filter", builders.buildpage_filter, "vertical spacing etc (mvl)") local vboxactions = nodes.tasks.actions("vboxhandlers") @@ -258,7 +264,7 @@ function builders.vbox_filter(head,groupcode) return head end -registercallback('packed_vbox_filter', builders.vbox_filter, "packed vbox treatments") +registercallback("packed_vbox_filter", builders.vbox_filter, "packed vbox treatments") statistics.register("v-node processing time", function() return statistics.elapsedseconds(builders) @@ -297,37 +303,51 @@ local report_quality = logs.reporter("pack quality") -- overflow|badness w h d dir -local function vpack_quality(how,n,detail,first,last,filename) - if last <= 0 then - report_quality("%s vbox",how) - elseif first > 0 and first < last then - report_quality("%s vbox at line %i - %i in file %a",how,first,last,filename or "?") - else - report_quality("%s vbox at line %i in file %a",how,filename or "?",last) +local report = true trackers.register("builders.vpack.quality", function(v) report = v end) +local collect = false trackers.register("builders.vpack.collect", function(v) collect = v end) +---- show = false trackers.register("builders.vpack.overflow",function(v) show = v end) + +function vpackbuilders.report(how,detail,n,first,last,filename) -- no return value + if report then + if last <= 0 then + report_quality("%s vbox",how) + elseif first > 0 and first < last then + report_quality("%s vbox at line %i - %i in file %a",how,first,last,filename or "?") + else + report_quality("%s vbox at line %i in file %a",how,last,filename or "?") + end + end + if collect then + list[#list+1] = { "hbox", how, filename, first, last, how, detail } end - list[#list+1] = { "hbox", how, filename, first, last, how } end -trackers.register("builders.vpack.quality",function(v) - registercallback("vpack_quality",v and vpack_quality or nil,"check vpack quality") -end) +-- function builders.vpack.show(how,detail,n,first,last,filename) -- return value +-- if show then +-- end +-- end -local report = false -local show = false +local report = true trackers.register("builders.hpack.quality", function(v) report = v end) +local collect = false trackers.register("builders.hpack.collect", function(v) collect = v end) +local show = false trackers.register("builders.hpack.overflow",function(v) show = v end) -local function hpack_quality(how,detail,n,first,last,filename) - n = tonut(n) +function hpackbuilders.report(how,detail,n,first,last,filename) -- no return value + local str = (report or collect) and listtoutf(getlist(n),"",true,nil,true) if report then - local str = listtoutf(getlist(n),"",true,nil,true) if last <= 0 then - report_quality("%s hbox: %s",how,str) + report_quality("%s hbox: %s (%p)",how,str,detail) elseif first > 0 and first < last then - report_quality("%s hbox at line %i - %i in file %a: %s",how,first,last,filename or "?",str) + report_quality("%s hbox at line %i - %i in file %a: %s (%p)",how,first,last,filename or "?",str,detail) else - report_quality("%s hbox at line %i in file %a: %s",how,last,filename or "?",str) + report_quality("%s hbox at line %i in file %a: %s (%p)",how,last,filename or "?",str,detail) end - list[#list+1] = { "hbox", how, filename, first, last, str } end + if collect then + list[#list+1] = { "hbox", how, filename, first, last, str, detail } + end +end + +function hpackbuilders.show(how,detail,n,first,last,filename,rule) -- return value if show then local width = 2*65536 local height = getheight(n) @@ -339,7 +359,10 @@ local function hpack_quality(how,detail,n,first,last,filename) if depth < 2*65526 then depth = 2*65526 end - local rule = new_rule(width,height,depth) + if rule then + flush(rule) + end + rule = new_rule(width,height,depth) setdirection(rule,direction) if how == "overfull" then setcolor(rule,"red") @@ -356,19 +379,40 @@ local function hpack_quality(how,detail,n,first,last,filename) rule = hpack(rule) setwidth(rule,0) -- maybe better whd all zero setdirection(rule,direction) - return tonode(rule) -- can be a nut + else + local width = texget("overfullrule") + if width > 0 then + rule = new_rule(width) + end end + return rule end -trackers.register("builders.hpack.quality",function(v) - report = v - registercallback("hpack_quality",(report or show) and hpack_quality or nil,"check hpack quality") -end) +-- -trackers.register("builders.hpack.overflow",function(v) - show = v - registercallback("hpack_quality",(report or show) and hpack_quality or nil,"check hpack quality") -end) +local hqualityactions = nodes.tasks.actions("hquality") +local vqualityactions = nodes.tasks.actions("vquality") + +function hpackbuilders.qualityactions(how,detail,n,first,last,filename) + local rul = nil + -- starttiming(builders) + rul = hqualityactions(how,detail,n,first,last,filename) + -- stoptiming(builders) + return rul +end +function vpackbuilders.qualityactions(how,detail,n,first,last,filename) + local rul = nil + -- starttiming(builders) + rul = vqualityactions(how,detail,n,first,last,filename) + -- stoptiming(builders) + return rul +end + +registercallback("hpack_quality", hpackbuilders.qualityactions, "report horizontal packing quality") +registercallback("vpack_quality", vpackbuilders.qualityactions, "report vertical packing quality") + + +-- statistics.register("quality reports", function() local n = #list @@ -390,7 +434,7 @@ statistics.register("quality reports", function() logs.startfilelogging(report_quality) for i=1,n do local l = list[i] - report_quality("%-" .. fw .. "s [%04i - %04i] : %-" .. hw .. "s %s : %s",file.basename(l[3]),l[4],l[5],l[2],l[1],l[6]) + report_quality("%-" .. fw .. "s [%04i - %04i] : %-" .. hw .. "s %s : %s (%p)",file.basename(l[3]),l[4],l[5],l[2],l[1],l[6],l[7]) end logs.stopfilelogging() report_quality() diff --git a/tex/context/base/mkxl/typo-del.mkxl b/tex/context/base/mkxl/typo-del.mkxl index 08d0a9b09..bd427b954 100644 --- a/tex/context/base/mkxl/typo-del.mkxl +++ b/tex/context/base/mkxl/typo-del.mkxl @@ -412,10 +412,10 @@ {\begingroup \typo_delimited_push{#1}{#2}% \dostarttaggedchained\t!delimitedblock\currentdelimitedtext\??delimitedtext - \edef\p_delimited_method{\delimitedtextparameter\c!method}% - \ifx\p_delimited_method\v!font + \edef\p_method{\delimitedtextparameter\c!method}% + \ifx\p_method\v!font \expandafter\typo_delimited_start_font - \orelse\ifx\p_delimited_method\v!paragraph + \orelse\ifx\p_method\v!paragraph \expandafter\typo_delimited_start_font \else \expandafter\typo_delimited_start_other @@ -485,12 +485,14 @@ \endgroup \dostoptagged} +\lettonothing\p_delimited_left +\lettonothing\p_delimited_right +\lettonothing\p_delimited_nextleft +\lettonothing\p_delimited_nextright + \tolerant\def\typo_delimited_start_par[#1]% {\let\typo_delimited_stop\typo_delimited_stop_par - \edef\p_delimited_spacebefore{\delimitedtextparameter\c!spacebefore}% - \ifempty\p_delimited_spacebefore \else - \blank[\p_delimited_spacebefore]% - \fi + \checkedblank[\delimitedtextparameter\c!spacebefore]% \delimitedtextparameter\c!before \edef\m_delimited_argument{#1}% \ifempty\m_delimited_argument @@ -538,10 +540,7 @@ \pop_macro_checkindentation \typo_delimited_stop_par_indeed \delimitedtextparameter\c!after - \edef\p_delimited_spaceafter{\delimitedtextparameter\c!spaceafter}% - \ifempty\p_delimited_spaceafter \else - \blank[\p_delimited_spaceafter]% - \fi + \checkedblank[\delimitedtextparameter\c!spaceafter]% \useindentnextparameter\delimitedtextparameter \aftergroup\dorechecknextindentation}% AM: This was missing! @@ -566,10 +565,10 @@ \permanent\tolerant\protected\def\delimitedtext[#1]#*[#2]% {\dontleavehmode % following ones can be omited \typo_delimited_push{#1}{#2}% - \edef\p_delimited_method{\delimitedtextparameter\c!method}% - \ifx\p_delimited_method\v!font + \edef\p_method{\delimitedtextparameter\c!method}% + \ifx\p_method\v!font \expandafter\typo_delimited_fontdriven - \orelse\ifx\p_delimited_method\v!text + \orelse\ifx\p_method\v!text \expandafter\typo_delimited_fontdriven \else \expandafter\typo_delimited_other diff --git a/tex/context/base/mkxl/typo-lbx.mkxl b/tex/context/base/mkxl/typo-lbx.mkxl index 93a2fc86f..57186856f 100644 --- a/tex/context/base/mkxl/typo-lbx.mkxl +++ b/tex/context/base/mkxl/typo-lbx.mkxl @@ -100,6 +100,8 @@ %D existing local box we create nested ones. This is handled in the callback but if %D really needed one can do something like (do we need a primitive?): +\mutable\lettonothing\currentlocalboxeslocation + \def\typo_localboxes_localbox {\ifx\currentlocalboxeslocation\v!right \localrightbox diff --git a/tex/context/fonts/mkiv/antykwa-math.lfg b/tex/context/fonts/mkiv/antykwa-math.lfg index debf5d1ed..975ada70e 100644 --- a/tex/context/fonts/mkiv/antykwa-math.lfg +++ b/tex/context/fonts/mkiv/antykwa-math.lfg @@ -1,24 +1,4 @@ -local common = fonts.goodies.load("common-math-jmn.lfg") -local helpers = common.mathematics.helpers - -if not fonts.encodings.math["extensible-jmn-private"] then - - local ps = fonts.helpers.privateslot - - fonts.encodings.math["extensible-jmn-private"] = { - [ps("rule middle piece")] = 200, -- minusjmn - [ps("rule right piece")] = 201, -- minusrightjmn - [ps("rule left piece")] = 202, -- minusleftjmn - [ps("double rule middle piece")] = 203, -- equaljmn - [ps("double rule right piece")] = 204, -- equalrightjmn - [ps("double rule left piece")] = 205, -- equalleftjmn - [ps("arrow left piece")] = 206, -- arrowleftjmn - [ps("arrow right piece")] = 207, -- arrowrightjmn - [ps("double arrow left piece")] = 208, -- arrowdblleftjmn - [ps("double arrow right piece")] = 209, -- arrowdblrightjmn - } - -end +-- no longer ok for mkiv: digits are not antykwa local fraction = .25 @@ -105,6 +85,95 @@ local uglyones = { vextenddouble = true, } +local recipes = { + ["antykwa-math"] = { + { name = "file:LatinModern-Math", features = "virtualmath-antykwa", main = true, parameters = false }, + -- + { name = "rm-anttr.tfm", vector = "tex-mr", skewchar=0x7F }, + { name = "mi-anttri.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "mi-anttri.tfm", vector = "tex-it", skewchar=0x7F }, + { name = "mi-anttbi.tfm", vector = "tex-bi", skewchar=0x7F }, + { name = "rm-anttb.tfm", vector = "tex-bf", skewchar=0x7F }, + { name = "sy-anttrz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true + { name = "sy-anttrz.tfm", vector = "extensible-jmn-private", skewchar=0x30 }, + { name = "file:AntykwaTorunska-Regular", vector = "tex-ex-braces", backmap = false }, + { name = "ex-anttr.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, + }, + ["antykwa-light-math"] = { + { name = "file:LatinModern-Math", features = "virtualmath-antykwa-light", main = true, parameters = false }, + -- + { name = "rm-anttl.tfm", vector = "tex-mr", skewchar=0x7F }, + { name = "mi-anttli.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "mi-anttli.tfm", vector = "tex-it", skewchar=0x7F }, + { name = "mi-anttri.tfm", vector = "tex-bi", skewchar=0x7F }, + { name = "rm-anttr.tfm", vector = "tex-bf", skewchar=0x7F }, + { name = "sy-anttlz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true + { name = "sy-anttlz.tfm", vector = "extensible-jmn-private", skewchar=0x30 }, + { name = "file:AntykwaTorunskaLight-Regular", vector = "tex-ex-braces", backmap = false }, + { name = "ex-anttl.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, + }, + ["antykwa-cond-math"] = { + { name = "file:LatinModern-Math", features = "virtualmath-antykwa-cond", main = true, parameters = false }, + -- + { name = "rm-anttcr.tfm", vector = "tex-mr", skewchar=0x7F }, + { name = "mi-anttcri.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "mi-anttcri.tfm", vector = "tex-it", skewchar=0x7F }, + { name = "mi-anttcbi.tfm", vector = "tex-bi", skewchar=0x7F }, + { name = "rm-anttcb.tfm", vector = "tex-bf", skewchar=0x7F }, + { name = "sy-anttcrz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true + { name = "sy-anttcrz.tfm", vector = "extensible-jmn-private", skewchar=0x30 }, + { name = "file:AntykwaTorunskaCond-Regular", vector = "tex-ex-braces", backmap = false }, + { name = "ex-anttcr.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, + }, + ["antykwa-light-cond-math"] = { + { name = "file:LatinModern-Math", features = "virtualmath-antykwa-lightcond", main = true, parameters = false }, + -- + { name = "rm-anttcl.tfm", vector = "tex-mr", skewchar=0x7F }, + { name = "mi-anttcli.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "mi-anttcli.tfm", vector = "tex-it", skewchar=0x7F }, + { name = "mi-anttcri.tfm", vector = "tex-bi", skewchar=0x7F }, + { name = "rm-anttcr.tfm", vector = "tex-bf", skewchar=0x7F }, + { name = "sy-anttclz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true + { name = "sy-anttclz.tfm", vector = "extensible-jmn-private", skewchar=0x30 }, + { name = "file:AntykwaTorunskaCondLight-Regular", vector = "tex-ex-braces", backmap = false }, + { name = "ex-anttcl.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, + }, +} + +local tweaks = nil +local common = fonts.goodies.load("common-math-jmn.lfg") + +if common then + + tweaks = { + { + tweak = "addmissing", + action = common.mathematics.helpers.addmissing, + }, + { + tweak = "setoptions", + set = { "ignorekerndimensions" } + }, -- we have dp > ht fences + { + tweak = "fixprimes", + factor = 1.0, -- accent base height + fake = 0.9, -- replace multiples with this width proportion + }, + { + tweak = "addequals", + force = true, + }, + { + tweak = "keepbases", +-- list = { 0x302 } + list = "default" + }, +} + + common.mathematics.helpers.copyrecipes(recipes) + +end + return { name = "antykwa-math", version = "1.00", @@ -123,59 +192,15 @@ return { notshiftfactor = 0.075, }, virtuals = { - ["antykwa-math"] = { - { name = "file:LatinModern-Math", features = "virtualmath-antykwa", main = true, parameters = false }, - -- - { name = "rm-anttr.tfm", vector = "tex-mr", skewchar=0x7F }, - { name = "mi-anttri.tfm", vector = "tex-mi", skewchar=0x7F }, - { name = "mi-anttri.tfm", vector = "tex-it", skewchar=0x7F }, - { name = "mi-anttbi.tfm", vector = "tex-bi", skewchar=0x7F }, - { name = "rm-anttb.tfm", vector = "tex-bf", skewchar=0x7F }, - { name = "sy-anttrz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true - { name = "sy-anttrz.tfm", vector = "extensible-jmn-private", skewchar=0x30 }, - { name = "file:AntykwaTorunska-Regular", vector = "tex-ex-braces", backmap = false }, - { name = "ex-anttr.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, - }, - ["antykwa-light-math"] = { - { name = "file:LatinModern-Math", features = "virtualmath-antykwa-light", main = true, parameters = false }, - -- - { name = "rm-anttl.tfm", vector = "tex-mr", skewchar=0x7F }, - { name = "mi-anttli.tfm", vector = "tex-mi", skewchar=0x7F }, - { name = "mi-anttli.tfm", vector = "tex-it", skewchar=0x7F }, - { name = "mi-anttri.tfm", vector = "tex-bi", skewchar=0x7F }, - { name = "rm-anttr.tfm", vector = "tex-bf", skewchar=0x7F }, - { name = "sy-anttlz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true - { name = "sy-anttlz.tfm", vector = "extensible-jmn-private", skewchar=0x30 }, - { name = "file:AntykwaTorunskaLight-Regular", vector = "tex-ex-braces", backmap = false }, - { name = "ex-anttl.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, - }, - ["antykwa-cond-math"] = { - { name = "file:LatinModern-Math", features = "virtualmath-antykwa-cond", main = true, parameters = false }, - -- - { name = "rm-anttcr.tfm", vector = "tex-mr", skewchar=0x7F }, - { name = "mi-anttcri.tfm", vector = "tex-mi", skewchar=0x7F }, - { name = "mi-anttcri.tfm", vector = "tex-it", skewchar=0x7F }, - { name = "mi-anttcbi.tfm", vector = "tex-bi", skewchar=0x7F }, - { name = "rm-anttcb.tfm", vector = "tex-bf", skewchar=0x7F }, - { name = "sy-anttcrz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true - { name = "sy-anttcrz.tfm", vector = "extensible-jmn-private", skewchar=0x30 }, - { name = "file:AntykwaTorunskaCond-Regular", vector = "tex-ex-braces", backmap = false }, - { name = "ex-anttcr.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, - }, - ["antykwa-light-cond-math"] = { - { name = "file:LatinModern-Math", features = "virtualmath-antykwa-lightcond", main = true, parameters = false }, - -- - { name = "rm-anttcl.tfm", vector = "tex-mr", skewchar=0x7F }, - { name = "mi-anttcli.tfm", vector = "tex-mi", skewchar=0x7F }, - { name = "mi-anttcli.tfm", vector = "tex-it", skewchar=0x7F }, - { name = "mi-anttcri.tfm", vector = "tex-bi", skewchar=0x7F }, - { name = "rm-anttcr.tfm", vector = "tex-bf", skewchar=0x7F }, - { name = "sy-anttclz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true, ignore = uglyones }, -- jmn = true - { name = "sy-anttclz.tfm", vector = "extensible-jmn-private", skewchar=0x30 }, - { name = "file:AntykwaTorunskaCondLight-Regular", vector = "tex-ex-braces", backmap = false }, - { name = "ex-anttcl.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, - } + ["antykwa-math"] = { recipe = recipes["antykwa-math"], tweaks = tweaks }, + ["antykwa-light-math"] = { recipe = recipes["antykwa-light-math"], tweaks = tweaks }, + ["antykwa-cond-math"] = { recipe = recipes["antykwa-cond-math"], tweaks = tweaks }, + ["antykwa-light-cond-math"] = { recipe = recipes["antykwa-light-cond-math"], tweaks = tweaks }, + + ["antykwa-math-nt"] = common and { recipe = recipes["antykwa-math-nt"] } or nil, + ["antykwa-light-math-nt"] = common and { recipe = recipes["antykwa-light-math-nt"] } or nil, + ["antykwa-cond-math-nt"] = common and { recipe = recipes["antykwa-cond-math-nt"] } or nil, + ["antykwa-light-cond-math-nt"] = common and { recipe = recipes["antykwa-light-cond-math-nt"] } or nil, }, - addmissing = helpers.addmissing, } } diff --git a/tex/context/fonts/mkiv/bonum-math.lfg b/tex/context/fonts/mkiv/bonum-math.lfg index ce36da352..13be0e69d 100644 --- a/tex/context/fonts/mkiv/bonum-math.lfg +++ b/tex/context/fonts/mkiv/bonum-math.lfg @@ -59,6 +59,7 @@ return { }, }, }, + presets.smalldigits { factor = 0.95 }, presets.scripttocalligraphic { }, presets.rsfstoscript { rscale = 0.98 }, presets.rsfsuprighttoscript { rscale = 0.98 }, @@ -93,8 +94,8 @@ return { { tweak = "kerns", list = { - [0x002F] = { topleft = -0.2, bottomright = -0.2 }, - ["0x002F.variants.*"] = { topleft = -0.2, bottomright = -0.2 }, + [0x002F] = { topleft = -0.2, bottomright = -0.2 }, + ["0x002F.variants.*"] = { topleft = -0.2, bottomright = -0.2 }, [0x007D] = { topright = -0.05, bottomright = -0.05 }, -- right brace variants ["0x7D.variants.*"] = { topright = -0.05, bottomright = -0.05 }, -- right brace variants ["0x7D.parts.top"] = { topright = -0.15, }, -- right brace top @@ -112,9 +113,9 @@ return { [0x27EB] = { topright = -0.1, bottomright = -0.1 }, ["0x27EB.variants.*"] = { topright = -0.2, bottomright = -0.2 }, -- - [0x1D465] = { bottomright = -0.05, }, -- italic x (ic is too large) - [0x00393] = { bottomright = -0.30, }, -- upright Gamma - [0x1D43F] = { bottomright = 0.01, }, -- upright L + [0x1D465] = { bottomright = -0.05 }, -- italic x (ic is too large) + [0x00393] = { bottomright = -0.30 }, -- upright Gamma + [0x1D43F] = { bottomright = 0.01 }, -- upright L ["0x222B.parts.bottom"] = { bottomright = -0.20 }, -- int ["0x222C.parts.bottom"] = { bottomright = -0.15 }, -- iint ["0x222D.parts.bottom"] = { bottomright = -0.10 }, -- iiint @@ -145,27 +146,23 @@ return { { tweak = "dimensions", list = { - -- [0x007D] = { topright = -0.05, bottomright = -0.05 }, -- right brace variants - ["0x7C"] = { width = 1.4, xoffset=0.2 }, -- vertical bar - -- ["0x7C.variants.*"] = { width = 1, extend = 2.4 }, -- vertical bar - -- ["0x7C.parts.top"] = { , }, -- vertical bar - -- ["0x7C.parts.bottom"] = { bottomright = -0.15 }, -- vertical bar + -- [0x007D] = { topright = -0.05, bottomright = -0.05 }, -- right brace variants + ["0x7C"] = { width = 1.4, xoffset=0.2 }, -- vertical bar (just looks better tis way) + -- ["0x7C.variants.*"] = { width = 1, extend = 2.4 }, + -- ["0x7C.parts.top"] = { }, + -- ["0x7C.parts.bottom"] = { bottomright = -0.15 }, }, }, --- { --- tweak = "fixaccents", --- }, -- First we set the dimensions of the initial accent which started out as zero but we want - -- a proper width. - { - tweak = "dimensions", - list = { - [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat - [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde - [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve - [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck - }, - }, + -- a proper width. Thjis is no longer needed because we tweak the dimensions automatically, + -- so this is just some documented history. + -- { + -- tweak = "dimensions", + -- list = { + -- [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat + -- ["0x00302.flataccent"] = { width = 1.4, anchor = 1.20 }, -- no offset, because we copy + -- }, + -- }, -- Then we deal with all offsets and heights in one go. So we treat the initial accent -- as well as the variants here. But none for Bonum. -- We now copy these to the not wide slots so that we can set these to stretch as well, @@ -236,10 +233,9 @@ return { }, { tweak = "replacerules", - -- minus = true, -- we have an extensible - fraction = { height = .244, yoffset = .757 }, - radical = { height = .244, yoffset = .754 }, - stacker = { height = .244, yoffset = .757 }, + fraction = { height = .244, yoffset = .758 }, + radical = { height = .244, yoffset = .758, leftoffset = .1, rightoffset = .1 }, + stacker = { height = .244, yoffset = .758 }, }, { -- This tweak is only needed for the funny arrows and these now get properly diff --git a/tex/context/fonts/mkiv/cambria-math.lfg b/tex/context/fonts/mkiv/cambria-math.lfg index 3b8e12cd9..15fad23c4 100644 --- a/tex/context/fonts/mkiv/cambria-math.lfg +++ b/tex/context/fonts/mkiv/cambria-math.lfg @@ -87,15 +87,15 @@ return { }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. - { - tweak = "dimensions", - list = { - [0x00302] = { width = 2, anchor = 1.5, xoffset = .25 }, -- widehat - [0x00303] = { width = 2, anchor = 1.5, xoffset = .25 }, -- widetilde - [0x00306] = { width = 2, anchor = 1.5, xoffset = .25 }, -- widebreve - [0x0030C] = { width = 2, anchor = 1.5, xoffset = .25 }, -- widecheck - }, - }, + -- { + -- tweak = "dimensions", + -- list = { + -- [0x00302] = { width = 2, anchor = 1.5, xoffset = .25 }, -- widehat + -- [0x00303] = { width = 2, anchor = 1.5, xoffset = .25 }, -- widetilde + -- [0x00306] = { width = 2, anchor = 1.5, xoffset = .25 }, -- widebreve + -- [0x0030C] = { width = 2, anchor = 1.5, xoffset = .25 }, -- widecheck + -- }, + -- }, -- Then we deal with all offsets and heights in one go. So we treat the initial accent -- as well as the variants here. { @@ -143,7 +143,8 @@ return { radical = { height = .204, yoffset = .796, - -- leftoffset = .075, + leftoffset = .0925, + rightoffset = .0925, }, stacker = { height = .204, diff --git a/tex/context/fonts/mkiv/common-math-jmn.lfg b/tex/context/fonts/mkiv/common-math-jmn.lfg index 995da0db6..1df814b2f 100644 --- a/tex/context/fonts/mkiv/common-math-jmn.lfg +++ b/tex/context/fonts/mkiv/common-math-jmn.lfg @@ -1,3 +1,12 @@ +if CONTEXTLMTXMODE == 0 then + + fonts.encodings.math["extensible-jmn-private"] = { } + fonts.encodings.math["tex-ex-braces"] = { } + + return false + +end + local nps = fonts.helpers.newprivateslot local fake20D6 = nps("arrow fake 0x20D6") @@ -10,6 +19,25 @@ local fake034D = nps("arrow fake 0x034D") local real034D = nps("arrow real 0x034D") +if not fonts.encodings.math["extensible-jmn-private"] then + + local ps = fonts.helpers.privateslot + + fonts.encodings.math["extensible-jmn-private"] = { + [ps("rule middle piece")] = 200, -- minusjmn + [ps("rule right piece")] = 201, -- minusrightjmn + [ps("rule left piece")] = 202, -- minusleftjmn + [ps("double rule middle piece")] = 203, -- equaljmn + [ps("double rule right piece")] = 204, -- equalrightjmn + [ps("double rule left piece")] = 205, -- equalleftjmn + [ps("arrow left piece")] = 206, -- arrowleftjmn + [ps("arrow right piece")] = 207, -- arrowrightjmn + [ps("double arrow left piece")] = 208, -- arrowdblleftjmn + [ps("double arrow right piece")] = 209, -- arrowdblrightjmn + } + +end + return { name = "common-math-jmn", version = "1.00", @@ -18,6 +46,15 @@ return { copyright = "ConTeXt development team", mathematics = { helpers = { + copyrecipes = function(recipes) + local list = table.keys(recipes) + for i=1,#list do + local n = list[i] + local t = table.copy(recipes[n]) + t[1].features = t[1].features .. "-nt" + recipes[n .. "-nt"] = t + end + end, addmissing = function(main) local max = math.max @@ -249,6 +286,8 @@ local bfactor = antykwa and 0.1 or 0.2 characters[0x2980].extensible = true characters[0x2980].varianttemplate = 0x5B +-- characters[0x0302].keepbase = true -- can also be a tweak + -- 21CB leftrightharpoon -- 21CC rightleftharpoon diff --git a/tex/context/fonts/mkiv/common-math.lfg b/tex/context/fonts/mkiv/common-math.lfg index 45e46d865..5c7ade3fb 100644 --- a/tex/context/fonts/mkiv/common-math.lfg +++ b/tex/context/fonts/mkiv/common-math.lfg @@ -301,6 +301,17 @@ return { }, } end, + smalldigits = function(parameters) + return { + tweak = "dimensions", + feature = "smalldigits", + list = { + ["digitsnormal"] = { + factor = parameters.factor or 0.9, + }, + }, + } + end, }, }, }, diff --git a/tex/context/fonts/mkiv/concrete-math.lfg b/tex/context/fonts/mkiv/concrete-math.lfg index e92bb122a..3c8f36391 100644 --- a/tex/context/fonts/mkiv/concrete-math.lfg +++ b/tex/context/fonts/mkiv/concrete-math.lfg @@ -97,9 +97,16 @@ return { }, { tweak = "replacerules", + -- minus = { + -- leftoffset = 0, + -- rightoffset = 0, + -- }, minus = true, fraction = { height = .2, yoffset = .8 }, - radical = { height = .2, yoffset = .8, leftoffset = .2 }, + -- Hans, add option not to cut off first piece + -- Hans, check height. + radical = { height = .2, yoffset = .585, leftoffset = .085, rightoffset = .085, leftoverlap = 0.03, yscale = 0.8 }, + -- radical = { height = .2, yoffset = .75, leftoffset = .085, rightoffset = .085, leftoverlap = 0.039 }, stacker = { height = .2, yoffset = .8 }, }, { diff --git a/tex/context/fonts/mkiv/dejavu-math.lfg b/tex/context/fonts/mkiv/dejavu-math.lfg index 4098a32d0..bd355c3b5 100644 --- a/tex/context/fonts/mkiv/dejavu-math.lfg +++ b/tex/context/fonts/mkiv/dejavu-math.lfg @@ -116,15 +116,15 @@ return { }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. - { - tweak = "dimensions", - list = { - [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat - [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde - [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve - [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck - }, - }, + -- { + -- tweak = "dimensions", + -- list = { + -- [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat + -- [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde + -- [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve + -- [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck + -- }, + -- }, -- Then we deal with all offsets and heights in one go. So we treat the initial accent -- as well as the variants here. { @@ -152,9 +152,8 @@ return { }, { tweak = "replacerules", - -- minus = true, -- we have an extensible fraction = { height = .254, yoffset = .746 }, - radical = { height = .254, yoffset = .746, yscale = .912 }, + radical = { height = .17, leftoffset = .1, rightoffset = .1, yoffset = .485, yscale = .65 }, stacker = { height = .254, yoffset = .746 }, }, { diff --git a/tex/context/fonts/mkiv/ebgaramond-math.lfg b/tex/context/fonts/mkiv/ebgaramond-math.lfg index c25147b14..20bf48460 100644 --- a/tex/context/fonts/mkiv/ebgaramond-math.lfg +++ b/tex/context/fonts/mkiv/ebgaramond-math.lfg @@ -190,10 +190,12 @@ return { yoffset = .8, }, radical = { - height = .2, - yoffset = .8, - leftoffset = .075, - yscale = .9775, + height = .2, + yoffset = .66, + leftoverlap = .020, + leftoffset = .075, -- todo + rightoffset = .075, -- todo + yscale = .84, }, stacker = { height = .2, diff --git a/tex/context/fonts/mkiv/erewhon-math.lfg b/tex/context/fonts/mkiv/erewhon-math.lfg index 5a28735f1..91f084e9b 100644 --- a/tex/context/fonts/mkiv/erewhon-math.lfg +++ b/tex/context/fonts/mkiv/erewhon-math.lfg @@ -109,9 +109,10 @@ return { yoffset = .812, }, radical = { - height = .188, - yoffset = .812, - leftoffset = 0.075, + height = .188, + yoffset = .812, + leftoffset = 0.12, + rightoffset = 0.12, }, stacker = { height = .188, diff --git a/tex/context/fonts/mkiv/iwona-math.lfg b/tex/context/fonts/mkiv/iwona-math.lfg index 815b9e120..2754e1577 100644 --- a/tex/context/fonts/mkiv/iwona-math.lfg +++ b/tex/context/fonts/mkiv/iwona-math.lfg @@ -29,6 +29,82 @@ local uglyones = { vextenddouble = true, } +local recipes = { + ["iwona-math"] = { + { name = "file:LatinModern-Math", features = "virtualmath-iwona", main = true, parameters = false }, + -- + { name = "rm-iwonar.tfm", vector = "tex-mr", skewchar=0x7F }, + { name = "mi-iwonari.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "mi-iwonari.tfm", vector = "tex-it", skewchar=0x7F }, + { name = "mi-iwonami.tfm", vector = "tex-bi", skewchar=0x7F }, + { name = "rm-iwonam.tfm", vector = "tex-bf", skewchar=0x7F }, + { name = "sy-iwonarz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, + { name = "ex-iwonar.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, + }, + ["iwona-light-math"] = { + { name = "file:LatinModern-Math", features = "virtualmath-iwona-light", main = true, parameters = false }, + -- + { name = "rm-iwonal.tfm", vector = "tex-mr", skewchar=0x7F }, + { name = "mi-iwonali.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "mi-iwonali.tfm", vector = "tex-it", skewchar=0x7F }, + { name = "mi-iwonari.tfm", vector = "tex-bi", skewchar=0x7F }, + { name = "rm-iwonar.tfm", vector = "tex-bf", skewchar=0x7F }, + { name = "sy-iwonalz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, + { name = "ex-iwonal.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, + }, + ["iwona-medium-math"] = { + { name = "file:LatinModern-Math", features = "virtualmath-iwona-medium", main = true, parameters = false }, + -- + { name = "rm-iwonam.tfm", vector = "tex-mr", skewchar=0x7F }, + { name = "mi-iwonami.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "mi-iwonami.tfm", vector = "tex-it", skewchar=0x7F }, + { name = "mi-iwonabi.tfm", vector = "tex-bi", skewchar=0x7F }, + { name = "rm-iwonab.tfm", vector = "tex-bf", skewchar=0x7F }, + { name = "sy-iwonamz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, + { name = "ex-iwonam.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, + }, + ["iwona-heavy-math"] = { + { name = "file:LatinModern-Math", features = "virtualmath-iwona-heavy", main = true, parameters = false }, + -- + { name = "rm-iwonah.tfm", vector = "tex-mr", skewchar=0x7F }, + { name = "mi-iwonahi.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "mi-iwonahi.tfm", vector = "tex-it", skewchar=0x7F }, + { name = "mi-iwonahi.tfm", vector = "tex-bi", skewchar=0x7F }, + { name = "rm-iwonah.tfm", vector = "tex-bf", skewchar=0x7F }, + { name = "sy-iwonahz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, + { name = "ex-iwonah.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, + }, +} + +local tweaks = nil +local common = fonts.goodies.load("common-math-jmn.lfg") + +if common then + + tweaks = { + { + tweak = "addmissing", + action = common.mathematics.helpers.addmissing, + }, + { + tweak = "setoptions", + set = { "ignorekerndimensions" } + }, -- we have dp > ht fences + { + tweak = "fixprimes", + factor = 1.0, -- accent base height + fake = 0.9, -- replace multiples with this width proportion + }, + { + tweak = "addequals", + force = true, + }, + } + + common.mathematics.helpers.copyrecipes(recipes) + +end + return { name = "iwona-math", version = "1.00", @@ -44,51 +120,15 @@ return { -- "mkiv-base.map", }, virtuals = { - ["iwona-math"] = { - { name = "file:LatinModern-Math", features = "virtualmath-iwona", main = true, parameters = false }, - -- - { name = "rm-iwonar.tfm", vector = "tex-mr", skewchar=0x7F }, - { name = "mi-iwonari.tfm", vector = "tex-mi", skewchar=0x7F }, - { name = "mi-iwonari.tfm", vector = "tex-it", skewchar=0x7F }, - { name = "mi-iwonami.tfm", vector = "tex-bi", skewchar=0x7F }, - { name = "rm-iwonam.tfm", vector = "tex-bf", skewchar=0x7F }, - { name = "sy-iwonarz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, - { name = "ex-iwonar.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, - }, - ["iwona-light-math"] = { - { name = "file:LatinModern-Math", features = "virtualmath-iwona-light", main = true, parameters = false }, - -- - { name = "rm-iwonal.tfm", vector = "tex-mr", skewchar=0x7F }, - { name = "mi-iwonali.tfm", vector = "tex-mi", skewchar=0x7F }, - { name = "mi-iwonali.tfm", vector = "tex-it", skewchar=0x7F }, - { name = "mi-iwonari.tfm", vector = "tex-bi", skewchar=0x7F }, - { name = "rm-iwonar.tfm", vector = "tex-bf", skewchar=0x7F }, - { name = "sy-iwonalz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, - { name = "ex-iwonal.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, - }, - ["iwona-medium-math"] = { - { name = "file:LatinModern-Math", features = "virtualmath-iwona-medium", main = true, parameters = false }, - -- - { name = "rm-iwonam.tfm", vector = "tex-mr", skewchar=0x7F }, - { name = "mi-iwonami.tfm", vector = "tex-mi", skewchar=0x7F }, - { name = "mi-iwonami.tfm", vector = "tex-it", skewchar=0x7F }, - { name = "mi-iwonabi.tfm", vector = "tex-bi", skewchar=0x7F }, - { name = "rm-iwonab.tfm", vector = "tex-bf", skewchar=0x7F }, - { name = "sy-iwonamz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, - { name = "ex-iwonam.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, - }, - ["iwona-heavy-math"] = { - { name = "file:LatinModern-Math", features = "virtualmath-iwona-heavy", main = true, parameters = false }, - -- - { name = "rm-iwonah.tfm", vector = "tex-mr", skewchar=0x7F }, - { name = "mi-iwonahi.tfm", vector = "tex-mi", skewchar=0x7F }, - { name = "mi-iwonahi.tfm", vector = "tex-it", skewchar=0x7F }, - { name = "mi-iwonahi.tfm", vector = "tex-bi", skewchar=0x7F }, - { name = "rm-iwonah.tfm", vector = "tex-bf", skewchar=0x7F }, - { name = "sy-iwonahz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, - { name = "ex-iwonah.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, - } + ["iwona-math"] = { recipe = recipes["iwona-math"], tweaks = tweaks }, + ["iwona-light-math"] = { recipe = recipes["iwona-light-math"], tweaks = tweaks }, + ["iwona-medium-math"] = { recipe = recipes["iwona-medium-math"], tweaks = tweaks }, + ["iwona-heavy-math"] = { recipe = recipes["iwona-heavy-math"], tweaks = tweaks }, + + ["iwona-math-nt"] = { recipe = common and recipes["iwona-math-nt"] or nil }, + ["iwona-light-math-nt"] = { recipe = common and recipes["iwona-light-math-nt"] or nil }, + ["iwona-medium-math-nt"] = { recipe = common and recipes["iwona-medium-math-nt"] or nil }, + ["iwona-heavy-math-nt"] = { recipe = common and recipes["iwona-heavy-math-nt"] or nil }, }, - addmissing = helpers.addmissing, } } diff --git a/tex/context/fonts/mkiv/kpfonts-math.lfg b/tex/context/fonts/mkiv/kpfonts-math.lfg index db3e44be8..628dd13b6 100644 --- a/tex/context/fonts/mkiv/kpfonts-math.lfg +++ b/tex/context/fonts/mkiv/kpfonts-math.lfg @@ -130,9 +130,10 @@ return { yoffset = .818, }, radical = { - height = .1818, - yoffset = .818, - leftoffset = 0.075, + height = .1818, + yoffset = .818, + leftoffset = 0.08, + rightoffset = 0.08, }, stacker = { height = .1818, diff --git a/tex/context/fonts/mkiv/kurier-math.lfg b/tex/context/fonts/mkiv/kurier-math.lfg index 221992518..a7290d0ca 100644 --- a/tex/context/fonts/mkiv/kurier-math.lfg +++ b/tex/context/fonts/mkiv/kurier-math.lfg @@ -29,6 +29,82 @@ local uglyones = { vextenddouble = true, } +local recipes = { + ["kurier-math"] = { + { name = "file:LatinModern-Math", features = "virtualmath-kurier", main = true, parameters = false }, + -- + { name = "rm-kurierr.tfm", vector = "tex-mr", skewchar=0x7F }, + { name = "mi-kurierri.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "mi-kurierri.tfm", vector = "tex-it", skewchar=0x7F }, + { name = "mi-kuriermi.tfm", vector = "tex-bi", skewchar=0x7F }, + { name = "rm-kurierm.tfm", vector = "tex-bf", skewchar=0x7F }, + { name = "sy-kurierrz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, + { name = "ex-kurierr.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, + }, + ["kurier-light-math"] = { + { name = "file:LatinModern-Math", features = "virtualmath-kurier-light", main = true, parameters = false }, + -- + { name = "rm-kurierl.tfm", vector = "tex-mr", skewchar=0x7F }, + { name = "mi-kurierli.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "mi-kurierli.tfm", vector = "tex-it", skewchar=0x7F }, + { name = "mi-kurierri.tfm", vector = "tex-bi", skewchar=0x7F }, + { name = "rm-kurierr.tfm", vector = "tex-bf", skewchar=0x7F }, + { name = "sy-kurierlz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, + { name = "ex-kurierl.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, + }, + ["kurier-medium-math"] = { + { name = "file:LatinModern-Math", features = "virtualmath-kurier-medium", main = true, parameters = false }, + -- + { name = "rm-kurierm.tfm", vector = "tex-mr", skewchar=0x7F }, + { name = "mi-kuriermi.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "mi-kuriermi.tfm", vector = "tex-it", skewchar=0x7F }, + { name = "mi-kurierhi.tfm", vector = "tex-bi", skewchar=0x7F }, + { name = "rm-kurierh.tfm", vector = "tex-bf", skewchar=0x7F }, + { name = "sy-kuriermz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, + { name = "ex-kurierm.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, + }, + ["kurier-heavy-math"] = { + { name = "file:LatinModern-Math", features = "virtualmath-kurier-heavy", main = true, parameters = false }, + -- + { name = "rm-kurierh.tfm", vector = "tex-mr", skewchar=0x7F }, + { name = "mi-kurierhi.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "mi-kurierhi.tfm", vector = "tex-it", skewchar=0x7F }, + { name = "mi-kurierhi.tfm", vector = "tex-bi", skewchar=0x7F }, + { name = "rm-kurierh.tfm", vector = "tex-bf", skewchar=0x7F }, + { name = "sy-kurierhz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, + { name = "ex-kurierh.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, + } +} + +local tweaks = nil +local common = fonts.goodies.load("common-math-jmn.lfg") + +if common then + + tweaks = { + { + tweak = "addmissing", + action = common.mathematics.helpers.addmissing, + }, + { + tweak = "setoptions", + set = { "ignorekerndimensions" } + }, -- we have dp > ht fences + { + tweak = "fixprimes", + factor = 1.0, -- accent base height + fake = 0.9, -- replace multiples with this width proportion + }, + { + tweak = "addequals", + force = true, + }, + } + + common.mathematics.helpers.copyrecipes(recipes) + +end + return { name = "kurier-math", version = "1.00", @@ -44,51 +120,15 @@ return { -- "mkiv-base.map", }, virtuals = { - ["kurier-math"] = { - { name = "file:LatinModern-Math", features = "virtualmath-kurier", main = true, parameters = false }, - -- - { name = "rm-kurierr.tfm", vector = "tex-mr", skewchar=0x7F }, - { name = "mi-kurierri.tfm", vector = "tex-mi", skewchar=0x7F }, - { name = "mi-kurierri.tfm", vector = "tex-it", skewchar=0x7F }, - { name = "mi-kuriermi.tfm", vector = "tex-bi", skewchar=0x7F }, - { name = "rm-kurierm.tfm", vector = "tex-bf", skewchar=0x7F }, - { name = "sy-kurierrz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, - { name = "ex-kurierr.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, - }, - ["kurier-light-math"] = { - { name = "file:LatinModern-Math", features = "virtualmath-kurier-light", main = true, parameters = false }, - -- - { name = "rm-kurierl.tfm", vector = "tex-mr", skewchar=0x7F }, - { name = "mi-kurierli.tfm", vector = "tex-mi", skewchar=0x7F }, - { name = "mi-kurierli.tfm", vector = "tex-it", skewchar=0x7F }, - { name = "mi-kurierri.tfm", vector = "tex-bi", skewchar=0x7F }, - { name = "rm-kurierr.tfm", vector = "tex-bf", skewchar=0x7F }, - { name = "sy-kurierlz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, - { name = "ex-kurierl.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, - }, - ["kurier-medium-math"] = { - { name = "file:LatinModern-Math", features = "virtualmath-kurier-medium", main = true, parameters = false }, - -- - { name = "rm-kurierm.tfm", vector = "tex-mr", skewchar=0x7F }, - { name = "mi-kuriermi.tfm", vector = "tex-mi", skewchar=0x7F }, - { name = "mi-kuriermi.tfm", vector = "tex-it", skewchar=0x7F }, - { name = "mi-kurierhi.tfm", vector = "tex-bi", skewchar=0x7F }, - { name = "rm-kurierh.tfm", vector = "tex-bf", skewchar=0x7F }, - { name = "sy-kuriermz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, - { name = "ex-kurierm.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, - }, - ["kurier-heavy-math"] = { - { name = "file:LatinModern-Math", features = "virtualmath-kurier-heavy", main = true, parameters = false }, - -- - { name = "rm-kurierh.tfm", vector = "tex-mr", skewchar=0x7F }, - { name = "mi-kurierhi.tfm", vector = "tex-mi", skewchar=0x7F }, - { name = "mi-kurierhi.tfm", vector = "tex-it", skewchar=0x7F }, - { name = "mi-kurierhi.tfm", vector = "tex-bi", skewchar=0x7F }, - { name = "rm-kurierh.tfm", vector = "tex-bf", skewchar=0x7F }, - { name = "sy-kurierhz.tfm", vector = "tex-sy", skewchar=0x30, parameters = true }, - { name = "ex-kurierh.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, - } + ["kurier-math"] = { recipe = recipes["kurier-math"], tweaks = tweaks }, + ["kurier-light-math"] = { recipe = recipes["kurier-light-math"], tweaks = tweaks }, + ["kurier-medium-math"] = { recipe = recipes["kurier-medium-math"], tweaks = tweaks }, + ["kurier-heavy-math"] = { recipe = recipes["kurier-heavy-math"], tweaks = tweaks }, + + ["kurier-math-nt"] = { recipe = common and recipes["kurier-math-nt"] or nil }, + ["kurier-light-math-nt"] = { recipe = common and recipes["kurier-light-math-nt"] or nil }, + ["kurier-medium-math-nt"] = { recipe = common and recipes["kurier-medium-math-nt"] or nil }, + ["kurier-heavy-math-nt"] = { recipe = common and recipes["kurier-heavy-math-nt"] or nil }, }, - addmissing = helpers.addmissing, - } + }, } diff --git a/tex/context/fonts/mkiv/libertinus-math.lfg b/tex/context/fonts/mkiv/libertinus-math.lfg index 0b8ca42ad..02afa0e90 100644 --- a/tex/context/fonts/mkiv/libertinus-math.lfg +++ b/tex/context/fonts/mkiv/libertinus-math.lfg @@ -58,6 +58,9 @@ return { presets.moveintegrals { factor = 1.5 }, presets.wipeitalics { }, { + tweak = "checkaccents", + }, + { tweak = "simplifykerns", }, { @@ -94,15 +97,15 @@ return { }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. - { - tweak = "dimensions", - list = { - [0x00302] = { width = 1.8, anchor = 1.40, xoffset = .20 }, -- widehat - [0x00303] = { width = 2.0, anchor = 1.50, xoffset = .30 }, -- widetilde - [0x00306] = { width = 1.6, anchor = 1.30, xoffset = .15 }, -- widebreve - [0x0030C] = { width = 1.3, anchor = 1.15, xoffset = .075 }, -- widecheck - }, - }, + -- { + -- tweak = "dimensions", + -- list = { + -- [0x00302] = { width = 1.8, anchor = 1.40, xoffset = .20 }, -- widehat + -- [0x00303] = { width = 2.0, anchor = 1.50, xoffset = .30 }, -- widetilde + -- [0x00306] = { width = 1.6, anchor = 1.30, xoffset = .15 }, -- widebreve + -- [0x0030C] = { width = 1.3, anchor = 1.15, xoffset = .075 }, -- widecheck + -- }, + -- }, -- Then we deal with all offsets and heights in one go. So we treat the initial accent -- as well as the variants here. None in libertinus. -- We now copy these to the not wide slots so that we can set these to stretch as well, @@ -154,10 +157,11 @@ return { yoffset = .825, }, radical = { - height = .140, - yoffset = .800, - leftoffset = .075, - yscale = .950, + height = .140, + yoffset = .6575, + leftoffset = .075, + rightoffset = .075, + yscale = .8, }, stacker = { height = .176, diff --git a/tex/context/fonts/mkiv/lucida-math.lfg b/tex/context/fonts/mkiv/lucida-math.lfg index 1e5391d6a..2c42db595 100644 --- a/tex/context/fonts/mkiv/lucida-math.lfg +++ b/tex/context/fonts/mkiv/lucida-math.lfg @@ -15,7 +15,7 @@ return { parameters = { FractionRuleThickness = 55, -- AccentBaseDepth = 250, - FlattenedAccentBaseHeight = 710,-- not present in font, set too small by 1. + FlattenedAccentBaseHeight = 710,-- slightly too large in the font DelimiterPercent = 90, DelimiterShortfall = 400, SuperscriptBottomMaxWithSubscript = 325, @@ -37,18 +37,18 @@ return { tweak = "parameters", feature = "boldmath", list = { - -- RadicalRuleThickness = 55, - RadicalRuleThickness = 60, - -- RadicalRuleThickness = "1.09*RadicalRuleThickness", - -- FractionRuleThickness = 65, - -- OverRuleThickness = 65, - -- UnderRuleThickness = 65, + RadicalRuleThickness = 60, + -- RadicalRuleThickness = "1.09*RadicalRuleThickness", + -- FractionRuleThickness = 65, + -- OverRuleThickness = 65, + -- UnderRuleThickness = 65, } }, { tweak = "addmirrors", }, - presets.scripttocalligraphic { }, + presets.smalldigits { factor = 0.90 }, + presets.scripttocalligraphic { }, presets.rsfstoscript { rscale = 1 }, presets.rsfsuprighttoscript { rscale = 1 }, presets.moderntocalligraphic { rscale = 1 }, @@ -124,6 +124,9 @@ return { -- and then need to tweak the width (which is auto set because it was zero with a large -- accent anchor offset). First we copy and fix. { + tweak = "checkaccents", + }, + { tweak = "extendaccents", }, { @@ -132,6 +135,10 @@ return { { tweak = "fixaccents", }, +{ + tweak = "keepbases", + list = { 0x302 } +}, { tweak = "radicaldegreeanchors", list = { @@ -166,9 +173,9 @@ return { ["0x0029.parts.top"] = { topright = -0.25 }, -- right parenthesis top ["0x0029.parts.bottom"] = { bottomright = -0.25 }, -- right parenthesis bottom ["0x0029.variants.*"] = { topright = -0.2, bottomright = -0.2 }, -- right parenthesis variants - ["0x221A.parts.top"] = { topright = 0.2 }, -- right radical top + ["0x221A.parts.top"] = { topright = 0.2 }, -- right radical top ["0x221A.parts.bottom"] = { bottomright = 0.2 }, -- right radical bottom - ["0x221A.variants.*"] = { topright = 0.2, bottomright = 0.2 }, -- right radical variants + ["0x221A.variants.*"] = { topright = 0.2, bottomright = 0.2 }, -- right radical variants [0x27E9] = { topright = -0.2, bottomright = -0.2 }, -- angle ["0x27E9.variants.*"] = { topright = -0.3, bottomright = -0.3 }, [0x27EB] = { topright = -0.2, bottomright = -0.2 }, @@ -195,18 +202,19 @@ return { { tweak = "replacerules", minus = { - leftoffset = .2, - rightoffset = .2, + leftoffset = .12, + rightoffset = .12, }, fraction = { height = .2, yoffset = .825, }, radical = { - height = .2, - yoffset = .825, - leftoffset = .075, - yscale = .940, + height = .13, + yoffset = .825, + leftoffset = .124, + rightoffset = .124, + yscale = .940, }, stacker = { height = .2, diff --git a/tex/context/fonts/mkiv/modern-math.lfg b/tex/context/fonts/mkiv/modern-math.lfg index fa4216263..ef99513b9 100644 --- a/tex/context/fonts/mkiv/modern-math.lfg +++ b/tex/context/fonts/mkiv/modern-math.lfg @@ -160,15 +160,15 @@ return { }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. - { - tweak = "dimensions", - list = { - [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat - [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde - [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve - [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck - }, - }, +-- { +-- tweak = "dimensions", +-- list = { +-- [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat +-- [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde +-- [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve +-- [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck +-- }, +-- }, -- Then we deal with all offsets and heights in one go. So we treat the initial accent -- as well as the variants here. { @@ -333,7 +333,9 @@ return { tweak = "replacerules", -- minus = true, -- we have an extensible fraction = { height = .15, yoffset = .85 }, - radical = { height = .15, yoffset = .85 }, + radical = { height = .15, yoffset = .85, leftoffset = .065, rightoffset = .065, leftoverlap = 0.023, +rightoverlap = 0.023 +}, stacker = { height = .15, yoffset = .85 }, }, { diff --git a/tex/context/fonts/mkiv/newcomputermodern-math.lfg b/tex/context/fonts/mkiv/newcomputermodern-math.lfg index d147e787e..12c6e8b23 100644 --- a/tex/context/fonts/mkiv/newcomputermodern-math.lfg +++ b/tex/context/fonts/mkiv/newcomputermodern-math.lfg @@ -155,7 +155,7 @@ return { tweak = "replacerules", -- minus = true, -- we have an extensible fraction = { height = .15, yoffset = .85 }, - radical = { height = .15, yoffset = .85 }, + radical = { height = .15, yoffset = .823, leftoffset = .065, rightoffset = .065, leftoverlap = 0.03 }, stacker = { height = .15, yoffset = .85 }, }, { diff --git a/tex/context/fonts/mkiv/pagella-math.lfg b/tex/context/fonts/mkiv/pagella-math.lfg index 3aa3ef24b..05e6fad81 100644 --- a/tex/context/fonts/mkiv/pagella-math.lfg +++ b/tex/context/fonts/mkiv/pagella-math.lfg @@ -114,12 +114,6 @@ return { tweak = "extendaccents", }, { - tweak = "radicaldegreeanchors", - list = { - ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.0, vfactor = 1.1 }, - } - }, - { tweak = "flattenaccents", }, { @@ -127,18 +121,18 @@ return { }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. - { - tweak = "dimensions", - list = { - [0x00300] = { width = 0.9 }, -- widegrave - [0x00301] = { width = 0.9 }, -- wideacute - [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat - [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde - [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve - [0x0030A] = { width = 0.9, xoffset = -.0 }, -- widering -- weird this one - [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck - }, - }, +-- { +-- tweak = "dimensions", +-- list = { +-- [0x00300] = { width = 0.9 }, -- widegrave +-- [0x00301] = { width = 0.9 }, -- wideacute +-- [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat +-- [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde +-- [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve +-- [0x0030A] = { width = 0.9, xoffset = -.0 }, -- widering -- weird this one +-- [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck +-- }, +-- }, -- Then we deal with all offsets and heights in one go. So we treat the initial accent -- as well as the variants here. { @@ -155,6 +149,12 @@ return { }, -- So far for the accents. { + tweak = "radicaldegreeanchors", + list = { + ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.0, vfactor = 1.1 }, + } + }, + { tweak = "fixslashes", }, { @@ -209,10 +209,17 @@ return { }, { tweak = "replacerules", - minus = { rightoffset = .045 }, - fraction = { height = .2, yoffset = .8, rightoffset = .04 }, - radical = { height = .2, yoffset = .8, rightoffset = .04 }, - stacker = { height = .2, yoffset = .8, rightoffset = .04 }, + fraction = { height = .215, yoffset = .785 }, + radical = { height = .215, yoffset = .785, leftoffset = .1, rightoffset = .1 }, + stacker = { height = .215, yoffset = .785 }, + }, + -- on the radical we adapt the offset and give some extra height (prevent clipping) + { + tweak = "replacerules", + feature = "euleroverpagella", + fraction = { height = .15, yoffset = .85 }, + radical = { height = .22, yoffset = .8, leftoffset = .05, rightoffset = .05, leftoverlap = .01 }, + stacker = { height = .15, yoffset = .85 }, }, { tweak = "addactuarian", diff --git a/tex/context/fonts/mkiv/schola-math.lfg b/tex/context/fonts/mkiv/schola-math.lfg index f0155cb57..42c2bbcc2 100644 --- a/tex/context/fonts/mkiv/schola-math.lfg +++ b/tex/context/fonts/mkiv/schola-math.lfg @@ -94,15 +94,15 @@ return { }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. - { - tweak = "dimensions", - list = { - [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat - [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde - [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve - [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck - }, - }, + -- { + -- tweak = "dimensions", + -- list = { + -- [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat + -- [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde + -- [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve + -- [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck + -- }, + -- }, -- Then we deal with all offsets and heights in one go. So we treat the initial accent -- as well as the variants here. Not in schola -- We now copy these to the not wide slots so that we can set these to stretch as well, @@ -124,10 +124,9 @@ return { }, { tweak = "replacerules", - -- minus = true, -- we have an extensible - fraction = { height = .25, yoffset = .75 }, - radical = { height = .25, yoffset = .75 }, - stacker = { height = .25, yoffset = .75 }, + fraction = { height = .25, yoffset = .7625 }, + radical = { height = .25, leftoffset = .1, rightoffset = .1, yoffset = .7625 }, + stacker = { height = .25, yoffset = .7625 }, }, { tweak = "addbars", diff --git a/tex/context/fonts/mkiv/stixtwo-math.lfg b/tex/context/fonts/mkiv/stixtwo-math.lfg index bbe4e3685..881de7523 100644 --- a/tex/context/fonts/mkiv/stixtwo-math.lfg +++ b/tex/context/fonts/mkiv/stixtwo-math.lfg @@ -157,15 +157,15 @@ return { }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. - { - tweak = "dimensions", - list = { - [0x00302] = { width = 1.2, anchor = 1.10, xoffset = .05 }, -- widehat - [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde - [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve - [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck - }, - }, + -- { + -- tweak = "dimensions", + -- list = { + -- [0x00302] = { width = 1.2, anchor = 1.10, xoffset = .05 }, -- widehat + -- [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde + -- [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve + -- [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck + -- }, + -- }, -- Then we deal with all offsets and heights in one go. So we treat the initial accent -- as well as the variants here. { @@ -208,8 +208,8 @@ return { minus = { height = .233, yoffset = .768, - -- leftoffset = .2, - -- rightoffset = .2, + leftoffset = .08, + rightoffset = .08, }, fraction = { height = .233, @@ -218,8 +218,8 @@ return { radical = { height = .233, yoffset = .768, - leftoffset = .05, - rightoffset = .05, + leftoffset = .08, + rightoffset = .08, }, stacker = { height = .233, diff --git a/tex/context/fonts/mkiv/termes-math.lfg b/tex/context/fonts/mkiv/termes-math.lfg index c74228179..7dfc73207 100644 --- a/tex/context/fonts/mkiv/termes-math.lfg +++ b/tex/context/fonts/mkiv/termes-math.lfg @@ -99,15 +99,15 @@ return { }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. - { - tweak = "dimensions", - list = { - [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat - [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde - [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve - [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck - }, - }, + -- { + -- tweak = "dimensions", + -- list = { + -- [0x00302] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widehat + -- [0x00303] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widetilde + -- [0x00306] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widebreve + -- [0x0030C] = { width = 1.4, anchor = 1.20, xoffset = .10 }, -- widecheck + -- }, + -- }, -- Then we deal with all offsets and heights in one go. So we treat the initial accent -- as well as the variants here. Not in termes. -- We now copy these to the not wide slots so that we can set these to stretch as well, @@ -130,11 +130,17 @@ return { }, { tweak = "replacerules", - -- minus = true, -- we have an extensible - fraction = { height = .2, yoffset = .8 }, - radical = { height = .2, yoffset = .8 }, - stacker = { height = .2, yoffset = .8 }, - }, + fraction = { height = .2, xleftoffset = .115, xrightoffset = .115, yoffset = .81 }, + radical = { height = .2, leftoffset = .115, rightoffset = .115, yoffset = .81 }, + stacker = { height = .2, xleftoffset = .115, xrightoffset = .115, yoffset = .81 }, + }, + -- { + -- tweak = "replacerules", + -- -- minus = true, -- we have an extensible + -- fraction = { height = .2, yoffset = .8 }, + -- radical = { height = .2, yoffset = .8 }, + -- stacker = { height = .2, yoffset = .8 }, + -- }, { tweak = "addbars", advance = 0.3, diff --git a/tex/context/fonts/mkiv/type-imp-antykwa.mkiv b/tex/context/fonts/mkiv/type-imp-antykwa.mkiv index f2fd100d0..413223df1 100644 --- a/tex/context/fonts/mkiv/type-imp-antykwa.mkiv +++ b/tex/context/fonts/mkiv/type-imp-antykwa.mkiv @@ -28,20 +28,27 @@ \startsetups[antykwa-torunska-cond] \directsetup{antykwa}\stopsetups \startsetups[antykwa-torunska-light-cond]\directsetup{antykwa}\stopsetups - \definefontfeature[virtualmath-antykwa] [virtualmath][virtualweight=antykwa] - \definefontfeature[virtualmath-antykwa-cond] [virtualmath][virtualweight=antykwa-cond] - \definefontfeature[virtualmath-antykwa-light] [virtualmath][virtualweight=antykwa-light] - \definefontfeature[virtualmath-antykwa-light-cond][virtualmath][virtualweight=antykwa-light-cond] - - \starttypescript [antykwa,antykwa-torunska,antykwa-light,antykwa-torunska-light,antykwa-cond,antykwa-torunska-cond,antykwa-light-cond,antykwa-torunska-light-cond] - \definetypeface[\typescriptone][\s!rm][\s!serif][\typescriptone] [\s!default] - \definetypeface[\typescriptone][\s!ss][\s!sans] [modern] [\s!default] [\s!rscale=1.05] - \definetypeface[\typescriptone][\s!tt][\s!mono] [modern] [\s!default] [\s!rscale=1.05] - \definetypeface[\typescriptone][\s!mm][\s!math] [\typescriptone] [\s!default] + % these fetaures make the loaded base font unique: + + \definefontfeature[virtualmath-antykwa] [virtualmath][virtualweight=antykwa] + \definefontfeature[virtualmath-antykwa-cond] [virtualmath][virtualweight=antykwa-cond] + \definefontfeature[virtualmath-antykwa-light] [virtualmath][virtualweight=antykwa-light] + \definefontfeature[virtualmath-antykwa-light-cond] [virtualmath][virtualweight=antykwa-light-cond] + + \definefontfeature[virtualmath-antykwa-nt] [virtualmath][virtualweight=antykwa-nt] + \definefontfeature[virtualmath-antykwa-cond-nt] [virtualmath][virtualweight=antykwa-cond-nt] + \definefontfeature[virtualmath-antykwa-light-nt] [virtualmath][virtualweight=antykwa-light-nt] + \definefontfeature[virtualmath-antykwa-light-cond-nt][virtualmath][virtualweight=antykwa-light-cond-nt] + + \starttypescript [antykwa,antykwa-nt,antykwa-torunska,antykwa-light,antykwa-light-nt,antykwa-torunska-light,antykwa-cond,antykwa-cond-nt,antykwa-torunska-cond,antykwa-light-cond,antykwa-light-cond-nt,antykwa-torunska-light-cond] + \definetypeface[\typescriptone][\s!rm][\s!serif][\typescriptone][\s!default] + \definetypeface[\typescriptone][\s!ss][\s!sans] [modern] [\s!default][\s!rscale=1.05] + \definetypeface[\typescriptone][\s!tt][\s!mono] [modern] [\s!default][\s!rscale=1.05] + \definetypeface[\typescriptone][\s!mm][\s!math] [\typescriptone][\s!default] \quittypescriptscanning \stoptypescript - \starttypescript [\s!serif] [antykwa,antykwa-torunska,antykwa-light,antykwa-torunska-light,antykwa-cond,antykwa-torunska-cond,antykwa-light-cond,antykwa-torunska-light-cond] + \starttypescript [\s!serif] [antykwa,antykwa-nt,antykwa-torunska,antykwa-light,antykwa-light-nt,antykwa-torunska-light,antykwa-cond,antykwa-cond-nt,antykwa-torunska-cond,antykwa-light-cond,antykwa-light-cond-nt,antykwa-torunska-light-cond] \definefontsynonym [AntykwaTorunska-Regular] [\s!file:AntykwaTorunska-Regular] [\s!features=\s!default] \definefontsynonym [AntykwaTorunska-Italic] [\s!file:AntykwaTorunska-Italic] [\s!features=\s!default] \definefontsynonym [AntykwaTorunska-Bold] [\s!file:AntykwaTorunska-Bold] [\s!features=\s!default] @@ -64,23 +71,37 @@ \loadfontgoodies[antykwa-math] \definefontsynonym[\s!MathRoman][antykwamath@antykwa-math] \stoptypescript - \starttypescript [\s!math][antykwa-light,antykwa-torunska-light][\s!all] \loadfontgoodies[antykwa-math] \definefontsynonym[\s!MathRoman][antykwalightmath@antykwa-light-math] \stoptypescript - \starttypescript [\s!math][antykwa-cond,antykwa-torunska-cond][\s!all] \loadfontgoodies[antykwa-math] \definefontsynonym[\s!MathRoman][antykwacondmath@antykwa-cond-math] \stoptypescript - \starttypescript [\s!math][antykwa-light-cond,antykwa-torunska-light-cond][\s!all] \loadfontgoodies[antykwa-math] \definefontsynonym[\s!MathRoman][antykwalightcondmath@antykwa-light-cond-math] \stoptypescript - \starttypescript [\s!serif] [antykwa,antykwa-torunska] [\s!name] + \starttypescript [\s!math][antykwa-nt][\s!all] + \loadfontgoodies[antykwa-math] + \definefontsynonym[\s!MathRoman][antykwamathnt@antykwa-math-nt] + \stoptypescript + \starttypescript [\s!math][antykwa-light-nt][\s!all] + \loadfontgoodies[antykwa-math] + \definefontsynonym[\s!MathRoman][antykwalightmathnt@antykwa-light-math-nt] + \stoptypescript + \starttypescript [\s!math][antykwa-cond-nt][\s!all] + \loadfontgoodies[antykwa-math] + \definefontsynonym[\s!MathRoman][antykwacondmathnt@antykwa-cond-math-nt] + \stoptypescript + \starttypescript [\s!math][antykwa-light-cond-nt][\s!all] + \loadfontgoodies[antykwa-math] + \definefontsynonym[\s!MathRoman][antykwacondmathnt@antykwa-light-cond-math-nt] + \stoptypescript + + \starttypescript [\s!serif] [antykwa,antykwa-nt,antykwa-torunska] [\s!name] \setups[\s!font:\s!fallback:\s!serif] \definefontsynonym [\s!Serif] [AntykwaTorunska-Regular] \definefontsynonym [\s!SerifBold] [AntykwaTorunska-Bold] @@ -88,7 +109,7 @@ \definefontsynonym [\s!SerifBoldItalic] [AntykwaTorunska-BoldItalic] \stoptypescript - \starttypescript [\s!serif] [antykwa-light,antykwa-torunska-light] [\s!name] + \starttypescript [\s!serif] [antykwa-light,antykwa-light-nt,antykwa-torunska-light] [\s!name] \setups[\s!font:\s!fallback:\s!serif] \definefontsynonym [\s!Serif] [AntykwaTorunska-Light] \definefontsynonym [\s!SerifBold] [AntykwaTorunska-Medium] @@ -96,7 +117,7 @@ \definefontsynonym [\s!SerifBoldItalic] [AntykwaTorunska-MediumItalic] \stoptypescript - \starttypescript [\s!serif] [antykwa-cond,antykwa-torunska-cond] [\s!name] + \starttypescript [\s!serif] [antykwa-cond,antykwa-cond-nt,antykwa-torunska-cond] [\s!name] \setups[\s!font:\s!fallback:\s!serif] \definefontsynonym [\s!Serif] [AntykwaTorunska-CondRegular] \definefontsynonym [\s!SerifBold] [AntykwaTorunska-CondBold] @@ -104,7 +125,7 @@ \definefontsynonym [\s!SerifBoldItalic] [AntykwaTorunska-CondBoldItalic] \stoptypescript - \starttypescript [\s!serif] [antykwa-light-cond,antykwa-torunska-light-cond] [\s!name] + \starttypescript [\s!serif] [antykwa-light-cond,antykwa-light-cond-nt,antykwa-torunska-light-cond] [\s!name] \setups[\s!font:\s!fallback:\s!serif] \definefontsynonym [\s!Serif] [AntykwaTorunska-CondLight] \definefontsynonym [\s!SerifBold] [AntykwaTorunska-CondMedium] diff --git a/tex/context/fonts/mkiv/type-imp-iwona.mkiv b/tex/context/fonts/mkiv/type-imp-iwona.mkiv index 01d859071..e68262265 100644 --- a/tex/context/fonts/mkiv/type-imp-iwona.mkiv +++ b/tex/context/fonts/mkiv/type-imp-iwona.mkiv @@ -25,12 +25,17 @@ \startsetups[iwona-medium-cond]\directsetup{antykwa}\stopsetups \startsetups[iwona-heavy-cond] \directsetup{antykwa}\stopsetups - \definefontfeature[virtualmath-iwona] [virtualmath][virtualweight=iwona] - \definefontfeature[virtualmath-iwona-light] [virtualmath][virtualweight=iwona-light] - \definefontfeature[virtualmath-iwona-medium][virtualmath][virtualweight=iwona-medium] - \definefontfeature[virtualmath-iwona-heavy] [virtualmath][virtualweight=iwona-heavy] + \definefontfeature[virtualmath-iwona] [virtualmath][virtualweight=iwona] + \definefontfeature[virtualmath-iwona-light] [virtualmath][virtualweight=iwona-light] + \definefontfeature[virtualmath-iwona-medium] [virtualmath][virtualweight=iwona-medium] + \definefontfeature[virtualmath-iwona-heavy] [virtualmath][virtualweight=iwona-heavy] - \starttypescript [\s!sans] [iwona,iwona-light,iwona-medium,iwona-heavy,iwona-cond,iwona-light-cond,iwona-medium-cond,iwona-heavy-cond] + \definefontfeature[virtualmath-iwona-nt] [virtualmath][virtualweight=iwona-nt] + \definefontfeature[virtualmath-iwona-light-nt] [virtualmath][virtualweight=iwona-light-nt] + \definefontfeature[virtualmath-iwona-medium-nt][virtualmath][virtualweight=iwona-medium-nt] + \definefontfeature[virtualmath-iwona-heavy-nt] [virtualmath][virtualweight=iwona-heavy-nt] + + \starttypescript [\s!sans] [iwona,iwona-light,iwona-medium,iwona-heavy,iwona-cond,iwona-light-cond,iwona-medium-cond,iwona-heavy-cond,iwona,iwona-light-nt,iwona-medium-nt,iwona-heavy-nt,iwona-cond-nt,iwona-light-cond-nt,iwona-medium-cond-nt,iwona-heavy-cond-nt] \definefontsynonym [Iwona-Regular] [\s!file:Iwona-Regular] [\s!features=\s!default] \definefontsynonym [Iwona-Italic] [\s!file:Iwona-Italic] [\s!features=\s!default] @@ -74,11 +79,27 @@ \definefontsynonym[\s!MathRoman][iwonaheavymath@iwona-heavy-math] \stoptypescript - \starttypescript [\s!math] [iwona,iwona-light,iwona-medium,iwona-heavy] [\s!all] + \starttypescript [\s!math][iwona-nt][\s!all] + \definefontsynonym[\s!MathRoman] [iwonamathnt@iwona-math-nt] + \definefontsynonym[\s!MathRomanBold][iwonamediummathnt@iwona-medium-math-nt] + \stoptypescript + \starttypescript [\s!math][iwona-light-nt][\s!all] + \definefontsynonym[\s!MathRoman] [iwonalightmathnt@iwona-light-math-nt] + \definefontsynonym[\s!MathRomanBold][iwonamathnt@kurier-medium-math-nt] + \stoptypescript + \starttypescript [\s!math][iwona-medium-nt][\s!all] + \definefontsynonym[\s!MathRoman] [iwonamediummathnt@iwona-medium-math-nt] + \definefontsynonym[\s!MathRomanBold][kurierheavymathnt@kurier-heavy-math-nt] + \stoptypescript + \starttypescript [\s!math][iwona-heavy-nt][\s!all] + \definefontsynonym[\s!MathRoman][iwonaheavymathnt@iwona-heavy-math-nt] + \stoptypescript + + \starttypescript [\s!math] [iwona,iwona-light,iwona-medium,iwona-heavy-nt,iwona-nt,iwona-light-nt,iwona-medium-nt,iwona-heavy-nt] [\s!all] \loadfontgoodies[iwona-math] \stoptypescript - \starttypescript [\s!sans] [iwona-light] [\s!name] + \starttypescript [\s!sans] [iwona-light,iwona-light-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Iwona-Light-Regular] \definefontsynonym [\s!SansItalic] [Iwona-Light-Italic] @@ -86,7 +107,7 @@ \definefontsynonym [\s!SansBoldItalic] [Iwona-Medium-Italic] \stoptypescript - \starttypescript [\s!sans] [iwona] [\s!name] + \starttypescript [\s!sans] [iwona,iwona-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Iwona-Regular] \definefontsynonym [\s!SansItalic] [Iwona-Italic] @@ -94,7 +115,7 @@ \definefontsynonym [\s!SansBoldItalic] [Iwona-BoldItalic] \stoptypescript - \starttypescript [\s!sans] [iwona-medium] [\s!name] + \starttypescript [\s!sans] [iwona-medium,iwona-medium-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Iwona-Medium-Regular] \definefontsynonym [\s!SansItalic] [Iwona-Medium-Italic] @@ -102,7 +123,7 @@ \definefontsynonym [\s!SansBoldItalic] [Iwona-Heavy-Italic] \stoptypescript - \starttypescript [\s!sans] [iwona-heavy] [\s!name] + \starttypescript [\s!sans] [iwona-heavy,iwona-heavy-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Iwona-Heavy-Regular] \definefontsynonym [\s!SansItalic] [Iwona-Heavy-Italic] @@ -110,7 +131,7 @@ \definefontsynonym [\s!SansBoldItalic] [Iwona-Heavy-Italic] \stoptypescript - \starttypescript [\s!sans] [iwona-light-cond] [\s!name] + \starttypescript [\s!sans] [iwona-light-cond,iwona-light-cond-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Iwona-CondLight-Regular] \definefontsynonym [\s!SansItalic] [Iwona-CondLight-Italic] @@ -119,7 +140,7 @@ \stoptypescript - \starttypescript [\s!sans] [iwona-cond] [\s!name] + \starttypescript [\s!sans] [iwona-cond,iwona-cond-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Iwona-CondRegular] \definefontsynonym [\s!SansItalic] [Iwona-CondItalic] @@ -127,7 +148,7 @@ \definefontsynonym [\s!SansBoldItalic] [Iwona-CondBoldItalic] \stoptypescript - \starttypescript [\s!sans] [iwona-medium-cond] [\s!name] + \starttypescript [\s!sans] [iwona-medium-cond,iwona-medium-cond-nt] [\s!name] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Iwona-CondMedium-Regular] \definefontsynonym [\s!SansItalic] [Iwona-CondMedium-Italic] @@ -135,7 +156,7 @@ \definefontsynonym [\s!SansBoldItalic] [Iwona-CondHeavy-Italic] \stoptypescript - \starttypescript [iwona,iwona-light,iwona-heavy,iwona-medium] + \starttypescript [iwona,iwona-light,iwona-heavy,iwona-medium,iwona-nt,iwona-light-nt,iwona-heavy-nt,iwona-medium-nt] \definetypeface[\typescriptone][\s!ss][\s!sans] [\typescriptone] [\s!default] \definetypeface[\typescriptone][\s!rm][\s!serif][modern] [\s!default] \definetypeface[\typescriptone][\s!tt][\s!mono] [modern] [\s!default] diff --git a/tex/context/fonts/mkiv/type-imp-kurier.mkiv b/tex/context/fonts/mkiv/type-imp-kurier.mkiv index 0ff7852fc..3f68cbfad 100644 --- a/tex/context/fonts/mkiv/type-imp-kurier.mkiv +++ b/tex/context/fonts/mkiv/type-imp-kurier.mkiv @@ -25,12 +25,17 @@ \startsetups[kurier-medium-cond]\directsetup{antykwa}\stopsetups \startsetups[kurier-heavy-cond] \directsetup{antykwa}\stopsetups - \definefontfeature[virtualmath-kurier] [virtualmath][virtualweight=kurier] - \definefontfeature[virtualmath-kurier-light] [virtualmath][virtualweight=kurier-light] - \definefontfeature[virtualmath-kurier-medium][virtualmath][virtualweight=kurier-medium] - \definefontfeature[virtualmath-kurier-heavy] [virtualmath][virtualweight=kurier-heavy] + \definefontfeature[virtualmath-kurier] [virtualmath][virtualweight=kurier] + \definefontfeature[virtualmath-kurier-light] [virtualmath][virtualweight=kurier-light] + \definefontfeature[virtualmath-kurier-medium] [virtualmath][virtualweight=kurier-medium] + \definefontfeature[virtualmath-kurier-heavy] [virtualmath][virtualweight=kurier-heavy] - \starttypescript [\s!sans] [kurier-light,kurier,kurier-medium,kurier-heavy] + \definefontfeature[virtualmath-kurier-nt] [virtualmath][virtualweight=kurier-nt] + \definefontfeature[virtualmath-kurier-light-nt] [virtualmath][virtualweight=kurier-light-nt] + \definefontfeature[virtualmath-kurier-medium-nt][virtualmath][virtualweight=kurier-medium-nt] + \definefontfeature[virtualmath-kurier-heavy-nt] [virtualmath][virtualweight=kurier-heavy-nt] + + \starttypescript [\s!sans] [kurier-light,kurier,kurier-medium,kurier-heavy,kurier-light-nt,kurier-nt,kurier-medium-nt,kurier-heavy-nt] \definefontsynonym [Kurier-Light] [\s!file:kurierlightregular] [\s!features=\s!default] \definefontsynonym [Kurier-LightItalic] [\s!file:kurierlightitalic] [\s!features=\s!default] \definefontsynonym [Kurier-Regular] [\s!file:kurierregular] [\s!features=\s!default] @@ -43,7 +48,7 @@ \definefontsynonym [Kurier-HeavyItalic] [\s!file:kurierheavyitalic] [\s!features=\s!default] \stoptypescript - \starttypescript [\s!sans] [kurier-lightcond,kurier-cond,kurier-mediumcond] + \starttypescript [\s!sans] [kurier-lightcond,kurier-cond,kurier-mediumcond,kurier-lightcond-nt,kurier-cond-nt,kurier-mediumcond-nt] \definefontsynonym [Kurier-CondLight] [\s!file:kuriercondlightregular] [\s!features=\s!default] \definefontsynonym [Kurier-CondLightItalic] [\s!file:kuriercondlightitalic] [\s!features=\s!default] \definefontsynonym [Kurier-CondRegular] [\s!file:kuriercondregular] [\s!features=\s!default] @@ -61,7 +66,7 @@ \definefontsynonym[\s!MathRomanBold][kuriermediummath@kurier-medium-math] \stoptypescript \starttypescript [\s!math][kurier-light][\s!all] - \definefontsynonym[\s!MathRoman][kurierlightmath@kurier-light-math] + \definefontsynonym[\s!MathRoman] [kurierlightmath@kurier-light-math] \definefontsynonym[\s!MathRomanBold][kuriermath@kurier-math] \stoptypescript \starttypescript [\s!math][kurier-medium][\s!all] @@ -72,11 +77,27 @@ \definefontsynonym[\s!MathRoman][kurierheavymath@kurier-heavy-math] \stoptypescript - \starttypescript [\s!math] [kurier,kurier-light,kurier-medium,kurier-heavy] [\s!all] + \starttypescript [\s!math][kurier-nt][\s!all] + \definefontsynonym[\s!MathRoman] [kuriermathnt@kurier-math-nt] + \definefontsynonym[\s!MathRomanBold][kuriermediummathnt@kurier-medium-math-nt] + \stoptypescript + \starttypescript [\s!math][kurier-light-nt][\s!all] + \definefontsynonym[\s!MathRoman] [kurierlightmathnt@kurier-light-math-nt] + \definefontsynonym[\s!MathRomanBold][kuriermathnt@kurier-math-nt] + \stoptypescript + \starttypescript [\s!math][kurier-medium-nt][\s!all] + \definefontsynonym[\s!MathRoman] [kuriermediummathnt@kurier-medium-math-nt] + \definefontsynonym[\s!MathRomanBold][kurierheavymathnt@kurier-heavy-math-nt] + \stoptypescript + \starttypescript [\s!math][kurier-heavy-nt][\s!all] + \definefontsynonym[\s!MathRoman][kurierheavymathnt@kurier-heavy-math-nt] + \stoptypescript + + \starttypescript [\s!math] [kurier,kurier-light,kurier-medium,kurier-heavy,kurier-nt,kurier-light-nt,kurier-medium-nt,kurier-heavy-nt] [\s!all] \loadfontgoodies[kurier-math] \stoptypescript - \starttypescript [\s!sans] [kurier-light] + \starttypescript [\s!sans] [kurier-light,kurier-light-nt] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Kurier-Light] \definefontsynonym [\s!SansItalic] [Kurier-LightItalic] @@ -84,7 +105,7 @@ \definefontsynonym [\s!SansBoldItalic] [Kurier-MediumItalic] \stoptypescript - \starttypescript [\s!sans] [kurier] + \starttypescript [\s!sans] [kurier,kurier-nt] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Kurier-Regular] \definefontsynonym [\s!SansItalic] [Kurier-Italic] @@ -92,7 +113,7 @@ \definefontsynonym [\s!SansBoldItalic] [Kurier-BoldItalic] \stoptypescript - \starttypescript [\s!sans] [kurier-medium] + \starttypescript [\s!sans] [kurier-medium,kurier-medium-nt] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Kurier-Medium] \definefontsynonym [\s!SansItalic] [Kurier-MediumItalic] @@ -100,7 +121,7 @@ \definefontsynonym [\s!SansBoldItalic] [Kurier-HeavyItalic] \stoptypescript - \starttypescript [\s!sans] [kurier-heavy] [\s!name] + \starttypescript [\s!sans] [kurier-heavy,kurier-heavy-nt] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Kurier-Heavy] \definefontsynonym [\s!SansItalic] [Kurier-HeavyItalic] @@ -108,7 +129,7 @@ \definefontsynonym [\s!SansBoldItalic] [Kurier-Heavy] \stoptypescript - \starttypescript [\s!sans] [kurier-lightcond] + \starttypescript [\s!sans] [kurier-lightcond,kurier-lightcond-nt] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Kurier-CondLight] \definefontsynonym [\s!SansItalic] [Kurier-CondLightItalic] @@ -116,7 +137,7 @@ \definefontsynonym [\s!SansBoldItalic] [Kurier-CondMediumItalic] \stoptypescript - \starttypescript [\s!sans] [kurier-cond] + \starttypescript [\s!sans] [kurier-cond,kurier-cond-nt] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Kurier-CondRegular] \definefontsynonym [\s!SansItalic] [Kurier-CondItalic] @@ -124,7 +145,7 @@ \definefontsynonym [\s!SansBoldItalic] [Kurier-CondBoldItalic] \stoptypescript - \starttypescript [\s!sans] [kurier-mediumcond] + \starttypescript [\s!sans] [kurier-mediumcond,kurier-mediumcond-nt] \setups[\s!font:\s!fallback:\s!sans] \definefontsynonym [\s!Sans] [Kurier-CondMedium] \definefontsynonym [\s!SansItalic] [Kurier-CondMediumItalic] @@ -132,7 +153,7 @@ \definefontsynonym [\s!SansBoldItalic] [Kurier-CondHeavyItalic] \stoptypescript - \starttypescript [kurier-light,kurier,kurier-medium,kurier-heavy,kurier-lightcond,kurier-cond,kurier-mediumcond] + \starttypescript [kurier-light,kurier,kurier-medium,kurier-heavy,kurier-lightcond,kurier-cond,kurier-mediumcond,kurier-light,kurier-nt,kurier-medium-nt,kurier-heavy-nt,kurier-lightcond-nt,kurier-cond-nt,kurier-mediumcond-nt] \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] \definetypeface [\typescriptone] [\s!rm] [\s!serif] [modern] [\s!default] \definetypeface [\typescriptone] [\s!tt] [\s!mono] [modern] [\s!default] diff --git a/tex/context/fonts/mkiv/type-imp-lucida.mkiv b/tex/context/fonts/mkiv/type-imp-lucida.mkiv index 44230b55d..e02e2fbae 100644 --- a/tex/context/fonts/mkiv/type-imp-lucida.mkiv +++ b/tex/context/fonts/mkiv/type-imp-lucida.mkiv @@ -35,9 +35,9 @@ \stoptypescript \starttypescript [\s!serif] [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt] - \definefontsynonym [\s!Serif] [\s!file:LucidaBrightOT.otf][\s!goodies=lucida-text] - \definefontsynonym [\s!SerifBold] [\s!file:LucidaBrightOT-Demi.otf][\s!goodies=lucida-text] - \definefontsynonym [\s!SerifItalic] [\s!file:LucidaBrightOT-Italic.otf][\s!goodies=lucida-text] + \definefontsynonym [\s!Serif] [\s!file:LucidaBrightOT.otf] [\s!goodies=lucida-text] + \definefontsynonym [\s!SerifBold] [\s!file:LucidaBrightOT-Demi.otf] [\s!goodies=lucida-text] + \definefontsynonym [\s!SerifItalic] [\s!file:LucidaBrightOT-Italic.otf] [\s!goodies=lucida-text] \definefontsynonym [\s!SerifBoldItalic] [\s!file:LucidaBrightOT-DemiItalic.otf][\s!goodies=lucida-text] \definefontsynonym [\s!SerifSlanted] [\s!SerifItalic] \definefontsynonym [\s!SerifBoldSlanted] [\s!SerifBoldItalic] @@ -83,8 +83,8 @@ \starttypescript [\s!math] [lucidaot-nt,lucida-nt] \definefontsynonym [\s!MathRoman] [\s!file:LucidaBrightMathOT.otf] [\s!features={\s!math\mathsizesuffix,mathlucida,lucida:mathextra,mathextra}] -% \definefontsynonym [\s!MathRomanBold] [\s!file:LucidaBrightMathOT-Demi.otf] [\s!features={\s!math\mathsizesuffix,mathlucida,mathextra}] - \definefontsynonym [\s!MathRomanBold] [\s!file:LucidaBrightMathOT.otf] [\s!features={\s!math\mathsizesuffix,lucida-math-bold,mathlucida,lucida:mathextra,mathextra}] + % \definefontsynonym [\s!MathRomanBold] [\s!file:LucidaBrightMathOT-Demi.otf] [\s!features={\s!math\mathsizesuffix,mathlucida,mathextra}] + \definefontsynonym [\s!MathRomanBold] [\s!file:LucidaBrightMathOT.otf] [\s!features={\s!math\mathsizesuffix,lucida-math-bold,mathlucida,lucida:mathextra,mathextra}] \stoptypescript \starttypescript [\s!handwriting] [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt] diff --git a/tex/context/fonts/mkiv/xcharter-math.lfg b/tex/context/fonts/mkiv/xcharter-math.lfg index 48b1cad5d..cc4e992d4 100644 --- a/tex/context/fonts/mkiv/xcharter-math.lfg +++ b/tex/context/fonts/mkiv/xcharter-math.lfg @@ -96,9 +96,12 @@ return { yoffset = .812, }, radical = { - height = .188, - yoffset = .812, - leftoffset = 0.2,-- no effect? + height = .188, + yoffset = .812, + leftoffset = 0.95, + rightoffset = 0.95, + -- leftoverlap = 0.1, -- Daniel will fix(!) + -- yscale = 0.8, -- no scaling }, stacker = { height = .188, diff --git a/tex/context/modules/mkiv/s-fonts-variable.mkiv b/tex/context/modules/mkiv/s-fonts-variable.mkiv index d061179eb..16ce91748 100644 --- a/tex/context/modules/mkiv/s-fonts-variable.mkiv +++ b/tex/context/modules/mkiv/s-fonts-variable.mkiv @@ -132,8 +132,11 @@ % \showfontvariations[font=file:goldmansanscdvf_wght.ttf] % \stoptext -\showfontvariations - [font=file:nupuram-vf.otf,features=malayalam-two,sample=test നൂപുരം] +% \showfontvariations +% [font=file:nupuram-vf.otf,features=malayalam-two,sample=test നൂപുരം] % [font=file:nupuram-vf.ttf,features=malayalam-two,sample=test നൂപുരം] +\showfontvariations + [font=file:robotoflex.ttf] + \stoptext diff --git a/tex/context/modules/mkxl/s-system-macros.mkxl b/tex/context/modules/mkxl/s-system-macros.mkxl index 7e78b265a..597af1a7b 100644 --- a/tex/context/modules/mkxl/s-system-macros.mkxl +++ b/tex/context/modules/mkxl/s-system-macros.mkxl @@ -27,6 +27,8 @@ % todo: and how about metapost ... i need a mp.hashtokens in order to do that and I also % need to think about protection there (tricky as we use an avl hash there) % +% todo: when possible replace \p_whatever_key by \p_key +% % public undefined : SmallCaps scitebuffer sciteinlinebuffer % single todos : \ \- \\ \_ @@ -56,14 +58,16 @@ if tex.modes.texmacros then - local context = context - local ctx_NC = context.NC - local ctx_NR = context.NR - local ctx_bold = context.bold - local ctx_verb = context.verbatim + local context = context + local ctx_NC = context.NC + local ctx_NR = context.NR + local ctx_bold = context.bold + local ctx_verb = context.verbatim + local ctx_escaped = context.escaped local find = string.find local gsub = string.gsub + local gmatch = string.gmatch local create = tokens.create local crap = "[$>%|%&%#" .. string.char(0xEF) .. "]" @@ -111,26 +115,82 @@ local data = scripts.interface.editor("data") local files = data and data.common and data.common.filenames or { } local macros = { } + local registers = { } + local implements = { } local flagged = 0 local total = 0 local list = tex.hashtokens() local all = not tex.modes.notmarked local everything = tex.modes.everything + local getmacro = token.getmacro local fmtname = resolvers.locateformat("cont-en.fmt") if fmtname then local logname = file.replacesuffix(fmtname,"log") - for filename in string.gmatch(io.loaddata(logname),"fullname=(%S+)") do + for filename in gmatch(io.loaddata(logname),"fullname=(%S+)") do local s = file.suffix(filename) local b = file.basename(filename) if s ~= "lua" and s ~= "lmt" then local d = io.loaddata(filename) - for m in string.gmatch(d,"\n[\\a-z]*[exg]*def\\([a-zA-Z_]+)") do + -- we could make a nice lpeg + for m in gmatch(d,"\n[\\a-z]*[exg]*def\\([a-zA-Z_]+)") do + macros[m] = b + end + for m in gmatch(d,"\n[\\a-z]*[g]*let\\([a-zA-Z_]+)") do + macros[m] = b + end + for m in gmatch(d,"\n\\lettonothing\\([a-zA-Z_]+)") do + macros[m] = b + end + for m in gmatch(d,"\n\\integerdef\\([a-zA-Z_]+)") do + macros[m] = b + end + for m in gmatch(d,"\n\\dimensiondef\\([a-zA-Z_]+)") do + macros[m] = b + end + for m in gmatch(d,"\n\\gluespecdef\\([a-zA-Z_]+)") do macros[m] = b end - for m in string.gmatch(d,"\n[\\a-z]*[g]*let\\([a-zA-Z_]+)") do + for m in gmatch(d,"\n\\mugluespecdef\\([a-zA-Z_]+)") do macros[m] = b end + for m in gmatch(d,"\n\\newinteger\\([a-zA-Z_]+)") do + registers[m] = b + end + for m in gmatch(d,"\n\\newdimension\\([a-zA-Z_]+)") do + registers[m] = b + end + for m in gmatch(d,"\n\\newgluespec\\([a-zA-Z_]+)") do + registers[m] = b + end + for m in gmatch(d,"\n\\newmugluespec\\([a-zA-Z_]+)") do + registers[m] = b + end + for m in gmatch(d,"\n\\newconditional\\([a-zA-Z_]+)") do + registers[m] = b + end + for m in gmatch(d,"\n\\newtoks\\([a-zA-Z_]+)") do + registers[m] = b + end + for m in gmatch(d,"\n\\newcount\\([a-zA-Z_]+)") do + registers[m] = b + end + for m in gmatch(d,"\n\\newdimen\\([a-zA-Z_]+)") do + registers[m] = b + end + for m in gmatch(d,"\n\\newskip\\([a-zA-Z_]+)") do + registers[m] = b + end + for m in gmatch(d,"\n\\newmuskip\\([a-zA-Z_]+)") do + registers[m] = b + end + elseif b ~= "char-def.lua" then + local d = io.loaddata(filename) + -- maybe inside implement { } + -- maybe get file from debug interface + for m in gmatch(d,'\n +name += +"([a-zA-Z_]+)",') do + implements[m] = b + end end end end @@ -138,8 +198,7 @@ table.sort(list) local function show(visible, check) - -- context.starttabulate { "|l|l|l|lj2|l|l|l|l|l|l|l|l|" } - context.starttabulate { "|l|l|l|lj2|l|l|l|l|l|l|l|l|l|" } + context.starttabulate { "|l|l|l|lj2|l|l|l|l|l|l|l|l|l|l|l|" } for i=1,#list do local k = list[i] if check(k) then @@ -151,6 +210,7 @@ local primitive = v.primitive and "primitive" local instance = v.instance and "instance" local constant = v.constant and "constant" + local untraced = v.untraced and "untraced" local dealtwith = mutable or immutable or mutable or frozen or permanent or primitive -- beware: we can have combinations local whatever = find(k,"^[a-z][a-z][a-z]+_") local cscommand = gsub(v.cmdname or "","_"," ") @@ -159,7 +219,7 @@ if everything or ((all or not marked) and not find(k,"^[pvm]_") and not find(k,"^![tT]")) then local parameters = v.parameters local noaligned = v.noaligned and "noaligned" - local filename = files[k] or macros[k] + local filename = files[k] or macros[k] or implements[k] or registers[k] or implements[gsub(k,"^clf_","")] local csname = context.escape(k) if undefined then marked = "?" @@ -178,7 +238,9 @@ ctx_NC() if instance then context(instance) end ctx_NC() if noaligned then context(noaligned) end ctx_NC() if constant then context(constant) end + ctx_NC() if untraced then context(untraced) end ctx_NC() if filename then context(hashnames[filename]) end + ctx_NC() if parameters then if parameters > 0 then ctx_escaped(getmacro(csname,false,true)) end end ctx_NC() ctx_NR() end if visible then diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 3cd7aa0da..d8d2fb6d9 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 2023-04-15 00:19 +-- merge date : 2023-04-26 23:28 do -- begin closure to overcome local limits and interference |