diff options
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r-- | tex/context/base/mkiv/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/font-ini.mkvi | 6 | ||||
-rw-r--r-- | tex/context/base/mkiv/grph-con.lua | 24 | ||||
-rw-r--r-- | tex/context/base/mkiv/grph-inc.lua | 28 | ||||
-rw-r--r-- | tex/context/base/mkiv/grph-inc.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/luat-lib.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/m-fonts-plugins.mkiv | 5 | ||||
-rw-r--r-- | tex/context/base/mkiv/mult-def.lua | 4 | ||||
-rw-r--r-- | tex/context/base/mkiv/mult-prm.lua | 19 | ||||
-rw-r--r-- | tex/context/base/mkiv/spac-chr.lua | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/status-files.pdf | bin | 24875 -> 23999 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/status-lua.pdf | bin | 240858 -> 224934 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/tabl-xtb.mkvi | 19 |
14 files changed, 100 insertions, 15 deletions
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 2b07e8d4b..223405dc1 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2021.04.21 11:36} +\newcontextversion{2021.04.26 00:51} %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 91d7c5640..c44775e59 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -45,7 +45,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2021.04.21 11:36} +\edef\contextversion{2021.04.26 00:51} %D Kind of special: diff --git a/tex/context/base/mkiv/font-ini.mkvi b/tex/context/base/mkiv/font-ini.mkvi index 271a81c2a..ccd034106 100644 --- a/tex/context/base/mkiv/font-ini.mkvi +++ b/tex/context/base/mkiv/font-ini.mkvi @@ -2852,4 +2852,10 @@ \unexpanded\def\usefontpath[#1]% {\clf_addfontpath{#1}} +%D NO select discs: + +\ifdefined\discretionaryligaturemode + \discretionaryligaturemode\plusone +\fi + \protect \endinput diff --git a/tex/context/base/mkiv/grph-con.lua b/tex/context/base/mkiv/grph-con.lua index b3d39f0bd..fdae2223b 100644 --- a/tex/context/base/mkiv/grph-con.lua +++ b/tex/context/base/mkiv/grph-con.lua @@ -29,6 +29,7 @@ local variables = interfaces.variables local v_high = variables.high local v_low = variables.low local v_medium = variables.medium +local v_yes = variables.yes local figures = figures @@ -48,6 +49,10 @@ do -- eps | ps local epsconverter = converters.eps converters.ps = epsconverter + local function gscrop(specification) + return (specification and specification.crop == v_yes) and "-dEPSCrop" or "" + end + local resolutions = { [v_low] = "screen", [v_medium] = "ebook", @@ -68,7 +73,7 @@ do -- eps | ps -dBATCH -dAutoRotatePages=/None -dPDFSETTINGS=/%presets% - -dEPSCrop + %crop% -dCompatibilityLevel=%level% -sOutputFile=%newname% %colorspace% @@ -81,6 +86,7 @@ do -- eps | ps presets = "string", level = "string", colorspace = "string", + -- crop = "string", }, } @@ -119,7 +125,7 @@ do -- eps | ps return tmpname end - function epsconverter.pdf(oldname,newname,resolution,colorspace) -- the resolution interface might change + function epsconverter.pdf(oldname,newname,resolution,colorspace,specification) -- the resolution interface might change local presets = resolutions[resolution or "high"] or resolutions.high local level = codeinjections.getformatoption("pdf_level") or "1.3" local tmpname = oldname @@ -141,13 +147,14 @@ do -- eps | ps presets = presets, level = tostring(level), colorspace = colorspace, + crop = gscrop(specification), } if tmpname ~= oldname then os.remove(tmpname) end end - epsconverter["gray.pdf"] = function(oldname,newname,resolution) -- the resolution interface might change + epsconverter["gray.pdf"] = function(oldname,newname,resolution,_,specification) -- the resolution interface might change epsconverter.pdf(oldname,newname,resolution,"gray") end @@ -211,11 +218,16 @@ do -- svg return new and "filename" or suffix end + local function inkscapecrop(specification) + return (specification and specification.crop == v_yes) and "--export-area-drawing" or "" + end + local runner = sandbox.registerrunner { name = "svg to something", program = "inkscape", template = longtostring [[ %oldname% + %crop% --export-dpi=%resolution% --export-%format%=%newname% ]], @@ -226,7 +238,7 @@ do -- svg resolution = "string", }, defaults = { - format = format, + format = "pdf", resolution = "600", } } @@ -235,10 +247,11 @@ do -- svg runner = runner, } - function svgconverter.pdf(oldname,newname) + function svgconverter.pdf(oldname,newname,resolution,arguments,specification) runner { format = inkscapeformat("pdf"), resolution = "600", + crop = inkscapecrop(specification), newname = expandfilename(newname), oldname = expandfilename(oldname), } @@ -248,6 +261,7 @@ do -- svg runner { format = inkscapeformat("png"), resolution = "600", + crop = inkscapecrop(specification), newname = expandfilename(newname), oldname = expandfilename(oldname), } diff --git a/tex/context/base/mkiv/grph-inc.lua b/tex/context/base/mkiv/grph-inc.lua index 6fdf74c08..d4e382a21 100644 --- a/tex/context/base/mkiv/grph-inc.lua +++ b/tex/context/base/mkiv/grph-inc.lua @@ -587,6 +587,7 @@ local function new() -- we could use metatables status -> used -> request but it controls = false, display = false, mask = false, + crop = false, conversion = false, resolution = false, color = false, @@ -766,18 +767,20 @@ local function register(askedname,specification) local conversion = wipe(specification.conversion) local resolution = wipe(specification.resolution) local arguments = wipe(specification.arguments) + local crop = wipe(specification.crop) local newformat = conversion if not newformat or newformat == "" then newformat = defaultformat end if trace_conversion then - report_inclusion("checking conversion of %a, fullname %a, old format %a, new format %a, conversion %a, resolution %a, arguments %a", + report_inclusion("checking conversion of %a, fullname %a, old format %a, new format %a, conversion %a, resolution %a, crop %a, arguments %a", askedname, specification.fullname, format, newformat, conversion or "default", resolution or "default", + crop or "default", arguments or "" ) end @@ -793,7 +796,7 @@ local function register(askedname,specification) end end -- end of quick hack - local converter = (not remapper) and (newformat ~= format or resolution or arguments) and converters[format] + local converter = (not remapper) and (newformat ~= format or resolution or arguments) and converters[format] -- no crop here if converter then local okay = converter[newformat] if okay then @@ -853,6 +856,10 @@ local function register(askedname,specification) if arguments then hash = hash .. "[a:" .. arguments .. "]" end + if crop then + hash = hash .. "[c:" .. crop .. "]" + end + newbase = gsub(newbase,"%.","_") -- nicer to have no suffix in the name if hash ~= "" then newbase = newbase .. "_" .. md5.hex(hash) end @@ -877,7 +884,7 @@ local function register(askedname,specification) if trace_conversion then report_inclusion("converting %a (%a) from %a to %a",askedname,oldname,format,newformat) end - converter(oldname,newname,resolution or "", arguments or "") + converter(oldname,newname,resolution or "", arguments or "",specification) -- in retrospect a table else if trace_conversion then report_inclusion("no need to convert %a (%a) from %a to %a",askedname,oldname,format,newformat) @@ -971,10 +978,12 @@ local function locate(request) -- name, format, cache local askedconversion = request.conversion local askedresolution = request.resolution local askedarguments = request.arguments + local askedcrop = request.crop local askedhash = f_hash_part( askedname, askedconversion or "default", askedresolution or "default", + askedcrop or "default", askedarguments or "" ) local foundname = figures_found[askedhash] @@ -1029,6 +1038,7 @@ local function locate(request) -- name, format, cache cache = askedcache, conversion = askedconversion, resolution = askedresolution, + crop = askedcrop, arguments = askedarguments, }) end @@ -1066,6 +1076,7 @@ local function locate(request) -- name, format, cache conversion = askedconversion, resolution = askedresolution, arguments = askedarguments, + crop = askedcrop, internal = internal, }) elseif quitscanning then @@ -1086,6 +1097,7 @@ local function locate(request) -- name, format, cache cache = askedcache, conversion = askedconversion, resolution = askedresolution, + crop = askedcrop, arguments = askedarguments, }) end @@ -1105,6 +1117,7 @@ local function locate(request) -- name, format, cache cache = askedcache, conversion = askedconversion, resolution = askedresolution, + crop = askedcrop, arguments = askedarguments, }) end @@ -1119,6 +1132,7 @@ local function locate(request) -- name, format, cache cache = askedcache, conversion = askedconversion, resolution = askedresolution, + crop = askedcrop, arguments = askedarguments, }) end @@ -1143,6 +1157,7 @@ local function locate(request) -- name, format, cache cache = askedcache, conversion = askedconversion, resolution = askedresolution, + crop = askedcrop, arguments = askedarguments, }) end @@ -1178,6 +1193,7 @@ local function locate(request) -- name, format, cache cache = askedcache, conversion = askedconversion, resolution = askedresolution, + crop = askedcrop, arguments = askedarguments }) end @@ -1206,6 +1222,7 @@ local function locate(request) -- name, format, cache cache = askedcache, conversion = askedconversion, resolution = askedresolution, + crop = askedcrop, arguments = askedarguments, }) end @@ -1231,6 +1248,7 @@ local function locate(request) -- name, format, cache cache = askedcache, conversion = askedconversion, resolution = askedresolution, + crop = askedcrop, arguments = askedarguments, }) end @@ -1241,6 +1259,7 @@ local function locate(request) -- name, format, cache return register(askedname, { -- these two are needed for hashing 'found' conversion = askedconversion, resolution = askedresolution, + crop = askedcrop, arguments = askedarguments, }) end @@ -1455,6 +1474,7 @@ function checkers.generic(data) local size = dr.size or "crop" local color = dr.color or "natural" local mask = dr.mask or "none" + local crop = dr.crop or "none" local conversion = dr.conversion local resolution = dr.resolution local arguments = dr.arguments @@ -1476,6 +1496,7 @@ function checkers.generic(data) size, color, mask, + crop, conversion, resolution, arguments @@ -2071,6 +2092,7 @@ implement { { "preview" }, { "display" }, { "mask" }, + { "crop" }, { "conversion" }, { "resolution" }, { "color" }, diff --git a/tex/context/base/mkiv/grph-inc.mkiv b/tex/context/base/mkiv/grph-inc.mkiv index 0b8065989..05d4c3a57 100644 --- a/tex/context/base/mkiv/grph-inc.mkiv +++ b/tex/context/base/mkiv/grph-inc.mkiv @@ -111,6 +111,7 @@ \c!ownerpassword =, \c!compact =, \c!cmyk =, + \c!crop =\v!yes, ] %D Defining figures. @@ -370,6 +371,7 @@ compact {\externalfigureparameter\c!compact}% experiment, share fonts userpassword {\externalfigureparameter\c!userpassword}% ownerpassword{\externalfigureparameter\c!ownerpassword}% + crop {\externalfigureparameter\c!crop}% \ifx\p_width\empty \else width \dimexpr\p_width\relax \fi diff --git a/tex/context/base/mkiv/luat-lib.mkiv b/tex/context/base/mkiv/luat-lib.mkiv index 6dbcdaf54..f6bab870b 100644 --- a/tex/context/base/mkiv/luat-lib.mkiv +++ b/tex/context/base/mkiv/luat-lib.mkiv @@ -85,6 +85,8 @@ \registerctxluafile{luat-mac}{} %registerctxluafile{luat-prp}{} % for the moment of not much use +\registerctxluafile{util-lib}{} + \registerctxluafile{lxml-tab}{} \registerctxluafile{lxml-lpt}{} \registerctxluafile{lxml-xml}{} diff --git a/tex/context/base/mkiv/m-fonts-plugins.mkiv b/tex/context/base/mkiv/m-fonts-plugins.mkiv index ec1c05e7a..a2b06fb8c 100644 --- a/tex/context/base/mkiv/m-fonts-plugins.mkiv +++ b/tex/context/base/mkiv/m-fonts-plugins.mkiv @@ -15,10 +15,13 @@ %D Eigner at an NTG meeting, then left it for a while, and sort of finalized it the %D last quarter of 2016. As I don't use this module, apart from maybe testing %D something, it is not guaranteed to work (but fixing should be a no real problem -%D as I expect apis to be stable). Plugins liek this can interfere with other +%D as I expect apis to be stable). Plugins like this can interfere with other %D functionality in \CONTEXT\ so don't expect too much support. The two modules %D mentioned below should work in the generic loader too. It's anyhow an %D illustration of how \type {ffi} be used in a practical application. +%D +%D I'm not sure if Idris will ever need this but the code has been used for some +%D articles so that's why it's eventually shipped. % \enabletrackers[resolvers.ffilib] diff --git a/tex/context/base/mkiv/mult-def.lua b/tex/context/base/mkiv/mult-def.lua index 0f2ef419c..6168da413 100644 --- a/tex/context/base/mkiv/mult-def.lua +++ b/tex/context/base/mkiv/mult-def.lua @@ -8264,6 +8264,10 @@ return { ["pe"]="criterium", ["ro"]="criteriu", }, + ["crop"]={ + ["en"]="crop", + ["fr"]="recadre", + }, ["cropoffset"]={ ["en"]="cropoffset", ["fr"]="decalagerecadre", diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua index 855b4bc1f..710934ae6 100644 --- a/tex/context/base/mkiv/mult-prm.lua +++ b/tex/context/base/mkiv/mult-prm.lua @@ -84,6 +84,7 @@ return { "Uleft", "Umathaccent", "Umathaccentbaseheight", + "Umathaccentvariant", "Umathaxis", "Umathbinbinspacing", "Umathbinclosespacing", @@ -93,6 +94,7 @@ return { "Umathbinordspacing", "Umathbinpunctspacing", "Umathbinrelspacing", + "Umathbotaccentvariant", "Umathchar", "Umathcharclass", "Umathchardef", @@ -112,12 +114,18 @@ return { "Umathcode", "Umathcodenum", "Umathconnectoroverlapmin", + "Umathdegreevariant", + "Umathdelimiterovervariant", + "Umathdelimiterundervariant", + "Umathdenominatorvariant", "Umathfractiondelsize", "Umathfractiondenomdown", "Umathfractiondenomvgap", "Umathfractionnumup", "Umathfractionnumvgap", "Umathfractionrule", + "Umathfractionvariant", + "Umathhextensiblevariant", "Umathinnerbinspacing", "Umathinnerclosespacing", "Umathinnerinnerspacing", @@ -134,6 +142,7 @@ return { "Umathlimitbelowvgap", "Umathnolimitsubfactor", "Umathnolimitsupfactor", + "Umathnumeratorvariant", "Umathopbinspacing", "Umathopclosespacing", "Umathopenbinspacing", @@ -163,7 +172,10 @@ return { "Umathoverbarrule", "Umathoverbarvgap", "Umathoverdelimiterbgap", + "Umathoverdelimitervariant", "Umathoverdelimitervgap", + "Umathoverlayaccentvariant", + "Umathoverlinevariant", "Umathpunctbinspacing", "Umathpunctclosespacing", "Umathpunctinnerspacing", @@ -178,6 +190,7 @@ return { "Umathradicaldegreeraise", "Umathradicalkern", "Umathradicalrule", + "Umathradicalvariant", "Umathradicalvgap", "Umathrelbinspacing", "Umathrelclosespacing", @@ -194,21 +207,27 @@ return { "Umathspacingmode", "Umathstackdenomdown", "Umathstacknumup", + "Umathstackvariant", "Umathstackvgap", + "Umathsubscriptvariant", "Umathsubshiftdown", "Umathsubshiftdrop", "Umathsubsupshiftdown", "Umathsubsupvgap", "Umathsubtopmax", "Umathsupbottommin", + "Umathsuperscriptvariant", "Umathsupshiftdrop", "Umathsupshiftup", "Umathsupsubbottommax", + "Umathtopaccentvariant", "Umathunderbarkern", "Umathunderbarrule", "Umathunderbarvgap", "Umathunderdelimiterbgap", + "Umathunderdelimitervariant", "Umathunderdelimitervgap", + "Umathunderlinevariant", "Umiddle", "Unosubprescript", "Unosubscript", diff --git a/tex/context/base/mkiv/spac-chr.lua b/tex/context/base/mkiv/spac-chr.lua index fa6eb18a5..7ec3e3cc4 100644 --- a/tex/context/base/mkiv/spac-chr.lua +++ b/tex/context/base/mkiv/spac-chr.lua @@ -130,7 +130,7 @@ end local function nbsp(head,current) local para = fontparameters[getfont(current)] local attr = getattr(current,a_alignstate) or 0 - if attr >= 1 or attr <= 3 then -- flushright + if attr >= 1 and attr <= 3 then -- flushright head, current = inject_nobreak_space(0x00A0,head,current,para.space,0,0) else head, current = inject_nobreak_space(0x00A0,head,current,para.space,para.spacestretch,para.spaceshrink) diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex af4f3802f..18d4edc32 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 1ddade41c..c7c27b61c 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/tabl-xtb.mkvi b/tex/context/base/mkiv/tabl-xtb.mkvi index c5042a405..3f3ef4be3 100644 --- a/tex/context/base/mkiv/tabl-xtb.mkvi +++ b/tex/context/base/mkiv/tabl-xtb.mkvi @@ -392,11 +392,24 @@ % in text flow: headers and footers get repeated -\setvalue{\??xtableflushsplit\v!repeat}% +% \setvalue{\??xtableflushsplit\v!repeat}% +% {\doloop +% {\clf_x_table_flush +% method {\v!split}% +% height \ifdim\pagegoal=\maxdimen\textheight\else\pagegoal\fi +% \relax +% \ifcase\c_tabl_x_state +% \exitloop +% \else +% \page +% \fi}} + +\defcsname\??xtableflushsplit\v!repeat\endcsname {\doloop - {\clf_x_table_flush + {\testpage[5]% for now hard coded, just as the \lineheight below, see mail end of april 2021 + \clf_x_table_flush method {\v!split}% - height \ifdim\pagegoal=\maxdimen\textheight\else\pagegoal\fi + height \ifdim\pagegoal=\maxdimen\textheight\else\dimexpr\pagegoal-\pagetotal-\lineheight\relax\fi \relax \ifcase\c_tabl_x_state \exitloop |