diff options
author | Hans Hagen <pragma@wxs.nl> | 2023-04-11 23:40:06 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2023-04-11 23:40:06 +0200 |
commit | 3b909ab613140e7a9c824c434b642f0578473a6d (patch) | |
tree | c4feec8afb3e9d1dfc26895a73c55ca194261601 | |
parent | 059fc69b2c7853b937ddb4cfc9d36304dee07893 (diff) | |
download | context-3b909ab613140e7a9c824c434b642f0578473a6d.tar.gz |
2023-04-11 22:47:00
153 files changed, 3119 insertions, 768 deletions
diff --git a/context/data/scite/context/lexers/data/scite-context-data-context.lua b/context/data/scite/context/lexers/data/scite-context-data-context.lua index 4c8884971..ebc92b4f4 100644 --- a/context/data/scite/context/lexers/data/scite-context-data-context.lua +++ b/context/data/scite/context/lexers/data/scite-context-data-context.lua @@ -1,4 +1,4 @@ return { - ["constants"]={ "zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive", "plussix", "plusseven", "pluseight", "plusnine", "plusten", "pluseleven", "plustwelve", "plussixteen", "plusfifty", "plushundred", "plusonehundred", "plustwohundred", "plusfivehundred", "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "maxcardminusone", "maxiterator", "zeropoint", "onepoint", "halfapoint", "onebasepoint", "maxcount", "maxdimen", "scaledpoint", "thousandpoint", "points", "halfpoint", "zeroskip", "centeringskip", "stretchingskip", "shrinkingskip", "centeringfillskip", "stretchingfillskip", "shrinkingfillskip", "zeromuskip", "onemuskip", "pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi", "normalpagebox", "binaryshiftedten", "binaryshiftedtwenty", "binaryshiftedthirty", "thickermuskip", "directionlefttoright", "directionrighttoleft", "endoflinetoken", "outputnewlinechar", "emptytoks", "empty", "undefined", "prerollrun", "voidbox", "emptybox", "emptyvbox", "emptyhbox", "bigskipamount", "medskipamount", "smallskipamount", "fmtname", "fmtversion", "texengine", "texenginename", "texengineversion", "texenginefunctionality", "luatexengine", "pdftexengine", "xetexengine", "unknownengine", "contextformat", "contextversion", "contextlmtxmode", "contextmark", "mksuffix", "activecatcode", "bgroup", "egroup", "endline", "conditionaltrue", "conditionalfalse", "attributeunsetvalue", "statuswrite", "uprotationangle", "rightrotationangle", "downrotationangle", "leftrotationangle", "inicatcodes", "ctxcatcodes", "texcatcodes", "notcatcodes", "txtcatcodes", "vrbcatcodes", "prtcatcodes", "nilcatcodes", "luacatcodes", "tpacatcodes", "tpbcatcodes", "xmlcatcodes", "ctdcatcodes", "rlncatcodes", "escapecatcode", "begingroupcatcode", "endgroupcatcode", "mathshiftcatcode", "alignmentcatcode", "endoflinecatcode", "parametercatcode", "superscriptcatcode", "subscriptcatcode", "ignorecatcode", "spacecatcode", "lettercatcode", "othercatcode", "activecatcode", "commentcatcode", "invalidcatcode", "tabasciicode", "newlineasciicode", "formfeedasciicode", "endoflineasciicode", "endoffileasciicode", "commaasciicode", "spaceasciicode", "periodasciicode", "hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode", "colonasciicode", "semicolonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode", "leftbraceasciicode", "barasciicode", "rightbraceasciicode", "tildeasciicode", "delasciicode", "leftparentasciicode", "rightparentasciicode", "lessthanasciicode", "morethanasciicode", "doublecommentsignal", "atsignasciicode", "exclamationmarkasciicode", "questionmarkasciicode", "doublequoteasciicode", "singlequoteasciicode", "forwardslashasciicode", "primeasciicode", "hyphenasciicode", "percentasciicode", "leftbracketasciicode", "rightbracketasciicode", "hsizefrozenparcode", "skipfrozenparcode", "hangfrozenparcode", "indentfrozenparcode", "parfillfrozenparcode", "adjustfrozenparcode", "protrudefrozenparcode", "tolerancefrozenparcode", "stretchfrozenparcode", "loosenessfrozenparcode", "lastlinefrozenparcode", "linepenaltyfrozenparcode", "clubpenaltyfrozenparcode", "widowpenaltyfrozenparcode", "displaypenaltyfrozenparcode", "brokenpenaltyfrozenparcode", "demeritsfrozenparcode", "shapefrozenparcode", "linefrozenparcode", "hyphenationfrozenparcode", "shapingpenaltyfrozenparcode", "orphanpenaltyfrozenparcode", "allfrozenparcode", "mathpenaltyfrozenparcode", "activemathcharcode", "activetabtoken", "activeformfeedtoken", "activeendoflinetoken", "batchmodecode", "nonstopmodecode", "scrollmodecode", "errorstopmodecode", "bottomlevelgroupcode", "simplegroupcode", "hboxgroupcode", "adjustedhboxgroupcode", "vboxgroupcode", "vtopgroupcode", "aligngroupcode", "noaligngroupcode", "outputgroupcode", "mathgroupcode", "discretionarygroupcode", "insertgroupcode", "vadjustgroupcode", "vcentergroupcode", "mathabovegroupcode", "mathchoicegroupcode", "alsosimplegroupcode", "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode", "localboxgroupcode", "splitoffgroupcode", "splitkeepgroupcode", "preamblegroupcode", "alignsetgroupcode", "finrowgroupcode", "discretionarygroupcode", "markautomigrationcode", "insertautomigrationcode", "adjustautomigrationcode", "preautomigrationcode", "postautomigrationcode", "charnodecode", "hlistnodecode", "vlistnodecode", "rulenodecode", "insertnodecode", "marknodecode", "adjustnodecode", "ligaturenodecode", "discretionarynodecode", "whatsitnodecode", "mathnodecode", "gluenodecode", "kernnodecode", "penaltynodecode", "unsetnodecode", "mathsnodecode", "overrulemathcontrolcode", "underrulemathcontrolcode", "radicalrulemathcontrolcode", "fractionrulemathcontrolcode", "accentskewhalfmathcontrolcode", "accentskewapplymathcontrolcode", "applyordinarykernpairmathcontrolcode", "applyverticalitalickernmathcontrolcode", "applyordinaryitalickernmathcontrolcode", "applycharitalickernmathcontrolcode", "reboxcharitalickernmathcontrolcode", "applyboxeditalickernmathcontrolcode", "staircasekernmathcontrolcode", "applytextitalickernmathcontrolcode", "applyscriptitalickernmathcontrolcode", "checkspaceitalickernmathcontrolcode", "checktextitalickernmathcontrolcode", "analyzescriptnucleuscharmathcontrolcode", "analyzescriptnucleuslistmathcontrolcode", "analyzescriptnucleusboxmathcontrolcode", "accenttopskewwithoffsetmathcontrolcode", "ignorekerndimensionsmathcontrolcode", "ignoreflataccentsmathcontrolcode", "extendaccentsmathcontrolcode", "extenddelimitersmathcontrolcode", "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noleftkerningglyphoptioncode", "noleftligaturingglyphoptioncode", "norightkerningglyphoptioncode", "norightligaturingglyphoptioncode", "noitaliccorrectionglyphoptioncode", "islargeoperatorglyphoptioncode", "hasitalicshapeglyphoptioncode", "normalparcontextcode", "vmodeparcontextcode", "vboxparcontextcode", "vtopparcontextcode", "vcenterparcontextcode", "vadjustparcontextcode", "insertparcontextcode", "outputparcontextcode", "alignparcontextcode", "noalignparcontextcode", "spanparcontextcode", "resetparcontextcode", "leftoriginlistanchorcode", "leftheightlistanchorcode", "leftdepthlistanchorcode", "rightoriginlistanchorcode", "rightheightlistanchorcode", "rightdepthlistanchorcode", "centeroriginlistanchorcode", "centerheightlistanchorcode", "centerdepthlistanchorcode", "halfwaytotallistanchorcode", "halfwayheightlistanchorcode", "halfwaydepthlistanchorcode", "halfwayleftlistanchorcode", "halfwayrightlistanchorcode", "negatexlistsigncode", "negateylistsigncode", "negatelistsigncode", "fontslantperpoint", "fontinterwordspace", "fontinterwordstretch", "fontinterwordshrink", "fontexheight", "fontemwidth", "fontextraspace", "slantperpoint", "mathexheight", "mathemwidth", "interwordspace", "interwordstretch", "interwordshrink", "exheight", "emwidth", "extraspace", "mathaxisheight", "muquad", "startmode", "stopmode", "startnotmode", "stopnotmode", "startmodeset", "stopmodeset", "doifmode", "doifelsemode", "doifmodeelse", "doifnotmode", "startmodeset", "stopmodeset", "startallmodes", "stopallmodes", "startnotallmodes", "stopnotallmodes", "doifallmodes", "doifelseallmodes", "doifallmodeselse", "doifnotallmodes", "startenvironment", "stopenvironment", "environment", "startcomponent", "stopcomponent", "component", "startproduct", "stopproduct", "product", "startproject", "stopproject", "project", "starttext", "stoptext", "startnotext", "stopnotext", "startdocument", "stopdocument", "documentvariable", "unexpandeddocumentvariable", "setupdocument", "presetdocument", "doifelsedocumentvariable", "doifdocumentvariableelse", "doifdocumentvariable", "doifnotdocumentvariable", "startmodule", "stopmodule", "usemodule", "usetexmodule", "useluamodule", "setupmodule", "currentmoduleparameter", "moduleparameter", "everystarttext", "everystoptext", "startTEXpage", "stopTEXpage", "enablemode", "disablemode", "preventmode", "definemode", "globalenablemode", "globaldisablemode", "globalpreventmode", "pushmode", "popmode", "typescriptone", "typescripttwo", "typescriptthree", "mathsizesuffix", "mathordinarycode", "mathordcode", "mathoperatorcode", "mathopcode", "mathbinarycode", "mathbincode", "mathrelationcode", "mathrelcode", "mathopencode", "mathclosecode", "mathpunctuationcode", "mathpunctcode", "mathovercode", "mathundercode", "mathinnercode", "mathradicalcode", "mathfractioncode", "mathmiddlecode", "mathaccentcode", "mathfencedcode", "mathghostcode", "mathvariablecode", "mathactivecode", "mathvcentercode", "mathconstructcode", "mathwrappedcode", "mathbegincode", "mathendcode", "mathexplicitcode", "mathdivisioncode", "mathfactorialcode", "mathdimensioncode", "mathexperimentalcode", "mathtextpunctuationcode", "mathimaginarycode", "mathdifferentialcode", "mathexponentialcode", "mathellipsiscode", "mathfunctioncode", "mathdigitcode", "mathalphacode", "mathboxcode", "mathchoicecode", "mathnothingcode", "mathlimopcode", "mathnolopcode", "mathunsetcode", "mathunspacedcode", "mathallcode", "mathfakecode", "mathunarycode", "mathmaybeordinarycode", "mathmayberelationcode", "mathmaybebinarycode", "mathnumbergroupcode", "constantnumber", "constantnumberargument", "constantdimen", "constantdimenargument", "constantemptyargument", "luastringsep", "!!bs", "!!es", "lefttorightmark", "righttoleftmark", "lrm", "rlm", "bidilre", "bidirle", "bidipop", "bidilro", "bidirlo", "breakablethinspace", "nobreakspace", "nonbreakablespace", "narrownobreakspace", "zerowidthnobreakspace", "ideographicspace", "ideographichalffillspace", "twoperemspace", "threeperemspace", "fourperemspace", "fiveperemspace", "sixperemspace", "figurespace", "punctuationspace", "hairspace", "enquad", "emquad", "zerowidthspace", "zerowidthnonjoiner", "zerowidthjoiner", "zwnj", "zwj", "optionalspace", "asciispacechar", "softhyphen", "autoinsertedspace", "Ux", "eUx", "parfillleftskip", "parfillrightskip", "startlmtxmode", "stoplmtxmode", "startmkivmode", "stopmkivmode", "wildcardsymbol", "normalhyphenationcode", "automatichyphenationcode", "explicithyphenationcode", "syllablehyphenationcode", "uppercasehyphenationcode", "collapsehyphenationcode", "compoundhyphenationcode", "strictstarthyphenationcode", "strictendhyphenationcode", "automaticpenaltyhyphenationcode", "explicitpenaltyhyphenationcode", "permitgluehyphenationcode", "permitallhyphenationcode", "permitmathreplacehyphenationcode", "forcecheckhyphenationcode", "lazyligatureshyphenationcode", "forcehandlerhyphenationcode", "feedbackcompoundhyphenationcode", "ignoreboundshyphenationcode", "partialhyphenationcode", "completehyphenationcode", "normalizelinenormalizecode", "parindentskipnormalizecode", "swaphangindentnormalizecode", "swapparsshapenormalizecode", "breakafterdirnormalizecode", "removemarginkernsnormalizecode", "clipwidthnormalizecode", "flattendiscretionariesnormalizecode", "discardzerotabskipsnormalizecode", "flattenhleadersnormalizecode", "normalizeparnormalizeparcode", "flattenvleadersnormalizeparcode", "nopreslackclassoptioncode", "nopostslackclassoptioncode", "lefttopkernclassoptioncode", "righttopkernclassoptioncode", "leftbottomkernclassoptioncode", "rightbottomkernclassoptioncode", "lookaheadforendclassoptioncode", "noitaliccorrectionclassoptioncode", "defaultmathclassoptions", "checkligatureclassoptioncode", "checkitaliccorrectionclassoptioncode", "checkkernpairclassoptioncode", "flattenclassoptioncode", "omitpenaltyclassoptioncode", "unpackclassoptioncode", "raiseprimeclassoptioncode", "carryoverlefttopkernclassoptioncode", "carryoverleftbottomkernclassoptioncode", "carryoverrighttopkernclassoptioncode", "carryoverrightbottomkernclassoptioncode", "preferdelimiterdimensionsclassoptioncode", "autoinjectclassoptioncode", "removeitaliccorrectionclassoptioncode", "operatoritaliccorrectionclassoptioncode", "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noleftligatureglyphoptioncode", "noleftkernglyphoptioncode", "norightligatureglyphoptioncode", "norightkernglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noitaliccorrectionglyphoptioncode", "nokerningcode", "noligaturingcode", "frozenflagcode", "tolerantflagcode", "protectedflagcode", "primitiveflagcode", "permanentflagcode", "noalignedflagcode", "immutableflagcode", "mutableflagcode", "globalflagcode", "overloadedflagcode", "immediateflagcode", "conditionalflagcode", "valueflagcode", "instanceflagcode", "ordmathflattencode", "binmathflattencode", "relmathflattencode", "punctmathflattencode", "innermathflattencode", "normalworddiscoptioncode", "preworddiscoptioncode", "postworddiscoptioncode", "continueifinputfile", "continuewhenlmtxmode", "continuewhenmkivmode" }, + ["constants"]={ "zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive", "plussix", "plusseven", "pluseight", "plusnine", "plusten", "pluseleven", "plustwelve", "plussixteen", "plusfifty", "plushundred", "plusonehundred", "plustwohundred", "plusfivehundred", "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "maxcardminusone", "maxiterator", "zeropoint", "onepoint", "halfapoint", "onebasepoint", "maxcount", "maxdimen", "scaledpoint", "thousandpoint", "points", "halfpoint", "zeroskip", "centeringskip", "stretchingskip", "shrinkingskip", "centeringfillskip", "stretchingfillskip", "shrinkingfillskip", "zeromuskip", "onemuskip", "pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi", "normalpagebox", "binaryshiftedten", "binaryshiftedtwenty", "binaryshiftedthirty", "thickermuskip", "directionlefttoright", "directionrighttoleft", "endoflinetoken", "outputnewlinechar", "emptytoks", "empty", "undefined", "prerollrun", "voidbox", "emptybox", "emptyvbox", "emptyhbox", "bigskipamount", "medskipamount", "smallskipamount", "fmtname", "fmtversion", "texengine", "texenginename", "texengineversion", "texenginefunctionality", "luatexengine", "pdftexengine", "xetexengine", "unknownengine", "contextformat", "contextversion", "contextlmtxmode", "contextmark", "mksuffix", "activecatcode", "bgroup", "egroup", "endline", "conditionaltrue", "conditionalfalse", "attributeunsetvalue", "statuswrite", "uprotationangle", "rightrotationangle", "downrotationangle", "leftrotationangle", "inicatcodes", "ctxcatcodes", "texcatcodes", "notcatcodes", "txtcatcodes", "vrbcatcodes", "prtcatcodes", "nilcatcodes", "luacatcodes", "tpacatcodes", "tpbcatcodes", "xmlcatcodes", "ctdcatcodes", "rlncatcodes", "escapecatcode", "begingroupcatcode", "endgroupcatcode", "mathshiftcatcode", "alignmentcatcode", "endoflinecatcode", "parametercatcode", "superscriptcatcode", "subscriptcatcode", "ignorecatcode", "spacecatcode", "lettercatcode", "othercatcode", "activecatcode", "commentcatcode", "invalidcatcode", "tabasciicode", "newlineasciicode", "formfeedasciicode", "endoflineasciicode", "endoffileasciicode", "commaasciicode", "spaceasciicode", "periodasciicode", "hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode", "colonasciicode", "semicolonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode", "leftbraceasciicode", "barasciicode", "rightbraceasciicode", "tildeasciicode", "delasciicode", "leftparentasciicode", "rightparentasciicode", "lessthanasciicode", "morethanasciicode", "doublecommentsignal", "atsignasciicode", "exclamationmarkasciicode", "questionmarkasciicode", "doublequoteasciicode", "singlequoteasciicode", "forwardslashasciicode", "primeasciicode", "hyphenasciicode", "percentasciicode", "leftbracketasciicode", "rightbracketasciicode", "hsizefrozenparcode", "skipfrozenparcode", "hangfrozenparcode", "indentfrozenparcode", "parfillfrozenparcode", "adjustfrozenparcode", "protrudefrozenparcode", "tolerancefrozenparcode", "stretchfrozenparcode", "loosenessfrozenparcode", "lastlinefrozenparcode", "linepenaltyfrozenparcode", "clubpenaltyfrozenparcode", "widowpenaltyfrozenparcode", "displaypenaltyfrozenparcode", "brokenpenaltyfrozenparcode", "demeritsfrozenparcode", "shapefrozenparcode", "linefrozenparcode", "hyphenationfrozenparcode", "shapingpenaltyfrozenparcode", "orphanpenaltyfrozenparcode", "allfrozenparcode", "mathpenaltyfrozenparcode", "activemathcharcode", "activetabtoken", "activeformfeedtoken", "activeendoflinetoken", "batchmodecode", "nonstopmodecode", "scrollmodecode", "errorstopmodecode", "bottomlevelgroupcode", "simplegroupcode", "hboxgroupcode", "adjustedhboxgroupcode", "vboxgroupcode", "vtopgroupcode", "aligngroupcode", "noaligngroupcode", "outputgroupcode", "mathgroupcode", "discretionarygroupcode", "insertgroupcode", "vadjustgroupcode", "vcentergroupcode", "mathabovegroupcode", "mathchoicegroupcode", "alsosimplegroupcode", "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode", "localboxgroupcode", "splitoffgroupcode", "splitkeepgroupcode", "preamblegroupcode", "alignsetgroupcode", "finrowgroupcode", "discretionarygroupcode", "markautomigrationcode", "insertautomigrationcode", "adjustautomigrationcode", "preautomigrationcode", "postautomigrationcode", "charnodecode", "hlistnodecode", "vlistnodecode", "rulenodecode", "insertnodecode", "marknodecode", "adjustnodecode", "ligaturenodecode", "discretionarynodecode", "whatsitnodecode", "mathnodecode", "gluenodecode", "kernnodecode", "penaltynodecode", "unsetnodecode", "mathsnodecode", "overrulemathcontrolcode", "underrulemathcontrolcode", "radicalrulemathcontrolcode", "fractionrulemathcontrolcode", "accentskewhalfmathcontrolcode", "accentskewapplymathcontrolcode", "applyordinarykernpairmathcontrolcode", "applyverticalitalickernmathcontrolcode", "applyordinaryitalickernmathcontrolcode", "applycharitalickernmathcontrolcode", "reboxcharitalickernmathcontrolcode", "applyboxeditalickernmathcontrolcode", "staircasekernmathcontrolcode", "applytextitalickernmathcontrolcode", "applyscriptitalickernmathcontrolcode", "checkspaceitalickernmathcontrolcode", "checktextitalickernmathcontrolcode", "analyzescriptnucleuscharmathcontrolcode", "analyzescriptnucleuslistmathcontrolcode", "analyzescriptnucleusboxmathcontrolcode", "accenttopskewwithoffsetmathcontrolcode", "ignorekerndimensionsmathcontrolcode", "ignoreflataccentsmathcontrolcode", "extendaccentsmathcontrolcode", "extenddelimitersmathcontrolcode", "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noleftkerningglyphoptioncode", "noleftligaturingglyphoptioncode", "norightkerningglyphoptioncode", "norightligaturingglyphoptioncode", "noitaliccorrectionglyphoptioncode", "islargeoperatorglyphoptioncode", "hasitalicshapeglyphoptioncode", "normalparcontextcode", "vmodeparcontextcode", "vboxparcontextcode", "vtopparcontextcode", "vcenterparcontextcode", "vadjustparcontextcode", "insertparcontextcode", "outputparcontextcode", "alignparcontextcode", "noalignparcontextcode", "spanparcontextcode", "resetparcontextcode", "leftoriginlistanchorcode", "leftheightlistanchorcode", "leftdepthlistanchorcode", "rightoriginlistanchorcode", "rightheightlistanchorcode", "rightdepthlistanchorcode", "centeroriginlistanchorcode", "centerheightlistanchorcode", "centerdepthlistanchorcode", "halfwaytotallistanchorcode", "halfwayheightlistanchorcode", "halfwaydepthlistanchorcode", "halfwayleftlistanchorcode", "halfwayrightlistanchorcode", "negatexlistsigncode", "negateylistsigncode", "negatelistsigncode", "fontslantperpoint", "fontinterwordspace", "fontinterwordstretch", "fontinterwordshrink", "fontexheight", "fontemwidth", "fontextraspace", "slantperpoint", "mathexheight", "mathemwidth", "interwordspace", "interwordstretch", "interwordshrink", "exheight", "emwidth", "extraspace", "mathaxisheight", "muquad", "startmode", "stopmode", "startnotmode", "stopnotmode", "startmodeset", "stopmodeset", "doifmode", "doifelsemode", "doifmodeelse", "doifnotmode", "startmodeset", "stopmodeset", "startallmodes", "stopallmodes", "startnotallmodes", "stopnotallmodes", "doifallmodes", "doifelseallmodes", "doifallmodeselse", "doifnotallmodes", "startenvironment", "stopenvironment", "environment", "startcomponent", "stopcomponent", "component", "startlocalcomponent", "stoplocalcomponent", "startproduct", "stopproduct", "product", "startproject", "stopproject", "project", "starttext", "stoptext", "startnotext", "stopnotext", "startdocument", "stopdocument", "documentvariable", "unexpandeddocumentvariable", "setupdocument", "presetdocument", "doifelsedocumentvariable", "doifdocumentvariableelse", "doifdocumentvariable", "doifnotdocumentvariable", "startmodule", "stopmodule", "usemodule", "usetexmodule", "useluamodule", "setupmodule", "currentmoduleparameter", "moduleparameter", "everystarttext", "everystoptext", "startTEXpage", "stopTEXpage", "enablemode", "disablemode", "preventmode", "definemode", "globalenablemode", "globaldisablemode", "globalpreventmode", "pushmode", "popmode", "typescriptone", "typescripttwo", "typescriptthree", "mathsizesuffix", "mathordinarycode", "mathordcode", "mathoperatorcode", "mathopcode", "mathbinarycode", "mathbincode", "mathrelationcode", "mathrelcode", "mathopencode", "mathclosecode", "mathpunctuationcode", "mathpunctcode", "mathovercode", "mathundercode", "mathinnercode", "mathradicalcode", "mathfractioncode", "mathmiddlecode", "mathaccentcode", "mathfencedcode", "mathghostcode", "mathvariablecode", "mathactivecode", "mathvcentercode", "mathconstructcode", "mathwrappedcode", "mathbegincode", "mathendcode", "mathexplicitcode", "mathdivisioncode", "mathfactorialcode", "mathdimensioncode", "mathexperimentalcode", "mathtextpunctuationcode", "mathimaginarycode", "mathdifferentialcode", "mathexponentialcode", "mathellipsiscode", "mathfunctioncode", "mathdigitcode", "mathalphacode", "mathboxcode", "mathchoicecode", "mathnothingcode", "mathlimopcode", "mathnolopcode", "mathunsetcode", "mathunspacedcode", "mathallcode", "mathfakecode", "mathunarycode", "mathmaybeordinarycode", "mathmayberelationcode", "mathmaybebinarycode", "mathnumbergroupcode", "constantnumber", "constantnumberargument", "constantdimen", "constantdimenargument", "constantemptyargument", "luastringsep", "!!bs", "!!es", "lefttorightmark", "righttoleftmark", "lrm", "rlm", "bidilre", "bidirle", "bidipop", "bidilro", "bidirlo", "breakablethinspace", "nobreakspace", "nonbreakablespace", "narrownobreakspace", "zerowidthnobreakspace", "ideographicspace", "ideographichalffillspace", "twoperemspace", "threeperemspace", "fourperemspace", "fiveperemspace", "sixperemspace", "figurespace", "punctuationspace", "hairspace", "enquad", "emquad", "zerowidthspace", "zerowidthnonjoiner", "zerowidthjoiner", "zwnj", "zwj", "optionalspace", "asciispacechar", "softhyphen", "autoinsertedspace", "Ux", "eUx", "parfillleftskip", "parfillrightskip", "startlmtxmode", "stoplmtxmode", "startmkivmode", "stopmkivmode", "wildcardsymbol", "normalhyphenationcode", "automatichyphenationcode", "explicithyphenationcode", "syllablehyphenationcode", "uppercasehyphenationcode", "collapsehyphenationcode", "compoundhyphenationcode", "strictstarthyphenationcode", "strictendhyphenationcode", "automaticpenaltyhyphenationcode", "explicitpenaltyhyphenationcode", "permitgluehyphenationcode", "permitallhyphenationcode", "permitmathreplacehyphenationcode", "forcecheckhyphenationcode", "lazyligatureshyphenationcode", "forcehandlerhyphenationcode", "feedbackcompoundhyphenationcode", "ignoreboundshyphenationcode", "partialhyphenationcode", "completehyphenationcode", "normalizelinenormalizecode", "parindentskipnormalizecode", "swaphangindentnormalizecode", "swapparsshapenormalizecode", "breakafterdirnormalizecode", "removemarginkernsnormalizecode", "clipwidthnormalizecode", "flattendiscretionariesnormalizecode", "discardzerotabskipsnormalizecode", "flattenhleadersnormalizecode", "normalizeparnormalizeparcode", "flattenvleadersnormalizeparcode", "nopreslackclassoptioncode", "nopostslackclassoptioncode", "lefttopkernclassoptioncode", "righttopkernclassoptioncode", "leftbottomkernclassoptioncode", "rightbottomkernclassoptioncode", "lookaheadforendclassoptioncode", "noitaliccorrectionclassoptioncode", "defaultmathclassoptions", "checkligatureclassoptioncode", "checkitaliccorrectionclassoptioncode", "checkkernpairclassoptioncode", "flattenclassoptioncode", "omitpenaltyclassoptioncode", "unpackclassoptioncode", "raiseprimeclassoptioncode", "carryoverlefttopkernclassoptioncode", "carryoverleftbottomkernclassoptioncode", "carryoverrighttopkernclassoptioncode", "carryoverrightbottomkernclassoptioncode", "preferdelimiterdimensionsclassoptioncode", "autoinjectclassoptioncode", "removeitaliccorrectionclassoptioncode", "operatoritaliccorrectionclassoptioncode", "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noleftligatureglyphoptioncode", "noleftkernglyphoptioncode", "norightligatureglyphoptioncode", "norightkernglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noitaliccorrectionglyphoptioncode", "nokerningcode", "noligaturingcode", "frozenflagcode", "tolerantflagcode", "protectedflagcode", "primitiveflagcode", "permanentflagcode", "noalignedflagcode", "immutableflagcode", "mutableflagcode", "globalflagcode", "overloadedflagcode", "immediateflagcode", "conditionalflagcode", "valueflagcode", "instanceflagcode", "ordmathflattencode", "binmathflattencode", "relmathflattencode", "punctmathflattencode", "innermathflattencode", "normalworddiscoptioncode", "preworddiscoptioncode", "postworddiscoptioncode", "continueifinputfile", "continuewhenlmtxmode", "continuewhenmkivmode" }, ["helpers"]={ "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "startluasetups", "stopluasetups", "starttexsetups", "stoptexsetups", "startrawsetups", "stoprawsetups", "startlocalsetups", "stoplocalsetups", "starttexdefinition", "stoptexdefinition", "starttexcode", "stoptexcode", "startcontextcode", "stopcontextcode", "startcontextdefinitioncode", "stopcontextdefinitioncode", "texdefinition", "doifelsesetups", "doifsetupselse", "doifsetups", "doifnotsetups", "setup", "setups", "texsetup", "xmlsetup", "luasetup", "directsetup", "fastsetup", "copysetups", "resetsetups", "doifelsecommandhandler", "doifcommandhandlerelse", "doifnotcommandhandler", "doifcommandhandler", "newmode", "setmode", "resetmode", "newsystemmode", "setsystemmode", "resetsystemmode", "pushsystemmode", "popsystemmode", "globalsetmode", "globalresetmode", "globalsetsystemmode", "globalresetsystemmode", "booleanmodevalue", "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newlanguage", "newfamily", "newfam", "newhelp", "newinteger", "newdimension", "newgluespec", "newmugluespec", "aliasinteger", "aliasdimension", "then", "begcsname", "autorule", "strippedcsname", "checkedstrippedcsname", "nofarguments", "firstargumentfalse", "firstargumenttrue", "secondargumentfalse", "secondargumenttrue", "thirdargumentfalse", "thirdargumenttrue", "fourthargumentfalse", "fourthargumenttrue", "fifthargumentfalse", "fifthargumenttrue", "sixthargumentfalse", "sixthargumenttrue", "seventhargumentfalse", "seventhargumenttrue", "vkern", "hkern", "vpenalty", "hpenalty", "doglobal", "dodoglobal", "redoglobal", "resetglobal", "donothing", "untraceddonothing", "dontcomplain", "moreboxtracing", "lessboxtracing", "noboxtracing", "forgetall", "donetrue", "donefalse", "foundtrue", "foundfalse", "inlineordisplaymath", "indisplaymath", "forcedisplaymath", "startforceddisplaymath", "stopforceddisplaymath", "startpickupmath", "stoppickupmath", "reqno", "forceinlinemath", "mathortext", "thebox", "htdp", "unvoidbox", "hfilll", "vfilll", "mathbox", "mathlimop", "mathnolop", "mathnothing", "mathalpha", "currentcatcodetable", "defaultcatcodetable", "catcodetablename", "newcatcodetable", "startcatcodetable", "stopcatcodetable", "startextendcatcodetable", "stopextendcatcodetable", "pushcatcodetable", "popcatcodetable", "restorecatcodes", "setcatcodetable", "letcatcodecommand", "defcatcodecommand", "uedcatcodecommand", "hglue", "vglue", "hfillneg", "vfillneg", "hfilllneg", "vfilllneg", "hsplit", "ruledhss", "ruledhfil", "ruledhfill", "ruledhfilll", "ruledhfilneg", "ruledhfillneg", "normalhfillneg", "normalhfilllneg", "ruledvss", "ruledvfil", "ruledvfill", "ruledvfilll", "ruledvfilneg", "ruledvfillneg", "normalvfillneg", "normalvfilllneg", "ruledhbox", "ruledvbox", "ruledvtop", "ruleddbox", "ruledvcenter", "ruledmbox", "ruledhpack", "ruledvpack", "ruledtpack", "ruleddpack", "ruledvsplit", "ruledtsplit", "ruleddsplit", "ruledhskip", "ruledvskip", "ruledkern", "ruledmskip", "ruledmkern", "ruledhglue", "ruledvglue", "normalhglue", "normalvglue", "ruledpenalty", "filledhboxb", "filledhboxr", "filledhboxg", "filledhboxc", "filledhboxm", "filledhboxy", "filledhboxk", "scratchstring", "scratchstringone", "scratchstringtwo", "tempstring", "scratchcounter", "globalscratchcounter", "privatescratchcounter", "scratchdimen", "globalscratchdimen", "privatescratchdimen", "scratchskip", "globalscratchskip", "privatescratchskip", "scratchmuskip", "globalscratchmuskip", "privatescratchmuskip", "scratchtoks", "globalscratchtoks", "privatescratchtoks", "scratchbox", "globalscratchbox", "privatescratchbox", "scratchmacro", "scratchmacroone", "scratchmacrotwo", "scratchconditiontrue", "scratchconditionfalse", "ifscratchcondition", "scratchconditiononetrue", "scratchconditiononefalse", "ifscratchconditionone", "scratchconditiontwotrue", "scratchconditiontwofalse", "ifscratchconditiontwo", "globalscratchcounterone", "globalscratchcountertwo", "globalscratchcounterthree", "groupedcommand", "groupedcommandcs", "triggergroupedcommand", "triggergroupedcommandcs", "simplegroupedcommand", "simplegroupedcommandcs", "pickupgroupedcommand", "pickupgroupedcommandcs", "mathgroupedcommandcs", "usedbaselineskip", "usedlineskip", "usedlineskiplimit", "availablehsize", "localhsize", "setlocalhsize", "distributedhsize", "hsizefraction", "next", "nexttoken", "nextbox", "dowithnextbox", "dowithnextboxcs", "dowithnextboxcontent", "dowithnextboxcontentcs", "flushnextbox", "boxisempty", "boxtostring", "contentostring", "prerolltostring", "givenwidth", "givenheight", "givendepth", "scangivendimensions", "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchtotal", "scratchitalic", "scratchhsize", "scratchvsize", "scratchxoffset", "scratchyoffset", "scratchhoffset", "scratchvoffset", "scratchxposition", "scratchyposition", "scratchtopoffset", "scratchbottomoffset", "scratchleftoffset", "scratchrightoffset", "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchcounterfour", "scratchcounterfive", "scratchcountersix", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchdimenfour", "scratchdimenfive", "scratchdimensix", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchskipfour", "scratchskipfive", "scratchskipsix", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchmuskipfour", "scratchmuskipfive", "scratchmuskipsix", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchtoksfour", "scratchtoksfive", "scratchtokssix", "scratchboxone", "scratchboxtwo", "scratchboxthree", "scratchboxfour", "scratchboxfive", "scratchboxsix", "scratchnx", "scratchny", "scratchmx", "scratchmy", "scratchunicode", "scratchmin", "scratchmax", "scratchleftskip", "scratchrightskip", "scratchtopskip", "scratchbottomskip", "doif", "doifnot", "doifelse", "firstinset", "doifinset", "doifnotinset", "doifelseinset", "doifinsetelse", "doifelsenextchar", "doifnextcharelse", "doifelsenextcharcs", "doifnextcharcselse", "doifelsenextoptional", "doifnextoptionalelse", "doifelsenextoptionalcs", "doifnextoptionalcselse", "doifelsefastoptionalcheck", "doiffastoptionalcheckelse", "doifelsefastoptionalcheckcs", "doiffastoptionalcheckcselse", "doifelsenextbgroup", "doifnextbgroupelse", "doifelsenextbgroupcs", "doifnextbgroupcselse", "doifelsenextparenthesis", "doifnextparenthesiselse", "doifelseundefined", "doifundefinedelse", "doifelsedefined", "doifdefinedelse", "doifundefined", "doifdefined", "doifelsevalue", "doifvalue", "doifnotvalue", "doifnothing", "doifsomething", "doifelsenothing", "doifnothingelse", "doifelsesomething", "doifsomethingelse", "doifvaluenothing", "doifvaluesomething", "doifelsevaluenothing", "doifvaluenothingelse", "doifelsedimension", "doifdimensionelse", "doifelsenumber", "doifnumberelse", "doifnumber", "doifnotnumber", "doifelsecommon", "doifcommonelse", "doifcommon", "doifnotcommon", "doifinstring", "doifnotinstring", "doifelseinstring", "doifinstringelse", "doifelseassignment", "doifassignmentelse", "docheckassignment", "doifelseassignmentcs", "doifassignmentelsecs", "validassignment", "novalidassignment", "doiftext", "doifelsetext", "doiftextelse", "doifnottext", "quitcondition", "truecondition", "falsecondition", "tracingall", "tracingnone", "loggingall", "tracingcatcodes", "showluatokens", "aliasmacro", "removetoks", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to", "endgraf", "endpar", "reseteverypar", "finishpar", "empty", "null", "space", "quad", "enspace", "emspace", "charspace", "nbsp", "crlf", "obeyspaces", "obeylines", "obeytabs", "obeypages", "obeyedspace", "obeyedline", "obeyedtab", "obeyedpage", "normalspace", "naturalspace", "controlspace", "normalspaces", "ignoretabs", "ignorelines", "ignorepages", "ignoreeofs", "setcontrolspaces", "executeifdefined", "singleexpandafter", "doubleexpandafter", "tripleexpandafter", "dontleavehmode", "removelastspace", "removeunwantedspaces", "keepunwantedspaces", "removepunctuation", "ignoreparskip", "forcestrutdepth", "onlynonbreakablespace", "wait", "writestatus", "define", "defineexpandable", "redefine", "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "freezemeasure", "measure", "measured", "directmeasure", "setquantity", "setequantity", "setgquantity", "setxquantity", "definequantity", "freezequantity", "quantity", "quantitied", "directquantity", "installcorenamespace", "getvalue", "getuvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", "globallet", "udef", "ugdef", "uedef", "uxdef", "checked", "unique", "getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters", "getdummyparameters", "dummyparameter", "directdummyparameter", "setdummyparameter", "letdummyparameter", "setexpandeddummyparameter", "resetdummyparameter", "usedummystyleandcolor", "usedummystyleparameter", "usedummycolorparameter", "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", "unexpanded", "expanded", "startexpanded", "stopexpanded", "protect", "unprotect", "firstofoneargument", "firstoftwoarguments", "secondoftwoarguments", "firstofthreearguments", "secondofthreearguments", "thirdofthreearguments", "firstoffourarguments", "secondoffourarguments", "thirdoffourarguments", "fourthoffourarguments", "firstoffivearguments", "secondoffivearguments", "thirdoffivearguments", "fourthoffivearguments", "fifthoffivearguments", "firstofsixarguments", "secondofsixarguments", "thirdofsixarguments", "fourthofsixarguments", "fifthofsixarguments", "sixthofsixarguments", "firstofoneunexpanded", "firstoftwounexpanded", "secondoftwounexpanded", "firstofthreeunexpanded", "secondofthreeunexpanded", "thirdofthreeunexpanded", "gobbleoneargument", "gobbletwoarguments", "gobblethreearguments", "gobblefourarguments", "gobblefivearguments", "gobblesixarguments", "gobblesevenarguments", "gobbleeightarguments", "gobbleninearguments", "gobbletenarguments", "gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals", "dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "dofastloopcs", "fastloopindex", "fastloopfinal", "dowith", "doloopovermatch", "doloopovermatched", "doloopoverlist", "newconstant", "setnewconstant", "setconstant", "setconstantvalue", "newconditional", "settrue", "setfalse", "settruevalue", "setfalsevalue", "setconditional", "newmacro", "setnewmacro", "newfraction", "newsignal", "newboundary", "dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty", "dosingleargument", "dodoubleargument", "dotripleargument", "doquadrupleargument", "doquintupleargument", "dosixtupleargument", "doseventupleargument", "dosinglegroupempty", "dodoublegroupempty", "dotriplegroupempty", "doquadruplegroupempty", "doquintuplegroupempty", "permitspacesbetweengroups", "dontpermitspacesbetweengroups", "nopdfcompression", "maximumpdfcompression", "normalpdfcompression", "onlypdfobjectcompression", "nopdfobjectcompression", "modulonumber", "dividenumber", "getfirstcharacter", "doifelsefirstchar", "doiffirstcharelse", "mathclassvalue", "startnointerference", "stopnointerference", "twodigits", "threedigits", "leftorright", "offinterlineskip", "oninterlineskip", "nointerlineskip", "strut", "halfstrut", "quarterstrut", "depthstrut", "halflinestrut", "noheightstrut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "strutgap", "begstrut", "endstrut", "lineheight", "leftboundary", "rightboundary", "signalcharacter", "aligncontentleft", "aligncontentmiddle", "aligncontentright", "shiftbox", "vpackbox", "hpackbox", "vpackedbox", "hpackedbox", "normalreqno", "startimath", "stopimath", "normalstartimath", "normalstopimath", "startdmath", "stopdmath", "normalstartdmath", "normalstopdmath", "normalsuperscript", "normalsubscript", "normalnosuperscript", "normalnosubscript", "normalprimescript", "superscript", "subscript", "nosuperscript", "nosubscript", "primescript", "superprescript", "subprescript", "nosuperprescript", "nosubsprecript", "uncramped", "cramped", "mathstyletrigger", "triggermathstyle", "triggeredmathstyle", "mathstylefont", "mathsmallstylefont", "mathstyleface", "mathsmallstyleface", "mathstylecommand", "mathpalette", "mathstylehbox", "mathstylevbox", "mathstylevcenter", "mathstylevcenteredhbox", "mathstylevcenteredvbox", "mathtext", "setmathsmalltextbox", "setmathtextbox", "pushmathstyle", "popmathstyle", "triggerdisplaystyle", "triggertextstyle", "triggerscriptstyle", "triggerscriptscriptstyle", "triggeruncrampedstyle", "triggercrampedstyle", "triggersmallstyle", "triggeruncrampedsmallstyle", "triggercrampedsmallstyle", "triggerbigstyle", "triggeruncrampedbigstyle", "triggercrampedbigstyle", "luaexpr", "expelsedoif", "expdoif", "expdoifnot", "expdoifelsecommon", "expdoifcommonelse", "expdoifelseinset", "expdoifinsetelse", "ctxdirectlua", "ctxlatelua", "ctxsprint", "ctxwrite", "ctxcommand", "ctxdirectcommand", "ctxlatecommand", "ctxreport", "ctxlua", "luacode", "lateluacode", "directluacode", "registerctxluafile", "ctxloadluafile", "luaversion", "luamajorversion", "luaminorversion", "ctxluacode", "luaconditional", "luaexpanded", "ctxluamatch", "startluaparameterset", "stopluaparameterset", "luaparameterset", "definenamedlua", "obeylualines", "obeyluatokens", "startluacode", "stopluacode", "startlua", "stoplua", "startctxfunction", "stopctxfunction", "ctxfunction", "startctxfunctiondefinition", "stopctxfunctiondefinition", "installctxfunction", "installprotectedctxfunction", "installprotectedctxscanner", "installctxscanner", "resetctxscanner", "cldprocessfile", "cldloadfile", "cldloadviafile", "cldcontext", "cldcommand", "carryoverpar", "freezeparagraphproperties", "defrostparagraphproperties", "setparagraphfreezing", "forgetparagraphfreezing", "updateparagraphproperties", "updateparagraphpenalties", "updateparagraphdemerits", "updateparagraphshapes", "updateparagraphlines", "lastlinewidth", "assumelongusagecs", "righttolefthbox", "lefttorighthbox", "righttoleftvbox", "lefttorightvbox", "righttoleftvtop", "lefttorightvtop", "rtlhbox", "ltrhbox", "rtlvbox", "ltrvbox", "rtlvtop", "ltrvtop", "autodirhbox", "autodirvbox", "autodirvtop", "leftorrighthbox", "leftorrightvbox", "leftorrightvtop", "lefttoright", "righttoleft", "checkedlefttoright", "checkedrighttoleft", "synchronizelayoutdirection", "synchronizedisplaydirection", "synchronizeinlinedirection", "dirlre", "dirrle", "dirlro", "dirrlo", "rtltext", "ltrtext", "lesshyphens", "morehyphens", "nohyphens", "dohyphens", "dohyphencollapsing", "nohyphencollapsing", "compounddiscretionary", "Ucheckedstartdisplaymath", "Ucheckedstopdisplaymath", "break", "nobreak", "allowbreak", "goodbreak", "nospace", "nospacing", "dospacing", "naturalhbox", "naturalvbox", "naturalvtop", "naturalhpack", "naturalvpack", "naturaltpack", "reversehbox", "reversevbox", "reversevtop", "reversehpack", "reversevpack", "reversetpack", "hcontainer", "vcontainer", "tcontainer", "frule", "compoundhyphenpenalty", "start", "stop", "unsupportedcs", "openout", "closeout", "write", "openin", "closein", "read", "readline", "readfromterminal", "boxlines", "boxline", "setboxline", "copyboxline", "boxlinewd", "boxlineht", "boxlinedp", "boxlinenw", "boxlinenh", "boxlinend", "boxlinels", "boxliners", "boxlinelh", "boxlinerh", "boxlinelp", "boxlinerp", "boxlinein", "boxrangewd", "boxrangeht", "boxrangedp", "bitwiseset", "bitwiseand", "bitwiseor", "bitwisexor", "bitwisenot", "bitwisenil", "ifbitwiseand", "bitwise", "bitwiseshift", "bitwiseflip", "textdir", "linedir", "pardir", "boxdir", "prelistbox", "postlistbox", "prelistcopy", "postlistcopy", "setprelistbox", "setpostlistbox", "noligaturing", "nokerning", "noexpansion", "noprotrusion", "noleftkerning", "noleftligaturing", "norightkerning", "norightligaturing", "noitaliccorrection", "futureletnexttoken", "defbackslashbreak", "letbackslashbreak", "pushoverloadmode", "popoverloadmode", "pushrunstate", "poprunstate", "suggestedalias", "showboxhere", "discoptioncodestring", "flagcodestring", "frozenparcodestring", "glyphoptioncodestring", "groupcodestring", "hyphenationcodestring", "mathcontrolcodestring", "mathflattencodestring", "normalizecodestring", "parcontextcodestring", "newlocalcount", "newlocaldimen", "newlocalskip", "newlocalmuskip", "newlocaltoks", "newlocalbox", "newlocalwrite", "newlocalread", "setnewlocalcount", "setnewlocaldimen", "setnewlocalskip", "setnewlocalmuskip", "setnewlocaltoks", "setnewlocalbox", "ifexpression" }, }
\ No newline at end of file diff --git a/context/data/scite/context/scite-context-data-context.properties b/context/data/scite/context/scite-context-data-context.properties index 45479331b..c80a0f933 100644 --- a/context/data/scite/context/scite-context-data-context.properties +++ b/context/data/scite/context/scite-context-data-context.properties @@ -70,56 +70,56 @@ stopmodeset doifmode doifelsemode doifmodeelse doifnotmode \ startmodeset stopmodeset startallmodes stopallmodes startnotallmodes \ stopnotallmodes doifallmodes doifelseallmodes doifallmodeselse doifnotallmodes \ startenvironment stopenvironment environment startcomponent stopcomponent \ -component startproduct stopproduct product startproject \ -stopproject project starttext stoptext startnotext \ -stopnotext startdocument stopdocument documentvariable unexpandeddocumentvariable \ -setupdocument presetdocument doifelsedocumentvariable doifdocumentvariableelse doifdocumentvariable \ -doifnotdocumentvariable startmodule stopmodule usemodule usetexmodule \ -useluamodule setupmodule currentmoduleparameter moduleparameter everystarttext \ -everystoptext startTEXpage stopTEXpage enablemode disablemode \ -preventmode definemode globalenablemode globaldisablemode globalpreventmode \ -pushmode popmode typescriptone typescripttwo typescriptthree \ -mathsizesuffix mathordinarycode mathordcode mathoperatorcode mathopcode \ -mathbinarycode mathbincode mathrelationcode mathrelcode mathopencode \ -mathclosecode mathpunctuationcode mathpunctcode mathovercode mathundercode \ -mathinnercode mathradicalcode mathfractioncode mathmiddlecode mathaccentcode \ -mathfencedcode mathghostcode mathvariablecode mathactivecode mathvcentercode \ -mathconstructcode mathwrappedcode mathbegincode mathendcode mathexplicitcode \ -mathdivisioncode mathfactorialcode mathdimensioncode mathexperimentalcode mathtextpunctuationcode \ -mathimaginarycode mathdifferentialcode mathexponentialcode mathellipsiscode mathfunctioncode \ -mathdigitcode mathalphacode mathboxcode mathchoicecode mathnothingcode \ -mathlimopcode mathnolopcode mathunsetcode mathunspacedcode mathallcode \ -mathfakecode mathunarycode mathmaybeordinarycode mathmayberelationcode mathmaybebinarycode \ -mathnumbergroupcode constantnumber constantnumberargument constantdimen constantdimenargument \ -constantemptyargument luastringsep !!bs !!es lefttorightmark \ -righttoleftmark lrm rlm bidilre bidirle \ -bidipop bidilro bidirlo breakablethinspace nobreakspace \ -nonbreakablespace narrownobreakspace zerowidthnobreakspace ideographicspace ideographichalffillspace \ -twoperemspace threeperemspace fourperemspace fiveperemspace sixperemspace \ -figurespace punctuationspace hairspace enquad emquad \ -zerowidthspace zerowidthnonjoiner zerowidthjoiner zwnj zwj \ -optionalspace asciispacechar softhyphen autoinsertedspace Ux \ -eUx parfillleftskip parfillrightskip startlmtxmode stoplmtxmode \ -startmkivmode stopmkivmode wildcardsymbol normalhyphenationcode automatichyphenationcode \ -explicithyphenationcode syllablehyphenationcode uppercasehyphenationcode collapsehyphenationcode compoundhyphenationcode \ -strictstarthyphenationcode strictendhyphenationcode automaticpenaltyhyphenationcode explicitpenaltyhyphenationcode permitgluehyphenationcode \ -permitallhyphenationcode permitmathreplacehyphenationcode forcecheckhyphenationcode lazyligatureshyphenationcode forcehandlerhyphenationcode \ -feedbackcompoundhyphenationcode ignoreboundshyphenationcode partialhyphenationcode completehyphenationcode normalizelinenormalizecode \ -parindentskipnormalizecode swaphangindentnormalizecode swapparsshapenormalizecode breakafterdirnormalizecode removemarginkernsnormalizecode \ -clipwidthnormalizecode flattendiscretionariesnormalizecode discardzerotabskipsnormalizecode flattenhleadersnormalizecode normalizeparnormalizeparcode \ -flattenvleadersnormalizeparcode nopreslackclassoptioncode nopostslackclassoptioncode lefttopkernclassoptioncode righttopkernclassoptioncode \ -leftbottomkernclassoptioncode rightbottomkernclassoptioncode lookaheadforendclassoptioncode noitaliccorrectionclassoptioncode defaultmathclassoptions \ -checkligatureclassoptioncode checkitaliccorrectionclassoptioncode checkkernpairclassoptioncode flattenclassoptioncode omitpenaltyclassoptioncode \ -unpackclassoptioncode raiseprimeclassoptioncode carryoverlefttopkernclassoptioncode carryoverleftbottomkernclassoptioncode carryoverrighttopkernclassoptioncode \ -carryoverrightbottomkernclassoptioncode preferdelimiterdimensionsclassoptioncode autoinjectclassoptioncode removeitaliccorrectionclassoptioncode operatoritaliccorrectionclassoptioncode \ -noligaturingglyphoptioncode nokerningglyphoptioncode noleftligatureglyphoptioncode noleftkernglyphoptioncode norightligatureglyphoptioncode \ -norightkernglyphoptioncode noexpansionglyphoptioncode noprotrusionglyphoptioncode noitaliccorrectionglyphoptioncode nokerningcode \ -noligaturingcode frozenflagcode tolerantflagcode protectedflagcode primitiveflagcode \ -permanentflagcode noalignedflagcode immutableflagcode mutableflagcode globalflagcode \ -overloadedflagcode immediateflagcode conditionalflagcode valueflagcode instanceflagcode \ -ordmathflattencode binmathflattencode relmathflattencode punctmathflattencode innermathflattencode \ -normalworddiscoptioncode preworddiscoptioncode postworddiscoptioncode continueifinputfile continuewhenlmtxmode \ -continuewhenmkivmode +component startlocalcomponent stoplocalcomponent startproduct stopproduct \ +product startproject stopproject project starttext \ +stoptext startnotext stopnotext startdocument stopdocument \ +documentvariable unexpandeddocumentvariable setupdocument presetdocument doifelsedocumentvariable \ +doifdocumentvariableelse doifdocumentvariable doifnotdocumentvariable startmodule stopmodule \ +usemodule usetexmodule useluamodule setupmodule currentmoduleparameter \ +moduleparameter everystarttext everystoptext startTEXpage stopTEXpage \ +enablemode disablemode preventmode definemode globalenablemode \ +globaldisablemode globalpreventmode pushmode popmode typescriptone \ +typescripttwo typescriptthree mathsizesuffix mathordinarycode mathordcode \ +mathoperatorcode mathopcode mathbinarycode mathbincode mathrelationcode \ +mathrelcode mathopencode mathclosecode mathpunctuationcode mathpunctcode \ +mathovercode mathundercode mathinnercode mathradicalcode mathfractioncode \ +mathmiddlecode mathaccentcode mathfencedcode mathghostcode mathvariablecode \ +mathactivecode mathvcentercode mathconstructcode mathwrappedcode mathbegincode \ +mathendcode mathexplicitcode mathdivisioncode mathfactorialcode mathdimensioncode \ +mathexperimentalcode mathtextpunctuationcode mathimaginarycode mathdifferentialcode mathexponentialcode \ +mathellipsiscode mathfunctioncode mathdigitcode mathalphacode mathboxcode \ +mathchoicecode mathnothingcode mathlimopcode mathnolopcode mathunsetcode \ +mathunspacedcode mathallcode mathfakecode mathunarycode mathmaybeordinarycode \ +mathmayberelationcode mathmaybebinarycode mathnumbergroupcode constantnumber constantnumberargument \ +constantdimen constantdimenargument constantemptyargument luastringsep !!bs \ +!!es lefttorightmark righttoleftmark lrm rlm \ +bidilre bidirle bidipop bidilro bidirlo \ +breakablethinspace nobreakspace nonbreakablespace narrownobreakspace zerowidthnobreakspace \ +ideographicspace ideographichalffillspace twoperemspace threeperemspace fourperemspace \ +fiveperemspace sixperemspace figurespace punctuationspace hairspace \ +enquad emquad zerowidthspace zerowidthnonjoiner zerowidthjoiner \ +zwnj zwj optionalspace asciispacechar softhyphen \ +autoinsertedspace Ux eUx parfillleftskip parfillrightskip \ +startlmtxmode stoplmtxmode startmkivmode stopmkivmode wildcardsymbol \ +normalhyphenationcode automatichyphenationcode explicithyphenationcode syllablehyphenationcode uppercasehyphenationcode \ +collapsehyphenationcode compoundhyphenationcode strictstarthyphenationcode strictendhyphenationcode automaticpenaltyhyphenationcode \ +explicitpenaltyhyphenationcode permitgluehyphenationcode permitallhyphenationcode permitmathreplacehyphenationcode forcecheckhyphenationcode \ +lazyligatureshyphenationcode forcehandlerhyphenationcode feedbackcompoundhyphenationcode ignoreboundshyphenationcode partialhyphenationcode \ +completehyphenationcode normalizelinenormalizecode parindentskipnormalizecode swaphangindentnormalizecode swapparsshapenormalizecode \ +breakafterdirnormalizecode removemarginkernsnormalizecode clipwidthnormalizecode flattendiscretionariesnormalizecode discardzerotabskipsnormalizecode \ +flattenhleadersnormalizecode normalizeparnormalizeparcode flattenvleadersnormalizeparcode nopreslackclassoptioncode nopostslackclassoptioncode \ +lefttopkernclassoptioncode righttopkernclassoptioncode leftbottomkernclassoptioncode rightbottomkernclassoptioncode lookaheadforendclassoptioncode \ +noitaliccorrectionclassoptioncode defaultmathclassoptions checkligatureclassoptioncode checkitaliccorrectionclassoptioncode checkkernpairclassoptioncode \ +flattenclassoptioncode omitpenaltyclassoptioncode unpackclassoptioncode raiseprimeclassoptioncode carryoverlefttopkernclassoptioncode \ +carryoverleftbottomkernclassoptioncode carryoverrighttopkernclassoptioncode carryoverrightbottomkernclassoptioncode preferdelimiterdimensionsclassoptioncode autoinjectclassoptioncode \ +removeitaliccorrectionclassoptioncode operatoritaliccorrectionclassoptioncode noligaturingglyphoptioncode nokerningglyphoptioncode noleftligatureglyphoptioncode \ +noleftkernglyphoptioncode norightligatureglyphoptioncode norightkernglyphoptioncode noexpansionglyphoptioncode noprotrusionglyphoptioncode \ +noitaliccorrectionglyphoptioncode nokerningcode noligaturingcode frozenflagcode tolerantflagcode \ +protectedflagcode primitiveflagcode permanentflagcode noalignedflagcode immutableflagcode \ +mutableflagcode globalflagcode overloadedflagcode immediateflagcode conditionalflagcode \ +valueflagcode instanceflagcode ordmathflattencode binmathflattencode relmathflattencode \ +punctmathflattencode innermathflattencode normalworddiscoptioncode preworddiscoptioncode postworddiscoptioncode \ +continueifinputfile continuewhenlmtxmode continuewhenmkivmode keywordclass.context.helpers=\ startsetups stopsetups startxmlsetups stopxmlsetups \ diff --git a/doc/context/scripts/mkiv/mtx-pdf.html b/doc/context/scripts/mkiv/mtx-pdf.html index 52c6b5608..3e4541a0c 100644 --- a/doc/context/scripts/mkiv/mtx-pdf.html +++ b/doc/context/scripts/mkiv/mtx-pdf.html @@ -44,7 +44,7 @@ <tr><th>--pretty</th><td></td><td>replace newlines in metadata</td></tr> <tr><th>--fonts</th><td></td><td>show used fonts (--detail)</td></tr> <tr><th>--object</th><td></td><td>show object"/></td></tr> - <tr><th>--linkjs</th><td></td><td>show links"/></td></tr> + <tr><th>--links</th><td></td><td>show links"/></td></tr> <tr><th/><td/><td/></tr> </table> <br/> diff --git a/doc/context/scripts/mkiv/mtx-pdf.man b/doc/context/scripts/mkiv/mtx-pdf.man index a8fbade52..222261a81 100644 --- a/doc/context/scripts/mkiv/mtx-pdf.man +++ b/doc/context/scripts/mkiv/mtx-pdf.man @@ -26,7 +26,7 @@ show used fonts (--detail) .B --object show object"/> .TP -.B --linkjs +.B --links show links"/> .SH AUTHOR More information about ConTeXt and the tools that come with it can be found at: diff --git a/doc/context/scripts/mkiv/mtx-pdf.xml b/doc/context/scripts/mkiv/mtx-pdf.xml index c4779d876..6b2efdcb8 100644 --- a/doc/context/scripts/mkiv/mtx-pdf.xml +++ b/doc/context/scripts/mkiv/mtx-pdf.xml @@ -13,7 +13,7 @@ <flag name="pretty"><short>replace newlines in metadata</short></flag> <flag name="fonts"><short>show used fonts (<ref name="detail)"/></short></flag> <flag name="object"><short>show object"/></short></flag> - <flag name="linkjs"><short>show links"/></short></flag> + <flag name="links"><short>show links"/></short></flag> </subcategory> <subcategory> <example><command>mtxrun --script pdf --info foo.pdf</command></example> diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-building.tex b/doc/context/sources/general/manuals/luametatex/luametatex-building.tex index ca09c53f9..277d39251 100644 --- a/doc/context/sources/general/manuals/luametatex/luametatex-building.tex +++ b/doc/context/sources/general/manuals/luametatex/luametatex-building.tex @@ -792,6 +792,60 @@ we can freeze them. {everybeforepar}, \prm {snapshotpar}, \prm {wrapuppar}, etc. For the moment the manuals that come with \CONTEXT\ have to do.} +% The concept of paragraph in \TEX\ can be a bit confusing, and what follows here +% is even more so. In \LUAMETATEX\ we distinguish three different cases: +% +% \startitemize[packed] +% \starthead {normal} +% This state is entered when we have an explicit \type {\par}. +% \stophead +% \starthead {inserted} +% This state is entered when \TEX\ forces a new paragraph which can happen when +% we automatically change to horizontal mode. +% \stophead +% \starthead{newline} +% This state is entered when an empty line is encoduntered. +% \stophead +% \stopitemize +% +% When defining macros, a \type {\par} can be a delimiter and an empty line is then +% equivalent to that. With \type {\autoparagraphmode} we can change this behaviour. +% The bits set in this variable determines how \type {\par} tokens are interpreted +% and processed in different situations. It is good to know that this experimental +% feature is pretty much \CONTEXT\ specific. Here are a few characteristics: +% +% \startitemize[packed] +% \startitem +% When any bit is set, a par token is appended when with property inserted. +% The reason behind different properties (mentioned above) is that we can +% intercept them with callbacks. +% \stopitem +% \startitem +% When bit~1 (text) is set, \type {\par} will be appended to a string when +% a token list is serialized. +% \stopitem +% \startitem +% When bit~2 (macro) is set when a macro is defined there is an explicit +% check for a par token when \type {\par} is part of the preamble. +% \stopitem +% \startitem +% When bit~4 (go on) is not set we enter the same state as a new line. +% After that when bit~1 (text) is set, a regular par token command is +% injected (with an associated newline state), otherwise the meaning of +% \type {\par} kicks in (users can have redefined \type {\par}). +% \stopitem +% \stopitemize +% +% In \CONTEXT\ we currently default to one, because we still have a few \type {\par} +% delimited macros but these will go and then we will set the mode to two. This +% means that in \CONTEXT\ such macro expects an explicit \type {\par} and not an +% empty line which in turn encourages users to use the proper alternatives. We +% anyway don't support redefined \type {\par} tokens. Therefore, when we load for +% instance tikz, we set the mode to zero (normal \TEX) and afterwards back to one. +% This is still an experimental feature that we occasionally review so don't bother +% us with questions about it (just don't set the mode). + + \stopsubsection \startsubsection[title=Penalties] diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex b/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex index 13bc3a3e3..dd7428e25 100644 --- a/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex +++ b/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex @@ -248,7 +248,7 @@ input that would have generated an error when processed by older \TEX|-|based engines. The affected commands with an altered initial (left of the equal sign) or secondary (right of the equal sign) value are: \prm {char}, \prm {lccode}, \prm {uccode}, \prm {hjcode}, \prm {catcode}, \prm {sfcode}, \prm {efcode}, \prm -{lpcode}, \prm {rpcode}, \prm {chardef}. +{cfcode}, \prm {lpcode}, \prm {rpcode}, \prm {chardef}. As far as the core engine is concerned, all input and output to text files is \UTF-8 encoded. Input files can be pre|-|processed using the \type {reader} @@ -1914,6 +1914,16 @@ by the engine for the same reasons: less code and less tracing clutter. \stopsubsection +\startsubsection[title={\prm{cdef}, \prm {cdefcsname} and \prm {constant}}] + +These primitives are like \prm {edef} and \prm {edefcsname} but tag the macro as +being kind of simple, which means that in some scenarios they are serialized in a +fast way, not going through the expansion machinery. This is actually an +experiment but it will stay. The \prm {constant} prefix can be used with other +definition primitives instead. + +\stopsubsection + \startsubsection[title={\prm {csstring}, \prm {begincsname} and \prm {lastnamedcs}}] These are somewhat special. The \prm {csstring} primitive is like @@ -2002,6 +2012,21 @@ defined (or used). \stopsubsection +\startsubsection[title=Prefixes] + +Quite some primitive usage can be preceded by a prefix. For instance assignments +can be \prm {global} and macros can be defined \prm {protected}. In \LUAMETATEX\ +we have more prefixes, like \prm {tolerant} that signals a different way of +interpreting macro arguments and \type {permanent} that flags a definition in +away that, when overload protection is enabled, will prevent redefinition. +Prefixes like \prm {immediate} and its counterpart \prm {deferred} are backend +related and, as we don't have one in the engine, are not doing much. They are +just intercepted and passed to e.g.\ some \LUA\ function called so that one can +use them to construct additional (\LUA\ based) pseudo primitives. Various +prefixes are discussed elsewhere. + +\stopsubsection + \startsubsection[title=Arguments] \topicindex {macros+arguments} @@ -2421,6 +2446,45 @@ omits the unit. \stopsubsection +\startsubsection[title={Units}] + +The familiar \TEX\ units like \type {pt} and \type {cm} are supported but since +the 2021 \CONTEXT\ meeting we also support the Knuthian Potrzebie, cf.\ \typ +{en.wikipedia.org/wiki/Potrzebie}. The two character acronym is \type {dk}. One +\type {dk} is 6.43985pt. This unit is particularly suited for offsets in framed +examples. + +In 2023 we added the Edith (\type {es}) and Tove (\type {ts}) as metric +replacements for the inch (\type {in}). As with the \type {dk} more background +information can be found in documents that come with \CONTEXT\ and user group +journals. The \type {eu} unit starts out as one \type {es} but can be scaled with +\prm {eufactor}. + +\startbuffer +\localcontrolledloop -5 55 5 { + \eufactor=\currentloopiterator + \dontleavehmode\strut + \vrule height .1es depth .25ts width 1dk\relax\quad + \vrule height .1es depth .25ts width 1eu\relax\quad + \the\currentloopiterator + \par +} +\stopbuffer + +\typebuffer + +This example code shows all four new units. Watch how \prm {eufactor} is clipped +to a value in the range $1-50$. The default factor of $10$ makes the European +Unit equivalent to ten Toves or one Edith. + +\startpacked +\startcolor[darkgray] +\getbuffer +\stopcolor +\stoppacked + +\stopsubsection + \stopsection \startsection[title=Expressions] diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-fonts.tex b/doc/context/sources/general/manuals/luametatex/luametatex-fonts.tex index b4e692545..127fd16c1 100644 --- a/doc/context/sources/general/manuals/luametatex/luametatex-fonts.tex +++ b/doc/context/sources/general/manuals/luametatex/luametatex-fonts.tex @@ -130,8 +130,14 @@ optical paragraph optimization: \NC \type {leftprotruding} \NC number \NC left protruding factor (\prm {lpcode}) \NC\NR \NC \type {rightprotruding} \NC number \NC right protruding factor (\prm {rpcode}) \NC\NR \NC \type {expansion} \NC number \NC expansion factor (\prm {efcode}) \NC\NR +\NC \type {compression} \NC number \NC compression factor (\prm {cfcode}) \NC\NR \stoptabulate +The \prm {lpcode}, \prm {rpcode} and \prm {efcode} are comparable to the ones +introduced by \PDFTEX, while \prm {cfcode} complements \prm {efcode}: a +compression alongside expansion code per character. In \LUAMETATEX\ the expansion +mechanism is also available in math. + From \TEX\ we inherit the following tables. Ligatures are only used in so call base mode, when the engine does the font magic. Kerns are used in text and optionally in math: More details follow below. diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-languages.tex b/doc/context/sources/general/manuals/luametatex/luametatex-languages.tex index 83e19dcc9..daa4420c9 100644 --- a/doc/context/sources/general/manuals/luametatex/luametatex-languages.tex +++ b/doc/context/sources/general/manuals/luametatex/luametatex-languages.tex @@ -130,7 +130,7 @@ hyphenation happens is (normally) when the paragraph or a horizontal box is constructed. When \prm {savinghyphcodes} was zero when the language got initialized you start out with nothing, otherwise you already have a set. -When a \prm {hjcode} is greater than 0 but less than 32 is indicates the +When a \prm {hjcode} is greater than 0 but less than 32 the value indicates the to be used length. In the following example we map a character (\type {x}) onto another one in the patterns and tell the engine that \type {œ} counts as two characters. Because traditionally zero itself is reserved for inhibiting diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex b/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex index bccb899c0..df4da576e 100644 --- a/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex +++ b/doc/context/sources/general/manuals/luametatex/luametatex-nodes.tex @@ -24,21 +24,63 @@ such a user data object is represented as \syntax {<node>}. \blank You can ask for a list of fields with \type {node.fields} and for valid subtypes -with \type {node.subtypes}. The \type {node.values} function reports some used -values. Valid arguments are \type {glue}, \type {style} and \type {math}. Keep in -mind that the setters normally expect a number, but this helper gives you a list -of what numbers matter. For practical reason the \type {pagestate} values are -also reported with this helper, but they are backend specific. +with \type {node.subtypes}. There are plenty specific field values and you can +some idea about them by calling \type {tex.get*values()} which returns a table if +numbers (exclusive numbers or bits): -\def\ShowValues#1{ +\starttexdefinition ShowTeXValues #1 \blank \dontleavehmode - {\bf The return values of \type {node.values("#1")} are:} +% {\bf The return values of \type {tex.get#1values()} are:}\space + {\bf #1:}\space \showvalues{#1} +% \showhexvalues{#1} \blank -} - -\ShowValues{glue} \ShowValues{style} \ShowValues{math} \ShowValues{pagestate} +\stoptexdefinition + +\ShowTeXValues{fill} +\ShowTeXValues{alignmentcontext} +\ShowTeXValues{appendlinecontext} +% \ShowTeXValues{automigration} +\ShowTeXValues{charactertag} +\ShowTeXValues{direction} +\ShowTeXValues{discoption} +\ShowTeXValues{discstate} +% \ShowTeXValues{error} +% \ShowTeXValues{flag} +% \ShowTeXValues{frozenpar} +\ShowTeXValues{glyphoption} +\ShowTeXValues{group} +\ShowTeXValues{hyphenation} +\ShowTeXValues{io} +\ShowTeXValues{kerneloption} +\ShowTeXValues{listanchor} +\ShowTeXValues{listgeometry} +\ShowTeXValues{listsign} +\ShowTeXValues{mathclassoption} +\ShowTeXValues{mathcontrol} +\ShowTeXValues{mathparameter} +\ShowTeXValues{mathstylename} +\ShowTeXValues{mathstyle} +% \ShowTeXValues{mathvariant} +% \ShowTeXValues{mode} +\ShowTeXValues{noadoption} +\ShowTeXValues{normalizeline} +\ShowTeXValues{normalizepar} +\ShowTeXValues{packtype} +\ShowTeXValues{pagecontext} +\ShowTeXValues{parbegin} +\ShowTeXValues{parcontext} +\ShowTeXValues{parmode} +% \ShowTeXValues{runstate} +% \ShowTeXValues{shapingpenalties} +% \ShowTeXValues{specialmathclass} +% \ShowTeXValues{textcontrol} + +There are a lot of helpers, especially for direct nodes. When possible they adapt +to the kind of node they get passed. Often multiple values are returned which +lessens the number of additional calls. It will take a while before all gets +documented (which is no big deal as the main usage for them is in \CONTEXT). \stopsection @@ -754,8 +796,6 @@ but don't rely on that for the future. Fields are: \showfields {style}. \LL \stoptabulate -Valid styles are: \showvalues{style}. - \stopsubsubsection \startsubsubsection[title={\nod {parameter} nodes}] @@ -2398,9 +2438,9 @@ number, for a glue, kern, hlist, vlist, rule and math nodes as well as glyph nodes (although this last one is not used in native \SYNCTEX). \startfunctioncall -node.setsynctexfields(<integer> f, <integer> l) +node.direct.setsynctexfields(<integer> f, <integer> l) <integer> f, <integer> l = - node.getsynctexfields(<node> n) + node.direct.getsynctexfields(<node> n) \stopfunctioncall Of course you need to know what you're doing as no checking on sane values takes diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-style.tex b/doc/context/sources/general/manuals/luametatex/luametatex-style.tex index 6586e6fc1..b3591344a 100644 --- a/doc/context/sources/general/manuals/luametatex/luametatex-style.tex +++ b/doc/context/sources/general/manuals/luametatex/luametatex-style.tex @@ -84,13 +84,14 @@ end end - function document.functions.showvalues(l) + function document.functions.showvalues(l,hex) if l then local n = table.count(l) local i = 0 + local f = hex and "%s{\\tttf %s} (0x%02X)" or "%s{\\tttf %s} (%i)" for k, v in table.sortedhash(l) do i = i + 1 - context("%s{\\tttf %s} (%i)", (i == 1 and "") or (i == n and " and ") or ", ", v,k) + context(f, (i == 1 and "") or (i == n and " and ") or ", ", v,k) end end end @@ -120,11 +121,11 @@ \protected\def\showfields #1{\ctxlua{document.functions.showfields("#1")}} \protected\def\showid #1{\ctxlua{document.functions.showid("#1")}} \protected\def\showsubtypes #1{\ctxlua{document.functions.showsubtypes("#1")}} -\protected\def\showvalues #1{\ctxlua{document.functions.showvalues(node.values("#1"))}} +\protected\def\showvalues #1{\ctxlua{document.functions.showvalues(tex.get#1values())}} +\protected\def\showhexvalues#1{\ctxlua{document.functions.showvalues(tex.get#1values(),true)}} \protected\def\showtypes {\ctxlua{document.functions.showvalues(node.types())}} \protected\def\showvaluelist#1{\ctxlua{document.functions.showvalues(#1)}} - \definecolor[blue] [b=.5] \definecolor[red] [r=.5] \definecolor[green] [g=.5] diff --git a/doc/context/sources/general/manuals/luametatex/luametatex.tex b/doc/context/sources/general/manuals/luametatex/luametatex.tex index f845fed17..e75053972 100644 --- a/doc/context/sources/general/manuals/luametatex/luametatex.tex +++ b/doc/context/sources/general/manuals/luametatex/luametatex.tex @@ -110,7 +110,7 @@ % because the amount of output which is sensitive for refresh delays set. The new % target is nwo 50 pages per second for this manual but on this laptop that is % unlikely to happen any time soon. With tabulateusesize and tabulatesparseskips -% experimends enabled we needed 8.1 second and 44.3 pps. +% experiments enabled we needed 8.1 second and 44.3 pps. % \enableexperiments [tabulateusesize] % \enableexperiments [tabulatesparseskips] diff --git a/doc/context/sources/general/manuals/luatex/luatex-languages.tex b/doc/context/sources/general/manuals/luatex/luatex-languages.tex index cb9ca10f3..b3f96d247 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-languages.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-languages.tex @@ -140,7 +140,7 @@ hyphenation happens is (normally) when the paragraph or a horizontal box is constructed. When \prm {savinghyphcodes} was zero when the language got initialized you start out with nothing, otherwise you already have a set. -When a \lpr {hjcode} is greater than 0 but less than 32 is indicates the +When a \lpr {hjcode} is greater than 0 but less than 32 it indicates the to be used length. In the following example we map a character (\type {x}) onto another one in the patterns and tell the engine that \type {œ} counts as one character. Because traditionally zero itself is reserved for inhibiting diff --git a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex index 6b9b0bd8c..2453edb2d 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex @@ -1321,8 +1321,8 @@ creates a node at the \TEX\ level. \libindex{flush_node} \libindex{flush_list} -The next one the node \type {n} from \TEX's memory. Be careful: no checks are -done on whether this node is still pointed to from a register or some \type +The next one removes the node \type {n} from \TEX's memory. Be careful: no checks +are done on whether this node is still pointed to from a register or some \type {next} field: it is up to you to make sure that the internal data structures remain correct. @@ -2490,9 +2490,9 @@ number, for a glue, kern, hlist, vlist, rule and math nodes as well as glyph nodes (although this last one is not used in native \SYNCTEX). \startfunctioncall -node.set_synctex_fields(<integer> f, <integer> l) +node.direct.set_synctex_fields(<integer> f, <integer> l) <integer> f, <integer> l = - node.get_synctex_fields(<node> n) + node.direct.get_synctex_fields(<node> n) \stopfunctioncall Of course you need to know what you're doing as no checking on sane values takes diff --git a/doc/context/sources/general/manuals/ontarget/ontarget-dk.tex b/doc/context/sources/general/manuals/ontarget/ontarget-dk.tex index d1df3b8cc..bda07ecc9 100644 --- a/doc/context/sources/general/manuals/ontarget/ontarget-dk.tex +++ b/doc/context/sources/general/manuals/ontarget/ontarget-dk.tex @@ -9,8 +9,8 @@ At the \CONTEXT\ 2021 meeting I mixed my \TEX\ talks with showing some of the (upcoming) \LUAMETATEX\ source code. One evening we had a extension party where a new unit was implemented, the \type {dk}. This event was triggered by a remark -Hraban [Ramm] made on the participants list in advance of the meeting, where he pointed -to a Wikipedia article from which we quote: +Hraban [Ramm] made on the participants list in advance of the meeting, where he +pointed to a Wikipedia article from which we quote: \startquotation In issue 33, Mad published a partial table of the \quotation {Potrzebie System of diff --git a/doc/context/sources/general/manuals/ontarget/ontarget.tex b/doc/context/sources/general/manuals/ontarget/ontarget.tex index 635ca5fb8..888a73f41 100644 --- a/doc/context/sources/general/manuals/ontarget/ontarget.tex +++ b/doc/context/sources/general/manuals/ontarget/ontarget.tex @@ -27,6 +27,7 @@ \component ontarget-gettingridof \component ontarget-registers \component ontarget-fairphone + % \component ontarget-mathsizes \stopbodymatter \stopdocument diff --git a/scripts/context/lua/mtx-pdf.lua b/scripts/context/lua/mtx-pdf.lua index a1803a801..05973d236 100644 --- a/scripts/context/lua/mtx-pdf.lua +++ b/scripts/context/lua/mtx-pdf.lua @@ -28,7 +28,7 @@ local helpinfo = [[ <flag name="pretty"><short>replace newlines in metadata</short></flag> <flag name="fonts"><short>show used fonts (<ref name="detail)"/></short></flag> <flag name="object"><short>show object"/></short></flag> - <flag name="linkjs"><short>show links"/></short></flag> + <flag name="links"><short>show links"/></short></flag> </subcategory> <subcategory> <example><command>mtxrun --script pdf --info foo.pdf</command></example> diff --git a/source/luametatex/source/libraries/mimalloc/cmake/mimalloc-config-version.cmake b/source/luametatex/source/libraries/mimalloc/cmake/mimalloc-config-version.cmake index 842c733ee..855c44d22 100644 --- a/source/luametatex/source/libraries/mimalloc/cmake/mimalloc-config-version.cmake +++ b/source/luametatex/source/libraries/mimalloc/cmake/mimalloc-config-version.cmake @@ -1,6 +1,6 @@ set(mi_version_major 2) set(mi_version_minor 1) -set(mi_version_patch 0) +set(mi_version_patch 1) set(mi_version ${mi_version_major}.${mi_version_minor}) set(PACKAGE_VERSION ${mi_version}) diff --git a/source/luametatex/source/libraries/mimalloc/include/mimalloc.h b/source/luametatex/source/libraries/mimalloc/include/mimalloc.h index 1372cb3f2..800cfd7e4 100644 --- a/source/luametatex/source/libraries/mimalloc/include/mimalloc.h +++ b/source/luametatex/source/libraries/mimalloc/include/mimalloc.h @@ -8,7 +8,7 @@ terms of the MIT license. A copy of the license can be found in the file #ifndef MIMALLOC_H #define MIMALLOC_H -#define MI_MALLOC_VERSION 210 // major + 2 digits minor +#define MI_MALLOC_VERSION 211 // major + 2 digits minor // ------------------------------------------------------ // Compiler specific attributes diff --git a/source/luametatex/source/libraries/mimalloc/include/mimalloc/prim.h b/source/luametatex/source/libraries/mimalloc/include/mimalloc/prim.h index 68f0871e8..10378c922 100644 --- a/source/luametatex/source/libraries/mimalloc/include/mimalloc/prim.h +++ b/source/luametatex/source/libraries/mimalloc/include/mimalloc/prim.h @@ -113,6 +113,10 @@ void _mi_prim_thread_associate_default_heap(mi_heap_t* heap); // for each thread (unequal to zero). //------------------------------------------------------------------- +// defined in `init.c`; do not use these directly +extern mi_decl_thread mi_heap_t* _mi_heap_default; // default heap to allocate from +extern bool _mi_process_is_initialized; // has mi_process_init been called? + static inline mi_threadid_t _mi_prim_thread_id(void) mi_attr_noexcept; #if defined(_WIN32) @@ -230,10 +234,6 @@ We try to circumvent this in an efficient way: - DragonFly: defaults are working but seem slow compared to freeBSD (see PR #323) ------------------------------------------------------------------------------------------- */ -// defined in `init.c`; do not use these directly -extern mi_decl_thread mi_heap_t* _mi_heap_default; // default heap to allocate from -extern bool _mi_process_is_initialized; // has mi_process_init been called? - static inline mi_heap_t* mi_prim_get_default_heap(void); #if defined(MI_MALLOC_OVERRIDE) diff --git a/source/luametatex/source/libraries/mimalloc/readme.md b/source/luametatex/source/libraries/mimalloc/readme.md index 98b9af675..408f3cb1f 100644 --- a/source/luametatex/source/libraries/mimalloc/readme.md +++ b/source/luametatex/source/libraries/mimalloc/readme.md @@ -12,8 +12,8 @@ is a general purpose allocator with excellent [performance](#performance) charac Initially developed by Daan Leijen for the runtime systems of the [Koka](https://koka-lang.github.io) and [Lean](https://github.com/leanprover/lean) languages. -Latest release tag: `v2.1.0` (2023-03-29). -Latest stable tag: `v1.8.0` (2023-03-29). +Latest release tag: `v2.1.1` (2023-04-03). +Latest stable tag: `v1.8.1` (2023-04-03). mimalloc is a drop-in replacement for `malloc` and can be used in other programs without code changes, for example, on dynamically linked ELF-based systems (Linux, BSD, etc.) you can use it as: @@ -78,6 +78,8 @@ Note: the `v2.x` version has a new algorithm for managing internal mimalloc page and fragmentation compared to mimalloc `v1.x` (especially for large workloads). Should otherwise have similar performance (see [below](#performance)); please report if you observe any significant performance regression. +* 2023-04-03, `v1.8.1`, `v2.1.1`: Fixes build issues on some platforms. + * 2023-03-29, `v1.8.0`, `v2.1.0`: Improved support dynamic overriding on Windows 11. Improved tracing precision with [asan](#asan) and [Valgrind](#valgrind), and added Windows event tracing [ETW](#ETW) (contributed by Xinglong He). Created an OS abstraction layer to make it easier to port and separate platform dependent code (in `src/prim`). Fixed C++ STL compilation on older Microsoft C++ compilers, and various small bug fixes. diff --git a/source/luametatex/source/libraries/mimalloc/src/alloc.c b/source/luametatex/source/libraries/mimalloc/src/alloc.c index 24045162d..147e11094 100644 --- a/source/luametatex/source/libraries/mimalloc/src/alloc.c +++ b/source/luametatex/source/libraries/mimalloc/src/alloc.c @@ -75,8 +75,8 @@ extern inline void* _mi_page_malloc(mi_heap_t* heap, mi_page_t* page, size_t siz ptrdiff_t delta = ((uint8_t*)padding - (uint8_t*)block - (size - MI_PADDING_SIZE)); #if (MI_DEBUG>=2) mi_assert_internal(delta >= 0 && mi_page_usable_block_size(page) >= (size - MI_PADDING_SIZE + delta)); - mi_track_mem_defined(padding,sizeof(mi_padding_t)); // note: re-enable since mi_page_usable_block_size may set noaccess #endif + mi_track_mem_defined(padding,sizeof(mi_padding_t)); // note: re-enable since mi_page_usable_block_size may set noaccess padding->canary = (uint32_t)(mi_ptr_encode(page,block,page->keys)); padding->delta = (uint32_t)(delta); #if MI_PADDING_CHECK @@ -401,8 +401,8 @@ static mi_decl_noinline void _mi_free_block_mt(mi_page_t* page, mi_block_t* bloc #endif } - #if (MI_DEBUG!=0) && !MI_TRACK_ENABLED && !MI_TSAN // note: when tracking, cannot use mi_usable_size with multi-threading - if (segment->kind != MI_SEGMENT_HUGE) { // not for huge segments as we just reset the content + #if (MI_DEBUG>0) && !MI_TRACK_ENABLED && !MI_TSAN // note: when tracking, cannot use mi_usable_size with multi-threading + if (segment->kind != MI_SEGMENT_HUGE) { // not for huge segments as we just reset the content memset(block, MI_DEBUG_FREED, mi_usable_size(block)); } #endif @@ -455,7 +455,7 @@ static inline void _mi_free_block(mi_page_t* page, bool local, mi_block_t* block // owning thread can free a block directly if mi_unlikely(mi_check_is_double_free(page, block)) return; mi_check_padding(page, block); - #if (MI_DEBUG!=0) && !MI_TRACK_ENABLED && !MI_TSAN + #if (MI_DEBUG>0) && !MI_TRACK_ENABLED && !MI_TSAN if (!mi_page_is_huge(page)) { // huge page content may be already decommitted memset(block, MI_DEBUG_FREED, mi_page_block_size(page)); } @@ -551,7 +551,7 @@ void mi_free(void* p) mi_attr_noexcept if mi_unlikely(mi_check_is_double_free(page, block)) return; mi_check_padding(page, block); mi_stat_free(page, block); - #if (MI_DEBUG!=0) && !MI_TRACK_ENABLED && !MI_TSAN + #if (MI_DEBUG>0) && !MI_TRACK_ENABLED && !MI_TSAN memset(block, MI_DEBUG_FREED, mi_page_block_size(page)); #endif mi_track_free_size(p, mi_page_usable_size_of(page,block)); // faster then mi_usable_size as we already know the page and that p is unaligned diff --git a/source/luametatex/source/libraries/mimalloc/src/arena.c b/source/luametatex/source/libraries/mimalloc/src/arena.c index 43defe009..35cbcde6a 100644 --- a/source/luametatex/source/libraries/mimalloc/src/arena.c +++ b/source/luametatex/source/libraries/mimalloc/src/arena.c @@ -27,7 +27,6 @@ The arena allocation needs to be thread safe and we use an atomic bitmap to allo #include "bitmap.h" // atomic bitmap - /* ----------------------------------------------------------- Arena allocation ----------------------------------------------------------- */ @@ -186,7 +185,7 @@ static mi_decl_noinline void* mi_arena_allocate(int numa_node, size_t size, size bool* is_pinned, bool* is_zero, mi_arena_id_t req_arena_id, size_t* memid, mi_os_tld_t* tld ) { - MI_UNUSED_RELEASE(alignment); + MI_UNUSED(alignment); mi_assert_internal(alignment <= MI_SEGMENT_ALIGN); const size_t max_arena = mi_atomic_load_relaxed(&mi_arena_count); const size_t bcount = mi_block_count_of_size(size); diff --git a/source/luametatex/source/libraries/mimalloc/src/bitmap.c b/source/luametatex/source/libraries/mimalloc/src/bitmap.c index 6fe745ac1..ee94edb98 100644 --- a/source/luametatex/source/libraries/mimalloc/src/bitmap.c +++ b/source/luametatex/source/libraries/mimalloc/src/bitmap.c @@ -300,7 +300,7 @@ bool _mi_bitmap_try_find_from_claim_across(mi_bitmap_t bitmap, const size_t bitm // Helper for masks across fields; returns the mid count, post_mask may be 0 static size_t mi_bitmap_mask_across(mi_bitmap_index_t bitmap_idx, size_t bitmap_fields, size_t count, size_t* pre_mask, size_t* mid_mask, size_t* post_mask) { - MI_UNUSED_RELEASE(bitmap_fields); + MI_UNUSED(bitmap_fields); const size_t bitidx = mi_bitmap_index_bit_in_field(bitmap_idx); if mi_likely(bitidx + count <= MI_BITMAP_FIELD_BITS) { *pre_mask = mi_bitmap_mask_(count, bitidx); diff --git a/source/luametatex/source/libraries/mimalloc/src/options.c b/source/luametatex/source/libraries/mimalloc/src/options.c index c39e20526..450bc2f3f 100644 --- a/source/luametatex/source/libraries/mimalloc/src/options.c +++ b/source/luametatex/source/libraries/mimalloc/src/options.c @@ -289,7 +289,7 @@ static void mi_recurse_exit(void) { } void _mi_fputs(mi_output_fun* out, void* arg, const char* prefix, const char* message) { - if (out==NULL || (FILE*)out==stdout || (FILE*)out==stderr) { // TODO: use mi_out_stderr for stderr? + if (out==NULL || (void*)out==(void*)stdout || (void*)out==(void*)stderr) { // TODO: use mi_out_stderr for stderr? if (!mi_recurse_enter()) return; out = mi_out_get_default(&arg); if (prefix != NULL) out(prefix, arg); diff --git a/source/luametatex/source/libraries/mimalloc/src/os.c b/source/luametatex/source/libraries/mimalloc/src/os.c index 75895c1b1..6145ccb36 100644 --- a/source/luametatex/source/libraries/mimalloc/src/os.c +++ b/source/luametatex/source/libraries/mimalloc/src/os.c @@ -403,10 +403,8 @@ static bool mi_os_resetx(void* addr, size_t size, bool reset, mi_stats_t* stats) else _mi_stat_decrease(&stats->reset, csize); if (!reset) return true; // nothing to do on unreset! - #if (MI_DEBUG>1) && !MI_TRACK_ENABLED // && !MI_TSAN - if (MI_SECURE==0) { - memset(start, 0, csize); // pretend it is eagerly reset - } + #if (MI_DEBUG>1) && !MI_SECURE && !MI_TRACK_ENABLED // && !MI_TSAN + memset(start, 0, csize); // pretend it is eagerly reset #endif int err = _mi_prim_reset(start, csize); diff --git a/source/luametatex/source/libraries/mimalloc/src/page.c b/source/luametatex/source/libraries/mimalloc/src/page.c index d0da87a1f..cae6b5813 100644 --- a/source/luametatex/source/libraries/mimalloc/src/page.c +++ b/source/luametatex/source/libraries/mimalloc/src/page.c @@ -383,7 +383,7 @@ void _mi_page_abandon(mi_page_t* page, mi_page_queue_t* pq) { mi_assert_internal(mi_page_thread_free_flag(page)==MI_NEVER_DELAYED_FREE); mi_page_set_heap(page, NULL); -#if MI_DEBUG>1 +#if (MI_DEBUG>1) && !MI_TRACK_ENABLED // check there are no references left.. for (mi_block_t* block = (mi_block_t*)pheap->thread_delayed_free; block != NULL; block = mi_block_nextx(pheap, block, pheap->keys)) { mi_assert_internal(_mi_ptr_page(block) != page); diff --git a/source/luametatex/source/libraries/mimalloc/src/prim/unix/prim.c b/source/luametatex/source/libraries/mimalloc/src/prim/unix/prim.c index 8d9c7a723..0c1fbb3e2 100644 --- a/source/luametatex/source/libraries/mimalloc/src/prim/unix/prim.c +++ b/source/luametatex/source/libraries/mimalloc/src/prim/unix/prim.c @@ -79,9 +79,9 @@ static int mi_prim_access(const char *fpath, int mode) { #elif !defined(__APPLE__) // avoid unused warnings static int mi_prim_open(const char* fpath, int open_flags) { - return open(fpath,open_flags,0); + return open(fpath,open_flags); } -static mi_ssize_t mi_prim_read(int fd, void* buf, size_t bufsize) { +static ssize_t mi_prim_read(int fd, void* buf, size_t bufsize) { return read(fd,buf,bufsize); } static int mi_prim_close(int fd) { @@ -169,7 +169,7 @@ static void* unix_mmap_prim(void* addr, size_t size, size_t try_alignment, int p p = mmap(addr, size, protect_flags, flags | MAP_ALIGNED(n), fd, 0); if (p==MAP_FAILED || !_mi_is_aligned(p,try_alignment)) { int err = errno; - _mi_warning_message("unable to directly request aligned OS memory (error: %d (0x%x), size: 0x%zx bytes, alignment: 0x%zx, hint address: %p)\n", err, err, size, try_alignment, hint); + _mi_warning_message("unable to directly request aligned OS memory (error: %d (0x%x), size: 0x%zx bytes, alignment: 0x%zx)\n", err, err, size, try_alignment); } if (p!=MAP_FAILED) return p; // fall back to regular mmap @@ -391,7 +391,7 @@ int _mi_prim_reset(void* start, size_t size) { err = unix_madvise(start, size, MADV_DONTNEED); } #else - int err = unix_madvise(start, csize, MADV_DONTNEED); + int err = unix_madvise(start, size, MADV_DONTNEED); #endif return err; } diff --git a/source/luametatex/source/lua/lmtnodelib.c b/source/luametatex/source/lua/lmtnodelib.c index d4a325c21..7896eff65 100644 --- a/source/luametatex/source/lua/lmtnodelib.c +++ b/source/luametatex/source/lua/lmtnodelib.c @@ -4871,32 +4871,33 @@ static int nodelib_shared_fields(lua_State *L) /* These should move to texlib ... which might happen. */ -static int nodelib_shared_values(lua_State *L) -{ - if (lua_type(L, 1) == LUA_TSTRING) { - /* - delimiter options (bit set) - delimiter modes (bit set) - */ - const char *s = lua_tostring(L, 1); - if (lua_key_eq(s, glue) || lua_key_eq(s, fill)) { - return lmt_push_info_values(L, lmt_interface.node_fill_values); - } else if (lua_key_eq(s, dir)) { - return lmt_push_info_values(L, lmt_interface.direction_values); - } else if (lua_key_eq(s, math)) { - /*tex A bit strange place, so moved to lmttexlib. */ - return lmt_push_info_keys(L, lmt_interface.math_parameter_values); - } else if (lua_key_eq(s, style)) { - /*tex A bit strange place, so moved to lmttexlib. */ - return lmt_push_info_values(L, lmt_interface.math_style_values); - } else if (lua_key_eq(s, page)) { - /*tex These are never used, whatsit related. */ - return lmt_push_info_values(L, lmt_interface.page_contribute_values); - } - } - lua_pushnil(L); - return 1; -} +// static int nodelib_shared_values(lua_State *L) +// { +// if (lua_type(L, 1) == LUA_TSTRING) { +// /* +// delimiter options (bit set) +// delimiter modes (bit set) +// */ +// const char *s = lua_tostring(L, 1); +// if (lua_key_eq(s, glue) || lua_key_eq(s, fill)) { +// return lmt_push_info_values(L, lmt_interface.node_fill_values); +// } else if (lua_key_eq(s, dir)) { +// /* moved to lmttexlib */ +// return lmt_push_info_values(L, lmt_interface.direction_values); +// } else if (lua_key_eq(s, math)) { +// /* moved to lmttexlib */ +// return lmt_push_info_keys(L, lmt_interface.math_parameter_values); +// } else if (lua_key_eq(s, style)) { +// /* moved to lmttexlib */ +// return lmt_push_info_values(L, lmt_interface.math_style_values); +// } else if (lua_key_eq(s, page)) { +// /*tex These are never used, whatsit related. */ +// return lmt_push_info_values(L, lmt_interface.page_contribute_values); +// } +// } +// lua_pushnil(L); +// return 1; +// } static int nodelib_shared_subtypes(lua_State *L) { @@ -9916,7 +9917,7 @@ static const struct luaL_Reg nodelib_direct_function_list[] = { { "types", nodelib_shared_types }, { "fields", nodelib_shared_fields }, { "subtypes", nodelib_shared_subtypes }, - { "values", nodelib_shared_values }, + /* { "values", nodelib_shared_values }, */ /* finally all are now in tex. */ { "id", nodelib_shared_id }, { "getcachestate", nodelib_shared_getcachestate }, { "todirect", nodelib_shared_todirect }, @@ -9966,7 +9967,7 @@ static const struct luaL_Reg nodelib_function_list[] = { { "types", nodelib_shared_types }, { "fields", nodelib_shared_fields }, { "subtypes", nodelib_shared_subtypes }, - { "values", nodelib_shared_values }, + /* { "values", nodelib_shared_values }, */ /* finally all are now in tex. */ { "id", nodelib_shared_id }, { "getcachestate", nodelib_shared_getcachestate }, { "todirect", nodelib_shared_todirect }, diff --git a/source/luametatex/source/lua/lmttexiolib.c b/source/luametatex/source/lua/lmttexiolib.c index 416293164..48b28e3dc 100644 --- a/source/luametatex/source/lua/lmttexiolib.c +++ b/source/luametatex/source/lua/lmttexiolib.c @@ -252,6 +252,18 @@ static int texiolib_closeinput(lua_State *L) return 0 ; } +static int texiolib_getinputindex(lua_State *L) +{ + lua_pushinteger(L, lmt_input_state.cur_input.index); + return 1; +} + +static int texiolib_getsourcefilename(lua_State *L) +{ + lua_pushstring(L, lmt_input_state.in_stack[lmt_input_state.in_stack_data.ptr].full_source_filename); + return 1; +} + /*tex This is a private hack, handy for testing runtime math font patches in lfg files with a bit of low level tracing. Setting the logfile is already handles by a callback so we don't support @@ -278,16 +290,25 @@ static int texiolib_setlogfile(lua_State *L) return 0; } +static int texiolib_forceendoffile(lua_State *L) +{ + lmt_token_state.force_eof = 1; + return 0; +} + static const struct luaL_Reg texiolib_function_list[] = { - { "write", texiolib_write }, - { "writenl", texiolib_write_nl }, - { "write_nl", texiolib_write_nl }, /* depricated */ - { "writeselector", texiolib_write_selector }, - { "writeselectornl", texiolib_write_selector_nl }, - { "writeselectorlf", texiolib_write_selector_lf }, - { "closeinput", texiolib_closeinput }, - { "setlogfile", texiolib_setlogfile }, - { NULL, NULL }, + { "write", texiolib_write }, + { "writenl", texiolib_write_nl }, + { "write_nl", texiolib_write_nl }, /* depricated */ + { "writeselector", texiolib_write_selector }, + { "writeselectornl", texiolib_write_selector_nl }, + { "writeselectorlf", texiolib_write_selector_lf }, + { "closeinput", texiolib_closeinput }, + { "setlogfile", texiolib_setlogfile }, + { "getinputindex", texiolib_getinputindex }, /*tex temporary, testing only */ + { "getsourcefilename", texiolib_getsourcefilename }, /*tex temporary, testing only */ + { "forceendoffile", texiolib_forceendoffile }, /*tex temporary, testing only */ + { NULL, NULL }, }; static const struct luaL_Reg texiolib_function_list_only[] = { diff --git a/source/luametatex/source/lua/lmttexlib.c b/source/luametatex/source/lua/lmttexlib.c index e87a88292..426ca222b 100644 --- a/source/luametatex/source/lua/lmttexlib.c +++ b/source/luametatex/source/lua/lmttexlib.c @@ -45,6 +45,7 @@ # define TEX_METATABLE_UCCODE "tex.uccode" # define TEX_METATABLE_HCCODE "tex.hccode" # define TEX_METATABLE_HMCODE "tex.hmcode" +# define TEX_METATABLE_AMCODE "tex.amcode" # define TEX_METATABLE_CATCODE "tex.catcode" # define TEX_METATABLE_MATHCODE "tex.mathcode" # define TEX_METATABLE_DELCODE "tex.delcode" @@ -2107,6 +2108,23 @@ static int texlib_sethmcode(lua_State *L) return 0; } +static int texlib_setamcode(lua_State *L) +{ + int top = lua_gettop(L); + if (top >= 2) { + quarterword level; + int slot = lmt_check_for_level(L, 1, &level, cur_level); + int ch = lmt_checkinteger(L, slot++); + if (character_in_range(ch)) { + halfword val = lmt_checkhalfword(L, slot); + tex_set_am_code(ch, val, level); + } else { + texlib_aux_show_character_error(L, ch); + } + } + return 0; +} + static int texlib_getlccode(lua_State *L) { int ch = lmt_checkinteger(L, 1); @@ -2167,6 +2185,18 @@ static int texlib_gethmcode(lua_State *L) return 1; } +static int texlib_getamcode(lua_State *L) +{ + int ch = lmt_checkinteger(L, 1); + if (character_in_range(ch)) { + lua_pushinteger(L, tex_get_am_code(ch)); + } else { + texlib_aux_show_character_error(L, ch); + lua_pushinteger(L, 0); + } + return 1; +} + /* [global] [cattable] code value */ static int texlib_setcatcode(lua_State *L) @@ -4884,6 +4914,7 @@ static int texlib_getnoadoptionvalues(lua_State *L) lua_push_key_at_index(L, shrink, noad_option_shrink); lua_push_key_at_index(L, stretch, noad_option_stretch); lua_push_key_at_index(L, center, noad_option_center); + lua_push_key_at_index(L, scale, noad_option_scale); return 1; } @@ -4924,7 +4955,7 @@ static int texlib_getlistsignvalues(lua_State *L) return 1; } -static int texlib_getlistgeometryalues(lua_State *L) +static int texlib_getlistgeometryvalues(lua_State *L) { lua_createtable(L, 3, 0); lua_set_string_by_index(L, offset_geometry, "offset"); @@ -5107,7 +5138,7 @@ static int texlib_getkerneloptionvalues(lua_State *L) static int texlib_getcharactertagvalues(lua_State *L) { - lua_createtable(L, 2, 12); + lua_createtable(L, 2, 15); lua_set_string_by_index(L, no_tag, "normal"); lua_set_string_by_index(L, ligatures_tag, "ligatures"); lua_set_string_by_index(L, kerns_tag, "kerns"); @@ -5305,6 +5336,16 @@ static int texlib_gettextcontrolvalues(lua_State *L) return 1; } +static int texlib_getfillvalues(lua_State *L) +{ + return lmt_push_info_values(L, lmt_interface.node_fill_values); +} + +static int texlib_getdirectionvalues(lua_State *L) +{ + return lmt_push_info_values(L, lmt_interface.direction_values); +} + /* relatively new */ static int texlib_getinsertdistance(lua_State *L) @@ -5482,6 +5523,8 @@ static const struct luaL_Reg texlib_function_list[] = { { "gethccode", texlib_gethccode }, { "sethmcode", texlib_sethmcode }, { "gethmcode", texlib_gethmcode }, + { "setamcode", texlib_setamcode }, + { "getamcode", texlib_getamcode }, { "setlccode", texlib_setlccode }, { "getlccode", texlib_getlccode }, { "setmathcode", texlib_setmathcode }, @@ -5567,7 +5610,7 @@ static const struct luaL_Reg texlib_function_list[] = { { "getdiscoptionvalues", texlib_getdiscoptionvalues }, { "getlistanchorvalues", texlib_getlistanchorvalues }, { "getlistsignvalues", texlib_getlistsignvalues }, - { "getlistgeometryvalues", texlib_getlistgeometryalues }, + { "getlistgeometryvalues", texlib_getlistgeometryvalues }, { "getdiscstatevalues", texlib_getdiscstatevalues }, { "getmathparametervalues", texlib_getmathparametervalues }, { "getmathstylenamevalues", texlib_getmathstylenamevalues }, @@ -5589,6 +5632,8 @@ static const struct luaL_Reg texlib_function_list[] = { { "getmathclassoptionvalues", texlib_getmathclassoptionvalues }, { "getnormalizelinevalues", texlib_getnormalizelinevalues }, { "getnormalizeparvalues", texlib_getnormalizeparvalues }, + { "getdirectionvalues", texlib_getdirectionvalues }, + { "getfillvalues", texlib_getfillvalues }, { "geterrorvalues", texlib_geterrorvalues }, { "getiovalues", texlib_getiovalues }, { "getprimitiveorigins", texlib_getprimitiveorigins }, @@ -5642,6 +5687,7 @@ defineindexers(lccode) defineindexers(uccode) defineindexers(hccode) defineindexers(hmcode) +defineindexers(amcode) defineindexers(catcode) defineindexers(mathcode) defineindexers(delcode) @@ -5673,6 +5719,7 @@ int luaopen_tex(lua_State *L) lmt_make_table(L, "uccode", TEX_METATABLE_UCCODE, texlib_index_uccode, texlib_newindex_uccode); lmt_make_table(L, "hccode", TEX_METATABLE_HCCODE, texlib_index_hccode, texlib_newindex_hccode); lmt_make_table(L, "hmcode", TEX_METATABLE_HMCODE, texlib_index_hmcode, texlib_newindex_hmcode); + lmt_make_table(L, "amcode", TEX_METATABLE_AMCODE, texlib_index_amcode, texlib_newindex_amcode); lmt_make_table(L, "catcode", TEX_METATABLE_CATCODE, texlib_index_catcode, texlib_newindex_catcode); lmt_make_table(L, "mathcode", TEX_METATABLE_MATHCODE, texlib_index_mathcode, texlib_newindex_mathcode); lmt_make_table(L, "delcode", TEX_METATABLE_DELCODE, texlib_index_delcode, texlib_newindex_delcode); diff --git a/source/luametatex/source/luacore/lua54/src/Makefile b/source/luametatex/source/luacore/lua54/src/Makefile index ee56c6720..38e21f1f5 100644 --- a/source/luametatex/source/luacore/lua54/src/Makefile +++ b/source/luametatex/source/luacore/lua54/src/Makefile @@ -8,7 +8,6 @@ CWARNSCPP= \ -Wfatal-errors \ -Wextra \ -Wshadow \ - -Wsign-compare \ -Wundef \ -Wwrite-strings \ -Wredundant-decls \ @@ -60,7 +59,7 @@ CWARNS= $(CWARNSCPP) $(CWARNSC) $(CWARNGCC) # The following options help detect "undefined behavior"s that seldom # create problems; some are only available in newer gcc versions. To -# use some of them, we also have to define an enrivonment variable +# use some of them, we also have to define an environment variable # ASAN_OPTIONS="detect_invalid_pointer_pairs=2". # -fsanitize=undefined # -fsanitize=pointer-subtract -fsanitize=address -fsanitize=pointer-compare diff --git a/source/luametatex/source/luacore/lua54/src/lua.h b/source/luametatex/source/luacore/lua54/src/lua.h index feb3dbc55..01927c6d9 100644 --- a/source/luametatex/source/luacore/lua54/src/lua.h +++ b/source/luametatex/source/luacore/lua54/src/lua.h @@ -25,7 +25,7 @@ #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR #define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE -#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2022 Lua.org, PUC-Rio" +#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2023 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes" @@ -496,7 +496,7 @@ struct lua_Debug { /****************************************************************************** -* Copyright (C) 1994-2022 Lua.org, PUC-Rio. +* Copyright (C) 1994-2023 Lua.org, PUC-Rio. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the diff --git a/source/luametatex/source/luametatex.h b/source/luametatex/source/luametatex.h index a318342c7..e9a2d3724 100644 --- a/source/luametatex/source/luametatex.h +++ b/source/luametatex/source/luametatex.h @@ -92,7 +92,7 @@ # define luametatex_version 210 # define luametatex_revision 8 # define luametatex_version_string "2.10.08" -# define luametatex_development_id 20230331 +# define luametatex_development_id 20230407 # define luametatex_name_camelcase "LuaMetaTeX" # define luametatex_name_lowercase "luametatex" diff --git a/source/luametatex/source/tex/texmaincontrol.c b/source/luametatex/source/tex/texmaincontrol.c index e901906c4..6d6a2c031 100644 --- a/source/luametatex/source/tex/texmaincontrol.c +++ b/source/luametatex/source/tex/texmaincontrol.c @@ -5939,10 +5939,10 @@ void tex_assign_internal_int_value(int a, halfword p, int val) goto DEFINE; */ case eu_factor_code: - if (val < 1) { - val = 1; - } else if (val > 50) { - val = 50; + if (val < eu_min_factor) { + val = eu_min_factor; + } else if (val > eu_max_factor) { + val = eu_max_factor; } tex_word_define(a, p, val); break; @@ -6584,7 +6584,7 @@ void tex_initialize_variables(void) math_font_control_par = assumed_math_control; math_eqno_gap_step_par = default_eqno_gap_step; px_dimen_par = one_bp; - eu_factor_par = 1000; + eu_factor_par = eu_def_factor; show_node_details_par = 2; /*tex $>1$: |[subtype]| $>2$: |[attributes]| */ ex_hyphen_char_par = '-'; escape_char_par = '\\'; diff --git a/source/luametatex/source/tex/texmath.c b/source/luametatex/source/tex/texmath.c index 7ace4f113..dff87b5cc 100644 --- a/source/luametatex/source/tex/texmath.c +++ b/source/luametatex/source/tex/texmath.c @@ -4132,8 +4132,20 @@ void tex_run_math_fence(void) } break; case 's': case 'S': - if (tex_scan_mandate_keyword("source", 1)) { - source = tex_scan_int(0, NULL); + switch (tex_scan_character("coCO", 0, 0, 0)) { + case 'c': case 'C': + if (tex_scan_mandate_keyword("scale", 2)) { + options |= noad_option_scale; + } + break; + case 'o': case 'O': + if (tex_scan_mandate_keyword("source", 2)) { + source = tex_scan_int(0, NULL); + } + break; + default: + tex_aux_show_keyword_error("scale|source"); + goto CHECK_PAIRING; } break; case 't': case 'T': diff --git a/source/luametatex/source/tex/texmlist.c b/source/luametatex/source/tex/texmlist.c index 53a0bd198..91bb864d7 100644 --- a/source/luametatex/source/tex/texmlist.c +++ b/source/luametatex/source/tex/texmlist.c @@ -413,6 +413,11 @@ inline static int tex_aux_math_engine_control(halfword fnt, halfword control) */ +inline static scaled tex_aux_math_math_scale(scaled v) +{ + return v ? scaledround(0.001 * lmt_math_state.scale * v) : 0; +} + inline static scaled tex_aux_math_glyph_scale(scaled v) { return v ? scaledround(0.001 * glyph_scale_par * v) : 0; @@ -530,17 +535,19 @@ static int tex_aux_math_followed_by_italic_kern(halfword current, const char *tr return 0; } -inline static int tex_aux_checked_left_kern_fnt_chr(halfword fnt, halfword chr, halfword state, halfword subtype) +inline static int tex_aux_checked_left_kern_fnt_chr(halfword fnt, halfword chr, halfword state, halfword subtype, halfword size) { halfword top = 0; halfword bot = 0; halfword hastop = (state & prime_script_state) || (state & post_super_script_state); halfword hasbot = state & post_sub_script_state; if (hastop && tex_math_has_class_option(subtype, left_top_kern_class_option)) { - top = tex_char_top_left_kern_from_font(fnt, chr); +// top = tex_char_top_left_kern_from_font(fnt, chr); +top = tex_aux_math_x_size_scaled(fnt, tex_char_top_left_kern_from_font(fnt, chr), size); } if (hasbot && tex_math_has_class_option(subtype, left_bottom_kern_class_option)) { - bot = tex_char_bottom_left_kern_from_font(fnt, chr); +// bot = tex_char_bottom_left_kern_from_font(fnt, chr); +bot = tex_aux_math_x_size_scaled(fnt, tex_char_bottom_left_kern_from_font(fnt, chr), size); } if (hastop && hasbot) { return top > bot ? top : bot; @@ -551,26 +558,28 @@ inline static int tex_aux_checked_left_kern_fnt_chr(halfword fnt, halfword chr, } } -inline static int tex_aux_checked_left_kern(halfword list, halfword state, halfword subtype) +inline static int tex_aux_checked_left_kern(halfword list, halfword state, halfword subtype, halfword size) { if (list && node_type(list) == glyph_node) { - return tex_aux_checked_left_kern_fnt_chr(glyph_font(list), glyph_character(list), state, subtype); + return tex_aux_checked_left_kern_fnt_chr(glyph_font(list), glyph_character(list), state, subtype, size); } else { return 0; } } -inline static int tex_aux_checked_right_kern_fnt_chr(halfword fnt, halfword chr, halfword state, halfword subtype) +inline static int tex_aux_checked_right_kern_fnt_chr(halfword fnt, halfword chr, halfword state, halfword subtype, halfword size) { halfword top = 0; halfword bot = 0; halfword hastop = state & pre_super_script_state; halfword hasbot = state & pre_sub_script_state; if (hastop && tex_math_has_class_option(subtype, right_top_kern_class_option)) { - top = tex_char_top_right_kern_from_font(fnt, chr); +// top = tex_char_top_right_kern_from_font(fnt, chr); +top = tex_aux_math_x_size_scaled(fnt, tex_char_top_right_kern_from_font(fnt, chr), size); } if (hasbot && tex_math_has_class_option(subtype, right_bottom_kern_class_option)) { - bot = tex_char_bottom_right_kern_from_font(fnt, chr); +// bot = tex_char_bottom_right_kern_from_font(fnt, chr); +bot = tex_aux_math_x_size_scaled(fnt, tex_char_bottom_right_kern_from_font(fnt, chr), size); } if (hastop && hasbot) { return top < bot ? bot : top; @@ -581,10 +590,10 @@ inline static int tex_aux_checked_right_kern_fnt_chr(halfword fnt, halfword chr, } } -inline static int tex_aux_checked_right_kern(halfword list, halfword state, halfword subtype) +inline static int tex_aux_checked_right_kern(halfword list, halfword state, halfword subtype, halfword size) { if (list && node_type(list) == glyph_node) { - return tex_aux_checked_right_kern_fnt_chr(glyph_font(list), glyph_character(list), state, subtype); + return tex_aux_checked_right_kern_fnt_chr(glyph_font(list), glyph_character(list), state, subtype, size); } else { return 0; } @@ -1418,8 +1427,8 @@ static halfword tex_aux_make_delimiter(halfword target, halfword delimiter, int /*tex are we trying the large variant? */ int large_attempt = 0; int do_parts = 0; - int shrink = flat && tex_has_noad_option(target, noad_option_shrink); - int stretch = flat && tex_has_noad_option(target, noad_option_stretch); + int shrink = flat && has_noad_option_shrink(target); + int stretch = flat && has_noad_option_stretch(target); /*tex to save the current attribute list */ halfword att = null; if (extremes) { @@ -2378,20 +2387,24 @@ static void tex_aux_assign_radical(halfword target, halfword radical) radical_right_delimiter(target) = null; } -static void tex_aux_set_radical_kerns(delimiterextremes *extremes, kernset *kerns) +static void tex_aux_set_radical_kerns(delimiterextremes *extremes, kernset *kerns, halfword size) { if (kerns && extremes->tfont) { if (tex_math_has_class_option(radical_noad_subtype, carry_over_left_top_kern_class_option)) { - kerns->topleft = tex_char_top_left_kern_from_font(extremes->tfont, extremes->tchar); +// kerns->topleft = tex_char_top_left_kern_from_font(extremes->tfont, extremes->tchar); +kerns->topleft = tex_aux_math_x_size_scaled(extremes->tfont, tex_char_top_left_kern_from_font(extremes->tfont, extremes->tchar), size); } if (tex_math_has_class_option(radical_noad_subtype, carry_over_left_bottom_kern_class_option)) { - kerns->bottomleft = tex_char_bottom_left_kern_from_font(extremes->bfont, extremes->bchar); +// kerns->bottomleft = tex_char_bottom_left_kern_from_font(extremes->bfont, extremes->bchar); +kerns->bottomleft = tex_aux_math_x_size_scaled(extremes->bfont, tex_char_bottom_left_kern_from_font(extremes->bfont, extremes->bchar), size); } if (tex_math_has_class_option(radical_noad_subtype, carry_over_right_top_kern_class_option)) { - kerns->topright = tex_char_top_right_kern_from_font(extremes->tfont, extremes->tchar); +// kerns->topright = tex_char_top_right_kern_from_font(extremes->tfont, extremes->tchar); +kerns->topright = tex_aux_math_x_size_scaled(extremes->tfont, tex_char_top_right_kern_from_font(extremes->tfont, extremes->tchar), size); } if (tex_math_has_class_option(radical_noad_subtype, carry_over_right_bottom_kern_class_option)) { - kerns->bottomright = tex_char_bottom_right_kern_from_font(extremes->bfont, extremes->bchar); +// kerns->bottomright = tex_char_bottom_right_kern_from_font(extremes->bfont, extremes->bchar); +kerns->bottomright = tex_aux_math_x_size_scaled(extremes->bfont, tex_char_bottom_right_kern_from_font(extremes->bfont, extremes->bchar), size); } if (tex_math_has_class_option(radical_noad_subtype, prefer_delimiter_dimensions_class_option)) { kerns->height = extremes->height; @@ -2478,7 +2491,7 @@ static void tex_aux_make_root_radical(halfword target, int style, int size, kern } } /* */ - tex_aux_set_radical_kerns(&extremes, kerns); + tex_aux_set_radical_kerns(&extremes, kerns, size); /* Radicals in traditional fonts have their shape below the baseline which makes them unuseable as stand alone characters but here we compensate for that fact. Opentype fonts derived from @@ -2588,7 +2601,7 @@ static void tex_aux_make_delimited_radical(halfword target, int style, int size, /*tex For now we assume symmetry and same height and depth! */ companion = tex_aux_make_delimiter(target, companion, size, total, 0, style, 2, NULL, NULL, 0, has_noad_option_nooverflow(target), &extremes, depth); } - tex_aux_set_radical_kerns(&extremes, kerns); + tex_aux_set_radical_kerns(&extremes, kerns, size); radical = tex_aux_link_radical(nucleus, delimiter, companion, rightdelimiter); tex_aux_assign_radical(target, radical); } @@ -2954,6 +2967,7 @@ static void tex_aux_do_make_math_accent(halfword target, halfword accentfnt, hal halfword stretch = (flags & stretch_accent_code) == stretch_accent_code; halfword basefnt = null_font; halfword basechr = 0; + int found = 0; /*tex Compute the amount of skew, or set |skew| to an alignment point. This will be true if a top-accent has been determined. @@ -3059,12 +3073,14 @@ static void tex_aux_do_make_math_accent(halfword target, halfword accentfnt, hal } if (! accent) { /*tex Italic gets added to width for traditional fonts (no italic anyway): */ - accent = tex_aux_char_box(accentfnt, accentchr, attrlist, NULL, glyph_math_accent_subtype, basewidth, style, 0, 0); // usedwidth +// accent = tex_aux_char_box(accentfnt, accentchr, attrlist, NULL, glyph_math_accent_subtype, basewidth, style, 0, 0); // usedwidth + accent = tex_aux_char_box(accentfnt, accentchr, attrlist, NULL, glyph_math_accent_subtype, usedwidth, style, 0, 0); // usedwidth + found = 1; } if (flags & top_accent_code) { scaled b = tex_get_math_y_parameter(style, math_parameter_accent_base_height); - scaled u = tex_get_math_y_parameter(style, stretch ? math_parameter_flattened_accent_top_shift_up : math_parameter_accent_top_shift_up); - if (! tex_aux_math_engine_control(accentfnt, math_control_ignore_flat_accents)) { + scaled u = found ? tex_get_math_y_parameter(style, stretch ? math_parameter_flattened_accent_top_shift_up : math_parameter_accent_top_shift_up) : undefined_math_parameter; + if (found && ! tex_aux_math_engine_control(accentfnt, math_control_ignore_flat_accents)) { scaled f = tex_get_math_y_parameter(style, math_parameter_flattened_accent_base_height); if (f != undefined_math_parameter && baseheight > f) { halfword flatchr = tex_char_flat_accent_from_font(accentfnt, accentchr); @@ -3327,16 +3343,20 @@ static void tex_aux_wrap_fraction_result(halfword target, int style, int size, h right = tex_aux_make_delimiter(target, right_delimiter, size, delta, 0, style, 1, NULL, NULL, 0, has_noad_option_nooverflow(target), &extremes, 0); if (kerns && extremes.tfont) { if (tex_math_has_class_option(fraction_noad_subtype, carry_over_left_top_kern_class_option)) { - kerns->topleft = tex_char_top_left_kern_from_font(extremes.tfont, extremes.tchar); +// kerns->topleft = tex_char_top_left_kern_from_font(extremes.tfont, extremes.tchar); +kerns->topleft = tex_aux_math_x_size_scaled(extremes.tfont, tex_char_top_left_kern_from_font(extremes.tfont, extremes.tchar), size); } if (tex_math_has_class_option(fraction_noad_subtype, carry_over_left_bottom_kern_class_option)) { - kerns->bottomleft = tex_char_bottom_left_kern_from_font(extremes.bfont, extremes.bchar); +// kerns->bottomleft = tex_char_bottom_left_kern_from_font(extremes.bfont, extremes.bchar); +kerns->bottomleft = tex_aux_math_x_size_scaled(extremes.bfont, tex_char_bottom_left_kern_from_font(extremes.bfont, extremes.bchar), size); } if (tex_math_has_class_option(fraction_noad_subtype, carry_over_right_top_kern_class_option)) { - kerns->topright = tex_char_top_right_kern_from_font(extremes.tfont, extremes.tchar); +// kerns->topright = tex_char_top_right_kern_from_font(extremes.tfont, extremes.tchar); +kerns->topright = tex_aux_math_x_size_scaled(extremes.tfont, tex_char_top_right_kern_from_font(extremes.tfont, extremes.tchar), size); } if (tex_math_has_class_option(fraction_noad_subtype, carry_over_right_bottom_kern_class_option)) { - kerns->bottomright = tex_char_bottom_right_kern_from_font(extremes.bfont, extremes.bchar); +// kerns->bottomright = tex_char_bottom_right_kern_from_font(extremes.bfont, extremes.bchar); +kerns->bottomright = tex_aux_math_x_size_scaled(extremes.bfont, tex_char_bottom_right_kern_from_font(extremes.bfont, extremes.bchar), size); } if (tex_math_has_class_option(fraction_noad_subtype, prefer_delimiter_dimensions_class_option)) { kerns->height = extremes.height; @@ -3570,10 +3590,12 @@ static halfword tex_aux_make_skewed_fraction(halfword target, int style, int siz ngap = hgap; dgap = hgap; if (tex_math_has_class_option(fraction_noad_subtype, carry_over_left_top_kern_class_option)) { - ngap += tex_char_top_left_kern_from_font(extremes.tfont, extremes.tchar); +// ngap += tex_char_top_left_kern_from_font(extremes.tfont, extremes.tchar); +ngap += tex_aux_math_x_size_scaled(extremes.tfont, tex_char_top_left_kern_from_font(extremes.tfont, extremes.tchar), size); } if (tex_math_has_class_option(fraction_noad_subtype, carry_over_right_bottom_kern_class_option)) { - dgap += tex_char_bottom_right_kern_from_font(extremes.tfont, extremes.tchar); +// dgap += tex_char_bottom_right_kern_from_font(extremes.bfont, extremes.bchar); +dgap += tex_aux_math_x_size_scaled(extremes.bfont, tex_char_bottom_right_kern_from_font(extremes.bfont, extremes.bchar), size); } if (ngap || dgap) { // todo: only add when non zero @@ -4556,6 +4578,7 @@ static scaled tex_aux_math_kern_at(halfword fnt, int chr, int side, int value) scaled *kerns_heights; int n_of_kerns = tex_get_charinfo_math_kerns(ci, side); if (n_of_kerns == 0) { + /*tex These are yet unscaled. */ switch (side) { case top_left_kern: return tex_char_top_left_kern_from_font(fnt, chr); @@ -5512,6 +5535,10 @@ static halfword tex_aux_make_left_right(halfword target, int style, scaled max_d extremes->height = 0; extremes->depth = 0; } + if (has_noad_option_scale(target)) { + height = tex_aux_math_math_scale(height); + depth = tex_aux_math_math_scale(depth); + } tex_aux_set_current_math_size(style); if (height || depth || has_noad_option_exact(target)) { halfword lst; @@ -5522,15 +5549,15 @@ static halfword tex_aux_make_left_right(halfword target, int style, scaled max_d /*tex Beware, a stacked delimiter has a shift but no corrected height/depth (yet). */ -/* or do we need has_noad_option_check(target) */ -if (! stack && has_noad_option_exact(target)) { - if (extremes && extremes->height < height) { - height = extremes->height; - } - if (extremes && extremes->depth < depth) { - depth = extremes->depth; - } -} + /* or do we need has_noad_option_check(target) */ + if (! stack && has_noad_option_exact(target)) { + if (extremes && extremes->height < height) { + height = extremes->height; + } + if (extremes && extremes->depth < depth) { + depth = extremes->depth; + } + } if (stack) { box_shift_amount(tmp) = depth; } @@ -5563,7 +5590,7 @@ if (! stack && has_noad_option_exact(target)) { if (leftoperator && has_noad_option_auto(target)) { /*tex Todo: option for skipping this. */ if (style < text_style) { - scaled s = scaledround((double) tex_get_math_parameter(style, math_parameter_operator_size, NULL)); + scaled s = tex_get_math_y_parameter_checked(style, math_parameter_operator_size); if (s > max_h + max_d) { max_h = scaledround(s / 2.0); max_d = max_h; @@ -5608,10 +5635,12 @@ if (! stack && has_noad_option_exact(target)) { /* maybe elsewhere as the above case */ if (extremes && extremes->tfont) { if (tex_math_has_class_option(fenced_noad_subtype, carry_over_right_top_kern_class_option)) { - kerns.topright = tex_char_top_right_kern_from_font(extremes->tfont, extremes->tchar); +// kerns.topright = tex_char_top_right_kern_from_font(extremes->tfont, extremes->tchar); +kerns.topright = tex_aux_math_x_size_scaled(extremes->tfont, tex_char_top_right_kern_from_font(extremes->tfont, extremes->tchar), size); } if (tex_math_has_class_option(fenced_noad_subtype, carry_over_right_bottom_kern_class_option)) { - kerns.bottomright = tex_char_bottom_right_kern_from_font(extremes->bfont, extremes->bchar); +// kerns.bottomright = tex_char_bottom_right_kern_from_font(extremes->bfont, extremes->bchar); +kerns.bottomright = tex_aux_math_x_size_scaled(extremes->bfont, tex_char_bottom_right_kern_from_font(extremes->bfont, extremes->bchar), size); } if (tex_math_has_class_option(fenced_noad_subtype, prefer_delimiter_dimensions_class_option)) { kerns.height = extremes->height; @@ -6177,10 +6206,12 @@ static void tex_aux_finish_fenced(halfword current, halfword main_style, scaled case left_fence_side: case extended_left_fence_side: if (tex_math_has_class_option(fenced_noad_subtype, carry_over_left_top_kern_class_option)) { - kerns->topleft = tex_char_top_left_kern_from_font(extremes.tfont, extremes.tchar); + // kerns->topleft = tex_char_top_left_kern_from_font(extremes.tfont, extremes.tchar); + kerns->topleft = tex_aux_math_x_size_scaled(extremes.tfont, tex_char_top_left_kern_from_font(extremes.tfont, extremes.tchar), main_style); } if (tex_math_has_class_option(fenced_noad_subtype, carry_over_left_bottom_kern_class_option)) { - kerns->bottomleft = tex_char_bottom_left_kern_from_font(extremes.bfont, extremes.bchar); + // kerns->bottomleft = tex_char_bottom_left_kern_from_font(extremes.bfont, extremes.bchar); + kerns->bottomleft = tex_aux_math_x_size_scaled(extremes.bfont, tex_char_bottom_left_kern_from_font(extremes.bfont, extremes.bchar), main_style); } if (tex_math_has_class_option(fenced_noad_subtype, prefer_delimiter_dimensions_class_option)) { kerns->height = extremes.height; @@ -6194,10 +6225,12 @@ static void tex_aux_finish_fenced(halfword current, halfword main_style, scaled case left_operator_side: case no_fence_side: if (tex_math_has_class_option(fenced_noad_subtype, carry_over_right_top_kern_class_option)) { - kerns->topright = tex_char_top_right_kern_from_font(extremes.tfont, extremes.tchar); +// kerns->topright = tex_char_top_right_kern_from_font(extremes.tfont, extremes.tchar); +kerns->topright = tex_aux_math_x_size_scaled(extremes.tfont, tex_char_top_right_kern_from_font(extremes.tfont, extremes.tchar), main_style); } if (tex_math_has_class_option(fenced_noad_subtype, carry_over_right_bottom_kern_class_option)) { - kerns->bottomright = tex_char_bottom_right_kern_from_font(extremes.bfont, extremes.bchar); +// kerns->bottomright = tex_char_bottom_right_kern_from_font(extremes.bfont, extremes.bchar); +kerns->bottomright = tex_aux_math_x_size_scaled(extremes.bfont, tex_char_bottom_right_kern_from_font(extremes.bfont, extremes.bchar), main_style); } if (tex_math_has_class_option(fenced_noad_subtype, prefer_delimiter_dimensions_class_option)) { kerns->height = extremes.height; @@ -7040,7 +7073,7 @@ static void tex_mlist_to_hlist_finalize_list(mliststate *state) /*tex Append inter-element spacing based on |r_type| and |t| */ if (current_plus_glyph && recent_script_state) { /*tex This is a very special case and used {x^2 / 3| kind of situations: */ - halfword plus = tex_aux_checked_left_kern(current_plus_glyph, recent_script_state, current_subtype); + halfword plus = tex_aux_checked_left_kern(current_plus_glyph, recent_script_state, current_subtype, lmt_math_state.size); if (plus) { halfword kern = tex_new_kern_node(plus, math_shape_kern_subtype); tex_attach_attribute_list_copy(kern, current); @@ -7081,7 +7114,7 @@ static void tex_mlist_to_hlist_finalize_list(mliststate *state) } if (recent_plus_glyph && current_script_state) { /*tex This is a very special case and used {x^2 / 3| kind of situations: */ - halfword plus = tex_aux_checked_right_kern(recent_plus_glyph, current_script_state, recent_subtype); + halfword plus = tex_aux_checked_right_kern(recent_plus_glyph, current_script_state, recent_subtype, lmt_math_state.size); if (plus) { halfword kern = tex_new_kern_node(plus, math_shape_kern_subtype); tex_attach_attribute_list_copy(kern, current); diff --git a/source/luametatex/source/tex/texnodes.h b/source/luametatex/source/tex/texnodes.h index cb666f874..f8766c430 100644 --- a/source/luametatex/source/tex/texnodes.h +++ b/source/luametatex/source/tex/texnodes.h @@ -1791,6 +1791,7 @@ typedef enum noad_options { # define noad_option_stretch 0x1000000000 # define noad_option_shrink 0x2000000000 # define noad_option_center 0x4000000000 +# define noad_option_scale 0x8000000000 # define has_option(a,b) (((a) & (b)) == (b)) # define unset_option(a,b) ((a) & ~(b)) @@ -1849,7 +1850,11 @@ inline static int has_noad_no_script_option(halfword n, halfword option) # define has_noad_option_source_on_nucleus(a) (has_option(noad_options(a), noad_option_source_on_nucleus)) # define has_noad_option_fixed_super_or_sub_script(a) (has_option(noad_options(a), noad_option_fixed_super_or_sub_script)) # define has_noad_option_fixed_super_and_sub_script(a) (has_option(noad_options(a), noad_option_fixed_super_and_sub_script)) +# define has_noad_option_stretch(a) (has_option(noad_options(a), noad_option_stretch)) +# define has_noad_option_shrink(a) (has_option(noad_options(a), noad_option_shrink)) # define has_noad_option_auto_base(a) (has_option(noad_options(a), noad_option_auto_base)) +# define has_noad_option_center(a) (has_option(noad_options(a), noad_option_center)) +# define has_noad_option_scale(a) (has_option(noad_options(a), noad_option_scale)) /*tex In the meantime the codes and subtypes are in sync. The variable component does not really diff --git a/source/luametatex/source/tex/textypes.h b/source/luametatex/source/tex/textypes.h index 399839227..c4f917d4f 100644 --- a/source/luametatex/source/tex/textypes.h +++ b/source/luametatex/source/tex/textypes.h @@ -576,7 +576,7 @@ typedef union tokenword { # define stp_language_size 250 /*tex - Units. At some point these will be used in texscanning and lmtexlib. + Units. At some point these will be used in texscanning and lmtexlib (3 times replacement). */ @@ -616,6 +616,10 @@ typedef union tokenword { # define ts_numerator 4588 // tove # define ts_denonimator 645 +# define eu_min_factor 1 +# define eu_max_factor 50 +# define eu_def_factor 10 + /*tex These are used in the code, so when we want them to adapt, which is needed when we make them diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 4eb526804..9a1ca833a 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.01 09:28} +\newcontextversion{2023.04.11 22:45} %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 a09091440..994439fa2 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.01 09:28} +\edef\contextversion{2023.04.11 22:45} %D For those who want to use this: diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index f0fd15f3b..c7c28fc7c 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.01 09:28} +\newcontextversion{2023.04.11 22:45} %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 c2735fa5e..aee10b279 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.01 09:28} +\edef\contextversion{2023.04.11 22:45} %D Kind of special: diff --git a/tex/context/base/mkiv/font-con.lua b/tex/context/base/mkiv/font-con.lua index 77708ee08..10f98ca12 100644 --- a/tex/context/base/mkiv/font-con.lua +++ b/tex/context/base/mkiv/font-con.lua @@ -6,6 +6,9 @@ if not modules then modules = { } end modules ['font-con'] = { license = "see context related readme files" } +-- Todo: Enable fixes from the lmt to here. Also in font-oto.lua wrt the changed +-- assignments. (Around texlive 2024 in order not to disturb generic.) + -- some names of table entries will be changed (no _) local next, tostring, tonumber, rawget = next, tostring, tonumber, rawget @@ -648,6 +651,14 @@ function constructors.scale(tfmdata,specification) if changed then local c = changed[unicode] if c and c ~= unicode then + -- local cc = changed[c] + -- if cc then + -- while cc do + -- c = cc + -- cc = changed[c] + -- end + -- end + -- check not needed: if c then description = descriptions[c] or descriptions[unicode] or character character = characters[c] or character diff --git a/tex/context/base/mkiv/font-otc.lua b/tex/context/base/mkiv/font-otc.lua index f83c3e8ec..0787a2035 100644 --- a/tex/context/base/mkiv/font-otc.lua +++ b/tex/context/base/mkiv/font-otc.lua @@ -786,7 +786,12 @@ local function addfeature(data,feature,specifications,prepareonly) local list = askedsteps[i] local coverage = nil local format = nil - if featuretype == "substitution" then +if type(list) == "function" then + list = list(data,specification,list,i) +end + if not list then + -- see ebgaramond hack + elseif featuretype == "substitution" then -- see font-imp-tweaks: we directly pass a mapping so no checks done category = "gsub" coverage = (mapping and list) or prepare_substitution(list,featuretype,nocheck) diff --git a/tex/context/base/mkiv/font-otl.lua b/tex/context/base/mkiv/font-otl.lua index 354ca59a7..0825077b3 100644 --- a/tex/context/base/mkiv/font-otl.lua +++ b/tex/context/base/mkiv/font-otl.lua @@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading") local fonts = fonts local otf = fonts.handlers.otf -otf.version = 3.132 -- beware: also sync font-mis.lua and in mtx-fonts +otf.version = 3.133 -- beware: also sync font-mis.lua and in mtx-fonts otf.cache = containers.define("fonts", "otl", otf.version, true) otf.svgcache = containers.define("fonts", "svg", otf.version, true) otf.pngcache = containers.define("fonts", "png", otf.version, true) diff --git a/tex/context/base/mkiv/font-oto.lua b/tex/context/base/mkiv/font-oto.lua index e8b92c077..0689f4dfb 100644 --- a/tex/context/base/mkiv/font-oto.lua +++ b/tex/context/base/mkiv/font-oto.lua @@ -6,6 +6,9 @@ if not modules then modules = { } end modules ['font-oto'] = { -- original tex license = "see context related readme files" } +-- Todo: Enable fixes from the lmt to here. Also in font-con.lua wrt the changed +-- assignments. (Around texlive 2024 in order not to disturb generic.) + local concat, unpack = table.concat, table.unpack local insert, remove = table.insert, table.remove local format, gmatch, gsub, find, match, lower, strip = string.format, string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip @@ -260,7 +263,9 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis for i=1,#steps do for unicode, data in next, steps[i].coverage do if unicode ~= data then +-- if not changed[unicode] then changed[unicode] = data +-- end end if trace_singles then report_substitution(feature,sequence,descriptions,unicode,data) @@ -273,7 +278,9 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis local replacement = data[alternate] if replacement then if unicode ~= replacement then +-- if not changed[unicode] then changed[unicode] = replacement +-- end end if trace_alternatives then report_alternate(feature,sequence,descriptions,unicode,replacement,value,"normal") @@ -281,7 +288,9 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis elseif defaultalt == "first" then replacement = data[1] if unicode ~= replacement then +-- if not changed[unicode] then changed[unicode] = replacement +-- end end if trace_alternatives then report_alternate(feature,sequence,descriptions,unicode,replacement,value,defaultalt) @@ -289,7 +298,9 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis elseif defaultalt == "last" then replacement = data[#data] if unicode ~= replacement then +-- if not changed[unicode] then changed[unicode] = replacement +-- end end if trace_alternatives then report_alternate(feature,sequence,descriptions,unicode,replacement,value,defaultalt) diff --git a/tex/context/base/mkiv/font-sol.lua b/tex/context/base/mkiv/font-sol.lua index b3b514a16..b194a6ca9 100644 --- a/tex/context/base/mkiv/font-sol.lua +++ b/tex/context/base/mkiv/font-sol.lua @@ -111,7 +111,7 @@ local whatsit_code = nodecodes.whatsit local fontkern_code = kerncodes.fontkern -local righttoleft_code = nodes.dirvalues.righttoleft +local righttoleft_code = (tex.directioncodes and tex.directioncodes.righttoleft) or nodes.dirvalues.righttoleft -- LMTX local userdefinedwhatsit_code = whatsitcodes.userdefined diff --git a/tex/context/base/mkiv/good-ini.lua b/tex/context/base/mkiv/good-ini.lua index df79adb61..33e79a5d4 100644 --- a/tex/context/base/mkiv/good-ini.lua +++ b/tex/context/base/mkiv/good-ini.lua @@ -9,12 +9,14 @@ if not modules then modules = { } end modules ['good-ini'] = { -- depends on ctx local type, next = type, next -local gmatch = string.gmatch -local sortedhash, insert = table.sortedhash, table.insert +local gmatch, find, topattern = string.gmatch, string.find, string.topattern +local sortedhash, insert, contains = table.sortedhash, table.insert, table.contains local fonts = fonts -local trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end) +local trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end) +local trace_extensions = false trackers.register("fonts.goodies.extensions", function(v) trace_extensions = v end) + local report_goodies = logs.reporter("fonts","goodies") local allocate = utilities.storage.allocate @@ -324,15 +326,43 @@ end local function setextensions(tfmdata) local goodies = tfmdata.goodies if goodies then + local shared = tfmdata.shared + local metadata = shared and shared.rawdata and shared.rawdata.metadata for i=1,#goodies do local g = goodies[i] local e = g.extensions if e then - local goodie = g.name or "unknown" + local goodie = g.name or "unknown" + local fontname = metadata and metadata.fontname + if trace_extensions then + report_goodies("checking extensions for font %a",fontname or "unknown") + end for i=1,#e do - local name = "extension-" .. i - -- report_goodies("adding extension %s from %s",name,goodie) - otf.enhancers.addfeature(tfmdata.shared.rawdata,name,e[i]) + local entry = e[i] + local fnames = entry.fonts + local tnames = type(fnames) + local valid = false + if not fontname then + valid = true + elseif tnames == "table" then + if fnames[fontname] then + valid = true + elseif #fnames > 0 and contains(fnames,fontname) then + valid = true + end + elseif tnames == "string" then + fnames = topattern(fnames) + valid = find(fontname,fnames) and true + else + valid = true + end + if valid then + local name = "extension-" .. i + if trace_extensions then + report_goodies("adding extension %a from %a for font %a",name,goodie,fontname or "unknown") + end + otf.enhancers.addfeature(tfmdata.shared.rawdata,name,entry) + end end end end diff --git a/tex/context/base/mkiv/lang-txt.lua b/tex/context/base/mkiv/lang-txt.lua index cb8053fb6..af1f42c47 100644 --- a/tex/context/base/mkiv/lang-txt.lua +++ b/tex/context/base/mkiv/lang-txt.lua @@ -1192,7 +1192,7 @@ data.labels={ ["ar"]="ملحق ", ["be"]="Апендыцыт", ["ca"]="Apèndix ", - ["cn"]="附录", + ["cn"]="附录 ", ["cs"]="Příloha ", ["da"]="Bilag ", ["de"]="Anhang ", @@ -1473,7 +1473,7 @@ data.labels={ ["be"]="Глава ", ["bg"]="Eпизод ", ["ca"]="Capítol ", - ["cn"]={ "第", "章" }, + ["cn"]={ "第 ", " 章" }, ["cs"]="Kapitola ", ["da"]="", ["de"]="Kapitel ", @@ -1774,7 +1774,7 @@ data.labels={ ["be"]="Малюнак", ["bg"]="Фигура", ["ca"]="Figura ", - ["cn"]="图", + ["cn"]="图 ", ["cs"]="Obrázek ", ["da"]="Figur ", ["de"]="Abbildung ", @@ -1925,7 +1925,7 @@ data.labels={ ["be"]="Графіка ", ["bg"]="Графичен ", ["ca"]="Gràfica ", - ["cn"]="插图", + ["cn"]="插图 ", ["cs"]="Graf ", ["da"]="Grafik ", ["de"]="Grafik ", @@ -2058,7 +2058,7 @@ data.labels={ ["be"]="Інтэрмецца ", ["bg"]="Интермецо ", ["ca"]="Intermedi ", - ["cn"]="퉣", + ["cn"]="퉣 ", ["cs"]="Intermezzo ", ["da"]="Intermezzo ", ["de"]="Intermezzo ", @@ -2395,7 +2395,7 @@ data.labels={ ["be"]="радок ", ["bg"]="ред ", ["ca"]="línia ", - ["cn"]="行", + ["cn"]="行 ", ["cs"]="řádek ", ["da"]="linie ", ["de"]="Zeile ", @@ -2441,7 +2441,7 @@ data.labels={ ["be"]="радкi ", ["bg"]="редове ", ["ca"]="línies ", - ["cn"]="行", + ["cn"]="行 ", ["cs"]="řádky ", ["da"]="linier ", ["de"]="Zeilen ", @@ -3002,7 +3002,7 @@ data.labels={ ["be"]="Частка ", ["bg"]="Частка ", ["ca"]="Part ", - ["cn"]={ "第", "部分" }, + ["cn"]={ "第 ", " 部分" }, ["cs"]="Část ", ["da"]="Del ", ["de"]="Teil ", @@ -3130,7 +3130,7 @@ data.labels={ ["ar"]="فصل ", ["bg"]="Cекция ", ["ca"]="Secció ", - ["cn"]={ "第", "节" }, + ["cn"]={ "第 ", " 节" }, ["cs"]="Sekce ", ["da"]="", ["de"]="Abschnitt ", @@ -3513,7 +3513,7 @@ data.labels={ ["be"]="Табліца ", ["bg"]="Таблица ", ["ca"]="Taula ", - ["cn"]="表", + ["cn"]="表 ", ["cs"]="Tabulka ", ["da"]="Tabel ", ["de"]="Tabelle ", @@ -3863,7 +3863,7 @@ data.labels={ ["ar"]="الأشكال", ["be"]="Спіс ілюстрацый", ["ca"]="Figures", - ["cn"]="图形", + ["cn"]="图", ["cs"]="Seznam obrázků", ["da"]="Figurer", ["de"]="Abbildungen", @@ -4046,7 +4046,7 @@ data.labels={ ["be"]="Лагатыпы", ["bg"]="Логотипи", ["ca"]="Logotips", - ["cn"]="徽贬", + ["cn"]="徽标", ["cs"]="Loga", ["da"]="Logoer", ["de"]="Logos", diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua index 686fbfb7a..8cc781034 100644 --- a/tex/context/base/mkiv/mult-low.lua +++ b/tex/context/base/mkiv/mult-low.lua @@ -146,7 +146,7 @@ return { "startallmodes", "stopallmodes", "startnotallmodes", "stopnotallmodes", "doifallmodes", "doifelseallmodes", "doifallmodeselse", "doifnotallmodes", "startenvironment", "stopenvironment", "environment", - "startcomponent", "stopcomponent", "component", + "startcomponent", "stopcomponent", "component", "startlocalcomponent", "stoplocalcomponent", "startproduct", "stopproduct", "product", "startproject", "stopproject", "project", "starttext", "stoptext", "startnotext", "stopnotext", diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 476b1642f..074d13f5d 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 734e7705c..e08a49d4e 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/typo-duc.lua b/tex/context/base/mkiv/typo-duc.lua index 614defeb6..2f00fa038 100644 --- a/tex/context/base/mkiv/typo-duc.lua +++ b/tex/context/base/mkiv/typo-duc.lua @@ -599,23 +599,23 @@ local function resolve_weak(list,size,start,limit,orderbefore,orderafter) else -- only more efficient when we have es/cs local runner = start + 2 if runner <= limit then - local before = list[start] - local entry = list[start + 1] - local after = list[runner] + local before = list[start] + local current = list[start + 1] + local after = list[runner] while after do - local direction = entry.direction + local direction = current.direction if direction == "es" then if before.direction == "en" and after.direction == "en" then - entry.direction = "en" + current.direction = "en" end elseif direction == "cs" then local prevdirection = before.direction if prevdirection == "en" then if after.direction == "en" then - entry.direction = "en" + current.direction = "en" end elseif prevdirection == "an" and after.direction == "an" then - entry.direction = "an" + current.direction = "an" end end before = current diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index 53ccef0b6..9f4678349 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.01 09:28} +\newcontextversion{2023.04.11 22:45} %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 6f4b7d052..19cc4ee85 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.01 09:28} +\immutable\edef\contextversion{2023.04.11 22:45} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/core-uti.lmt b/tex/context/base/mkxl/core-uti.lmt index e4b6606e3..dbfa82ed7 100644 --- a/tex/context/base/mkxl/core-uti.lmt +++ b/tex/context/base/mkxl/core-uti.lmt @@ -377,16 +377,15 @@ function job.loadother(filename) local jobname = environment.jobname if filename == jobname then return - else - report_passes("integrating list %a into %a",filename,jobname) end - statistics.starttiming(loadedfiles) filename = file.addsuffix(filename,"tuc") local unpacked = othercache[filename] if not unpacked then - -- so we can register the same name twice(in loading order) + -- so we can register the same name twice (in loading order) ... needs checking if we want this + statistics.starttiming(loadedfiles) local utilitydata = load(filename) if utilitydata then + report_passes("integrating list %a into %a",filename,jobname) local jobpacker = utilitydata.job.packed unpacknumberdata(jobpacker.index) unpacked = { } @@ -401,14 +400,15 @@ function job.loadother(filename) end unpacked.job.packed = nil -- nicer in inspecting othercache[filename] = unpacked - -- + -- + utilitydata.components, utilitydata.namestack = collectstructure(utilitydata.job.structure.collected) + -- structures.lists .integrate(utilitydata) structures.registers .integrate(utilitydata) structures.references.integrate(utilitydata) - -- end + statistics.stoptiming(loadedfiles) end - statistics.stoptiming(loadedfiles) return unpacked end diff --git a/tex/context/base/mkxl/driv-shp.lmt b/tex/context/base/mkxl/driv-shp.lmt index 09928f303..18a12eff7 100644 --- a/tex/context/base/mkxl/driv-shp.lmt +++ b/tex/context/base/mkxl/driv-shp.lmt @@ -69,11 +69,11 @@ local parameters = fonthashes.parameters local nodecodes = nodes.nodecodes local whatsitcodes = nodes.whatsitcodes local gluecodes = nodes.gluecodes -local dirvalues = nodes.dirvalues local subtypes = nodes.subtypes -local lefttoright_code = dirvalues.lefttoright -local righttoleft_code = dirvalues.righttoleft +local directioncodes = tex.directioncodes +local lefttoright_code = directioncodes.lefttoright +local righttoleft_code = directioncodes.righttoleft local glyph_code = nodecodes.glyph local kern_code = nodecodes.kern diff --git a/tex/context/base/mkxl/driv-usr.lmt b/tex/context/base/mkxl/driv-usr.lmt index 0542228aa..df381f35f 100644 --- a/tex/context/base/mkxl/driv-usr.lmt +++ b/tex/context/base/mkxl/driv-usr.lmt @@ -40,10 +40,10 @@ local dirdimensions = nuts.dirdimensions local nodecodes = nodes.nodecodes local whatsitcodes = nodes.whatsitcodes -local dirvalues = nodes.dirvalues -local lefttoright_code = dirvalues.lefttoright -local righttoleft_code = dirvalues.righttoleft +local directioncodes = tex.directioncodes +local lefttoright_code = directioncodes.lefttoright +local righttoleft_code = directioncodes.righttoleft local glyph_code = nodecodes.glyph local kern_code = nodecodes.kern diff --git a/tex/context/base/mkxl/file-job.lmt b/tex/context/base/mkxl/file-job.lmt index e117b914e..c3906468b 100644 --- a/tex/context/base/mkxl/file-job.lmt +++ b/tex/context/base/mkxl/file-job.lmt @@ -13,7 +13,7 @@ local next, rawget, tostring, tonumber = next, rawget, tostring, tonumber local gsub, match, gmatch, ind = string.gsub, string.match, string.gmatch, string.find local insert, remove, concat, unique, imerged = table.insert, table.remove, table.concat, table.unique, table.imerged local validstring, formatters = string.valid, string.formatters -local sortedhash = table.sortedhash +local sortedhash, copytable = table.sortedhash, table.copy local setmetatableindex, setmetatablenewindex = table.setmetatableindex, table.setmetatablenewindex local commands = commands @@ -24,10 +24,12 @@ local ctx_doifelse = commands.doifelse local implement = interfaces.implement -local trace_jobfiles = false trackers.register("system.jobfiles", function(v) trace_jobfiles = v end) +local trace_jobfiles = false trackers.register("system.jobfiles", function(v) trace_jobfiles = v end) +local trace_structure = false trackers.register("system.structure", function(v) trace_structure = v end) local report = logs.reporter("system") local report_jobfiles = logs.reporter("system", "jobfiles") +local report_structure = logs.reporter("system", "structure") local report_functions = logs.reporter("system", "functions") local texsetcount = tex.setcount @@ -69,6 +71,12 @@ local v_product = variables.product local v_component = variables.component local v_yes = variables.yes +local v_local = variables["local"] +local v_global = variables["global"] + +local e_start = elements.start +local e_stop = elements.stop + -- main code .. there is some overlap .. here we have loc:// local function findctxfile(name) -- loc ? any ? @@ -402,7 +410,7 @@ local c_textlevel = tex.iscount("textlevel") local function dummyfunction() end local function startstoperror() - report("invalid \\%s%s ... \\%s%s structure",elements.start,v_text,elements.stop,v_text) + report("invalid \\%s%s ... \\%s%s structure",e_start,v_text,e_stop,v_text) startstoperror = dummyfunction end @@ -528,6 +536,10 @@ local tree = { type = "text", name = "", branches = { } } local treestack = { } local top = tree.branches local root = tree +local namestack = { } +local namelist = { } +local namehash = { } +local nametop = false local project_stack = { } local product_stack = { } @@ -550,6 +562,15 @@ local function pushtree(what,name) top = t end +local function pushcurrent(what,name) + if what == v_product or what == v_component or what == v_text then + insert(namestack,name) + nametop = copytable(namestack) + namelist[#namelist+1] = nametop + insert(namehash,#namelist) + end +end + local function poptree() top = remove(treestack) if #top[#top].branches == 0 then @@ -557,6 +578,13 @@ local function poptree() end end +local function popcurrent(what) + if what == v_product or what == v_component then + remove(namestack) + remove(namehash) + end +end + do local function log_tree(report,top,depth) @@ -600,22 +628,75 @@ job.structure = jobstructure jobstructure.collected = jobstructure.collected or { } jobstructure.tobesaved = root jobstructure.components = { } +jobstructure.namestack = { } -local function initialize() - local function collect(root,result) +function collectstructure(collected) + local namestack = { } + local n = 0 + local function collect(root,result,stack) local branches = root.branches if branches then + local s = copytable(stack) + local m = #s + 1 for i=1,#branches do local branch = branches[i] - if branch.type == "component" then + local what = branch.type + if what == v_component then result[#result+1] = branch.name end - collect(branch,result) + s[m] = branch.name + if what == v_product or what == v_component then + n = n + 1 + namestack[n] = copytable(s) + end + collect(branch,result,s) end end return result end - jobstructure.components = collect(jobstructure.collected,{}) + local components = collect(collected,{},{}) +-- inspect(namestack) + return components, namestack +end + +local function initialize() + jobstructure.components, jobstructure.namestack = collectstructure(jobstructure.collected) +end + +function jobresolvers.collectstructure(collected) + return collectstructure(collected or jobstructure.collected) +end + +do + local reported = { } + + function jobresolvers.currentstructure() +-- inspect(namehash) + local n = namehash[#namehash] + if trace_structure and not reported[n] then + local namestack = jobstructure.namestack + local new = namelist [n] + local old = namestack[n] + new = new and concat(new," ") or "" + old = old and concat(old," ") or "" + if old == new then + report_structure("%02i : %a",n,old) + else + report_structure("%02i : %a <> %a",n,old,new) + end + reported[n] = true + end + return n, namelist[n] + end + +end + +function jobresolvers.namelist(n,utilitydata) + if utilitydata then + return utilitydata.namestack[n] + else + return namelist[n] or jobstructure.namestack[n] + end end job.register('job.structure.collected',root,initialize) @@ -836,36 +917,32 @@ implement { name = "usecomponent", public = true, protected = true, actions = -- [v_environment] = context.stopenvironmentindeed, -- } -local start = { - [v_project] = "startprojectindeed", - [v_product] = "startproductindeed", - [v_component] = "startcomponentindeed", - [v_environment] = "startenvironmentindeed", -} +-- local start = { +-- [v_project] = "startprojectindeed", +-- [v_product] = "startproductindeed", +-- [v_component] = "startcomponentindeed", +-- [v_environment] = "startenvironmentindeed", +-- } -local stop = { - [v_project] = "stopprojectindeed", - [v_product] = "stopproductindeed", - [v_component] = "stopcomponentindeed", - [v_environment] = "stopenvironmentindeed", -} +-- local stop = { +-- [v_project] = "stopprojectindeed", +-- [v_product] = "stopproductindeed", +-- [v_component] = "stopcomponentindeed", +-- [v_environment] = "stopenvironmentindeed", +-- } -local function gotonextlevel(what,name) -- todo: something with suffix name +local function gotonextlevel(what,how,name) -- todo: something with suffix name insert(stacks[what],name) insert(typestack,currenttype) currenttype = what pushtree(what,name) - if start[what] then - -- start[what]() - token.expandmacro(start[what]) - end + pushcurrent(what,name) + token.expandmacro(e_start..":"..what..":"..how) end -local function gotopreviouslevel(what) - if stop[what] then - token.expandmacro(stop[what]) - -- stop[what]() -- not immediate - end +local function gotopreviouslevel(what,how) + token.expandmacro(e_stop..":"..what..":"..how) + popcurrent(what) poptree() currenttype = remove(typestack) or v_text remove(stacks[what]) -- not currenttype ... weak recovery @@ -881,20 +958,22 @@ local function autoname() return name end -implement { name = "startproject", public = true, protected = true, actions = function() gotonextlevel(v_project, autoname()) end } -implement { name = "startproduct", public = true, protected = true, actions = function() gotonextlevel(v_product, autoname()) end } -implement { name = "startcomponent", public = true, protected = true, actions = function() gotonextlevel(v_component, autoname()) end } -implement { name = "startenvironment", public = true, protected = true, actions = function() gotonextlevel(v_environment,autoname()) end } - -implement { name = "stopproject", public = true, protected = true, actions = function() gotopreviouslevel(v_project ) end } -implement { name = "stopproduct", public = true, protected = true, actions = function() gotopreviouslevel(v_product ) end } -implement { name = "stopcomponent", public = true, protected = true, actions = function() gotopreviouslevel(v_component ) end } -implement { name = "stopenvironment", public = true, protected = true, actions = function() gotopreviouslevel(v_environment) end } - -implement { name = "currentproject", public = true, actions = function() context(topofstack(v_project )) end } -implement { name = "currentproduct", public = true, actions = function() context(topofstack(v_product )) end } -implement { name = "currentcomponent", public = true, actions = function() context(topofstack(v_component )) end } -implement { name = "currentenvironment", public = true, actions = function() context(topofstack(v_environment)) end } +implement { name = "startproject", public = true, protected = true, actions = function() gotonextlevel(v_project, v_global, autoname()) end } +implement { name = "startproduct", public = true, protected = true, actions = function() gotonextlevel(v_product, v_global, autoname()) end } +implement { name = "startcomponent", public = true, protected = true, actions = function() gotonextlevel(v_component, v_global, autoname()) end } +implement { name = "startlocalcomponent", public = true, protected = true, actions = function() gotonextlevel(v_component, v_local, autoname()) end } +implement { name = "startenvironment", public = true, protected = true, actions = function() gotonextlevel(v_environment, v_global, autoname()) end } + +implement { name = "stopproject", public = true, protected = true, actions = function() gotopreviouslevel(v_project, v_global) end } +implement { name = "stopproduct", public = true, protected = true, actions = function() gotopreviouslevel(v_product, v_global) end } +implement { name = "stopcomponent", public = true, protected = true, actions = function() gotopreviouslevel(v_component, v_global) end } +implement { name = "stoplocalcomponent", public = true, protected = true, actions = function() gotopreviouslevel(v_component, v_local ) end } +implement { name = "stopenvironment", public = true, protected = true, actions = function() gotopreviouslevel(v_environment, v_global) end } + +implement { name = "currentproject", public = true, actions = function() context(topofstack(v_project )) end } +implement { name = "currentproduct", public = true, actions = function() context(topofstack(v_product )) end } +implement { name = "currentcomponent", public = true, actions = function() context(topofstack(v_component )) end } +implement { name = "currentenvironment", public = true, actions = function() context(topofstack(v_environment)) end } -- -- -- this will move -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/tex/context/base/mkxl/file-job.mklx b/tex/context/base/mkxl/file-job.mklx index 76b679bd6..1c57a832d 100644 --- a/tex/context/base/mkxl/file-job.mklx +++ b/tex/context/base/mkxl/file-job.mklx @@ -184,43 +184,54 @@ \newsystemmode\v!component \newsystemmode\v!environment -\permanent\protected\def\startprojectindeed +\permanent\protected\defcsname\e!start:\v!project:\v!global\endcsname {%starttext \pushsystemmode\v!project \setsystemmode\v!project} -\permanent\protected\def\stopprojectindeed +\permanent\protected\defcsname\e!stop:\v!project:\v!global\endcsname {\popsystemmode\v!project %stoptext \endinput} -\permanent\protected\def\startproductindeed +\permanent\protected\defcsname\e!start:\v!product:\v!global\endcsname {\starttext \pushsystemmode\v!product \setsystemmode\v!product} -\permanent\protected\def\stopproductindeed +\permanent\protected\defcsname\e!stop:\v!product:\v!global\endcsname {\popsystemmode\v!product \stoptext \endinput} -\permanent\protected\def\startcomponentindeed +\permanent\protected\defcsname\e!start:\v!component:\v!global\endcsname {\starttext \pushreferenceprefix\currentcomponent \pushsystemmode\v!component \setsystemmode\v!component} -\permanent\protected\def\stopcomponentindeed +\permanent\protected\defcsname\e!stop:\v!component:\v!global\endcsname {\popsystemmode\v!component \popreferenceprefix \stoptext \endinput} -\permanent\protected\def\startenvironmentindeed +\permanent\protected\defcsname\e!start:\v!component:\v!local\endcsname + {\starttext + \pushreferenceprefix\currentcomponent + \pushsystemmode\v!component + \setsystemmode\v!component} + +\permanent\protected\defcsname\e!stop:\v!component:\v!local\endcsname + {\popsystemmode\v!component + \popreferenceprefix + \stoptext} + +\permanent\protected\defcsname\e!start:\v!environment:\v!global\endcsname {\pushsystemmode\v!environment \setsystemmode\v!environment} -\permanent\protected\def\stopenvironmentindeed +\permanent\protected\defcsname\e!stop:\v!environment:\v!global\endcsname {\popsystemmode\v!environment \endinput} diff --git a/tex/context/base/mkxl/font-con.lmt b/tex/context/base/mkxl/font-con.lmt index 5a887d61d..599641e2c 100644 --- a/tex/context/base/mkxl/font-con.lmt +++ b/tex/context/base/mkxl/font-con.lmt @@ -589,6 +589,14 @@ function constructors.scale(tfmdata,specification) if changed then local c = changed[unicode] if c and c ~= unicode then + local cc = changed[c] + if cc then + while cc do + c = cc + cc = changed[c] + end + end + -- check not needed: if c then description = descriptions[c] or descriptions[unicode] or character character = characters[c] or character diff --git a/tex/context/base/mkxl/font-lib.mklx b/tex/context/base/mkxl/font-lib.mklx index 6caf1daf8..9214a8b52 100644 --- a/tex/context/base/mkxl/font-lib.mklx +++ b/tex/context/base/mkxl/font-lib.mklx @@ -52,7 +52,7 @@ \registerctxluafile{font-oti}{} % otf initialization \registerctxluafile{font-ott}{} % otf tables (first) \registerctxluafile{font-otl}{autosuffix} -\registerctxluafile{font-oto}{} +\registerctxluafile{font-oto}{autosuffix} \registerctxluafile{font-otj}{autosuffix} \registerctxluafile{font-oup}{} \registerctxluafile{font-ota}{autosuffix} diff --git a/tex/context/base/mkxl/font-mat.mklx b/tex/context/base/mkxl/font-mat.mklx index 54473a347..a93174e37 100644 --- a/tex/context/base/mkxl/font-mat.mklx +++ b/tex/context/base/mkxl/font-mat.mklx @@ -533,7 +533,12 @@ \else \c_math_m_scaled\numericscale#1\relax \fi - \scaledmathstyle\c_math_m_scaled + \scaledmathstyle + \ifnum\glyphscale=\plusthousand + \c_math_m_scaled + \else + \numexpr(\c_math_m_scaled*\glyphscale)/\plusthousand\relax + \fi \fi} %D This is nasty, as the engine only stores the last set family parameters (per style) which diff --git a/tex/context/base/mkxl/font-oto.lmt b/tex/context/base/mkxl/font-oto.lmt new file mode 100644 index 000000000..f22696273 --- /dev/null +++ b/tex/context/base/mkxl/font-oto.lmt @@ -0,0 +1,556 @@ +if not modules then modules = { } end modules ['font-oto'] = { -- original tex + version = 1.001, + comment = "companion to font-ini.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local concat, unpack = table.concat, table.unpack +local insert, remove = table.insert, table.remove +local format, gmatch, gsub, find, match, lower, strip = string.format, string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip +local type, next, tonumber, tostring = type, next, tonumber, tostring + +local trace_baseinit = false trackers.register("otf.baseinit", function(v) trace_baseinit = v end) +local trace_singles = false trackers.register("otf.singles", function(v) trace_singles = v end) +local trace_multiples = false trackers.register("otf.multiples", function(v) trace_multiples = v end) +local trace_alternatives = false trackers.register("otf.alternatives", function(v) trace_alternatives = v end) +local trace_ligatures = false trackers.register("otf.ligatures", function(v) trace_ligatures = v end) +local trace_kerns = false trackers.register("otf.kerns", function(v) trace_kerns = v end) +local trace_preparing = false trackers.register("otf.preparing", function(v) trace_preparing = v end) + +local report_prepare = logs.reporter("fonts","otf prepare") + +local fonts = fonts +local otf = fonts.handlers.otf + +local otffeatures = otf.features +local registerotffeature = otffeatures.register + +otf.defaultbasealternate = "none" -- first last + +local getprivate = fonts.constructors.getprivate + +local wildcard = "*" +local default = "dflt" + +local formatters = string.formatters +local f_unicode = formatters["%U"] +local f_uniname = formatters["%U (%s)"] +local f_unilist = formatters["% t (% t)"] + +local function gref(descriptions,n) + if type(n) == "number" then + local name = descriptions[n].name + if name then + return f_uniname(n,name) + else + return f_unicode(n) + end + elseif n then + local num = { } + local nam = { } + local j = 0 + for i=1,#n do + local ni = n[i] + if tonumber(ni) then -- first is likely a key + j = j + 1 + local di = descriptions[ni] + num[j] = f_unicode(ni) + nam[j] = di and di.name or "-" + end + end + return f_unilist(num,nam) + else + return "<error in base mode tracing>" + end +end + +local function cref(feature,sequence) + return formatters["feature %a, type %a, (chain) lookup %a"](feature,sequence.type,sequence.name) +end + +local function report_substitution(feature,sequence,descriptions,unicode,substitution) + if unicode == substitution then + report_prepare("%s: base substitution %s maps onto itself", + cref(feature,sequence), + gref(descriptions,unicode)) + else + report_prepare("%s: base substitution %s => %S", + cref(feature,sequence), + gref(descriptions,unicode), + gref(descriptions,substitution)) + end +end + +local function report_alternate(feature,sequence,descriptions,unicode,replacement,value,comment) + if unicode == replacement then + report_prepare("%s: base alternate %s maps onto itself", + cref(feature,sequence), + gref(descriptions,unicode)) + else + report_prepare("%s: base alternate %s => %s (%S => %S)", + cref(feature,sequence), + gref(descriptions,unicode), + replacement and gref(descriptions,replacement), + value, + comment) + end +end + +local function report_ligature(feature,sequence,descriptions,unicode,ligature) + report_prepare("%s: base ligature %s => %S", + cref(feature,sequence), + gref(descriptions,ligature), + gref(descriptions,unicode)) +end + +local function report_kern(feature,sequence,descriptions,unicode,otherunicode,value) + report_prepare("%s: base kern %s + %s => %S", + cref(feature,sequence), + gref(descriptions,unicode), + gref(descriptions,otherunicode), + value) +end + +-- We need to make sure that luatex sees the difference between base fonts that have +-- different glyphs in the same slots in fonts that have the same fullname (or filename). +-- LuaTeX will merge fonts eventually (and subset later on). If needed we can use a more +-- verbose name as long as we don't use <()<>[]{}/%> and the length is < 128. + +local basehash, basehashes, applied = { }, 1, { } + +local function registerbasehash(tfmdata) + local properties = tfmdata.properties + local hash = concat(applied," ") + local base = basehash[hash] + if not base then + basehashes = basehashes + 1 + base = basehashes + basehash[hash] = base + end + properties.basehash = base + properties.fullname = (properties.fullname or properties.name) .. "-" .. base + -- report_prepare("fullname base hash '%a, featureset %a",tfmdata.properties.fullname,hash) + applied = { } +end + +local function registerbasefeature(feature,value) + applied[#applied+1] = feature .. "=" .. tostring(value) +end + +-- The original basemode ligature builder used the names of components and did some expression +-- juggling to get the chain right. The current variant starts with unicodes but still uses +-- names to make the chain. This is needed because we have to create intermediates when needed +-- but use predefined snippets when available. To some extend the current builder is more stupid +-- but I don't worry that much about it as ligatures are rather predicatable. +-- +-- Personally I think that an ff + i == ffi rule as used in for instance latin modern is pretty +-- weird as no sane person will key that in and expect a glyph for that ligature plus the following +-- character. Anyhow, as we need to deal with this, we do, but no guarantes are given. +-- +-- latin modern dejavu +-- +-- f+f 102 102 102 102 +-- f+i 102 105 102 105 +-- f+l 102 108 102 108 +-- f+f+i 102 102 105 +-- f+f+l 102 102 108 102 102 108 +-- ff+i 64256 105 64256 105 +-- ff+l 64256 108 +-- +-- As you can see here, latin modern is less complete than dejavu but +-- in practice one will not notice it. +-- +-- The while loop is needed because we need to resolve for instance pseudo names like +-- hyphen_hyphen to endash so in practice we end up with a bit too many definitions but the +-- overhead is neglectable. We can have changed[first] or changed[second] but it quickly becomes +-- messy if we need to take that into account. + +local function makefake(tfmdata,name,present) + local private = getprivate(tfmdata) + local character = { intermediate = true, ligatures = { } } + tfmdata.resources.unicodes[name] = private + tfmdata.characters[private] = character + tfmdata.descriptions[private] = { name = name } + present[name] = private + return character +end + +local function make_1(present,tree,name) + if tonumber(tree) then + present[name] = v + else + for k, v in next, tree do + if k == "ligature" then + present[name] = v + else + make_1(present,v,name .. "_" .. k) + end + end + end +end + +local function make_3(present,tfmdata,characters,tree,name,preceding,unicode,done,v) + local character = characters[preceding] + if not character then + if trace_baseinit then + report_prepare("weird ligature in lookup %a, current %C, preceding %C",sequence.name,v,preceding) + end + character = makefake(tfmdata,name,present) + end + local ligatures = character.ligatures + if ligatures then + ligatures[unicode] = { char = v } + else + character.ligatures = { [unicode] = { char = v } } + end + if done then + local d = done[name] + if not d then + done[name] = { "dummy", v } + else + d[#d+1] = v + end + end +end + +local function make_2(present,tfmdata,characters,tree,name,preceding,unicode,done) + if tonumber(tree) then + make_3(present,tfmdata,characters,tree,name,preceding,unicode,done,tree) + else + for k, v in next, tree do + if k == "ligature" then + make_3(present,tfmdata,characters,tree,name,preceding,unicode,done,v) + else + local code = present[name] or unicode + local name = name .. "_" .. k + make_2(present,tfmdata,characters,v,name,code,k,done) + end + end + end +end + +local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplist) + local characters = tfmdata.characters + local descriptions = tfmdata.descriptions + local resources = tfmdata.resources + local changed = tfmdata.changed + + local ligatures = { } + local alternate = tonumber(value) or true and 1 + local defaultalt = otf.defaultbasealternate + local trace_singles = trace_baseinit and trace_singles + local trace_alternatives = trace_baseinit and trace_alternatives + local trace_ligatures = trace_baseinit and trace_ligatures + + -- A chain of changes is handled in font-con which is cleaner because + -- we can have shared changes and such. + + if not changed then + changed = { } + tfmdata.changed = changed + end + + for i=1,#lookuplist do + local sequence = lookuplist[i] + local steps = sequence.steps + local kind = sequence.type + if kind == "gsub_single" then + for i=1,#steps do + for unicode, data in next, steps[i].coverage do + if unicode ~= data and not changed[unicode] then + changed[unicode] = data + end + if trace_singles then + report_substitution(feature,sequence,descriptions,unicode,data) + end + end + end + elseif kind == "gsub_alternate" then + for i=1,#steps do + for unicode, data in next, steps[i].coverage do + local replacement = data[alternate] + if replacement then + if unicode ~= replacement and not changed[unicode] then + changed[unicode] = replacement + end + if trace_alternatives then + report_alternate(feature,sequence,descriptions,unicode,replacement,value,"normal") + end + elseif defaultalt == "first" then + replacement = data[1] + if unicode ~= replacement and not changed[unicode] then + changed[unicode] = replacement + end + if trace_alternatives then + report_alternate(feature,sequence,descriptions,unicode,replacement,value,defaultalt) + end + elseif defaultalt == "last" then + replacement = data[#data] + if unicode ~= replacement and not changed[unicode] then + changed[unicode] = replacement + end + if trace_alternatives then + report_alternate(feature,sequence,descriptions,unicode,replacement,value,defaultalt) + end + else + if trace_alternatives then + report_alternate(feature,sequence,descriptions,unicode,replacement,value,"unknown") + end + end + end + end + elseif kind == "gsub_ligature" then + for i=1,#steps do + for unicode, data in next, steps[i].coverage do + ligatures[#ligatures+1] = { unicode, data, "" } -- lookupname } + if trace_ligatures then + report_ligature(feature,sequence,descriptions,unicode,data) + end + end + end + end + end + + local nofligatures = #ligatures + + if nofligatures > 0 then + local characters = tfmdata.characters + local present = { } + local done = trace_baseinit and trace_ligatures and { } + + for i=1,nofligatures do + local ligature = ligatures[i] + local unicode = ligature[1] + local tree = ligature[2] + make_1(present,tree,"ctx_"..unicode) + end + + for i=1,nofligatures do + local ligature = ligatures[i] + local unicode = ligature[1] + local tree = ligature[2] + local lookupname = ligature[3] + make_2(present,tfmdata,characters,tree,"ctx_"..unicode,unicode,unicode,done,sequence) + end + + end + +end + +local function preparepositionings(tfmdata,feature,value,validlookups,lookuplist) + local characters = tfmdata.characters + local descriptions = tfmdata.descriptions + local resources = tfmdata.resources + local properties = tfmdata.properties + local traceindeed = trace_baseinit and trace_kerns + -- check out this sharedkerns trickery + for i=1,#lookuplist do + local sequence = lookuplist[i] + local steps = sequence.steps + local kind = sequence.type + local format = sequence.format + if kind == "gpos_pair" then + for i=1,#steps do + local step = steps[i] + local format = step.format + if format == "kern" or format == "move" then + for unicode, data in next, steps[i].coverage do + local character = characters[unicode] + local kerns = character.kerns + if not kerns then + kerns = { } + character.kerns = kerns + end + if traceindeed then + for otherunicode, kern in next, data do + if not kerns[otherunicode] and kern ~= 0 then + kerns[otherunicode] = kern + report_kern(feature,sequence,descriptions,unicode,otherunicode,kern) + end + end + else + for otherunicode, kern in next, data do + if not kerns[otherunicode] and kern ~= 0 then + kerns[otherunicode] = kern + end + end + end + end + else + for unicode, data in next, steps[i].coverage do + local character = characters[unicode] + local kerns = character.kerns + for otherunicode, kern in next, data do + -- kern[2] is true (all zero) or a table + local other = kern[2] + if other == true or (not other and not (kerns and kerns[otherunicode])) then + local kern = kern[1] + if kern == true then + -- all zero + elseif kern[1] ~= 0 or kern[2] ~= 0 or kern[4] ~= 0 then + -- a complex pair not suitable for basemode + else + kern = kern[3] + if kern ~= 0 then + if kerns then + kerns[otherunicode] = kern + else + kerns = { [otherunicode] = kern } + character.kerns = kerns + end + if traceindeed then + report_kern(feature,sequence,descriptions,unicode,otherunicode,kern) + end + end + end + end + end + end + end + end + end + end + +end + +local function initializehashes(tfmdata) + -- already done +end + +local function checkmathreplacements(tfmdata,fullname,fixitalics) + if tfmdata.mathparameters then + local characters = tfmdata.characters + local changed = tfmdata.changed + if next(changed) then + if trace_preparing or trace_baseinit then + report_prepare("checking math replacements for %a",fullname) + end + for unicode, replacement in next, changed do + local u = characters[unicode] + local r = characters[replacement] + if u and r then + local n = u.next + local v = u.vert_variants + local h = u.horiz_variants + if fixitalics then + -- quite some warnings on stix ... + local ui = u.italic + if ui and not r.italic then + if trace_preparing then + report_prepare("using %i units of italic correction from %C for %U",ui,unicode,replacement) + end + r.italic = ui -- print(ui,ri) + end + end + if n and not r.next then + if trace_preparing then + report_prepare("forcing %s for %C substituted by %U","incremental step",unicode,replacement) + end + r.next = n + end + if v and not r.vert_variants then + if trace_preparing then + report_prepare("forcing %s for %C substituted by %U","vertical variants",unicode,replacement) + end + r.vert_variants = v + end + if h and not r.horiz_variants then + if trace_preparing then + report_prepare("forcing %s for %C substituted by %U","horizontal variants",unicode,replacement) + end + r.horiz_variants = h + end + else + if trace_preparing then + report_prepare("error replacing %C by %U",unicode,replacement) + end + end + end + end + end +end + +local function featuresinitializer(tfmdata,value) + if true then -- value then + local starttime = trace_preparing and os.clock() + local features = tfmdata.shared.features + local fullname = tfmdata.properties.fullname or "?" + if features then + initializehashes(tfmdata) + local collectlookups = otf.collectlookups + local rawdata = tfmdata.shared.rawdata + local properties = tfmdata.properties + local script = properties.script + local language = properties.language + local rawresources = rawdata.resources + local rawfeatures = rawresources and rawresources.features + local basesubstitutions = rawfeatures and rawfeatures.gsub + local basepositionings = rawfeatures and rawfeatures.gpos + local substitutionsdone = false + local positioningsdone = false + -- + if basesubstitutions or basepositionings then + local sequences = tfmdata.resources.sequences + for s=1,#sequences do + local sequence = sequences[s] + local sfeatures = sequence.features + if sfeatures then + local order = sequence.order + if order then + for i=1,#order do -- + local feature = order[i] + local value = features[feature] + if value then + local validlookups, lookuplist = collectlookups(rawdata,feature,script,language) +-- if not validlookups and not lookuplist and script == "math" then +-- validlookups, lookuplist = collectlookups(rawdata,feature,"dflt","dflt") +-- end + if not validlookups then + -- skip + elseif basesubstitutions and basesubstitutions[feature] then + if trace_preparing then + report_prepare("filtering base %s feature %a for %a with value %a","sub",feature,fullname,value) + end + preparesubstitutions(tfmdata,feature,value,validlookups,lookuplist) + registerbasefeature(feature,value) + substitutionsdone = true + elseif basepositionings and basepositionings[feature] then + if trace_preparing then + report_prepare("filtering base %a feature %a for %a with value %a","pos",feature,fullname,value) + end + preparepositionings(tfmdata,feature,value,validlookups,lookuplist) + registerbasefeature(feature,value) + positioningsdone = true + end + end + end + end + end + end + end + -- + if substitutionsdone then + checkmathreplacements(tfmdata,fullname,features.fixitalics) + end + -- + registerbasehash(tfmdata) + end + if trace_preparing then + report_prepare("preparation time is %0.3f seconds for %a",os.clock()-starttime,fullname) + end + end +end + +registerotffeature { + name = "features", + description = "features", + default = true, + initializers = { + -- position = 1, -- after setscript (temp hack ... we need to force script / language to 1 + base = featuresinitializer, + } +} + +otf.basemodeinitializer = featuresinitializer diff --git a/tex/context/base/mkxl/font-ots.lmt b/tex/context/base/mkxl/font-ots.lmt index 0e99de6d1..9e7fdb1ab 100644 --- a/tex/context/base/mkxl/font-ots.lmt +++ b/tex/context/base/mkxl/font-ots.lmt @@ -252,8 +252,8 @@ local math_code = nodecodes.math local dir_code = nodecodes.dir local par_code = nodecodes.par -local lefttoright_code = nodes.dirvalues.lefttoright -local righttoleft_code = nodes.dirvalues.righttoleft +local lefttoright_code = tex.directioncodes.lefttoright +local righttoleft_code = tex.directioncodes.righttoleft local discretionarydisc_code = nodes.disccodes.discretionary diff --git a/tex/context/base/mkxl/font-txt.lmt b/tex/context/base/mkxl/font-txt.lmt index aae69ddd3..c42a3a655 100644 --- a/tex/context/base/mkxl/font-txt.lmt +++ b/tex/context/base/mkxl/font-txt.lmt @@ -122,7 +122,7 @@ local math_code = nodecodes.math local dir_code = nodecodes.dir local par_code = nodecodes.par -local righttoleft_code = nodes.dirvalues.righttoleft +local righttoleft_code = tex.directioncodes.righttoleft local txtdirstate = otf.helpers.txtdirstate local pardirstate = otf.helpers.pardirstate diff --git a/tex/context/base/mkxl/lpdf-ano.lmt b/tex/context/base/mkxl/lpdf-ano.lmt index 2e19ffd5e..4d9af002c 100644 --- a/tex/context/base/mkxl/lpdf-ano.lmt +++ b/tex/context/base/mkxl/lpdf-ano.lmt @@ -26,11 +26,12 @@ local rep, format, find = string.rep, string.format, string.find local min = math.min local lpegmatch = lpeg.match local formatters = string.formatters -local sortedkeys, concat = table.sortedkeys, table.concat +local sortedkeys, concat, swapped = table.sortedkeys, table.concat, table.swapped local trace_references = false trackers.register("references.references", function(v) trace_references = v end) local trace_destinations = false trackers.register("references.destinations", function(v) trace_destinations = v end) local trace_bookmarks = false trackers.register("references.bookmarks", function(v) trace_bookmarks = v end) +local trace_externals = false trackers.register("references.externals", function(v) trace_externals = v end) local log_destinations = false directives.register("destinations.log", function(v) log_destinations = v end) local untex_urls = true directives.register("references.untexurls", function(v) untex_urls = v end) @@ -510,59 +511,65 @@ function nodeinjections.destination(width,height,depth,names,view) if method == v_page then for n=1,#names do local name = names[n] - local used = usedviews[name] - if used and used ~= true then - -- already done, maybe a warning - elseif type(name) == "number" then - -- if noview then - -- usedviews[name] = view - -- names[n] = false - -- else + if name then + local used = usedviews[name] + if used and used ~= true then + -- already done, maybe a warning + elseif type(name) == "number" then + -- if noview then + -- usedviews[name] = view + -- names[n] = false + -- else + usedviews[name] = view + names[n] = false + -- end + else usedviews[name] = view - names[n] = false - -- end - else - usedviews[name] = view + end end end elseif method == v_name then for n=1,#names do local name = names[n] - local used = usedviews[name] - if used and used ~= true then - -- already done, maybe a warning - elseif type(name) == "number" then - local used = usedinternals[name] - usedviews[name] = view - names[n] = registerautoprefix(name) - doview = true - else - usedviews[name] = view - doview = true + if name then + local used = usedviews[name] + if used and used ~= true then + -- already done, maybe a warning + elseif type(name) == "number" then + local used = usedinternals[name] + usedviews[name] = view + names[n] = registerautoprefix(name) + doview = true + else + usedviews[name] = view + doview = true + end end end else for n=1,#names do local name = names[n] - if usedviews[name] then - -- already done, maybe a warning - elseif type(name) == "number" then - if noview then - usedviews[name] = view - names[n] = false - else - local used = usedinternals[name] - if used and used ~= defaultview then + if name then + if usedviews[name] then + -- already done, maybe a warning + elseif type(name) == "number" then + if noview then usedviews[name] = view - names[n] = registerautoprefix(name) - doview = true - else names[n] = false + else + local used = usedinternals[name] + if used and used ~= defaultview then + usedviews[name] = view + names[n] = registerautoprefix(name) + doview = true + else + names[n] = false + end end + else + usedviews[name] = view + doview = true end - else - usedviews[name] = view - doview = true end end end @@ -634,20 +641,95 @@ end -- annotations -local function pdffilelink(filename,destination,page,actions) - if not filename or filename == "" or file.basename(filename) == tex.jobname then - return false - end - filename = file.addsuffix(filename,"pdf") - if (not destination or destination == "") or (references.outermethod == v_page) then - destination = pdfarray { (page or 1) - 1, pdf_fit } +local pdffilelink do + + local valid = table.setmetatableindex(function(t,filename) + local found = false + if lfs.isfile(filename) then + report_destinations("loading destinations from file %a",filename) + local pdffile = lpdf.epdf.load(filename) + if pdffile then + local pages = pdffile.pages + local nofpages = pdffile.nofpages + local destinations = pdffile.destinations + if pages and nofpages > 0 and destinations then + local reverse = swapped(pages) + local total = 0 + found = { } + for k, v in next, destinations do + local D = v.D + if D then + found[k] = reverse[D[1]] + total = total + 1 + end + end + t[filename] = found + report_destinations("%i destinations on %i pages found",total,nofpages) + end + end + end + return found + end) + + local pagefromhash = structures.references.pagefromhash + + pdffilelink = function(filename,destination,page,actions) + if not filename or filename == "" or file.basename(filename) == tex.jobname then + return false + end + filename = file.addsuffix(filename,"pdf") + -- page auto name + local forcepage = false + if not destination or destination == "" then + forcepage = true + elseif references.outermethod == v_page then + if not page then + local hash = valid[filename] + page = hash and hash[destination] + if not page or trace_externals then + report_destinations("no %s destination %a in file %a","page",destination,filename) + end + end + forcepage = true + else -- name or auto, maybe only check with auto + local hash = valid[filename] + if hash then + local p = nil + p, destination = pagefromhash(hash,destination,page,actions) + if p then + if references.outermethod == v_name then + -- keep destination string + elseif page then + if p ~= page then + report_destinations("page %i for destination %a in %a conflicts, %i expected",page,destination,filename,p) + page = p + end + forcepage = true + elseif p then + page = p + forcepage = true + end + else + if not page or trace_externals then + report_destinations("no %s destination %a in file %a","name",destination,filename) + end + forcepage = true + end + -- else + -- keep destination string + end + end + if forcepage then + destination = pdfarray { (page or 1) - 1, pdf_fit } + end + return pdfdictionary { + S = pdf_gotor, -- can also be pdf_launch + F = filename, + D = destination or defaultdestination, + NewWindow = actions.newwindow and true or nil, + } end - return pdfdictionary { - S = pdf_gotor, -- can also be pdf_launch - F = filename, - D = destination or defaultdestination, - NewWindow = actions.newwindow and true or nil, - } + end local untex = references.urls.untex @@ -981,6 +1063,9 @@ runners["outer"] = function(var,actions) end runners["outer with inner"] = function(var,actions) + if var.r then + actions.realpage = var.r + end return pdffilelink(references.checkedfile(var.outer),var.inner,var.r,actions) end diff --git a/tex/context/base/mkxl/lpdf-rul.lmt b/tex/context/base/mkxl/lpdf-rul.lmt index 4efa17bb0..ce90488bd 100644 --- a/tex/context/base/mkxl/lpdf-rul.lmt +++ b/tex/context/base/mkxl/lpdf-rul.lmt @@ -21,7 +21,7 @@ local ruleactions = nuts.rules.ruleactions local getwhd = nuts.getwhd -local lefttoright_code = nodes.dirvalues.lefttoright +local lefttoright_code = tex.directioncodes.lefttoright local mpcolor = attributes.colors.mpcolor diff --git a/tex/context/base/mkxl/luat-run.lmt b/tex/context/base/mkxl/luat-run.lmt index f6b2ea063..c53817697 100644 --- a/tex/context/base/mkxl/luat-run.lmt +++ b/tex/context/base/mkxl/luat-run.lmt @@ -211,6 +211,14 @@ function luatex.currentfile() return stack[#stack] or tex.jobname end +function luatex.currentlevel() + return level +end + +function luatex.currenttotal() + return total +end + local function report_start(name,rest) if rest then -- luatex diff --git a/tex/context/base/mkxl/math-acc.mklx b/tex/context/base/mkxl/math-acc.mklx index c3c4a5d34..8c5a1adfa 100644 --- a/tex/context/base/mkxl/math-acc.mklx +++ b/tex/context/base/mkxl/math-acc.mklx @@ -32,6 +32,35 @@ %D Older implementations are kept in the \MKII\ and \MKIV\ modules for educational %D purposes. +%D Only very few fonts provide flat accents but we emulate them for those that don't +%D have them. We also need to fix the related font parameter for a few fonts like +%D Lucida and Garamond. + +% \startbuffer +% \im{ +% \dostepwiserecurse{`A}{`Z}{1}{ +% \blackrule[height=\the\Umathflattenedaccentbaseheight\textstyle,depth=0pt,width=0.05ts] +% \hat{\char#1} +% } +% } +% \stopbuffer +% +% \start % TEXpage[offset=1ts] +% \showglyphs +% \switchtobodyfont[modern] \getbuffer\par +% \switchtobodyfont[erewhon] \getbuffer\par +% \switchtobodyfont[concrete] \getbuffer\par +% \switchtobodyfont[libertinus] \getbuffer\par +% \switchtobodyfont[stixtwo] \getbuffer\par +% \switchtobodyfont[kpfonts] \getbuffer\par +% \switchtobodyfont[minion] \getbuffer\par +% \switchtobodyfont[schola] \getbuffer\par +% \switchtobodyfont[lucida] \getbuffer\par +% \switchtobodyfont[xcharter] \getbuffer\par +% \switchtobodyfont[libertinus] \getbuffer\par +% \switchtobodyfont[termes] \getbuffer\par +% \stop %TEXpage + \installcorenamespace{mathaccents} \installcommandhandler \??mathaccents {mathaccent} \??mathaccents @@ -166,7 +195,7 @@ \definemathtopaccent[\v!top][acute] ["0301] \definemathtopaccent[\v!top][hat] ["0302] \definemathtopaccent[\v!top][tilde] ["0303] -\definemathtopaccent[\v!top][bar] ["0304] +\definemathtopaccent[\v!top][bar] ["0305] %definemathtopaccent[\v!top][overbar] ["0305]% We expect overbar to stretch, so later \definemathtopaccent[\v!top][breve] ["0306] \definemathtopaccent[\v!top][dot] ["0307] diff --git a/tex/context/base/mkxl/math-act.lmt b/tex/context/base/mkxl/math-act.lmt index 4a46baff9..e8310ef2b 100644 --- a/tex/context/base/mkxl/math-act.lmt +++ b/tex/context/base/mkxl/math-act.lmt @@ -296,7 +296,7 @@ local function report_tweak(fmt,target,original,...) metadata and metadata.fontname or "unknown", parameters.size or 655360, parameters.mathsize or 1, - string.formatters[fmt](...) + formatters[fmt](...) ) else print("something is wrong") @@ -1701,7 +1701,8 @@ do accent = { [0x0300] = over, -- widegrave [0x0308] = over, -- wideddot - [0x0304] = over, -- widebar + [0x0304] = over, -- macron (bar) + [0x0305] = over, -- widebar [0x0301] = over, -- wideacute [0x0302] = over, -- widehat [0x030C] = over, -- widecheck @@ -2116,7 +2117,7 @@ do local force = false experiments.register("math.arrows", function(v) force = v end) local function tighten(target,unicode,left,right,squeeze,yoffset) - local name = string.formatters["math tightened %U %.3N %.3N %.3N %.3N"](unicode,left,right,squeeze,yoffset) + local name = formatters["math tightened %U %.3N %.3N %.3N %.3N"](unicode,left,right,squeeze,yoffset) local slot = privateslot(target,name) if not slot then local characters = target.characters @@ -2654,17 +2655,17 @@ do -- see pagella for an extensive example local nps = fonts.helpers.newprivateslot local mapping = { - [0x0300] = { 0x0060, false, nps("flat 0x0060 1") }, - [0x0308] = { 0x00A8, false, nps("flat 0x00A8 1") }, - [0x0304] = { 0x00AF, false, nps("flat 0x00AF 1") }, - [0x0301] = { 0x00B4, false, nps("flat 0x00B4 1") }, - [0x0302] = { 0x02C6, true, nps("flat 0x02C6 1") }, - [0x030C] = { 0x02C7, true, nps("flat 0x02C7 1") }, - [0x0306] = { 0x02D8, false, nps("flat 0x02D8 1") }, - [0x0307] = { 0x02D9, false, nps("flat 0x02D9 1") }, - [0x030A] = { 0x02DA, false, nps("flat 0x02DA 1") }, - [0x0303] = { 0x02DC, true, nps("flat 0x02DC 1") }, - [0x20DB] = { 0x20DB, false, nps("flat 0x20DB 1") }, + [0x0300] = { 0x0060, false }, + [0x0308] = { 0x00A8, false }, + [0x0304] = { 0x00AF, false }, -- 305 + [0x0301] = { 0x00B4, false }, + [0x0302] = { 0x02C6, true }, + [0x030C] = { 0x02C7, true }, + [0x0306] = { 0x02D8, false }, + [0x0307] = { 0x02D9, false }, + [0x030A] = { 0x02DA, false }, + [0x0303] = { 0x02DC, true }, + [0x20DB] = { 0x20DB, false }, } datasets.fixaccents = mapping @@ -2686,6 +2687,15 @@ do -- see pagella for an extensive example stretchingdata.advance = 0 stretchingdata.topanchor = topanchor stretchingdata.commands = { rightcommand[width + topanchor], charcommand[stretching] } +-- local flat = stretchingdata.flataccent +-- if flat then +-- -- Nasty! xoffset needed. Check this when we patch vf. +-- local flatdata = characters[flat] +-- flatdata.width = width +-- flatdata.advance = 0 +-- flatdata.topanchor = topanchor +-- flatdata.xoffset = width + topanchor +-- end if not trace_tweaking then done = true elseif done then @@ -2753,20 +2763,23 @@ do -- see pagella for an extensive example -- offset factor 0.9|calculated -- squeeze factor 0.1|calculated + local f_flat = formatters["flat accent %05X"] + function mathtweaks.flattenaccents(target,original,parameters) local characters = target.characters local force = parameters.force - local squeeze = parameters.squeeze or 0.8 - local ofactor = parameters.offset or (squeeze/2) + local squeeze = parameters.squeeze or 0.85 + local ofactor = parameters.offset or (squeeze/8.5) local hfactor = parameters.height or (1 - ofactor) local done = false for stretching, entry in sortedhash(mapping) do + local code = stretching local last = characters[stretching] while last do if force or not last.flataccent then - local slot = entry[3] + local slot = nps(f_flat(code)) local data = copytable(last) - local height = data.height or 0 + local height = data.height or 0 data.effect = { squeeze = squeeze } data.height = hfactor * height data.yoffset = ofactor * height @@ -2780,9 +2793,9 @@ do -- see pagella for an extensive example done = { [stretching] = true } end end - local n = last.next - if n then - last = characters[n] + code = last.next + if code then + last = characters[code] else break end diff --git a/tex/context/base/mkxl/math-fen.mkxl b/tex/context/base/mkxl/math-fen.mkxl index a69cafb97..a01f589e5 100644 --- a/tex/context/base/mkxl/math-fen.mkxl +++ b/tex/context/base/mkxl/math-fen.mkxl @@ -981,7 +981,11 @@ \protected\def\math_choosemathbig_math#1#2% so we accept \big{||} as well {\math_fenced_force_size\bigmathdelimitervariant{#1}\relax - \Uvextensible#2\relax + \Uvextensible + \s!axis + \s!exact + #2% + \relax \c_attr_mathsize\attributeunsetvalue} \protected\def\math_choosemathbig_text#1#2% so we accept \big{||} as well @@ -996,7 +1000,11 @@ \permanent\protected\def\mathdelimiterstep#1#2% not used, only in example {\begingroup \math_fenced_force_size\plusone{#1}% - \Uvextensible#2\relax + \Uvextensible + \s!axis + \s!exact + #2% + \relax \endgroup} \definemathcommand [big] {\choosemathbig1} diff --git a/tex/context/base/mkxl/math-ini.mkxl b/tex/context/base/mkxl/math-ini.mkxl index 6f2dfc1c2..2529890d7 100644 --- a/tex/context/base/mkxl/math-ini.mkxl +++ b/tex/context/base/mkxl/math-ini.mkxl @@ -1422,20 +1422,20 @@ \inherited\setmathspacing \mathtextpunctuationcode \mathdifferentialcode \allmathstyles \mathinterwordmuskip \inherited\setmathspacing \mathtextpunctuationcode \mathpunctuationcode \allmathstyles \mathinterwordmuskip % - \inherited\setmathspacing \mathordinarycode \mathtextpunctuationcode \allmathstyles \tinymuskip - \inherited\setmathspacing \mathoperatorcode \mathtextpunctuationcode \allmathstyles \tinymuskip - \inherited\setmathspacing \mathbinarycode \mathtextpunctuationcode \allmathstyles \tinymuskip - \inherited\setmathspacing \mathrelationcode \mathtextpunctuationcode \allmathstyles \tinymuskip - \inherited\setmathspacing \mathopencode \mathtextpunctuationcode \allmathstyles \tinymuskip - \inherited\setmathspacing \mathmiddlecode \mathtextpunctuationcode \allmathstyles \tinymuskip - \inherited\setmathspacing \mathclosecode \mathtextpunctuationcode \allmathstyles \tinymuskip - \inherited\setmathspacing \mathpunctuationcode \mathtextpunctuationcode \allmathstyles \tinymuskip - \inherited\setmathspacing \mathconstructcode \mathtextpunctuationcode \allmathstyles \tinymuskip - \inherited\setmathspacing \mathellipsiscode \mathtextpunctuationcode \allmathstyles \tinymuskip - \inherited\setmathspacing \mathfractioncode \mathtextpunctuationcode \allmathstyles \tinymuskip - \inherited\setmathspacing \mathradicalcode \mathtextpunctuationcode \allmathstyles \tinymuskip - \inherited\setmathspacing \mathdifferentialcode \mathtextpunctuationcode \allmathstyles \tinymuskip - \inherited\setmathspacing \mathpunctuationcode \mathtextpunctuationcode \allmathstyles \tinymuskip + \inherited\setmathspacing \mathordinarycode \mathtextpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathoperatorcode \mathtextpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathbinarycode \mathtextpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathrelationcode \mathtextpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathopencode \mathtextpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathmiddlecode \mathtextpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathclosecode \mathtextpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathpunctuationcode \mathtextpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathconstructcode \mathtextpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathellipsiscode \mathtextpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathfractioncode \mathtextpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathradicalcode \mathtextpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathdifferentialcode \mathtextpunctuationcode \allmathstyles \pettymuskip + \inherited\setmathspacing \mathpunctuationcode \mathtextpunctuationcode \allmathstyles \pettymuskip \stopsetups \directsetup{math:spacing:default} diff --git a/tex/context/base/mkxl/math-noa.lmt b/tex/context/base/mkxl/math-noa.lmt index f64783ed9..ef75ac4c4 100644 --- a/tex/context/base/mkxl/math-noa.lmt +++ b/tex/context/base/mkxl/math-noa.lmt @@ -881,52 +881,49 @@ do local method = div(a,100) local size = a % 100 setattr(pointer,a_mathsize,0) - local delimiter = getdelimiter(pointer) - if delimiter then - local oldchar, font, fam = getcharspec(delimiter) - if oldchar > 0 and font > 0 then - local ht = getheight(pointer) - local dp = getdepth(pointer) - local data = fontdata[font] - local characters = data.characters - local olddata = characters[oldchar] - if olddata then --- local oldheight = olddata.height or 0 --- local olddepth = olddata.depth or 0 - local template = olddata.varianttemplate - local newchar = mathematics.big(data,template or oldchar,size,method) - local newdata = characters[newchar] - local newheight = newdata.height or 0 - local newdepth = newdata.depth or 0 - if template then --- local ratio = (newheight + newdepth) / (oldheight + olddepth) --- setheight(pointer,ratio * oldheight) --- setdepth(pointer,ratio * olddepth) - setheight(pointer,newheight) - setdepth(pointer,newdepth) - if not olddata.extensible then - -- check this on bonum and antykwa - setoptions(pointer,0) - end - if trace_fences then --- report_fences("replacing %C using method %a, size %a, template %C and ratio %.3f",newchar,method,size,template,ratio) - report_fences("replacing %C using method %a, size %a and template %C",newchar,method,size,template) - end - else - -- 1 scaled point is a signal, for now - if ht == 1 then + if size ~= 0 then + local delimiter = getdelimiter(pointer) + if delimiter then + local oldchar, font, fam = getcharspec(delimiter) + if oldchar > 0 and font > 0 then + local ht = getheight(pointer) + local dp = getdepth(pointer) + local data = fontdata[font] + local characters = data.characters + local olddata = characters[oldchar] + if olddata then + local template = olddata.varianttemplate + local newchar = mathematics.big(data,template or oldchar,size,method) + local newdata = characters[newchar] + local newheight = newdata.height or 0 + local newdepth = newdata.depth or 0 + if template then setheight(pointer,newheight) - end - if dp == 1 then setdepth(pointer,newdepth) + if not olddata.extensible then + -- check this on bonum and antykwa + setoptions(pointer,0) + end + setoptions(pointer,getoptions(pointer)| tex.noadoptioncodes.scale ) + if trace_fences then + report_fences("replacing %C using method %a, size %a and template %C",newchar,method,size,template) + end + else + -- 1 scaled point is a signal, for now + if ht == 1 then + setheight(pointer,newheight) + end + if dp == 1 then + setdepth(pointer,newdepth) + end + setchar(delimiter,newchar) + if trace_fences then + report_fences("replacing %C by %C using method %a and size %a",oldchar,char,method,size) + end end - setchar(delimiter,newchar) - if trace_fences then - report_fences("replacing %C by %C using method %a and size %a",oldchar,char,method,size) - end + elseif trace_fences then + report_fences("not replacing %C using method %a and size %a",oldchar,method,size) end - elseif trace_fences then - report_fences("not replacing %C using method %a and size %a",oldchar,method,size) end end end @@ -1556,18 +1553,22 @@ do local attributes = mathalternates.attributes local registered = mathalternates.registered local hashes = mathalternates.hashes + local newchar = nil for i=1,#registered do local r = registered[i] if (a & r) ~= 0 then - local char = getchar(pointer) + local char = newchar or getchar(pointer) local alt = hashes[i][char] if alt == nil then local what = attributes[r] +local list = what.list +if not list or list[char] then alt = otf.getalternate(fontdata[fontid],char,what.feature,what.value) or false if alt == char then alt = false end hashes[i][char] = alt +end end if alt then if trace_alternates then @@ -1575,11 +1576,15 @@ do report_alternates("alternate %a, value %a, replacing glyph %U by glyph %U", tostring(what.feature),tostring(what.value),char,alt) end - setchar(pointer,alt) - break + -- setchar(pointer,alt) + -- break + newchar = alt end end end + if newchar then + setchar(pointer,newchar) + end end end end diff --git a/tex/context/base/mkxl/math-ttv.lmt b/tex/context/base/mkxl/math-ttv.lmt index 3393ecc03..06d92e8b9 100644 --- a/tex/context/base/mkxl/math-ttv.lmt +++ b/tex/context/base/mkxl/math-ttv.lmt @@ -144,7 +144,8 @@ mathencodings["tex-mr"] = { -- [0x002C7] = 0x14, -- [math]check -- [0x002D8] = 0x15, -- [math]breve -- [0x000AF] = 0x16, -- [math]bar --- [0x00021] = 0x21, -- ! +[0x00021] = 0x21, -- ! -- MS +[0x00026] = 0x26, -- & -- MS [0x00028] = 0x28, -- ( [0x00029] = 0x29, -- ) [0x0002B] = 0x2B, -- + diff --git a/tex/context/base/mkxl/math-vfu.lmt b/tex/context/base/mkxl/math-vfu.lmt index 1639517b5..237b39d9f 100644 --- a/tex/context/base/mkxl/math-vfu.lmt +++ b/tex/context/base/mkxl/math-vfu.lmt @@ -745,6 +745,7 @@ local function copy_glyph(main,target,original,unicode,slot) kerns = olddata.kerns, mathkerns = olddata.mathkerns, tounicode = olddata.tounicode, +-- smaller = olddata.smaller, commands = { slotcommand[slot][unicode] }, } local glyphdata = newdata @@ -1058,7 +1059,7 @@ function vfmath.define(specification,set,goodies) mathparameters.axisheight = newparameters[22] or 0 -- axisheight : height of fraction lines above the baseline -- report_virtual("loading and virtualizing font %a at size %p, setting sy parameters",name,size) end - -- We no longer care about kerns and ligatures here. We use backmack because we need to know + -- We no longer care about kerns and ligatures here. We use backmap because we need to know -- the original order and the loader has made a unicode font of it and weird glyph names have -- spoiled that a bit too. if ss.overlay then diff --git a/tex/context/base/mkxl/node-dir.lmt b/tex/context/base/mkxl/node-dir.lmt index 246bf34e4..5692fddb7 100644 --- a/tex/context/base/mkxl/node-dir.lmt +++ b/tex/context/base/mkxl/node-dir.lmt @@ -14,7 +14,8 @@ local hlist_code = nodecodes.hlist local vlist_code = nodecodes.vlist local normaldir_code = nodes.dircodes.normal local line_code = nodes.listcodes.line -local lefttoright_code = nodes.dirvalues.lefttoright + +local lefttoright_code = tex.directioncodes.lefttoright local getnext = nuts.getnext local getlist = nuts.getlist diff --git a/tex/context/base/mkxl/node-ini.lmt b/tex/context/base/mkxl/node-ini.lmt index 38f55c160..435f3bf7e 100644 --- a/tex/context/base/mkxl/node-ini.lmt +++ b/tex/context/base/mkxl/node-ini.lmt @@ -23,7 +23,7 @@ local allocate = utilities.storage.allocate local formatcolumns = utilities.formatters.formatcolumns local getsubtypes = node.subtypes -local getvalues = node.values +----- getvalues = node.values local listcodes = mark(getsubtypes("list")) local rulecodes = mark(getsubtypes("rule")) @@ -45,10 +45,6 @@ local choicecodes = mark(getsubtypes("choice")) local parcodes = mark(getsubtypes("par")) local attributecodes = mark(getsubtypes("attribute")) -local fillvalues = mark(getvalues("fill")) -local dirvalues = mark(getvalues("dir")) -local mathvalues = mark(getvalues("math")) - local function simplified(t) local r = { } for k, v in next, t do @@ -57,17 +53,17 @@ local function simplified(t) return r end -local noadoptions = allocate { - set = 0x08, - unused_1 = 0x00 + 0x08, - unused_2 = 0x01 + 0x08, - axis = 0x02 + 0x08, - no_axis = 0x04 + 0x08, - exact = 0x10 + 0x08, - left = 0x11 + 0x08, - middle = 0x12 + 0x08, - right = 0x14 + 0x08, -} +-- local noadoptions = allocate { +-- set = 0x08, +-- unused_1 = 0x00 + 0x08, +-- unused_2 = 0x01 + 0x08, +-- axis = 0x02 + 0x08, +-- no_axis = 0x04 + 0x08, +-- exact = 0x10 + 0x08, +-- left = 0x11 + 0x08, +-- middle = 0x12 + 0x08, +-- right = 0x14 + 0x08, +-- } local nodecodes = simplified(node.types()) @@ -90,11 +86,6 @@ choicecodes = allocate(swapped(choicecodes,choicecodes)) parcodes = allocate(swapped(parcodes,parcodes)) attributecodes = allocate(swapped(attributecodes,attributecodes)) rulecodes = allocate(swapped(rulecodes,rulecodes)) -noadoptions = allocate(swapped(noadoptions,noadoptions)) - -dirvalues = allocate(swapped(dirvalues,dirvalues)) -fillvalues = allocate(swapped(fillvalues,fillvalues)) -mathvalues = allocate(swapped(mathvalues,mathvalues)) nodes.gluecodes = gluecodes nodes.dircodes = dircodes @@ -115,24 +106,26 @@ nodes.parcodes = parcodes nodes.attributecodes = attributecodes nodes.rulecodes = rulecodes -nodes.noadoptions = noadoptions -nodes.fillvalues = fillvalues -nodes.fillcodes = fillvalues -- for now -nodes.dirvalues = dirvalues -nodes.mathvalues = mathvalues +nodes.nodecodes = nodecodes + +-- these are now in tex namespace but we keep them for old times sake -nodes.nodecodes = nodecodes +nodes.fillvalues = tex.fillcodes +nodes.fillcodes = tex.fillcodes +nodes.dirvalues = tex.directioncodes +nodes.directionvalues = tex.directioncodes +nodes.mathvalues = tex.mathparametercodes -- we will transition to more verbose subtypes (after other math is done) -noadcodes.ord = noadcodes.ord or noadcodes.ordinary -noadcodes.operator = noadcodes.op or noadcodes.operator -noadcodes.bin = noadcodes.bin or noadcodes.binary -noadcodes.rel = noadcodes.rel or noadcodes.relation -noadcodes.punct = noadcodes.punct or noadcodes.punctuation -noadcodes.rad = noadcodes.rad or noadcodes.radical -noadcodes.frac = noadcodes.frac or noadcodes.fraction -noadcodes.acc = noadcodes.acc or noadcodes.accent +noadcodes.ord = noadcodes.ord or noadcodes.ordinary +noadcodes.operator = noadcodes.op or noadcodes.operator +noadcodes.bin = noadcodes.bin or noadcodes.binary +noadcodes.rel = noadcodes.rel or noadcodes.relation +noadcodes.punct = noadcodes.punct or noadcodes.punctuation +noadcodes.rad = noadcodes.rad or noadcodes.radical +noadcodes.frac = noadcodes.frac or noadcodes.fraction +noadcodes.acc = noadcodes.acc or noadcodes.accent -- so for now: @@ -188,8 +181,6 @@ nodes.skipcodes = gluecodes nodes.directioncodes = dircodes nodes.discretionarycodes = disccodes -nodes.directionvalues = dirvalues - glyphcodes.glyph = glyphcodes.character gluecodes.parfillrightskip = gluecodes.parfillrightskip or gluecodes.parfillskip @@ -201,18 +192,6 @@ listcodes.column = listcodes.alignment kerncodes.kerning = kerncodes.fontkern kerncodes.italiccorrection = kerncodes.italiccorrection or 1 -- new -nodes.noadoptions = { - set = 0x08, - unused_1 = 0x00 + 0x08, - unused_2 = 0x01 + 0x08, - axis = 0x02 + 0x08, - no_axis = 0x04 + 0x08, - exact = 0x10 + 0x08, - left = 0x11 + 0x08, - middle = 0x12 + 0x08, - right = 0x14 + 0x08, -} - -- We use the real node code numbers. local texsetintegervalue = tex.setintegervalue diff --git a/tex/context/base/mkxl/node-ref.lmt b/tex/context/base/mkxl/node-ref.lmt index 15c35cba9..18bda16e9 100644 --- a/tex/context/base/mkxl/node-ref.lmt +++ b/tex/context/base/mkxl/node-ref.lmt @@ -96,9 +96,9 @@ local nodecodes = nodes.nodecodes local gluecodes = nodes.gluecodes local listcodes = nodes.listcodes -local dirvalues = nodes.dirvalues -local lefttoright_code = dirvalues.lefttoright -local righttoleft_code = dirvalues.righttoleft +local directioncodes = tex.directioncodes +local lefttoright_code = directioncodes.lefttoright +local righttoleft_code = directioncodes.righttoleft local hlist_code = nodecodes.hlist local vlist_code = nodecodes.vlist @@ -689,7 +689,8 @@ do local function setdestination(n,h,d,name,view) -- n = grouplevel, name == table topofstack = topofstack + 1 - stack[topofstack] = { n, h, d, name, view } + -- stack[topofstack] = { n, h, d, name, view } + stack[topofstack] = { n, h or false, d or false, name, view } return topofstack end diff --git a/tex/context/base/mkxl/node-res.lmt b/tex/context/base/mkxl/node-res.lmt index 2d2c31965..b514a3568 100644 --- a/tex/context/base/mkxl/node-res.lmt +++ b/tex/context/base/mkxl/node-res.lmt @@ -174,7 +174,7 @@ local cleader = register_nut(copy_nut(glue)) setsubtype(cleader,glueco -- the dir field needs to be set otherwise crash: -local lefttoright_code = nodes.dirvalues.lefttoright +local lefttoright_code = tex.directioncodes.lefttoright local rule = register_nut(new_nut(rule_code)) -- setdirection(rule, lefttoright_code) local emptyrule = register_nut(new_nut(rule_code,rulecodes.empty)) -- setdirection(rule, lefttoright_code) diff --git a/tex/context/base/mkxl/node-tra.lmt b/tex/context/base/mkxl/node-tra.lmt index fe212f787..4aa476ce5 100644 --- a/tex/context/base/mkxl/node-tra.lmt +++ b/tex/context/base/mkxl/node-tra.lmt @@ -65,7 +65,7 @@ local new_rule = nutpool.rule local nodecodes = nodes.nodecodes local whatsitcodes = nodes.whatsitcodes -local fillcodes = nodes.fillcodes +local fillcodes = tex.fillcodes local subtypes = nodes.subtypes diff --git a/tex/context/base/mkxl/phys-dim.mkxl b/tex/context/base/mkxl/phys-dim.mkxl index 1d5e7fff6..2dc6e7e1e 100644 --- a/tex/context/base/mkxl/phys-dim.mkxl +++ b/tex/context/base/mkxl/phys-dim.mkxl @@ -706,9 +706,16 @@ \fi :} +% \permanent\protected\def\unitsSOLIDUS +% {\ifnum\c_phys_units_state=\plusone % suffix +% \unitsbackspace +% \fi +% {/}% +% }%\unitsbackspace} + \permanent\protected\def\unitsSOLIDUS {\ifnum\c_phys_units_state=\plusone % suffix - \unitsbackspace + \ifmmode\else\unitsbackspace\fi % we have advanced solidus handling in math \fi {/}% }%\unitsbackspace} diff --git a/tex/context/base/mkxl/spac-ali.lmt b/tex/context/base/mkxl/spac-ali.lmt index 9fa024672..0eeda643a 100644 --- a/tex/context/base/mkxl/spac-ali.lmt +++ b/tex/context/base/mkxl/spac-ali.lmt @@ -22,7 +22,8 @@ local takeattr = nuts.takeattr local getwidth = nuts.getwidth local findtail = nuts.tail -local righttoleft_code = nodes.dirvalues.righttoleft +local righttoleft_code = tex.directioncodes.righttoleft + local linelist_code = nodes.listcodes.line local hpack_nodes = nuts.hpack diff --git a/tex/context/base/mkxl/strc-lst.lmt b/tex/context/base/mkxl/strc-lst.lmt index d54129f29..312a815cd 100644 --- a/tex/context/base/mkxl/strc-lst.lmt +++ b/tex/context/base/mkxl/strc-lst.lmt @@ -37,7 +37,8 @@ local conditionals = tex.conditionals local ctx_latelua = context.latelua -local cheat = true +----- cheat = true -- fragile when we have a multi-component document with cross references +local cheat = false -- so this will become a directive or maybe even just an experiment local structures = structures local lists = structures.lists @@ -259,27 +260,34 @@ function lists.addto(t) -- maybe more more here (saves parsing at the tex end) numberdata.numbers = cached[groupindex].numberdata.numbers end end - local setcomponent = references.setcomponent - if setcomponent then - setcomponent(t) -- can be inlined - end + -- +-- local setcomponent = references.setcomponent +-- if setcomponent then +-- setcomponent(t) -- can be inlined, will be replaced by setstructure below +-- end + -- local r = t.references - if r and not r.section then - r.section = structures.sections.currentid() - end - local b = r and t.block - if r and not b then - local s = r.section - if s then - s = structures.sections.tobesaved[s] - r.block = s and s.block or nil - end - end local i = r and r.internal or 0 -- brrr - if r and kind and name then - local tag = tags.getid(kind,name) - if tag and tag ~= "?" then - r.tag = tag -- todo: use internal ... is unique enough + if r then + if not r.section then + r.section = structures.sections.currentid() + end + if not r.structure then + r.structure = resolvers.jobs.currentstructure() + end + local b = r and t.block + if not b then + local s = r.section + if s then + s = structures.sections.tobesaved[s] + r.block = s and s.block or nil + end + end + if kind and name then + local tag = tags.getid(kind,name) + if tag and tag ~= "?" then + r.tag = tag -- todo: use internal ... is unique enough + end end end local p = pushed[i] @@ -597,7 +605,7 @@ filters[v_intro] = function(specification) return result end -filters[v_reference] = function(specification) +filters[v_reference] = function(specification) -- this will go away local collected = specification.collected local result = { } local nofresult = 0 @@ -954,7 +962,6 @@ filters[v_default] = function(specification) -- is named for i=1,#collected do local v = collected[i] local r = v.references --- inspect(v) if r and (not block or not r.block or pblock == r.block) then local sectionnumber = sections[r.section] if sectionnumber then @@ -1016,10 +1023,9 @@ function lists.process(specification) local references = listentry.references local special = specials and numberdata and specials[zerostrippedconcat(numberdata.numbers,".")] or "" local view = usedviews[i] - -- if cheat and references then - -- -- HH: I still need to test this patch: +-- if cheat and references and cheats[view] then if cheat and references and view and cheats[view] then - -- this permits runs=2 with interactivity + -- this permits runs=2 with interactivity local internal = references.internal usedinternals[internal] = true usedviews [internal] = references.view @@ -1591,6 +1597,12 @@ function lists.integrate(utilitydata) -- references.internal = nil -- references.realpage = nil -- references.section = nil + if references.view then + references.view = nil + end + if references.used then + references.used = nil + end if references.x then references.x = nil end diff --git a/tex/context/base/mkxl/strc-ref.lmt b/tex/context/base/mkxl/strc-ref.lmt index 945364b18..6a320f141 100644 --- a/tex/context/base/mkxl/strc-ref.lmt +++ b/tex/context/base/mkxl/strc-ref.lmt @@ -30,6 +30,7 @@ local trace_referencing = false trackers.register("structures.referencing", local trace_analyzing = false trackers.register("structures.referencing.analyzing", function(v) trace_analyzing = v end) local trace_identifying = false trackers.register("structures.referencing.identifying", function(v) trace_identifying = v end) local trace_importing = false trackers.register("structures.referencing.importing", function(v) trace_importing = v end) +local trace_external = false trackers.register("structures.referencing.external", function(v) trace_external = v end) local trace_empty = false trackers.register("structures.referencing.empty", function(v) trace_empty = v end) local check_duplicates = true @@ -39,6 +40,7 @@ directives.register("structures.referencing.checkduplicates", function(v) check_ local report_references = logs.reporter("references") local report_identifying = logs.reporter("references","identifying") local report_importing = logs.reporter("references","importing") +local report_external = logs.reporter("references","external") local report_empty = logs.reporter("references","empty") local report = report_references @@ -174,6 +176,11 @@ local function initializer() -- can we use a tobesaved as metatable for collecte if i then internals[i] = data usedinternals[i] = r.used + local structure = r.structure + if structure then + structure = resolvers.jobs.namelist(structure,namestack) + r.namestack = structure + end end end end @@ -347,26 +354,37 @@ local function currentorder(kind,name) return orders[kind] and orders[kind][name] or lastorder end -local function setcomponent(data) - -- we might consider doing this at the tex end, just like prefix - local component = productcomponent() - if component then - local references = data and data.references - if references then - references.component = component - if references.prefix == component then - references.prefix = nil - end - end - return component - end - -- but for the moment we do it here (experiment) -end +-- local function setstructure(data) +-- local structure = resolvers.jobs.currentnamehash() +-- if structure then +-- local references = data and data.references +-- if references then +-- references.structure = structure +-- end +-- end +-- end + +-- local function setcomponent(data) +-- -- we might consider doing this at the tex end, just like prefix +-- local component = productcomponent() -- todo: maybe a list +-- -- local component = resolvers.jobs.currentcomponent() +-- if component then +-- local references = data and data.references +-- if references then +-- references.component = component +-- if references.prefix == component then +-- references.prefix = nil +-- end +-- end +-- return component +-- end +-- end references.setnextorder = setnextorder references.setnextinternal = setnextinternal references.currentorder = currentorder -references.setcomponent = setcomponent +references.setstructure = resolvers.jobs.currentstructure -- yes or no here +----------.setcomponent = setcomponent -- implement { -- name = "setnextreferenceorder", @@ -405,6 +423,9 @@ function references.set(data) -- report_references("invalid reference") -- harmless return 0 end + -- + references.structure = resolvers.jobs.currentstructure() + -- local prefix = references.prefix or "" local pd = tobesaved[prefix] -- nicer is a metatable if not pd then @@ -497,31 +518,82 @@ implement { -- no metatable here .. better be sparse -local function register_from_list(collected,derived,external) +local function register_from_list(collected,derived,external,namestack) local derived_g = derived[""] -- global local derived_p = nil local derived_c = nil local prefix = nil - local component = nil +-- local component = nil local entry = nil if not derived_g then derived_g = { } derived[""] = derived_g end - local function action(s) - if trace_referencing then - report_references("list entry %a provides %a reference %a on realpage %a",i,kind,s,realpage) - end - if derived_p and not derived_p[s] then - derived_p[s] = entry - end - if derived_c and not derived_c[s] then - derived_c[s] = entry + local action = trace_external and + function(s) + if structure then + for i=1,#structure do + local si = structure[i] + -- if si == component then + -- -- skipped + -- elseif si == prefix then + -- -- skipped + -- else + local ds = derived[si] + if not ds then + derived[si] = { [s] = entry } + report_external("reference %a, %s %a",s,"structure",si) + elseif not ds[s] then + ds[s] = entry + report_external("reference %a, %s %a",s,"structure",si) + end + -- end + end + end + if derived_p and not derived_p[s] then + report_external("reference %a, %s %a",s,"prefix",prefix) + derived_p[s] = entry + + end +-- if derived_c and not derived_c[s] then +-- report_external("reference %a, %s %a",s,"component",component) +-- derived_c[s] = entry +-- end + if not derived_g[s] then + report_external("reference %a, %s %a",s,"global","") + derived_g[s] = entry -- first wins + end end - if not derived_g[s] then - derived_g[s] = entry -- first wins + or + function(s) + if derived_p and not derived_p[s] then + derived_p[s] = entry + end +-- if derived_c and not derived_c[s] then +-- derived_c[s] = entry +-- end + if not derived_g[s] then + derived_g[s] = entry -- first wins + end + if structure then + for i=1,#structure do + local si = structure[i] + if si == component then + -- skipped + elseif si == prefix then + -- skipped + else + local ds = derived[si] + if not ds then + derived[si] = { [s] = entry } + elseif not ds[s] then + ds[s] = entry + end + end + end + end end - end + -- for i=1,#collected do entry = collected[i] local metadata = entry.metadata @@ -535,20 +607,32 @@ local function register_from_list(collected,derived,external) local realpage = references.realpage if realpage then prefix = references.prefix - component = references.component +-- component = references.component if prefix and prefix ~= "" then derived_p = derived[prefix] if not derived_p then derived_p = { } derived[prefix] = derived_p end + else + derived_p = nil end - if component and component ~= "" and component ~= prefix then - derived_c = derived[component] - if not derived_c then - derived_c = { } - derived[component] = derived_c - end +-- if component and component ~= "" and component ~= prefix then +-- derived_c = derived[component] +-- if not derived_c then +-- derived_c = { } +-- derived[component] = derived_c +-- end +-- else +-- derived_c = nil +-- end + structure = references.structure + if structure then + structure = resolvers.jobs.namelist(structure,namestack) + references.namestack = structure + end + if trace_referencing or trace_external then + report_references("list entry %a provides %a reference %a on realpage %a",i,kind,reference,realpage) end process_settings(reference,action) end @@ -567,7 +651,7 @@ function references.integrate(utilitydata) if structures then local lists = structures.lists.collected if lists then - register_from_list(lists,derived,filename) + register_from_list(lists,derived,filename,utilitydata) end end end @@ -575,7 +659,7 @@ end references.registerinitializer(function() -- the main document - register_from_list(lists.collected,derived) + register_from_list(lists.collected,derived) -- false, false end) -- tracing @@ -652,10 +736,10 @@ end) -- urls -local urls = references.urls or { } -references.urls = urls -local urldata = urls.data or { } -urls.data = urldata +local urls = references.urls or { } +references.urls = urls +local urldata = urls.data or { } +urls.data = urldata local p_untexurl = Cs ( ( P("\\")/"" * (P("%")/"%%" + P(1)) @@ -1097,13 +1181,6 @@ local function loadexternalreferences(name,utilitydata) target = { } external[prefix] = target end - -- for s in gmatch(reference,"%s*([^,]+)") do - -- if trace_importing then - -- report_importing("registering %s reference, kind %a, name %a, prefix %a, reference %a", - -- "external",kind,name,prefix,s) - -- end - -- target[s] = target[s] or entry - -- end local function action(s) if trace_importing then report_importing("registering %s reference, kind %a, name %a, prefix %a, reference %a", @@ -1147,7 +1224,7 @@ setmetatableindex(externals, function(t,k) -- either or not automatically return false end) -local productdata = allocate { +local productdata = allocate { -- will go productreferences = { }, componentreferences = { }, components = { }, @@ -1196,6 +1273,13 @@ local function loadproductreferences(productname,componentname,utilitydata) if kind and realpage then local prefix = references.prefix or "" local component = references.component + + -- local structure = references.structure + -- print("!!!!!!!!",structure) + -- if structure then + -- inspect(resolvers.job.namelist(structure)) + -- end + local ctarget, ptarget if not component or component == componentname then -- skip @@ -1327,7 +1411,7 @@ function references.loadpresets(product,component) -- we can consider a special loadproductvariables (product,component,utilitydata) loadproductcomponents(product,component,utilitydata) loadproductreferences(product,component,utilitydata) --- loadproductcomponents(product,component,utilitydata) + -- loadproductcomponents(product,component,utilitydata) end end end @@ -1483,11 +1567,20 @@ end -- foo:bar -> foo == prefix (first we try the global one) -- -:bar -> ignore prefix -local function finish_inner(var,p,i) - var.kind = "inner" +local function finish_inner(set,var,p,i) + local external = i.references.external + local realpage = (i.references and i.references.realpage) or (i.pagedata and i.pagedata.realpage) or 1 + if external then + var.kind = "outer with inner" + var.external = true + var.outer = external + set.external = true -- probably not needed + else + var.kind = "inner" + var.p = p + end + var.r = realpage var.i = i - var.p = p - var.r = (i.references and i.references.realpage) or (i.pagedata and i.pagedata.realpage) or 1 return var end @@ -1506,7 +1599,7 @@ local function identify_inner(set,var,prefix,collected,derived) if i then i = i[splitinner] if i then - return finish_inner(var,"",i) + return finish_inner(set,var,"",i) end end end @@ -1514,7 +1607,7 @@ local function identify_inner(set,var,prefix,collected,derived) if i then i = i[splitinner] if i then - return finish_inner(var,splitprefix,i) + return finish_inner(set,var,splitprefix,i) end end if derived then @@ -1522,11 +1615,13 @@ local function identify_inner(set,var,prefix,collected,derived) -- using the prefix that is active at this moment (so we overload the given -- these are taken from other data structures (like lists) if splitprefix == "-" then +-- loop over the current structure list reversed +-- and end with "" .. needs example local i = derived[""] if i then i = i[splitinner] if i then - return finish_inner(var,"",i) + return finish_inner(set,var,"",i) end end end @@ -1534,7 +1629,7 @@ local function identify_inner(set,var,prefix,collected,derived) if i then i = i[splitinner] if i then - return finish_inner(var,splitprefix,i) + return finish_inner(set,var,splitprefix,i) end end end @@ -1545,7 +1640,7 @@ local function identify_inner(set,var,prefix,collected,derived) if i then i = i[inner] if i then - return finish_inner(var,prefix,i) + return finish_inner(set,var,prefix,i) end end if not i and derived then @@ -1554,7 +1649,22 @@ local function identify_inner(set,var,prefix,collected,derived) if i then i = i[inner] if i then - return finish_inner(var,prefix,i) + return finish_inner(set,var,prefix,i) + end + end + -- + local n, list = resolvers.jobs.currentstructure() + if list then + for i=#list,1,-1 do + local l = list[i] + local i = derived[l] + if i then + i = i[inner] + if i then + -- return finish_inner(set,var,"",i) + return finish_inner(set,var,l,i) + end + end end end end @@ -1571,10 +1681,7 @@ local function unprefixed_inner(set,var,prefix,collected,derived,tobesaved) (derived and derived [""] and derived [""][inner]) or (tobesaved and tobesaved[""] and tobesaved[""][inner]) if i then - var.kind = "inner" - var.p = "" - var.i = i - var.r = (i.references and i.references.realpage) or (i.pagedata and i.pagedata.realpage) or 1 + finish_inner(set,var,"",i) else var.error = "unknown inner or special" end @@ -1611,13 +1718,13 @@ local function identify_auto(set,var,i) end end -- escape from prefix --- local pdata = odata[""] --- if pdata then --- local r = pdata[inner] --- if r then --- return okay(o,"2h") --- end --- end + -- local pdata = odata[""] + -- if pdata then + -- local r = pdata[inner] + -- if r then + -- return okay(o,"2h") + -- end + -- end else for p, pdata in sortedhash(odata) do local r = pdata[inner] @@ -1765,7 +1872,6 @@ end local function identify_inner_or_outer(set,var,i) -- here we fall back on product data local inner = var.inner - if inner and inner ~= "" then -- first we look up in collected and derived using the current prefix @@ -1780,7 +1886,8 @@ local function identify_inner_or_outer(set,var,i) return v end - if var.inner == var.reference and identify_auto(set,var,i) and var.outer and var.outer ~= "" then +-- if var.inner == var.reference and identify_auto(set,var,i) and var.outer and var.outer ~= "" then + if var.inner == var.reference and var.outer and var.outer ~= "" then return identify_outer(set,var,i) end @@ -1804,7 +1911,6 @@ local function identify_inner_or_outer(set,var,i) end -- as a last resort we will consult the global lists - local v = unprefixed_inner(set,var,"",collected,derived,tobesaved) if v then if trace_identifying then @@ -1873,6 +1979,7 @@ local function identify_inner_or_outer(set,var,i) end end end + var.error = "unknown inner" else var.error = "no inner" @@ -1896,40 +2003,51 @@ local function identify_inner_component(set,var,i) return var end +local function identify_outer_component_step(set,var,vi,i,component,where) + if vi then + var.outer = component + var.i = vi + var.kind = "outer with inner" + set.external = true + if trace_identifying then + report_identify_outer(set,var,i,where) + end + return true + end +end + local function identify_outer_component(set,var,i) local component = var.component - local inner = var.inner + local inner = var.inner + -- local data = productdata.componentreferences[component] if data then local d = data[""] - local vi = d and d[inner] - if vi then - var.inner = inner - var.outer = component - var.i = vi - var.kind = "outer with inner" - set.external = true - if trace_identifying then - report_identify_outer(set,var,i,"6a") - end + local d = d and d[inner] + if d and identify_outer_component_step(set,var,d,i,component,"6a") then return var end end + -- local data = productdata.productreferences[component] if data then - local vi = data[inner] - if vi then - var.inner = inner - var.outer = component - var.i = vi - var.kind = "outer with inner" - set.external = true - if trace_identifying then - report_identify_outer(set,var,i,"6b") - end + local d = data[inner] + if d and identify_outer_component_step(set,var,d,i,component,"6b") then + return var + end + end + -- +if texconditionals.autocrossfilereferences then + references.loadpresets(component,component) + local data = productdata.productreferences[component] + if data then + local d = data[inner] + if d and identify_outer_component_step(set,var,d,i,component,"6c") then return var end end +end + -- var.error = "unknown component" if trace_identifying then report_identify_outer(set,var,i,"6c") @@ -1962,6 +2080,8 @@ local function identify(prefix,reference) var = identify_outer(set,var,i) elseif var.arguments then var = identify_arguments(set,var,i) +-- else +-- var = identify_inner_or_outer(set,var,i) elseif not var.component then var = identify_inner_or_outer(set,var,i) elseif productcomponent() then @@ -2691,6 +2811,7 @@ function references.analyze(actions,position,spread) actions.pagestate = checkedpagestate(actions.n,realpage,actions,position,spread) end end +-- inspect(actions) return actions end @@ -2698,6 +2819,8 @@ local function referencepagestate(position,detail,spread) local actions = references.currentset if not actions then return 0 + elseif actions.external then + return 0 else local pagestate = actions.pagestate for i=1,#actions do @@ -3067,3 +3190,32 @@ implement { name = "popreferenceprefix", actions = { popreferenceprefix, context }, -- we can use setmacro } + +-- a bit weird one, used for checkinh in the backend + +function references.pagefromhash(hash,destination,page,actions) + local r = actions[1] + if type(r) == "table" then + r = r.i + if r then + r = r.references + if r then + local structure = r.structure + if structure then + local namestack = r.namestack + if namestack then + for i=#namestack,1,-1 do + local d = namestack[i] .. ":" .. destination + page = hash[d] + if page then + destination = d + break + end + end + end + end + end + end + end + return page, destination +end diff --git a/tex/context/base/mkxl/strc-reg.lmt b/tex/context/base/mkxl/strc-reg.lmt index 27d7e2586..a8a7d0a90 100644 --- a/tex/context/base/mkxl/strc-reg.lmt +++ b/tex/context/base/mkxl/strc-reg.lmt @@ -585,8 +585,10 @@ local function storeregister(rawdata) -- metadata, references, entries rawdata.userdata = touserdata(userdata) end -- - references.section = currentid() - metadata.level = currentlevel() + references.block = structures.sections.currentblock() + references.structure = resolvers.jobs.currentstructure() + references.section = currentid() + metadata.level = currentlevel() -- local data = notsaved and collected[name] or tobesaved[name] local entries = data.entries diff --git a/tex/context/base/mkxl/supp-box.lmt b/tex/context/base/mkxl/supp-box.lmt index a5bfe1394..093cac164 100644 --- a/tex/context/base/mkxl/supp-box.lmt +++ b/tex/context/base/mkxl/supp-box.lmt @@ -481,9 +481,9 @@ local doifelse = commands.doifelse do - local dirvalues = nodes.dirvalues - local lefttoright_code = dirvalues.lefttoright - local righttoleft_code = dirvalues.righttoleft + local directioncodes = tex.directioncodes + local lefttoright_code = directioncodes.lefttoright + local righttoleft_code = directioncodes.righttoleft local function firstdirinbox(n) local b = getbox(n) diff --git a/tex/context/base/mkxl/tabl-xtb.lmt b/tex/context/base/mkxl/tabl-xtb.lmt index c475d6233..50f321c0d 100644 --- a/tex/context/base/mkxl/tabl-xtb.lmt +++ b/tex/context/base/mkxl/tabl-xtb.lmt @@ -87,7 +87,7 @@ local new_glue = nodepool.glue local new_kern = nodepool.kern local new_hlist = nodepool.hlist -local lefttoright_code = nodes.dirvalues.lefttoright +local lefttoright_code = tex.directioncodes.lefttoright local v_stretch = variables.stretch local v_normal = variables.normal diff --git a/tex/context/base/mkxl/toks-aux.lmt b/tex/context/base/mkxl/toks-aux.lmt index 83e714d77..2027ed78e 100644 --- a/tex/context/base/mkxl/toks-aux.lmt +++ b/tex/context/base/mkxl/toks-aux.lmt @@ -197,6 +197,9 @@ tex.listsigncodes = getthem(tex.getlistsignvalues, "listsigncode tex.classoptioncodes = getthem(tex.getmathclassoptionvalues, "classoptioncode") ---.alignmentcontextcodes = getthem(tex.getalignmentcontextvalues ) -- only at lua end tex.specialmathclasscodes = getthem(tex.getspecialmathclassvalues ) -- only at lua end +tex.directioncodes = getthem(tex.getdirectionvalues ) -- only at lua end (todo tex) +tex.fillcodes = getthem(tex.getfillvalues ) -- only at lua end (todo tex) +tex.mathparametercodes = getthem(tex.getmathparametervalues ) -- only at lua end (todo tex) function tex.stringtocodesbitmap(str,codes) local bitmap = 0 diff --git a/tex/context/base/mkxl/trac-inf.lmt b/tex/context/base/mkxl/trac-inf.lmt index feef3714f..649fef30b 100644 --- a/tex/context/base/mkxl/trac-inf.lmt +++ b/tex/context/base/mkxl/trac-inf.lmt @@ -304,6 +304,9 @@ local registered = false local enabled = false local finished = false +local status = status -- needed for --sandbox +local mplib = mplib -- needed for --sandbox + function statistics.showusage(when) if finished and when == "finish" then return diff --git a/tex/context/base/mkxl/trac-vis.lmt b/tex/context/base/mkxl/trac-vis.lmt index c9b68b407..9b467de29 100644 --- a/tex/context/base/mkxl/trac-vis.lmt +++ b/tex/context/base/mkxl/trac-vis.lmt @@ -760,16 +760,16 @@ end local ruleddir, ruledpar do - local dircodes = nodes.dircodes - local dirvalues = nodes.dirvalues + local dircodes = nodes.dircodes + local directioncodes = tex.directioncodes -- nodes.dirvalues - local cancel_code = dircodes.cancel - local l2r_code = dirvalues.l2r - local r2l_code = dirvalues.r2l + local cancel_code = dircodes.cancel + local l2r_code = directioncodes.l2r + local r2l_code = directioncodes.r2l - local d_cache = caches["dir"] + local d_cache = caches["dir"] - local getdirection = nuts.getdirection + local getdirection = nuts.getdirection local tags = { l2r = "L2R", @@ -1295,7 +1295,7 @@ local ruledglue, ruledmathglue do -- we sometimes pass previous as we can have issues in math (not watertight for all) - local mathvalues = nodes.mathvalues + local mathvalues = tex.mathparametercodes -- nodes.mathvalues mathvalues[-1] = "left" mathvalues[-2] = "right" diff --git a/tex/context/base/mkxl/type-set.mkxl b/tex/context/base/mkxl/type-set.mkxl index 62dd3c9ab..ae1c85ee9 100644 --- a/tex/context/base/mkxl/type-set.mkxl +++ b/tex/context/base/mkxl/type-set.mkxl @@ -180,6 +180,6 @@ \definefilesynonym [type-imp-antykwa-light.mkiv] [type-imp-antykwa.mkiv] \definefilesynonym [type-imp-antykwa-cond.mkiv] [type-imp-antykwa.mkiv] -\definefilesynonym [type-imp-antykwa-lightcond.mkiv] [type-imp-antykwa.mkiv] +\definefilesynonym [type-imp-antykwa-light-cond.mkiv] [type-imp-antykwa.mkiv] \protect \endinput diff --git a/tex/context/base/mkxl/typo-dha.lmt b/tex/context/base/mkxl/typo-dha.lmt index e1a6662c4..8671970d8 100644 --- a/tex/context/base/mkxl/typo-dha.lmt +++ b/tex/context/base/mkxl/typo-dha.lmt @@ -81,12 +81,12 @@ local glue_code = nodecodes.glue local dir_code = nodecodes.dir local par_code = nodecodes.par -local dirvalues = nodes.dirvalues -local lefttoright_code = dirvalues.lefttoright -local righttoleft_code = dirvalues.righttoleft - local parfillskip_code = gluecodes.parfillskip +local directioncodes = tex.directioncodes +local lefttoright_code = directioncodes.lefttoright +local righttoleft_code = directioncodes.righttoleft + local new_direction = nodepool.direction local insert = table.insert diff --git a/tex/context/base/mkxl/typo-duc.lmt b/tex/context/base/mkxl/typo-duc.lmt index 2e3638946..ecc1396a1 100644 --- a/tex/context/base/mkxl/typo-duc.lmt +++ b/tex/context/base/mkxl/typo-duc.lmt @@ -99,9 +99,9 @@ local penalty_code = nodecodes.penalty local parfillskip_code = gluecodes.parfillskip local parfillleftskip_code = gluecodes.parfillleftskip -local dirvalues = nodes.dirvalues -local lefttoright_code = dirvalues.lefttoright -local righttoleft_code = dirvalues.righttoleft +local directioncodes = tex.directioncodes +local lefttoright_code = directioncodes.lefttoright +local righttoleft_code = directioncodes.righttoleft local maximum_stack = 0xFF @@ -609,23 +609,23 @@ local function resolve_weak(list,size,start,limit,orderbefore,orderafter) else -- only more efficient when we have es/cs local runner = start + 2 if runner <= limit then - local before = list[start] - local entry = list[start + 1] - local after = list[runner] + local before = list[start] + local current = list[start + 1] + local after = list[runner] while after do - local direction = entry.direction + local direction = current.direction if direction == "es" then if before.direction == "en" and after.direction == "en" then - entry.direction = "en" + current.direction = "en" end elseif direction == "cs" then local prevdirection = before.direction if prevdirection == "en" then if after.direction == "en" then - entry.direction = "en" + current.direction = "en" end elseif prevdirection == "an" and after.direction == "an" then - entry.direction = "an" + current.direction = "an" end end before = current diff --git a/tex/context/base/mkxl/typo-lin.lmt b/tex/context/base/mkxl/typo-lin.lmt index 42ee5a957..2a0182e28 100644 --- a/tex/context/base/mkxl/typo-lin.lmt +++ b/tex/context/base/mkxl/typo-lin.lmt @@ -97,7 +97,7 @@ local new_hlist = nodepool.hlist local new_rule = nodepool.rule local new_glue = nodepool.glue -local righttoleft_code = nodes.dirvalues.righttoleft +local righttoleft_code = tex.directioncodes.righttoleft local setmetatableindex = table.setmetatableindex diff --git a/tex/context/fonts/mkiv/antykwa-math.lfg b/tex/context/fonts/mkiv/antykwa-math.lfg index 2965332e4..debf5d1ed 100644 --- a/tex/context/fonts/mkiv/antykwa-math.lfg +++ b/tex/context/fonts/mkiv/antykwa-math.lfg @@ -147,7 +147,7 @@ return { { 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 = uglyone }, + { 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 }, @@ -160,9 +160,9 @@ return { { 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 = uglyone }, + { name = "ex-anttcr.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, }, - ["antykwa-lightcond-math"] = { + ["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 }, @@ -173,7 +173,7 @@ return { { 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 = uglyone }, + { name = "ex-anttcl.tfm", vector = "tex-ex", extension = true, badones = badones, ignore = uglyones }, } }, addmissing = helpers.addmissing, diff --git a/tex/context/fonts/mkiv/bonum-math.lfg b/tex/context/fonts/mkiv/bonum-math.lfg index aa35c7b5a..2852c6449 100644 --- a/tex/context/fonts/mkiv/bonum-math.lfg +++ b/tex/context/fonts/mkiv/bonum-math.lfg @@ -125,10 +125,10 @@ return { tweak = "extendaccents", }, { - tweak = "flattenaccents", - squeeze = 0.8, - height = 0.9, - offset = 0.1, + tweak = "flattenaccents", + }, + { + tweak = "fixaccents", -- after flatten (zero width intefrerence) }, { tweak = "radicaldegreeanchors", @@ -149,10 +149,9 @@ return { -- ["0x7C.parts.bottom"] = { bottomright = -0.15 }, -- vertical bar }, }, - - { - tweak = "fixaccents", - }, +-- { +-- tweak = "fixaccents", +-- }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. { diff --git a/tex/context/fonts/mkiv/cambria-math.lfg b/tex/context/fonts/mkiv/cambria-math.lfg index 9ad2c3afc..3b8e12cd9 100644 --- a/tex/context/fonts/mkiv/cambria-math.lfg +++ b/tex/context/fonts/mkiv/cambria-math.lfg @@ -70,6 +70,9 @@ return { tweak = "extendaccents", }, { + tweak = "fixaccents", + }, + { tweak = "radicaldegreeanchors", list = { [0x221A] = { location = "left", hfactor = -0.15, vfactor = .75 }, @@ -82,9 +85,6 @@ return { ["0x221A.parts.bottom"] = { location = "left", hfactor = -0.1, vfactor = 0.95 }, } }, - { - tweak = "fixaccents", - }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. { diff --git a/tex/context/fonts/mkiv/concrete-math.lfg b/tex/context/fonts/mkiv/concrete-math.lfg index 53972ab05..142778015 100644 --- a/tex/context/fonts/mkiv/concrete-math.lfg +++ b/tex/context/fonts/mkiv/concrete-math.lfg @@ -74,6 +74,12 @@ return { }, }, { + tweak = "extendaccents", + }, + { + tweak = "flattenaccents", + }, + { tweak = "radicaldegreeanchors", list = { ["0x221A.parts.bottom"] = { location = "left", hfactor = .0, vfactor = 1.075 }, diff --git a/tex/context/fonts/mkiv/dejavu-math.lfg b/tex/context/fonts/mkiv/dejavu-math.lfg index f3e1011ad..c97765122 100644 --- a/tex/context/fonts/mkiv/dejavu-math.lfg +++ b/tex/context/fonts/mkiv/dejavu-math.lfg @@ -106,6 +106,9 @@ return { } }, { + tweak = "flattenaccents", + }, + { tweak = "fixaccents", }, -- First we set the dimensions of the initial accent which started out as zero but we want diff --git a/tex/context/fonts/mkiv/dejavu-text.lfg b/tex/context/fonts/mkiv/dejavu-text.lfg new file mode 100644 index 000000000..ba6458eaf --- /dev/null +++ b/tex/context/fonts/mkiv/dejavu-text.lfg @@ -0,0 +1,58 @@ +return { + name = "dejavu-text", + version = "1.00", + comment = "Goodies that complement dejavu.", + author = "Mikael Sundqvist & Hans Hagen", + copyright = "ConTeXt development team", + extensions = { + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "DejaVuSerif", + "DejaVuSerif-Bold", + }, + data = { + ["f"] = { + [")"] = 100, + ["}"] = 100, + ["]"] = 100, + ["|"] = 150, + ["\\"] = 175, + ["!"] = 100, + ["?"] = 100, + ["*"] = 100, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "DejaVuSerif-Italic", + "DejaVuSerif-BoldItalic", + }, + data = { + ["f"] = { + [")"] = 140, + ["}"] = 140, + ["]"] = 140, + ["|"] = 100, + ["\\"] = 200, + ["!"] = 100, + ["?"] = 100, + ["*"] = 250, + }, + ["("] = { + ["f"] = 100, + }, + ["{"] = { + ["f"] = 100, + }, + ["["] = { + ["f"] = 100, + }, + } + }, + } +} diff --git a/tex/context/fonts/mkiv/ebgaramond-math.lfg b/tex/context/fonts/mkiv/ebgaramond-math.lfg index bf9a2e027..d2ef73f55 100644 --- a/tex/context/fonts/mkiv/ebgaramond-math.lfg +++ b/tex/context/fonts/mkiv/ebgaramond-math.lfg @@ -13,6 +13,7 @@ return { OverbarRuleThickness = 60, UnderbarRuleThickness = 60, AccentTopShiftUp = -25, -- was 075 + FlattenedAccentBaseHeight = 620, -- 420 in font (maybe some misunderstanding in the font regarding accents and heights) FlattenedAccentTopShiftUp = -25, -- was 075 AccentBaseDepth = 75, DelimiterPercent = 90, @@ -146,8 +147,11 @@ return { tweak = "extendaccents", }, { - tweak = "radicaldegreeanchors", - list = { + tweak = "flattenaccents", + }, + { + tweak = "radicaldegreeanchors", + list = { ["0x221A.parts.bottom"] = { location = "left", hfactor = .0, vfactor = 1.0 }, } }, diff --git a/tex/context/fonts/mkiv/ebgaramond-text.lfg b/tex/context/fonts/mkiv/ebgaramond-text.lfg new file mode 100644 index 000000000..824728460 --- /dev/null +++ b/tex/context/fonts/mkiv/ebgaramond-text.lfg @@ -0,0 +1,59 @@ +return { + name = "ebgaramond-text", + version = "1.00", + comment = "Goodies that complement ebgaramond.", + author = "Mikael Sundqvist & Hans Hagen", + copyright = "ConTeXt development team", + extensions = { + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "EBGaramond-Regular", + }, + data = { + ["f"] = { + [")"] = 80, + ["}"] = 100, + ["]"] = 100, + ["|"] = 100, + ["\\"] = 120, + ["!"] = 100, + ["?"] = 100, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "EBGaramond-Italic", + "EBGaramond-BoldItalic", + }, + data = { + ["f"] = { + [")"] = 120, + ["}"] = 120, + ["]"] = 120, + ["|"] = 120, + ["\\"] = 120, + ["!"] = 75, + ["?"] = 75, + ["*"] = 120, + }, + ["("] = { + ["f"] = 120, + }, + ["{"] = { + ["f"] = 120, + }, + ["["] = { + ["f"] = 120, + }, + ["|"] = { + ["f"] = 120, + }, + } + }, + } +} diff --git a/tex/context/fonts/mkiv/erewhon-math.lfg b/tex/context/fonts/mkiv/erewhon-math.lfg index 68a088d3f..223927184 100644 --- a/tex/context/fonts/mkiv/erewhon-math.lfg +++ b/tex/context/fonts/mkiv/erewhon-math.lfg @@ -73,6 +73,9 @@ return { }, }, { + tweak = "flattenaccents", + }, + { tweak = "radicaldegreeanchors", list = { ["0x221A.parts.bottom"] = { location = "left", hfactor = .1, vfactor = 1.025 }, diff --git a/tex/context/fonts/mkiv/erewhon-text.lfg b/tex/context/fonts/mkiv/erewhon-text.lfg new file mode 100644 index 000000000..46a3aa842 --- /dev/null +++ b/tex/context/fonts/mkiv/erewhon-text.lfg @@ -0,0 +1,81 @@ +return { + name = "erewhon-text", + version = "1.00", + comment = "Goodies that complement erewhon.", + author = "Mikael Sundqvist & Hans Hagen", + copyright = "ConTeXt development team", + extensions = { + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "Erewhon-Regular", + -- "Erewhon-Bold", + }, + data = { + ["f"] = { + [")"] = 100, + ["}"] = 100, + ["]"] = 100, + ["|"] = 100, + ["\\"] = 75, + ["!"] = 100, + ["?"] = 100, + ["*"] = 100, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "Erewhon-Bold", + }, + data = { + ["f"] = { + [")"] = 25, + ["}"] = 50, + ["]"] = 25, + ["|"] = 50, + ["\\"] = 75, + ["!"] = 50, + ["?"] = 50, + ["*"] = 50, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "Erewhon-Italic", + "Erewhon-BoldItalic", + }, + data = { + ["f"] = { + [")"] = 50, + ["}"] = 50, + ["]"] = 50, + ["|"] = 125, + ["\\"] = 125, + ["!"] = 100, + ["?"] = 100, + ["*"] = 100, + ["@"] = 100, + }, + ["("] = { + ["f"] = 100, + }, + ["{"] = { + ["f"] = 100, + }, + ["["] = { + ["f"] = 100, + }, + ["|"] = { + ["f"] = 130, + }, + } + }, + } +} diff --git a/tex/context/fonts/mkiv/euler-math.lfg b/tex/context/fonts/mkiv/euler-math.lfg index 1c4659786..23d92b047 100644 --- a/tex/context/fonts/mkiv/euler-math.lfg +++ b/tex/context/fonts/mkiv/euler-math.lfg @@ -78,6 +78,9 @@ return { -- add the accent fixes -- fixslashes? { + tweak = "flattenaccents", + }, + { tweak = "checkspacing", }, { diff --git a/tex/context/fonts/mkiv/kpfonts-math.lfg b/tex/context/fonts/mkiv/kpfonts-math.lfg index 5896323b4..1b2eea45f 100644 --- a/tex/context/fonts/mkiv/kpfonts-math.lfg +++ b/tex/context/fonts/mkiv/kpfonts-math.lfg @@ -102,7 +102,9 @@ return { ["0x221A.parts.bottom"] = { location = "left", hfactor = .0, vfactor = 0.65 }, } }, - + { + tweak = "flattenaccents", + }, { tweak = "addscripts", }, diff --git a/tex/context/fonts/mkiv/kpfonts-text.lfg b/tex/context/fonts/mkiv/kpfonts-text.lfg new file mode 100644 index 000000000..6a14bec54 --- /dev/null +++ b/tex/context/fonts/mkiv/kpfonts-text.lfg @@ -0,0 +1,57 @@ +return { + name = "kpfonts-text", + version = "1.00", + comment = "Goodies that complement kpfonts.", + author = "Mikael Sundqvist & Hans Hagen", + copyright = "ConTeXt development team", + extensions = { + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "KpRoman-Regular", + }, + data = { + ["f"] = { + [")"] = 50, + ["}"] = 50, + ["]"] = 50, + ["*"] = 50, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "KpRoman-Italic", + "KpRoman-SemiboldItalic", + }, + data = { + ["f"] = { + [")"] = 150, + ["}"] = 50, + ["]"] = 50, + ["|"] = 125, + ["\\"] = 125, + ["!"] = 100, + ["?"] = 100, + ["*"] = 100, + ["@"] = 100, + }, + ["("] = { + ["f"] = 100, + }, + ["{"] = { + ["f"] = 100, + }, + ["["] = { + ["f"] = 100, + }, + ["|"] = { + ["f"] = 130, + }, + } + }, + } +} diff --git a/tex/context/fonts/mkiv/libertinus-math.lfg b/tex/context/fonts/mkiv/libertinus-math.lfg index ac15d6674..0b8ca42ad 100644 --- a/tex/context/fonts/mkiv/libertinus-math.lfg +++ b/tex/context/fonts/mkiv/libertinus-math.lfg @@ -87,6 +87,9 @@ return { tweak = "extendaccents", }, { + tweak = "flattenaccents", + }, + { tweak = "fixaccents", }, -- First we set the dimensions of the initial accent which started out as zero but we want diff --git a/tex/context/fonts/mkiv/libertinus-text.lfg b/tex/context/fonts/mkiv/libertinus-text.lfg new file mode 100644 index 000000000..76afb51cd --- /dev/null +++ b/tex/context/fonts/mkiv/libertinus-text.lfg @@ -0,0 +1,59 @@ +return { + name = "libertinus-text", + version = "1.00", + comment = "Goodies that complement libertinus.", + author = "Mikael Sundqvist & Hans Hagen", + copyright = "ConTeXt development team", + extensions = { + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "LibertinusSerif-Regular", + }, + data = { + ["f"] = { + [")"] = 50, + ["}"] = 50, + ["]"] = 50, + ["|"] = 100, + ["\\"] = 50, + ["*"] = 50, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "LibertinusSerif-Italic", + "LibertinusSerif-BoldItalic", + }, + data = { + ["f"] = { + [")"] = 50, + ["}"] = 50, + ["]"] = 50, + ["|"] = 125, + ["\\"] = 125, + ["!"] = 100, + ["?"] = 100, + ["*"] = 100, + ["@"] = 100, + }, + ["("] = { + ["f"] = 100, + }, + ["{"] = { + ["f"] = 100, + }, + ["["] = { + ["f"] = 100, + }, + ["|"] = { + ["f"] = 130, + }, + } + }, + } +} diff --git a/tex/context/fonts/mkiv/lucida-math.lfg b/tex/context/fonts/mkiv/lucida-math.lfg index 50dce6907..1e5391d6a 100644 --- a/tex/context/fonts/mkiv/lucida-math.lfg +++ b/tex/context/fonts/mkiv/lucida-math.lfg @@ -15,6 +15,7 @@ return { parameters = { FractionRuleThickness = 55, -- AccentBaseDepth = 250, + FlattenedAccentBaseHeight = 710,-- not present in font, set too small by 1. DelimiterPercent = 90, DelimiterShortfall = 400, SuperscriptBottomMaxWithSubscript = 325, @@ -126,16 +127,19 @@ return { tweak = "extendaccents", }, { - tweak = "radicaldegreeanchors", - list = { + tweak = "flattenaccents", + }, + { + tweak = "fixaccents", + }, + { + tweak = "radicaldegreeanchors", + list = { ["0x221A.variants.3"] = { location = "left", hfactor = 0, vfactor = .55 }, ["0x221A.variants.4"] = { location = "left", hfactor = 0, vfactor = .50 }, ["0x221A.parts.bottom"] = { location = "left", hfactor = 0, vfactor = .85 }, } }, - { - tweak = "fixaccents", - }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. Not in lucida -- Then we deal with all offsets and heights in one go. So we treat the initial accent diff --git a/tex/context/fonts/mkiv/lucida-text.lfg b/tex/context/fonts/mkiv/lucida-text.lfg new file mode 100644 index 000000000..cd32aee2b --- /dev/null +++ b/tex/context/fonts/mkiv/lucida-text.lfg @@ -0,0 +1,69 @@ +return { + name = "lucida-text", + version = "1.00", + comment = "Goodies that complement lucida.", + author = "Mikael Sundqvist & Hans Hagen", + copyright = "ConTeXt development team", + extensions = { + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "LucidaBrightOT", + }, + data = { + ["f"] = { + [")"] = 70, + ["}"] = 70, + ["]"] = 70, + ["\\"] = 100, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "LucidaBrightOT-Demibold", + }, + data = { + ["f"] = { + [")"] = 70, + ["}"] = 70, + ["]"] = 70, + ["\\"] = 100, + }, + } + }, + { + name = "kern", + type = "kern", + fonts = { + "LucidaBrightOT-Italic", + }, + data = { + ["f"] = { + [")"] = 70, + ["}"] = 20, + ["]"] = 70, + ["\\"] = 100, + }, + } + }, + { + name = "kern", + type = "kern", + fonts = { + "LucidaBrightOT-DemiboldItalic", + }, + data = { + ["f"] = { + [")"] = 70, + ["}"] = 40, + ["]"] = 70, + ["\\"] = 100, + }, + } + }, + } +} diff --git a/tex/context/fonts/mkiv/modern-math.lfg b/tex/context/fonts/mkiv/modern-math.lfg index e2560f0f1..fb9c8fd4b 100644 --- a/tex/context/fonts/mkiv/modern-math.lfg +++ b/tex/context/fonts/mkiv/modern-math.lfg @@ -144,14 +144,17 @@ return { tweak = "extendaccents", }, { + tweak = "flattenaccents", + }, + { + tweak = "fixaccents", + }, + { tweak = "radicaldegreeanchors", list = { ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.05 }, } }, - { - tweak = "fixaccents", - }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. { diff --git a/tex/context/fonts/mkiv/modern-text.lfg b/tex/context/fonts/mkiv/modern-text.lfg new file mode 100644 index 000000000..20bdcc60b --- /dev/null +++ b/tex/context/fonts/mkiv/modern-text.lfg @@ -0,0 +1,62 @@ +return { + name = "modern-text", + version = "1.00", + comment = "Goodies that complement latin modern.", + author = "Mikael Sundqvist & Hans Hagen", + copyright = "ConTeXt development team", + extensions = { + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + -- "LMRoman-Regular", + "LMRoman10-Regular", + "LMRoman10-Bold", + }, + data = { + ["f"] = { + [")"] = 50, + ["}"] = 50, + ["]"] = 50, + ["|"] = 100, + ["\\"] = 50, + ["?"] = 50, + ["*"] = 50, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "LMRoman-Italic", + "LMRoman-BoldItalic", + }, + data = { + ["f"] = { + [")"] = 50, + ["}"] = 50, + ["]"] = 50, + ["|"] = 125, + ["\\"] = 125, + ["!"] = 100, + ["?"] = 100, + ["*"] = 100, + ["@"] = 100, + }, + ["("] = { + ["f"] = 100, + }, + ["{"] = { + ["f"] = 100, + }, + ["["] = { + ["f"] = 100, + }, + ["|"] = { + ["f"] = 130, + }, + } + }, + } +} diff --git a/tex/context/fonts/mkiv/newcomputermodern-math.lfg b/tex/context/fonts/mkiv/newcomputermodern-math.lfg index bb881eda0..9e5e6ab3a 100644 --- a/tex/context/fonts/mkiv/newcomputermodern-math.lfg +++ b/tex/context/fonts/mkiv/newcomputermodern-math.lfg @@ -1,3 +1,5 @@ +local common = fonts.goodies.load("common-math.lfg") +local presets = common.mathematics.tweaks.presets -- In order to be able to use beta math fonts, we use our own file name and -- always remap. As this font is experimental we don't spend too much time -- on it now. Even then, we migth stick to design sizes only. @@ -66,10 +68,12 @@ return { end return o * target.parameters.factor end, - NoLimitSupFactor = 0, - NoLimitSubFactor = 1200, - DelimiterPercent = 90, - DelimiterShortfall = 400, + NoLimitSupFactor = 0, + NoLimitSubFactor = 1200, + DelimiterPercent = 90, + DelimiterShortfall = 400, + AccentTopShiftUp = -60, + FlattenedAccentTopShiftUp = -60, SubscriptBaselineDropMin = 50, -- 200 in font (multiplied by 0.59999/2.39868) SubscriptShiftDown = 150, -- 247 in font (multiplied to be consistent with cm) SubscriptShiftDownWithSuperscript = 247, -- relates to the previous one (see math-act) @@ -91,6 +95,18 @@ return { smaller = true, fake = 0.6, }, + presets.scripttocalligraphic { }, + presets.rsfstoscript { }, + presets.rsfsuprighttoscript { }, + presets.moderntocalligraphic { }, + presets.eulertocalligraphic { }, + presets.xitsarabic { rscale = 0.80 }, + presets.fallbacks { }, + presets.moveitalics { correct = true }, + presets.moveitalics { correct = true, letters = true }, + presets.moveintegrals { factor = 1.4, icfactor = 0.8 }, -- the icfactor is due to the very slanted integral. + presets.wipeanchors { }, + presets.wipeitalics { }, { tweak = "kerns", list = { @@ -115,6 +131,9 @@ return { }, }, { + tweak = "flattenaccents", + }, + { tweak = "checkspacing", }, { diff --git a/tex/context/fonts/mkiv/newcomputermodern-text.lfg b/tex/context/fonts/mkiv/newcomputermodern-text.lfg new file mode 100644 index 000000000..24991642a --- /dev/null +++ b/tex/context/fonts/mkiv/newcomputermodern-text.lfg @@ -0,0 +1,63 @@ +return { + name = "newcomputermodern-text", + version = "1.00", + comment = "Goodies that complement newcomputermodern.", + author = "Mikael Sundqvist & Hans Hagen", + copyright = "ConTeXt development team", + extensions = { + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "NewCM10-Book", + "NewCM10", + "NewCM10-Bold", + }, + data = { + ["f"] = { + [")"] = 50, + ["}"] = 50, + ["]"] = 50, + ["|"] = 100, + ["\\"] = 75, + ["?"] = 50, + ["*"] = 50, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "NewCM10-BookItalic", + "NewCM10-BoldItalic", + "NewCM10-Italic", + }, + data = { + ["f"] = { + [")"] = 50, + ["}"] = 50, + ["]"] = 50, + ["|"] = 125, + ["\\"] = 100, + ["!"] = 100, + ["?"] = 100, + ["*"] = 50, + ["@"] = 100, + }, + ["("] = { + ["f"] = 100, + }, + ["{"] = { + ["f"] = 100, + }, + ["["] = { + ["f"] = 100, + }, + ["|"] = { + ["f"] = 130, + }, + } + }, + } +} diff --git a/tex/context/fonts/mkiv/pagella-math.lfg b/tex/context/fonts/mkiv/pagella-math.lfg index 230f81c9c..a9b3ea4bb 100644 --- a/tex/context/fonts/mkiv/pagella-math.lfg +++ b/tex/context/fonts/mkiv/pagella-math.lfg @@ -40,9 +40,26 @@ return { feature = "euleroverpagella", filename = "euler-math.otf", list = { - { source = { first = 0x02100, last = 0x02BFF } }, - { source = { first = 0x1D400, last = 0x1D7FF } }, - { source = { first = 0x1D538, last = 0x1D550 } }, + { source = "lowercasenormal", target = "lowercaseitalic" }, + { source = "lowercasebold", target = "lowercasebolditalic" }, + { source = "lowercasegreeknormal", target = "lowercasegreekitalic" }, + { source = "lowercasegreekbold", target = "lowercasegreekbolditalic" }, + { source = "uppercasenormal", target = "uppercaseitalic" }, + { source = "uppercasebold", target = "uppercasebolditalic" }, + { source = "uppercasegreeknormal", target = "uppercasegreekitalic" }, + { source = "uppercasegreekbold", target = "uppercasegreekbolditalic" }, + { source = "lowercasenormal", target = "lowercasenormal" }, + { source = "lowercasebold", target = "lowercasebold" }, + { source = "lowercasegreeknormal", target = "lowercasegreeknormal" }, + { source = "lowercasegreekbold", target = "lowercasegreekbold" }, + { source = "uppercasenormal", target = "uppercasenormal" }, + { source = "uppercasebold", target = "uppercasebold" }, + { source = "uppercasegreeknormal", target = "uppercasegreeknormal" }, + { source = "uppercasegreekbold", target = "uppercasegreekbold" }, + { source = "digitsnormal", target = "digitsnormal" }, + -- + { source = { first = 0x02100, last = 0x02BFF } }, -- symbols + { source = { first = 0x1D400, last = 0x1D7FF } }, -- various alphabets }, }, { @@ -94,12 +111,15 @@ return { tweak = "extendaccents", }, { - tweak = "radicaldegreeanchors", - list = { + tweak = "radicaldegreeanchors", + list = { ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.0, vfactor = 1.1 }, } }, { + tweak = "flattenaccents", + }, + { tweak = "fixaccents", }, -- First we set the dimensions of the initial accent which started out as zero but we want diff --git a/tex/context/fonts/mkiv/schola-math.lfg b/tex/context/fonts/mkiv/schola-math.lfg index 2e36f0825..58eb1a6ea 100644 --- a/tex/context/fonts/mkiv/schola-math.lfg +++ b/tex/context/fonts/mkiv/schola-math.lfg @@ -78,12 +78,15 @@ return { tweak = "extendaccents", }, { - tweak = "radicaldegreeanchors", - list = { + tweak = "radicaldegreeanchors", + list = { ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.1 }, } }, { + tweak = "flattenaccents", + }, + { tweak = "fixaccents", }, -- First we set the dimensions of the initial accent which started out as zero but we want diff --git a/tex/context/fonts/mkiv/stixtwo-math.lfg b/tex/context/fonts/mkiv/stixtwo-math.lfg index c0c97862f..ebacf7a81 100644 --- a/tex/context/fonts/mkiv/stixtwo-math.lfg +++ b/tex/context/fonts/mkiv/stixtwo-math.lfg @@ -13,7 +13,11 @@ return { copyright = "ConTeXt development team", mathematics = { alternates = { - calligraphic = { feature = 'ss01', value = 1, comment = "Mathematical Alternative Calligraphic Characters" }, + lambdabar = { feature = 'cv01', value = 1, comment = "Mathematical Alternative Lambda Bar" }, + ramshorn = { feature = 'cv02', value = 1, comment = "Mathematical Alternative Rams Horn" }, + emptyset = { feature = 'cv03', value = 1, comment = "Mathematical Alternative Empty Set" }, + setminus = { feature = 'cv04', value = 1, comment = "Mathematical Alternative Setminus" }, + calligraphic = { feature = 'ss01', value = 1, comment = "Mathematical Alternative Calligraphic Characters" }, -- We do this differently italic = { feature = 'ss02', value = 1, comment = "Mathematical Alternative Lowercase Italic" }, barred = { feature = 'ss03', value = 1, comment = "Mathematical Alternative Barred Characters" }, -- hbar, lambdabar etc primes = { feature = 'ss04', value = 1, comment = "Mathematical Alternative Primes" }, -- larger/lower primes, minute etc @@ -23,9 +27,26 @@ return { upright = { feature = 'ss08', value = 1, comment = "Mathematical Alternative Upright Symbols" }, -- upright integrals etc. negated = { feature = 'ss09', value = 1, comment = "Mathematical Alternative Negated Symbols" }, relation = { feature = 'ss10', value = 1, comment = "Mathematical Alternative Relations" }, - negatedset = { feature = 'ss09', value = 1, comment = "Mathematical Alternative Negated Set Symbols" }, - -- todo = { feature = 'ss14', value = 1, comment = "" }, + negatedset = { feature = 'ss11', value = 1, comment = "Mathematical Alternative Negated Set Symbols" }, + propfrown = { feature = 'ss12', value = 1, comment = "Mathematical Alternative Proportional and Frown" }, + negsine = { feature = 'ss13', value = 1, comment = "Mathematical Alternative Negated Sine Wave" }, + intprod = { feature = 'ss14', value = 1, comment = "Mathematical Alternative Interior Products" }, + capcup = { feature = 'ss15', value = 1, comment = "Mathematical Alternative Intersection and Union with serif" }, circled = { feature = 'ss16', value = 1, comment = "Mathematical Alternative Circled Operators" }, + simvar = { feature = 'ss20', value = 1, comment = "Mathematical Alternative Similar and some more unrelated" }, + -- demo features: + negated8774 = { + feature = 'ss09', + value = 1, + comment = "Mathematical Alternative Negated 8774", + list = { [8774] = true }, + }, + negated8775 = { + feature = 'ss09', + value = 1, + comment = "Mathematical Alternative Negated 8775", + list = { [8775] = true }, + }, }, parameters = { AccentBaseDepth = 30, @@ -115,7 +136,9 @@ return { ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.00 }, } }, - + { + tweak = "flattenaccents", + }, { tweak = "fixaccents", }, diff --git a/tex/context/fonts/mkiv/stixtwo-text.lfg b/tex/context/fonts/mkiv/stixtwo-text.lfg new file mode 100644 index 000000000..2a3b46a78 --- /dev/null +++ b/tex/context/fonts/mkiv/stixtwo-text.lfg @@ -0,0 +1,60 @@ +return { + name = "stixtwo-text", + version = "1.00", + comment = "Goodies that complement stix two.", + author = "Mikael Sundqvist & Hans Hagen", + copyright = "ConTeXt development team", + extensions = { + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "STIXTwoText-Regular", + "STIXTwoText-Bold", + }, + data = { + ["f"] = { + [")"] = 50, + ["}"] = 50, + ["]"] = 50, + ["|"] = 100, + ["\\"] = 100, + ["*"] = 50, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "STIXTwoText-Italic", + "STIXTwoText-BoldItalic", + }, + data = { + ["f"] = { + [")"] = 50, + ["}"] = 50, + ["]"] = 50, + ["|"] = 125, + ["\\"] = 125, + ["!"] = 100, + ["?"] = 100, + ["*"] = 100, + ["@"] = 100, + }, + ["("] = { + ["f"] = 100, + }, + ["{"] = { + ["f"] = 100, + }, + ["["] = { + ["f"] = 100, + }, + ["|"] = { + ["f"] = 130, + }, + } + }, + } +} diff --git a/tex/context/fonts/mkiv/termes-math.lfg b/tex/context/fonts/mkiv/termes-math.lfg index 364ea8369..504249878 100644 --- a/tex/context/fonts/mkiv/termes-math.lfg +++ b/tex/context/fonts/mkiv/termes-math.lfg @@ -81,6 +81,12 @@ return { tweak = "extendaccents", }, { + tweak = "flattenaccents", + }, + { + tweak = "fixaccents", + }, + { tweak = "radicaldegreeanchors", list = { [0x221A] = { location = "left", hfactor = 0.0, vfactor = 0.6 }, @@ -88,9 +94,6 @@ return { ["0x221A.parts.bottom"] = { location = "left", hfactor = 0.05, vfactor = 1.1 }, } }, - { - tweak = "fixaccents", - }, -- First we set the dimensions of the initial accent which started out as zero but we want -- a proper width. { diff --git a/tex/context/fonts/mkiv/texgyre-text.lfg b/tex/context/fonts/mkiv/texgyre-text.lfg new file mode 100644 index 000000000..947d730cd --- /dev/null +++ b/tex/context/fonts/mkiv/texgyre-text.lfg @@ -0,0 +1,185 @@ +return { + name = "texgyre-text", + version = "1.00", + comment = "Goodies that complement the texgyre fonts.", + author = "Mikael Sundqvist & Hans Hagen", + copyright = "ConTeXt development team", + extensions = { + { + name = "kern", -- adds to kerns + type = "kern", + -- we have three optional methods for filtering: + fonts = { + "TeXGyreBonum-Regular", + "TeXGyreBonum-Bold", + }, + -- fonts = { + -- ["TeXGyreBonum-Regular"] = true, + -- }, + -- fonts = "TeXGyreBonum-*", + data = { + ["f"] = { + [")"] = 100, + ["}"] = 100, + ["]"] = 100, + ["|"] = 100, + ["\\"] = 120, + ["!"] = 100, + ["?"] = 100, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "TeXGyreBonum-Italic", + "TeXGyreBonum-BoldItalic", + }, + data = { + ["f"] = { + [")"] = 140, + ["}"] = 140, + ["]"] = 140, + ["|"] = 100, + ["\\"] = 150, + ["!"] = 100, + ["?"] = 100, + }, + ["("] = { + ["f"] = 190, + }, + ["{"] = { + ["f"] = 190, + }, + ["["] = { + ["f"] = 190, + }, + } + }, + { + name = "kern", + type = "kern", + fonts = { + "TeXGyreTermes-Regular", + "TeXGyreTermes-Bold", + }, + data = { + ["f"] = { + [")"] = 75, + ["}"] = 75, + ["]"] = 75, + ["|"] = 75, + ["\\"] = 110, + ["!"] = 75, + ["?"] = 75, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "TeXGyreTermes-Italic", + "TeXGyreTermes-BoldItalic", + }, + data = { + ["f"] = { + [")"] = 75, + ["}"] = 75, + ["]"] = 75, + ["|"] = 75, + ["\\"] = 200, + ["!"] = 75, + ["?"] = 75, + }, + ["("] = { + ["f"] = 75, + }, + ["{"] = { + ["f"] = 75, + }, + ["["] = { + ["f"] = 75, + }, + ["|"] = { + ["f"] = 150, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "TeXGyrePagella-Italic", + "TeXGyrePagella-BoldItalic", + }, + data = { + ["f"] = { + [")"] = 120, + ["}"] = 120, + ["]"] = 120, + ["|"] = 120, + ["\\"] = 120, + ["!"] = 75, + ["?"] = 75, + ["*"] = 120, + }, + ["("] = { + ["f"] = 120, + }, + ["{"] = { + ["f"] = 120, + }, + ["["] = { + ["f"] = 120, + }, + ["|"] = { + ["f"] = 120, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "TeXGyreSchola-Regular", + "TeXGyreSchola-Bold", + }, + data = { + ["f"] = { + [")"] = 120, + ["}"] = 120, + ["]"] = 120, + -- ["|"] = 50, + ["\\"] = 100, + ["!"] = 100, + ["?"] = 100, + ["*"] = 75, + ["@"] = 75, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "TeXGyreSchola-Italic", + "TeXGyreSchola-BoldItalic", + }, + data = { + ["f"] = { + [")"] = 120, + ["}"] = 120, + ["]"] = 120, + ["|"] = 120, + ["\\"] = 120, + ["!"] = 75, + ["?"] = 75, + ["*"] = 120, + ["@"] = 75, + }, + } + }, + } +} diff --git a/tex/context/fonts/mkiv/type-imp-dejavu.mkiv b/tex/context/fonts/mkiv/type-imp-dejavu.mkiv index 49b788a73..70fc8ae8d 100644 --- a/tex/context/fonts/mkiv/type-imp-dejavu.mkiv +++ b/tex/context/fonts/mkiv/type-imp-dejavu.mkiv @@ -16,16 +16,16 @@ \definefontfeature[dejavu-condensed-mono][extend=.8] -\starttypescriptcollection[xxdejavu] +\starttypescriptcollection[dejavu] \doifunknownfontfeature {dejavu-math-bold} {\definefontfeature[dejavu-math-bold][boldened]} \starttypescript [\s!serif] [dejavu] [\s!name] \setups[\s!font:\s!fallback:\s!serif] - \definefontsynonym [\s!Serif] [\s!name:dejavuserif] [\s!features=\s!default,\s!fallbacks=\s!Serif] - \definefontsynonym [\s!SerifBold] [\s!name:dejavuserifbold] [\s!features=\s!default,\s!fallbacks=\s!SerifBold] - \definefontsynonym [\s!SerifItalic] [\s!name:dejavuserifitalic] [\s!features=\s!default,\s!fallbacks=\s!SerifItalic] - \definefontsynonym [\s!SerifBoldItalic] [\s!name:dejavuserifbolditalic] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic] + \definefontsynonym [\s!Serif] [\s!name:dejavuserif] [\s!features=\s!default,\s!fallbacks=\s!Serif,\s!goodies=dejavu-text] + \definefontsynonym [\s!SerifBold] [\s!name:dejavuserifbold] [\s!features=\s!default,\s!fallbacks=\s!SerifBold,\s!goodies=dejavu-text] + \definefontsynonym [\s!SerifItalic] [\s!name:dejavuserifitalic] [\s!features=\s!default,\s!fallbacks=\s!SerifItalic,\s!goodies=dejavu-text] + \definefontsynonym [\s!SerifBoldItalic] [\s!name:dejavuserifbolditalic] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic,\s!goodies=dejavu-text] \stoptypescript \starttypescript [\s!sans] [dejavu] [\s!name] diff --git a/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv b/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv index 42575a61c..46c73956f 100644 --- a/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv +++ b/tex/context/fonts/mkiv/type-imp-ebgaramond.mkiv @@ -73,10 +73,10 @@ \starttypescript [\s!serif] [ebgaramond] \setups[font:fallback:serif] - \definefontsynonym [\s!Serif] [\s!file:ebgaramond-regular] [\s!features=eb-garamond-normal] - \definefontsynonym [\s!SerifItalic] [\s!file:ebgaramond-italic] [\s!features=eb-garamond-normal] - \definefontsynonym [\s!SerifBold] [\s!file:ebgaramond-bold] [\s!features=eb-garamond-normal] - \definefontsynonym [\s!SerifBoldItalic][\s!file:ebgaramond-bolditalic][\s!features=eb-garamond-normal] + \definefontsynonym [\s!Serif] [\s!file:ebgaramond-regular] [\s!features=eb-garamond-normal,\s!goodies=ebgaramond-text] + \definefontsynonym [\s!SerifItalic] [\s!file:ebgaramond-italic] [\s!features=eb-garamond-normal,\s!goodies=ebgaramond-text] + \definefontsynonym [\s!SerifBold] [\s!file:ebgaramond-bold] [\s!features=eb-garamond-normal,\s!goodies=ebgaramond-text] + \definefontsynonym [\s!SerifBoldItalic][\s!file:ebgaramond-bolditalic][\s!features=eb-garamond-normal,\s!goodies=ebgaramond-text] \definefontsynonym [\s!SerifCaps] [\s!Serif] [\s!features=eb-garamond-smallcaps] \stoptypescript diff --git a/tex/context/fonts/mkiv/type-imp-erewhon.mkiv b/tex/context/fonts/mkiv/type-imp-erewhon.mkiv index c536caa0e..660b4c58a 100644 --- a/tex/context/fonts/mkiv/type-imp-erewhon.mkiv +++ b/tex/context/fonts/mkiv/type-imp-erewhon.mkiv @@ -23,11 +23,11 @@ \doifunknownfontfeature {erewhon-math-bold} {\definefontfeature[erewhon-math-bold][boldened]} \starttypescript [\s!serif] [erewhon] - \definefontsynonym [\s!Serif] [\s!file:Erewhon-Regular] [\s!features=\s!default] - \definefontsynonym [\s!SerifItalic] [\s!file:Erewhon-Italic] [\s!features=\s!default] + \definefontsynonym [\s!Serif] [\s!file:Erewhon-Regular] [\s!features=\s!default,\s!goodies=erewhon-text] + \definefontsynonym [\s!SerifItalic] [\s!file:Erewhon-Italic] [\s!features=\s!default,\s!goodies=erewhon-text] \definefontsynonym [\s!SerifSlanted] [\s!file:Erewhon-RegularSlanted][\s!features=\s!default] - \definefontsynonym [\s!SerifBold] [\s!file:Erewhon-Bold] [\s!features=\s!default] - \definefontsynonym [\s!SerifBoldItalic] [\s!file:Erewhon-BoldItalic] [\s!features=\s!default] + \definefontsynonym [\s!SerifBold] [\s!file:Erewhon-Bold] [\s!features=\s!default,\s!goodies=erewhon-text] + \definefontsynonym [\s!SerifBoldItalic] [\s!file:Erewhon-BoldItalic] [\s!features=\s!default,\s!goodies=erewhon-text] \definefontsynonym [\s!SerifBoldSlanted][\s!file:Erewhon-BoldSlanted] [\s!features=\s!default] \stoptypescript diff --git a/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv b/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv index c8e92d20b..bc7de3ae7 100644 --- a/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv +++ b/tex/context/fonts/mkiv/type-imp-kpfonts.mkiv @@ -34,10 +34,10 @@ \stoptypescript \starttypescript [\s!serif] [kpfonts,kpfonts-sans,kpfonts-nt] - \definefontsynonym [\s!Serif] [\s!file:KpRoman-Regular.otf] - \definefontsynonym [\s!SerifBold] [\s!file:KpRoman-SemiBold.otf] - \definefontsynonym [\s!SerifItalic] [\s!file:KpRoman-Italic.otf] - \definefontsynonym [\s!SerifBoldItalic] [\s!file:KpRoman-SemiboldItalic.otf] + \definefontsynonym [\s!Serif] [\s!file:KpRoman-Regular.otf][\s!goodies=kpfonts-text] + \definefontsynonym [\s!SerifBold] [\s!file:KpRoman-SemiBold.otf][\s!goodies=kpfonts-text] + \definefontsynonym [\s!SerifItalic] [\s!file:KpRoman-Italic.otf][\s!goodies=kpfonts-text] + \definefontsynonym [\s!SerifBoldItalic] [\s!file:KpRoman-SemiboldItalic.otf][\s!goodies=kpfonts-text] \definefontsynonym [\s!SerifSlanted] [\s!SerifItalic] \definefontsynonym [\s!SerifBoldSlanted] [\s!SerifBoldItalic] \stoptypescript diff --git a/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv b/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv index f5082f784..a995bc42f 100644 --- a/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv +++ b/tex/context/fonts/mkiv/type-imp-latinmodern.mkiv @@ -121,12 +121,12 @@ \starttypescript [\s!serif] [modern,latin-modern] \loadfontgoodies[lm] - \definefontsynonym [LMRoman-Regular] [\s!file:lmroman10-regular] [\s!features=\s!default] - \definefontsynonym [LMRoman-Bold] [\s!file:lmroman10-bold] [\s!features=\s!default] + \definefontsynonym [LMRoman-Regular] [\s!file:lmroman10-regular] [\s!features=\s!default,\s!goodies=modern-text] + \definefontsynonym [LMRoman-Bold] [\s!file:lmroman10-bold] [\s!features=\s!default,\s!goodies=modern-text] \definefontsynonym [LMRoman-Demi] [\s!file:lmromandemi10-regular] [\s!features=\s!default] - \definefontsynonym [LMRoman-Italic] [\s!file:lmroman10-italic] [\s!features=\s!default] + \definefontsynonym [LMRoman-Italic] [\s!file:lmroman10-italic] [\s!features=\s!default,\s!goodies=modern-text] \definefontsynonym [LMRoman-Oblique] [\s!file:lmromanslant10-regular] [\s!features=\s!default] - \definefontsynonym [LMRoman-BoldItalic] [\s!file:lmroman10-bolditalic] [\s!features=\s!default] + \definefontsynonym [LMRoman-BoldItalic] [\s!file:lmroman10-bolditalic] [\s!features=\s!default,\s!goodies=modern-text] \definefontsynonym [LMRoman-BoldOblique] [\s!file:lmromanslant10-bold] [\s!features=\s!default] \definefontsynonym [LMRoman-DemiOblique] [\s!file:lmromandemi10-oblique] [\s!features=\s!default] \definefontsynonym [LMRoman-CapsRegular] [\s!file:lmroman10-CapsRegular] [\s!features=\s!default] diff --git a/tex/context/fonts/mkiv/type-imp-libertinus.mkiv b/tex/context/fonts/mkiv/type-imp-libertinus.mkiv index 97e3b3493..36d2666f7 100644 --- a/tex/context/fonts/mkiv/type-imp-libertinus.mkiv +++ b/tex/context/fonts/mkiv/type-imp-libertinus.mkiv @@ -24,11 +24,11 @@ \doifunknownfontfeature {libertinus-math-bold} {\definefontfeature[libertinus-math-bold][boldened]} \starttypescript [\s!serif] [libertinus] - \definefontsynonym [LibertinusSerif-Regular] [\s!file:libertinusserif-regular] - \definefontsynonym [LibertinusSerif-Italic] [\s!file:libertinusserif-italic] + \definefontsynonym [LibertinusSerif-Regular] [\s!file:libertinusserif-regular][\s!goodies=libertinus-text] + \definefontsynonym [LibertinusSerif-Italic] [\s!file:libertinusserif-italic][\s!goodies=libertinus-text] \definefontsynonym [LibertinusSerif-Slanted] [\s!file:libertinusserif-italic] - \definefontsynonym [LibertinusSerif-Bold] [\s!file:libertinusserif-bold] - \definefontsynonym [LibertinusSerif-BoldItalic] [\s!file:libertinusserif-bolditalic] + \definefontsynonym [LibertinusSerif-Bold] [\s!file:libertinusserif-bold][\s!goodies=libertinus-text] + \definefontsynonym [LibertinusSerif-BoldItalic] [\s!file:libertinusserif-bolditalic][\s!goodies=libertinus-text] \definefontsynonym [LibertinusSerif-BoldSlanted] [\s!file:libertinusserif-bolditalic] \stoptypescript diff --git a/tex/context/fonts/mkiv/type-imp-lucida.mkiv b/tex/context/fonts/mkiv/type-imp-lucida.mkiv index 186854efc..44230b55d 100644 --- a/tex/context/fonts/mkiv/type-imp-lucida.mkiv +++ b/tex/context/fonts/mkiv/type-imp-lucida.mkiv @@ -35,10 +35,10 @@ \stoptypescript \starttypescript [\s!serif] [lucida,lucidaot,lucidadk,lucidaot-nt,lucida-nt] - \definefontsynonym [\s!Serif] [\s!file:LucidaBrightOT.otf] - \definefontsynonym [\s!SerifBold] [\s!file:LucidaBrightOT-Demi.otf] - \definefontsynonym [\s!SerifItalic] [\s!file:LucidaBrightOT-Italic.otf] - \definefontsynonym [\s!SerifBoldItalic] [\s!file:LucidaBrightOT-DemiItalic.otf] + \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] \stoptypescript diff --git a/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv b/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv index 65a84ec5f..b6bb26c76 100644 --- a/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv +++ b/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv @@ -25,10 +25,10 @@ \starttypescript [\s!serif] [newcomputermodern] [\s!name] \setups[\s!font:\s!fallback:\s!serif] - \definefontsynonym [\s!Serif] [\s!file:newcm10-regular.otf] [\s!features=\s!default,\s!fallbacks=\s!Serif] - \definefontsynonym [\s!SerifBold] [\s!file:newcm10-bold.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBold] - \definefontsynonym [\s!SerifItalic] [\s!file:newcm10-italic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifItalic] - \definefontsynonym [\s!SerifBoldItalic] [\s!file:newcm10-bolditalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic] + \definefontsynonym [\s!Serif] [\s!file:newcm10-regular.otf] [\s!features=\s!default,\s!fallbacks=\s!Serif,\s!goodies=newcomputermodern-text] + \definefontsynonym [\s!SerifBold] [\s!file:newcm10-bold.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBold,\s!goodies=newcomputermodern-text] + \definefontsynonym [\s!SerifItalic] [\s!file:newcm10-italic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifItalic,\s!goodies=newcomputermodern-text] + \definefontsynonym [\s!SerifBoldItalic] [\s!file:newcm10-bolditalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic,\s!goodies=newcomputermodern-text] \stoptypescript \starttypescript [\s!sans] [newcomputermodern] [\s!name] @@ -55,10 +55,10 @@ \starttypescript [\s!serif] [newcomputermodern-book] [\s!name] \setups[\s!font:\s!fallback:\s!serif] - \definefontsynonym [\s!Serif] [\s!file:newcm10-book.otf] [\s!features=\s!default,\s!fallbacks=\s!Serif] - \definefontsynonym [\s!SerifBold] [\s!file:newcm10-bold.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBold] - \definefontsynonym [\s!SerifItalic] [\s!file:newcm10-bookitalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifItalic] - \definefontsynonym [\s!SerifBoldItalic] [\s!file:newcm10-bolditalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic] + \definefontsynonym [\s!Serif] [\s!file:newcm10-book.otf] [\s!features=\s!default,\s!fallbacks=\s!Serif,\s!goodies=newcomputermodern-text] + \definefontsynonym [\s!SerifBold] [\s!file:newcm10-bold.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBold,\s!goodies=newcomputermodern-text] + \definefontsynonym [\s!SerifItalic] [\s!file:newcm10-bookitalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifItalic,\s!goodies=newcomputermodern-text] + \definefontsynonym [\s!SerifBoldItalic] [\s!file:newcm10-bolditalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic,\s!goodies=newcomputermodern-text] \stoptypescript \starttypescript [\s!sans] [newcomputermodern-book] [\s!name] diff --git a/tex/context/fonts/mkiv/type-imp-stix.mkiv b/tex/context/fonts/mkiv/type-imp-stix.mkiv index 3ac0b7257..d1bad9a2e 100644 --- a/tex/context/fonts/mkiv/type-imp-stix.mkiv +++ b/tex/context/fonts/mkiv/type-imp-stix.mkiv @@ -58,10 +58,10 @@ \starttypescript [\s!serif] [stix,stixtwo,xits] [\s!name] \setups[\s!font:\s!fallback:\s!serif] - \definefontsynonym[\s!Serif] [\s!file:stixtwotext-regular.ttf] [\s!features=\s!default] - \definefontsynonym[\s!SerifBold] [\s!file:stixtwotext-bold.ttf] [\s!features=\s!default] - \definefontsynonym[\s!SerifItalic] [\s!file:stixtwotext-italic.ttf] [\s!features=\s!default] - \definefontsynonym[\s!SerifBoldItalic][\s!file:stixtwotext-bolditalic.ttf][\s!features=\s!default] + \definefontsynonym[\s!Serif] [\s!file:stixtwotext-regular.ttf] [\s!features=\s!default,\s!goodies=stixtwo-text] + \definefontsynonym[\s!SerifBold] [\s!file:stixtwotext-bold.ttf] [\s!features=\s!default,\s!goodies=stixtwo-text] + \definefontsynonym[\s!SerifItalic] [\s!file:stixtwotext-italic.ttf] [\s!features=\s!default,\s!goodies=stixtwo-text] + \definefontsynonym[\s!SerifBoldItalic][\s!file:stixtwotext-bolditalic.ttf][\s!features=\s!default,\s!goodies=stixtwo-text] \stoptypescript \starttypescript[stix,stixtwo,xits,stix-nt,stixtwo-nt] diff --git a/tex/context/fonts/mkiv/type-imp-texgyre.mkiv b/tex/context/fonts/mkiv/type-imp-texgyre.mkiv index a3f3952c7..c4f28fcc4 100644 --- a/tex/context/fonts/mkiv/type-imp-texgyre.mkiv +++ b/tex/context/fonts/mkiv/type-imp-texgyre.mkiv @@ -67,10 +67,10 @@ \definetypescriptprefix [n:chancery] [TeXGyreChorus] \starttypescript [\s!serif,\s!sans] [adventor,bonum,bookman,heros,helvetica,pagella,palatino,schola,schoolbook,termes,times] - \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-regular] [\s!features=\s!default] - \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Italic] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-italic] [\s!features=\s!default] - \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Bold] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bold] [\s!features=\s!default] - \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalic] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bolditalic] [\s!features=\s!default] + \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-regular] [\s!features=\s!default,\s!goodies=texgyre-text] + \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Italic] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-italic] [\s!features=\s!default,\s!goodies=texgyre-text] + \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Bold] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bold] [\s!features=\s!default,\s!goodies=texgyre-text] + \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalic] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bolditalic] [\s!features=\s!default,\s!goodies=texgyre-text] \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Caps] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-regular] [\s!features=\s!smallcaps] \definefontsynonym [\typescriptprefix{n:\typescripttwo}-ItalicCaps] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-italic] [\s!features=\s!smallcaps] \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldCaps] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-bold] [\s!features=\s!smallcaps] diff --git a/tex/context/fonts/mkiv/type-imp-xcharter.mkiv b/tex/context/fonts/mkiv/type-imp-xcharter.mkiv index 6b6e5fc4e..7d1a88241 100644 --- a/tex/context/fonts/mkiv/type-imp-xcharter.mkiv +++ b/tex/context/fonts/mkiv/type-imp-xcharter.mkiv @@ -19,11 +19,11 @@ \doifunknownfontfeature {xcharter-math-bold} {\definefontfeature[xcharter-math-bold][boldened]} \starttypescript [\s!serif] [xcharter] [\s!name] - \definefontsynonym [\s!Serif] [\s!file:XCharter-Roman] [\s!features=\s!default] - \definefontsynonym [\s!SerifItalic] [\s!file:XCharter-Italic] [\s!features=\s!default] + \definefontsynonym [\s!Serif] [\s!file:XCharter-Roman] [\s!features=\s!default,\s!goodies=xcharter-text] + \definefontsynonym [\s!SerifItalic] [\s!file:XCharter-Italic] [\s!features=\s!default,\s!goodies=xcharter-text] \definefontsynonym [\s!SerifSlanted] [\s!file:XCharter-Slanted] [\s!features=\s!default] - \definefontsynonym [\s!SerifBold] [\s!file:XCharter-Bold] [\s!features=\s!default] - \definefontsynonym [\s!SerifBoldItalic] [\s!file:xcharter-BoldItalic] [\s!features=\s!default] + \definefontsynonym [\s!SerifBold] [\s!file:XCharter-Bold] [\s!features=\s!default,\s!goodies=xcharter-text] + \definefontsynonym [\s!SerifBoldItalic] [\s!file:xcharter-BoldItalic] [\s!features=\s!default,\s!goodies=xcharter-text] \definefontsynonym [\s!SerifBoldSlanted][\s!file:XCharter-BoldSlanted][\s!features=\s!default] \stoptypescript diff --git a/tex/context/fonts/mkiv/xcharter-math.lfg b/tex/context/fonts/mkiv/xcharter-math.lfg index 3c349ee88..e2ed3e116 100644 --- a/tex/context/fonts/mkiv/xcharter-math.lfg +++ b/tex/context/fonts/mkiv/xcharter-math.lfg @@ -66,6 +66,9 @@ return { } }, { + tweak = "flattenaccents", + }, + { tweak = "checkspacing", }, { diff --git a/tex/context/fonts/mkiv/xcharter-text.lfg b/tex/context/fonts/mkiv/xcharter-text.lfg new file mode 100644 index 000000000..a836695fd --- /dev/null +++ b/tex/context/fonts/mkiv/xcharter-text.lfg @@ -0,0 +1,62 @@ +return { + name = "xcharter-text", + version = "1.00", + comment = "Goodies that complement Xcharter.", + author = "Mikael Sundqvist & Hans Hagen", + copyright = "ConTeXt development team", + extensions = { + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "XCharter-Roman", + "XCharter-Bold", + }, + data = { + ["f"] = { + [")"] = 125, + ["}"] = 125, + ["]"] = 125, + -- ["|"] = 100, + ["\\"] = 50, + ["*"] = 50, + ["?"] = 50, + ["!"] = 50, + ["\\"] = 125, + }, + } + }, + { + name = "kern", -- adds to kerns + type = "kern", + fonts = { + "XCharter-Italic", + "XCharter-BoldItalic", + }, + data = { + ["f"] = { + [")"] = 150, + ["}"] = 150, + ["]"] = 150, + ["\\"] = 125, + ["!"] = 100, + ["?"] = 100, + ["*"] = 100, + ["@"] = 100, + }, + ["("] = { + ["f"] = 100, + }, + ["{"] = { + ["f"] = 150, + }, + ["["] = { + ["f"] = 100, + }, + ["|"] = { + ["f"] = 130, + }, + } + }, + } +} diff --git a/tex/context/base/mkxl/type-imp-bengali.mkxl b/tex/context/fonts/mkxl/type-imp-bengali.mkxl index 84a0b6402..84a0b6402 100644 --- a/tex/context/base/mkxl/type-imp-bengali.mkxl +++ b/tex/context/fonts/mkxl/type-imp-bengali.mkxl diff --git a/tex/context/base/mkxl/type-imp-braille.mkxl b/tex/context/fonts/mkxl/type-imp-braille.mkxl index 17209d50c..17209d50c 100644 --- a/tex/context/base/mkxl/type-imp-braille.mkxl +++ b/tex/context/fonts/mkxl/type-imp-braille.mkxl diff --git a/tex/context/base/mkxl/type-imp-devanagari.mkxl b/tex/context/fonts/mkxl/type-imp-devanagari.mkxl index 4fb082094..4fb082094 100644 --- a/tex/context/base/mkxl/type-imp-devanagari.mkxl +++ b/tex/context/fonts/mkxl/type-imp-devanagari.mkxl diff --git a/tex/context/base/mkxl/type-imp-euler.mkxl b/tex/context/fonts/mkxl/type-imp-euler.mkxl index a2e066f6b..a2e066f6b 100644 --- a/tex/context/base/mkxl/type-imp-euler.mkxl +++ b/tex/context/fonts/mkxl/type-imp-euler.mkxl diff --git a/tex/context/base/mkxl/type-imp-gujarati.mkxl b/tex/context/fonts/mkxl/type-imp-gujarati.mkxl index d7f3f7072..d7f3f7072 100644 --- a/tex/context/base/mkxl/type-imp-gujarati.mkxl +++ b/tex/context/fonts/mkxl/type-imp-gujarati.mkxl diff --git a/tex/context/base/mkxl/type-imp-indic.mkxl b/tex/context/fonts/mkxl/type-imp-indic.mkxl index aeda08337..aeda08337 100644 --- a/tex/context/base/mkxl/type-imp-indic.mkxl +++ b/tex/context/fonts/mkxl/type-imp-indic.mkxl diff --git a/tex/context/base/mkxl/type-imp-kannada.mkxl b/tex/context/fonts/mkxl/type-imp-kannada.mkxl index 4838075b2..4838075b2 100644 --- a/tex/context/base/mkxl/type-imp-kannada.mkxl +++ b/tex/context/fonts/mkxl/type-imp-kannada.mkxl diff --git a/tex/context/base/mkxl/type-imp-malayalam.mkxl b/tex/context/fonts/mkxl/type-imp-malayalam.mkxl index 67a35d472..67a35d472 100644 --- a/tex/context/base/mkxl/type-imp-malayalam.mkxl +++ b/tex/context/fonts/mkxl/type-imp-malayalam.mkxl diff --git a/tex/context/base/mkxl/type-imp-tamil.mkxl b/tex/context/fonts/mkxl/type-imp-tamil.mkxl index 90516365e..90516365e 100644 --- a/tex/context/base/mkxl/type-imp-tamil.mkxl +++ b/tex/context/fonts/mkxl/type-imp-tamil.mkxl diff --git a/tex/context/base/mkxl/type-imp-telugu.mkxl b/tex/context/fonts/mkxl/type-imp-telugu.mkxl index 33d07664c..33d07664c 100644 --- a/tex/context/base/mkxl/type-imp-telugu.mkxl +++ b/tex/context/fonts/mkxl/type-imp-telugu.mkxl diff --git a/tex/context/modules/mkiv/m-tikz.mkiv b/tex/context/modules/mkiv/m-tikz.mkiv index ef1b6b7e3..61df89cfd 100644 --- a/tex/context/modules/mkiv/m-tikz.mkiv +++ b/tex/context/modules/mkiv/m-tikz.mkiv @@ -39,10 +39,10 @@ \permanent\protected\def\starttikzinput {\pushcatcodetable \setcatcodetable\texcatcodes - \catcode`\@=11 - \catcode`\|=12 - \catcode`\!=12 - \catcode`\~=12 + \catcode`\@=11\relax + \catcode`\|=12\relax + \catcode`\!=12\relax + \catcode`\~=13\relax \relax} \permanent\protected\def\stoptikzinput diff --git a/tex/context/modules/mkiv/s-fonts-tables.lua b/tex/context/modules/mkiv/s-fonts-tables.lua index 65725594b..ed034b882 100644 --- a/tex/context/modules/mkiv/s-fonts-tables.lua +++ b/tex/context/modules/mkiv/s-fonts-tables.lua @@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['s-fonts-tables'] = { license = "see context related readme files" } +-- Thsi file needs to be updated to LMTX! + moduledata.fonts = moduledata.fonts or { } moduledata.fonts.tables = moduledata.fonts.tables or { } @@ -29,7 +31,7 @@ local setlink = nodes.setlink local hpack = nodes.hpack local applyvisuals = nodes.applyvisuals -local lefttoright_code = nodes.dirvalues.lefttoright +local lefttoright_code = (tex.directioncodes and tex.directioncodes.lefttoright) or nodes.dirvalues.lefttoright -- LMTX local handle_positions = fonts.handlers.otf.datasetpositionprocessor local handle_injections = nodes.injections.handler diff --git a/tex/context/modules/mkxl/m-tikz-pgfplots.tex b/tex/context/modules/mkxl/m-tikz-pgfplots.tex index 1dd06b8b2..666f6b00b 100644 --- a/tex/context/modules/mkxl/m-tikz-pgfplots.tex +++ b/tex/context/modules/mkxl/m-tikz-pgfplots.tex @@ -4,6 +4,8 @@ \writestatus{loading}{ConTeXt User Module / Pgfplots} +\usemodule[tikz] + \tikzinputfile{pgfplots.revision.tex} \usetikzlibrary[plotmarks] diff --git a/tex/context/modules/mkxl/m-tikz.mkxl b/tex/context/modules/mkxl/m-tikz.mkxl index 6b173227c..e79806ca9 100644 --- a/tex/context/modules/mkxl/m-tikz.mkxl +++ b/tex/context/modules/mkxl/m-tikz.mkxl @@ -42,10 +42,11 @@ \setcatcodetable\texcatcodes \pushmacro\meaning \let\meaning\meaningless - \catcode`\@=11 - \catcode`\|=12 - \catcode`\!=12 - \catcode`\~=13 + \catcode`\@=11\relax + \catcode`\|=13\relax % was 12 < texlive 2023 + \catcode`\!=12\relax + \catcode`\~=13\relax % needed >= texlive 2023 + % \catcode`\$= 3\relax \autoparagraphmode\zerocount} \permanent\protected\def\stoptikzinput diff --git a/tex/context/modules/mkxl/s-math-atoms.mkxl b/tex/context/modules/mkxl/s-math-atoms.mkxl index 1b5ebed41..ab54dd291 100644 --- a/tex/context/modules/mkxl/s-math-atoms.mkxl +++ b/tex/context/modules/mkxl/s-math-atoms.mkxl @@ -1,5 +1,5 @@ %D \module -%D [ file=s-math-atoms.mksl, +%D [ file=s-math-atoms.mkxl, %D version=2022.02.13, %D title=\CONTEXT\ Style File, %D subtitle=Show Math Atom Spacing, diff --git a/tex/context/modules/mkxl/s-math-tests.mkxl b/tex/context/modules/mkxl/s-math-tests.mkxl new file mode 100644 index 000000000..35f2a6248 --- /dev/null +++ b/tex/context/modules/mkxl/s-math-tests.mkxl @@ -0,0 +1,112 @@ +%D \module +%D [ file=s-math-tests.mkxl, +%D version=2023.04.03, +%D title=\CONTEXT\ Style File, +%D subtitle=Some Math Tests, +%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. + +\continueifinputfile{s-math-tests.mkxl} + +%D Here we collect some tests that later will become proper macros. + +\starttext + +\startbuffer + \ruledhbox \bgroup \im { + \dostepwiserecurse{`A}{`Z}{1}{ + \blackrule[color=darkgray,height=\the\Umathflattenedaccentbaseheight\textstyle,depth=0pt,width=0.05ts] + \hat{\char#1} + } + }\egroup +\stopbuffer + +\startTEXpage[offset=1ts] + \showglyphs +% \switchtobodyfont[modern] \getbuffer\par +% \blank +% \switchtobodyfont[pagella] \getbuffer\par +% \switchtobodyfont[termes] \getbuffer\par +% \switchtobodyfont[schola] \getbuffer\par +% \blank +% \switchtobodyfont[ebgaramon-nt]\getbuffer\par +% \switchtobodyfont[ebgaramond] \getbuffer\par +% \blank +% \switchtobodyfont[erewhon] \getbuffer\par +% \switchtobodyfont[kpfonts] \getbuffer\par +% \switchtobodyfont[xcharter] \getbuffer\par +% \switchtobodyfont[concrete] \getbuffer\par +% \switchtobodyfont[libertinus] \getbuffer\par +% \switchtobodyfont[stixtwo] \getbuffer\par +% \switchtobodyfont[lucida-nt] \getbuffer\par + \switchtobodyfont[lucida] + % 8.67123pt default + \bgroup + \bitwiseflip\mathfontcontrol\ignoreflataccentsmathcontrolcode + \appendtoks + \Umathflattenedaccentbaseheight\textstyle8.67123pt + \to\everymathematics + \getbuffer\par + \egroup + \bgroup + \appendtoks + \Umathflattenedaccentbaseheight\textstyle8.67123pt + \to\everymathematics + \getbuffer\par + \egroup + % 8.51532pt fixed + \bgroup + \appendtoks + \Umathflattenedaccentbaseheight\textstyle8.51532pt + \to\everymathematics + \getbuffer\par + \egroup +% \switchtobodyfont[libertinus] \getbuffer\par +\stopTEXpage + +\startTEXpage[offset=1ts] + + \definefontfeature[mathextra][] +% \definefontfeature[mathextra][ss10=yes,ss06=yes] + + \setupbodyfont[ebgaramond] + + \bgroup + \setupmathematics[stylealternative=] + \im{\hbar^{\hbar^{\hbar}}} + \egroup + \bgroup + \setupmathematics[stylealternative={hbar}] + \im{\hbar^{\hbar^{\hbar}}} + \egroup + \bgroup + \setupmathematics[stylealternative={hbar,outbendingh}] + \im{\hbar^{\hbar^{\hbar}}} + \egroup + \bgroup + \setupmathematics[stylealternative={outbendingh}] + \im{\hbar^{\hbar^{\hbar}}} + \egroup + + \definefontfeature[mathextra][] +% \definefontfeature[mathextra][cv03=yes] + + \setupbodyfont[stixtwo] + + \bgroup + \setupmathematics[stylealternative=] + \im{\emptyset^{\emptyset^{\emptyset}}} + \egroup + \bgroup + \setupmathematics[stylealternative={emptyset}] + \im{\emptyset^{\emptyset^{\emptyset}}} + \egroup + +\stopTEXpage + +\stoptext diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 7d9befa51..2e71a19d3 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-01 09:28 +-- merge date : 2023-04-11 22:45 do -- begin closure to overcome local limits and interference @@ -21334,7 +21334,7 @@ local trace_defining=false registertracker("fonts.defining",function(v) trace_d local report_otf=logs.reporter("fonts","otf loading") local fonts=fonts local otf=fonts.handlers.otf -otf.version=3.132 +otf.version=3.133 otf.cache=containers.define("fonts","otl",otf.version,true) otf.svgcache=containers.define("fonts","svg",otf.version,true) otf.pngcache=containers.define("fonts","png",otf.version,true) @@ -31740,7 +31740,11 @@ local function addfeature(data,feature,specifications,prepareonly) local list=askedsteps[i] local coverage=nil local format=nil - if featuretype=="substitution" then +if type(list)=="function" then + list=list(data,specification,list,i) +end + if not list then + elseif featuretype=="substitution" then category="gsub" coverage=(mapping and list) or prepare_substitution(list,featuretype,nocheck) elseif featuretype=="ligature" then |