diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-04-13 17:46:47 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-04-13 17:46:47 +0200 |
commit | daff89c886893f6bf7d092e45b7f78d5395f6274 (patch) | |
tree | 2c3a929bfba1f8d3e4eec6d6f03b888b1e80261b /tex | |
parent | d7a8aefe572fffed32a9dea97c4383d0622e7559 (diff) | |
download | context-daff89c886893f6bf7d092e45b7f78d5395f6274.tar.gz |
2016-04-13 16:51:00
Diffstat (limited to 'tex')
21 files changed, 848 insertions, 879 deletions
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 9efcf2403..da86faf6b 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 52051bd43..12e0c7057 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2016.04.12 10:12} +\newcontextversion{2016.04.13 16:46} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context-help.lmx b/tex/context/base/mkiv/context-help.lmx index cf4f73a61..5f5b5b20a 100644 --- a/tex/context/base/mkiv/context-help.lmx +++ b/tex/context/base/mkiv/context-help.lmx @@ -60,6 +60,17 @@ padding: 1em ; } </style> + <style type="text/css"> + #main-left { + background-color: #C0C0C0 ; + color: black; + } + <?lua + if utilities and utilities.scite and utilities.scite.css then +p(utilities.scite.css()) + end + ?> + </style> </head> <body> <div id="top"><div id="top-one"><div id="top-two"> diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 86bb83f5c..b2043ced7 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2016.04.12 10:12} +\edef\contextversion{2016.04.13 16:46} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-otr.lua b/tex/context/base/mkiv/font-otr.lua index 0ad1e194f..c5f3d563a 100644 --- a/tex/context/base/mkiv/font-otr.lua +++ b/tex/context/base/mkiv/font-otr.lua @@ -1798,15 +1798,15 @@ otf.unpackoutlines = unpackoutlines -- some properties in order to read following tables. When details is true we also -- initialize the glyphs data. -local function getinfo(maindata,sub,platformnames) +local function getinfo(maindata,sub,platformnames,rawfamilynames) local fontdata = sub and maindata.subfonts and maindata.subfonts[sub] or maindata local names = fontdata.names local info = nil if names then local metrics = fontdata.windowsmetrics or { } - local postscript = fontdata.postscript or { } - local fontheader = fontdata.fontheader or { } - local cffinfo = fontdata.cffinfo or { } + local postscript = fontdata.postscript or { } + local fontheader = fontdata.fontheader or { } + local cffinfo = fontdata.cffinfo or { } local filename = fontdata.filename local weight = getname(fontdata,"weight") or cffinfo.weight or metrics.weight local width = getname(fontdata,"width") or cffinfo.width or metrics.width @@ -1814,9 +1814,15 @@ local function getinfo(maindata,sub,platformnames) local fullname = getname(fontdata,"fullname") local family = getname(fontdata,"family") local subfamily = getname(fontdata,"subfamily") - local familyname = getname(fontdata,"typographicfamily") or family - local subfamilyname = getname(fontdata,"typographicsubfamily") or subfamily - local compatiblename = getname(fontdata,"compatiblefullname") + local familyname = getname(fontdata,"typographicfamily") + local subfamilyname = getname(fontdata,"typographicsubfamily") + local compatiblename = getname(fontdata,"compatiblefullname") -- kind of useless + if rawfamilynames then + -- for PG (for now, as i need to check / adapt context to catch a no-fallback case) + else + if not familyname then familyname = family end + if not subfamilyname then subfamilyname = subfamily end + end info = { -- we inherit some inconsistencies/choices from ff subfontindex = fontdata.subfontindex or sub or 0, -- filename = filename, @@ -2139,31 +2145,34 @@ end function readers.getinfo(filename,specification) -- string, nil|number|table -- platformnames is optional and not used by context (a too unpredictable mess -- that only add to the confusion) .. so it's only for checking things - local subfont = nil - local platformname = false + local subfont = nil + local platformname = false + local rawfamilynames = false if type(specification) == "table" then - subfont = tonumber(specification.subfont) - platformnames = specification.platformnames + subfont = tonumber(specification.subfont) + platformnames = specification.platformnames + rawfamilynames = specification.rawfamilynames else subfont = tonumber(specification) end local fontdata = loadfont { - filename = filename, - details = true, - platformnames = platformnames, + filename = filename, + details = true, + platformnames = platformnames, + -- rawfamilynames = rawfamilynames, } if fontdata then local subfonts = fontdata.subfonts if not subfonts then - return getinfo(fontdata,nil,platformnames) + return getinfo(fontdata,nil,platformnames,rawfamilynames) elseif not subfont then local info = { } for i=1,#subfonts do - info[i] = getinfo(fontdata,i,platformnames) + info[i] = getinfo(fontdata,i,platformnames,rawfamilynames) end return info elseif subfont > 1 and subfont <= #subfonts then - return getinfo(fontdata,subfont,platformnames) + return getinfo(fontdata,subfont,platformnames,rawfamilynames) else return { filename = filename, diff --git a/tex/context/base/mkiv/font-syn.lua b/tex/context/base/mkiv/font-syn.lua index 049fbd101..2d671c397 100644 --- a/tex/context/base/mkiv/font-syn.lua +++ b/tex/context/base/mkiv/font-syn.lua @@ -308,14 +308,12 @@ end but to keep the overview, we define them here.</p> --ldx]]-- --- filters.dfont = get_font_info - filters.otf = fonts.handlers.otf.readers.getinfo filters.ttf = filters.otf filters.ttc = filters.otf --- filters.ttx = filters.otf +-------.ttx = filters.otf -local function normalize(t) +local function normalize(t) -- only for afm parsing local boundingbox = t.fontbbox if boundingbox then for i=1,#boundingbox do @@ -329,7 +327,6 @@ local function normalize(t) fontname = t.fontname, fullname = t.fullname, familyname = t.familyname, - -- subfamilyname = t.subfamilyname, -- nor used / needed weight = t.weight, widtht = t.width, italicangle = tonumber(t.italicangle) or 0, @@ -564,7 +561,7 @@ local function check_name(data,result,filename,modification,suffix,subfont) local family = result.family local subfamily = result.subfamily local familyname = result.familyname - local subfamilyname = result.subfamilyname or result.modifiers + local subfamilyname = result.subfamilyname -- local compatiblename = result.compatiblename local weight = result.weight local italicangle = tonumber(result.italicangle) @@ -585,10 +582,12 @@ local function check_name(data,result,filename,modification,suffix,subfont) -- analyze local a_name, a_weight, a_style, a_width, a_variant = analyzespec(fullname or fontname or familyname) -- check - local width = a_width + local width = a_width local variant = a_variant - local style = subfamilyname and gsub(subfamilyname,"[^%a]","") - if not style and italicangle then + local style = subfamilyname or subfamily -- can re really trust subfamilyname? + if style then + style = gsub(style,"[^%a]","") + elseif italicangle then style = "italic" end if not variant or variant == "" then @@ -624,8 +623,8 @@ local function check_name(data,result,filename,modification,suffix,subfont) rawname = rawname, fullname = fullname, fontname = fontname, - family = family, -- kind of redundant, could be nil if familyname - subfamily = subfamily, -- kind of redundant, could be nil if familyname + family = family, + subfamily = subfamily, familyname = familyname, subfamilyname = subfamilyname, -- compatiblename = compatiblename, -- nor used / needed @@ -793,29 +792,50 @@ local function collecthashes() if specifications then -- maybe multiple passes for index=1,#specifications do - local s = specifications[index] - local format, fullname, fontname, familyname, weight, subfamily = s.format, s.fullname, s.fontname, s.familyname, s.weight, s.subfamily - local mf, ff = mappings[format], fallbacks[format] - if fullname and not mf[fullname] then - mf[fullname], nofmappings = index, nofmappings + 1 - end - if fontname and not mf[fontname] then - mf[fontname], nofmappings = index, nofmappings + 1 - end - if familyname and weight and weight ~= sub(familyname,#familyname-#weight+1,#familyname) then - local madename = familyname .. weight - if not mf[madename] and not ff[madename] then - ff[madename], noffallbacks = index, noffallbacks + 1 - end + local specification = specifications[index] + local format = specification.format + local fullname = specification.fullname + local fontname = specification.fontname + local familyname = specification.familyname or specification.family + local subfamilyname = specification.subfamilyname + local subfamily = specification.subfamily + local weight = specification.weight + local mapping = mappings[format] + local fallback = fallbacks[format] + if fullname and not mapping[fullname] then + mapping[fullname] = index + nofmappings = nofmappings + 1 + end + if fontname and not mapping[fontname] then + mapping[fontname] = index + nofmappings = nofmappings + 1 end - if familyname and subfamily and subfamily ~= sub(familyname,#familyname-#subfamily+1,#familyname) then - local extraname = familyname .. subfamily - if not mf[extraname] and not ff[extraname] then - ff[extraname], noffallbacks = index, noffallbacks + 1 + if familyname then + if weight and weight ~= sub(familyname,#familyname-#weight+1,#familyname) then + local madename = familyname .. weight + if not mapping[madename] and not fallback[madename] then + fallback[madename] = index + noffallbacks = noffallbacks + 1 + end + end + if subfamily and subfamily ~= sub(familyname,#familyname-#subfamily+1,#familyname) then + local extraname = familyname .. subfamily + if not mapping[extraname] and not fallback[extraname] then + fallback[extraname] = index + noffallbacks = noffallbacks + 1 + end + end + if subfamilyname and subfamilyname ~= sub(familyname,#familyname-#subfamilyname+1,#familyname) then + local extraname = familyname .. subfamilyname + if not mapping[extraname] and not fallback[extraname] then + fallback[extraname] = index + noffallbacks = noffallbacks + 1 + end + end + if not mapping[familyname] and not fallback[familyname] then + fallback[familyname] = index + noffallbacks = noffallbacks + 1 end - end - if familyname and not mf[familyname] and not ff[familyname] then - ff[familyname], noffallbacks = index, noffallbacks + 1 end end end diff --git a/tex/context/base/mkiv/mult-def.lua b/tex/context/base/mkiv/mult-def.lua index 47f6518c4..24c602729 100644 --- a/tex/context/base/mkiv/mult-def.lua +++ b/tex/context/base/mkiv/mult-def.lua @@ -17127,4 +17127,548 @@ return { ["ro"]="da", }, }, + ["setupstrings"]={ + ["cd:buffer"]={ + ["cs"]="buffer", + ["de"]="buffer", + ["en"]="buffer", + ["fr"]="buffer", + ["it"]="buffer", + ["nl"]="buffer", + ["ro"]="buffer", + }, + ["cd:category"]={ + ["cs"]="category", + ["de"]="category", + ["en"]="category", + ["fr"]="category", + ["it"]="category", + ["nl"]="category", + ["ro"]="category", + }, + ["cd:character"]={ + ["cs"]="character", + ["de"]="character", + ["en"]="character", + ["fr"]="character", + ["it"]="character", + ["nl"]="karakter", + ["ro"]="character", + }, + ["cd:color"]={ + ["cs"]="color", + ["de"]="color", + ["en"]="color", + ["fr"]="color", + ["it"]="color", + ["nl"]="kleur", + ["ro"]="color", + }, + ["cd:column"]={ + ["cs"]="column", + ["de"]="column", + ["en"]="column", + ["fr"]="column", + ["it"]="column", + ["nl"]="kolom", + ["ro"]="column", + }, + ["cd:command"]={ + ["cs"]="Befehl", + ["de"]="Befehl", + ["en"]="command", + ["fr"]="Befehl", + ["it"]="Befehl", + ["nl"]="commando", + ["ro"]="Befehl", + }, + ["cd:content"]={ + ["cs"]="content", + ["de"]="content", + ["en"]="content", + ["fr"]="content", + ["it"]="content", + ["nl"]="inhoud", + ["ro"]="content", + }, + ["cd:csname"]={ + ["cs"]="csname", + ["de"]="csname", + ["en"]="csname", + ["fr"]="csname", + ["it"]="csname", + ["nl"]="naam", + ["ro"]="csname", + }, + ["cd:destination"]={ + ["cs"]="destination", + ["de"]="destination", + ["en"]="destination", + ["fr"]="destination", + ["it"]="destination", + ["nl"]="bestemming", + ["ro"]="destination", + }, + ["cd:dimension"]={ + ["cs"]="Dimension", + ["de"]="Dimension", + ["en"]="dimension", + ["fr"]="Dimension", + ["it"]="Dimension", + ["nl"]="maat", + ["ro"]="Dimension", + }, + ["cd:displaymath"]={ + ["cs"]="formula", + ["de"]="formula", + ["en"]="formula", + ["fr"]="formula", + ["it"]="formula", + ["nl"]="formule", + ["ro"]="formula", + }, + ["cd:false"]={ + ["cs"]="false", + ["de"]="false", + ["en"]="false", + ["fr"]="false", + ["it"]="false", + ["nl"]="false", + ["ro"]="false", + }, + ["cd:file"]={ + ["cs"]="file", + ["de"]="file", + ["en"]="file", + ["fr"]="file", + ["it"]="file", + ["nl"]="file", + ["ro"]="file", + }, + ["cd:first"]={ + ["cs"]="first", + ["de"]="first", + ["en"]="first", + ["fr"]="first", + ["it"]="first", + ["nl"]="eerste", + ["ro"]="first", + }, + ["cd:font"]={ + ["cs"]="font", + ["de"]="font", + ["en"]="font", + ["fr"]="font", + ["it"]="font", + ["nl"]="font", + ["ro"]="font", + }, + ["cd:formula"]={ + ["cs"]="Formel", + ["de"]="Formel", + ["en"]="formula", + ["fr"]="Formel", + ["it"]="Formel", + ["nl"]="formule", + ["ro"]="Formel", + }, + ["cd:identifier"]={ + ["cs"]="Name", + ["de"]="Name", + ["en"]="identifier", + ["fr"]="Name", + ["it"]="Name", + ["nl"]="naam", + ["ro"]="Name", + }, + ["cd:index"]={ + ["cs"]="entry", + ["de"]="entry", + ["en"]="entry", + ["fr"]="entry", + ["it"]="entry", + ["nl"]="ingang", + ["ro"]="entry", + }, + ["cd:inherits"]={ + ["cs"]="inherits", + ["de"]="inherits", + ["en"]="inherits", + ["fr"]="inherits", + ["it"]="inherits", + ["nl"]="erft", + ["ro"]="inherits", + }, + ["cd:key"]={ + ["cs"]="key", + ["de"]="key", + ["en"]="key", + ["fr"]="key", + ["it"]="key", + ["nl"]="parameter", + ["ro"]="key", + }, + ["cd:language"]={ + ["cs"]="sprache", + ["de"]="sprache", + ["en"]="language", + ["fr"]="sprache", + ["it"]="sprache", + ["nl"]="taal", + ["ro"]="sprache", + }, + ["cd:last"]={ + ["cs"]="last", + ["de"]="last", + ["en"]="last", + ["fr"]="last", + ["it"]="last", + ["nl"]="laatste", + ["ro"]="last", + }, + ["cd:list"]={ + ["cs"]="Liste", + ["de"]="Liste", + ["en"]="list", + ["fr"]="Liste", + ["it"]="Liste", + ["nl"]="lijst", + ["ro"]="Liste", + }, + ["cd:lpath"]={ + ["cs"]="lpath", + ["de"]="lpath", + ["en"]="lpath", + ["fr"]="lpath", + ["it"]="lpath", + ["nl"]="lpath", + ["ro"]="lpath", + }, + ["cd:luafunction"]={ + ["cs"]="luafunction", + ["de"]="luafunction", + ["en"]="luafunction", + ["fr"]="luafunction", + ["it"]="luafunction", + ["nl"]="luafunction", + ["ro"]="luafunction", + }, + ["cd:mark"]={ + ["cs"]="Beschriftung", + ["de"]="Beschriftung", + ["en"]="mark", + ["fr"]="Beschriftung", + ["it"]="Beschriftung", + ["nl"]="markering", + ["ro"]="Beschriftung", + }, + ["cd:marking"]={ + ["cs"]="marking", + ["de"]="marking", + ["en"]="marking", + ["fr"]="marking", + ["it"]="marking", + ["nl"]="markering", + ["ro"]="marking", + }, + ["cd:math"]={ + ["cs"]="formula", + ["de"]="formula", + ["en"]="formula", + ["fr"]="formula", + ["it"]="formula", + ["nl"]="formule", + ["ro"]="formula", + }, + ["cd:matrix"]={ + ["cs"]="n*m", + ["de"]="n*m", + ["en"]="n*m", + ["fr"]="n*m", + ["it"]="n*m", + ["nl"]="n*m", + ["ro"]="n*m", + }, + ["cd:name"]={ + ["cs"]="Name", + ["de"]="Name", + ["en"]="name", + ["fr"]="Name", + ["it"]="Name", + ["nl"]="naam", + ["ro"]="Name", + }, + ["cd:node"]={ + ["cs"]="node", + ["de"]="node", + ["en"]="node", + ["fr"]="node", + ["it"]="node", + ["nl"]="node", + ["ro"]="node", + }, + ["cd:nothing"]={ + ["cs"]="empty", + ["de"]="empty", + ["en"]="empty", + ["fr"]="empty", + ["it"]="empty", + ["nl"]="leeg", + ["ro"]="empty", + }, + ["cd:number"]={ + ["cs"]="Nummer", + ["de"]="Nummer", + ["en"]="number", + ["fr"]="Nummer", + ["it"]="Nummer", + ["nl"]="getal", + ["ro"]="Nummer", + }, + ["cd:optional"]={ + ["cs"]="opt", + ["de"]="opt", + ["en"]="opt", + ["fr"]="opt", + ["it"]="opt", + ["nl"]="opt", + ["ro"]="opt", + }, + ["cd:plural"]={ + ["cs"]="plural", + ["de"]="plural", + ["en"]="plural", + ["fr"]="plural", + ["it"]="plural", + ["nl"]="naam", + ["ro"]="plural", + }, + ["cd:position"]={ + ["cs"]="position", + ["de"]="position", + ["en"]="position", + ["fr"]="position", + ["it"]="position", + ["nl"]="positie", + ["ro"]="position", + }, + ["cd:processor"]={ + ["cs"]="processor", + ["de"]="processor", + ["en"]="processor", + ["fr"]="processor", + ["it"]="processor", + ["nl"]="verwerker", + ["ro"]="processor", + }, + ["cd:reference"]={ + ["cs"]="reference", + ["de"]="reference", + ["en"]="reference", + ["fr"]="reference", + ["it"]="reference", + ["nl"]="verwijzing", + ["ro"]="reference", + }, + ["cd:row"]={ + ["cs"]="row", + ["de"]="row", + ["en"]="row", + ["fr"]="row", + ["it"]="row", + ["nl"]="rij", + ["ro"]="row", + }, + ["cd:section"]={ + ["cs"]="Abschnitt", + ["de"]="Abschnitt", + ["en"]="section", + ["fr"]="Abschnitt", + ["it"]="Abschnitt", + ["nl"]="sectie", + ["ro"]="Abschnitt", + }, + ["cd:sectionblock"]={ + ["cs"]="sectionblock", + ["de"]="sectionblock", + ["en"]="sectionblock", + ["fr"]="sectionblock", + ["it"]="sectionblock", + ["nl"]="sectieblok", + ["ro"]="sectionblock", + }, + ["cd:see"]={ + ["cs"]="siehe", + ["de"]="siehe", + ["en"]="see", + ["fr"]="siehe", + ["it"]="siehe", + ["nl"]="zie", + ["ro"]="siehe", + }, + ["cd:setup"]={ + ["cs"]="setup", + ["de"]="setup", + ["en"]="setup", + ["fr"]="setup", + ["it"]="setup", + ["nl"]="setup", + ["ro"]="setup", + }, + ["cd:singular"]={ + ["cs"]="singular", + ["de"]="singular", + ["en"]="singular", + ["fr"]="singular", + ["it"]="singular", + ["nl"]="naam", + ["ro"]="singular", + }, + ["cd:style"]={ + ["cs"]="style", + ["de"]="style", + ["en"]="style", + ["fr"]="style", + ["it"]="style", + ["nl"]="letter", + ["ro"]="style", + }, + ["cd:template"]={ + ["cs"]="template", + ["de"]="template", + ["en"]="template", + ["fr"]="template", + ["it"]="template", + ["nl"]="sjabloon", + ["ro"]="template", + }, + ["cd:text"]={ + ["cs"]="Text", + ["de"]="Text", + ["en"]="text", + ["fr"]="Text", + ["it"]="Text", + ["nl"]="tekst", + ["ro"]="Text", + }, + ["cd:title"]={ + ["cs"]="Setup", + ["de"]="Setup", + ["en"]="setup", + ["fr"]="Setup", + ["it"]="Setup", + ["nl"]="setup", + ["ro"]="Setup", + }, + ["cd:triplet"]={ + ["cs"]="triplet", + ["de"]="triplet", + ["en"]="triplet", + ["fr"]="triplet", + ["it"]="triplet", + ["nl"]="triplet", + ["ro"]="triplet", + }, + ["cd:true"]={ + ["cs"]="true", + ["de"]="true", + ["en"]="true", + ["fr"]="true", + ["it"]="true", + ["nl"]="true", + ["ro"]="true", + }, + ["cd:url"]={ + ["cs"]="url", + ["de"]="url", + ["en"]="url", + ["fr"]="url", + ["it"]="url", + ["nl"]="url", + ["ro"]="url", + }, + ["cd:userdata"]={ + ["cs"]="userdata", + ["de"]="userdata", + ["en"]="userdata", + ["fr"]="userdata", + ["it"]="userdata", + ["nl"]="gebruikersdata", + ["ro"]="userdata", + }, + ["cd:value"]={ + ["cs"]="value", + ["de"]="value", + ["en"]="value", + ["fr"]="value", + ["it"]="value", + ["nl"]="waarde", + ["ro"]="value", + }, + ["cd:word"]={ + ["cs"]="word", + ["de"]="word", + ["en"]="word", + ["fr"]="word", + ["it"]="word", + ["nl"]="woord", + ["ro"]="word", + }, + ["cd:xmlsetup"]={ + ["cs"]="xmlsetup", + ["de"]="xmlsetup", + ["en"]="xmlsetup", + ["fr"]="xmlsetup", + ["it"]="xmlsetup", + ["nl"]="xmlsetup", + ["ro"]="xmlsetup", + }, + ["s:sign"] = { en = "[-+]" }, + ["s:noargument"] = { en = "\\..." }, + ["s:oneargument"] = { en = "\\...#1" }, + ["s:twoarguments"] = { en = "\\...#1#2" }, + ["s:threearguments"] = { en = "\\...#1#2#3" }, + ["s:braces"] = { en = "{...}" }, + ["l:braces"] = { en = "{...,...}" }, + ["s:brackets"] = { en = "[...]" }, + ["l:brackets"] = { en = "[...,...]" }, + ["s:index"] = { en = "[...]" }, + ["l:index"] = { en = "[..+...+..]" }, + ["s:math"] = { en = "$...$" }, + ["s:inlinemath"] = { en = "$...$" }, + ["s:displaymath"] = { en = "$$...$$" }, + ["s:template"] = { en = "[|...|]" }, + ["l:template"] = { en = "[|...|...|]" }, + ["s:twowords"] = { en = "[..+..]" }, + ["s:threewords"] = { en = "[..+..+..]" }, + ["s:angle"] = { en = "<<...>>" }, + ["s:reference"] = { en = "[...]" }, + ["l:reference"] = { en = "[...,...]" }, + ["s:position"] = { en = "(...)" }, + ["l:position"] = { en = "(...,...)" }, + ["s:triplet"] = { en = "[x:y:z=]" }, + ["l:triplet"] = { en = "[x:y:z=,..]" }, + ["s:word"] = { en = "{...}" }, + ["l:word"] = { en = "{.. ... ..}" }, + ["s:content"] = { en = "{...}" }, + ["l:content"] = { en = "{.. ... ..}" }, + ["s:textual"] = { en = "..." }, + ["l:textual"] = { en = ".. ... .." }, + ["s:none"] = { en = "..." }, + ["l:none"] = { en = ".. ... .." }, + ["s:macro"] = { en = "\\... " }, + ["s:to"] = { en = "\\to " }, + ["s:destination"] = { en = "[{..[ref]}]" }, + ["l:destination"] = { en = "[..,{..[ref,..]},..]" }, + ["s:nothing"] = { en = "..." }, + ["s:file"] = { en = " ... " }, + ["s:bracedassignment"] = { en = "{..=..}" }, + ["l:bracedassignment"] = { en = "{..,..=..,..}" }, + ["s:bracketedassignment"] = { en = "[..=..]" }, + ["l:bracketedassignment"] = { en = "[..,..=..,..]" }, + ["s:parenthesizedassignment"] = { en = "[..=..]" }, + ["l:parenthesizedassignment"] = { en = "[..,..=..,..]" }, + ["s:apply"] = { en = "[..=>..]" }, + ["l:apply"] = { en = "[..,..=>..,..]" }, + } } diff --git a/tex/context/base/mkiv/mult-ini.lua b/tex/context/base/mkiv/mult-ini.lua index 99703b488..3fb5416ba 100644 --- a/tex/context/base/mkiv/mult-ini.lua +++ b/tex/context/base/mkiv/mult-ini.lua @@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['mult-ini'] = { license = "see context related readme files" } -local format, gmatch, match = string.format, string.gmatch, string.match +local format, gmatch, match, find, sub = string.format, string.gmatch, string.match, string.find, string.sub local lpegmatch = lpeg.match local serialize, concat = table.serialize, table.concat local rawget, type = rawget, type @@ -18,6 +18,7 @@ local implement = interfaces.implement local allocate = utilities.storage.allocate local mark = utilities.storage.mark local prtcatcodes = catcodes.numbers.prtcatcodes +local vrbcatcodes = catcodes.numbers.vrbcatcodes local contextsprint = context.sprint local setmetatableindex = table.setmetatableindex local formatters = string.formatters @@ -30,6 +31,7 @@ interfaces.variables = mark(interfaces.variables or { }) interfaces.elements = mark(interfaces.elements or { }) interfaces.formats = mark(interfaces.formats or { }) interfaces.translations = mark(interfaces.translations or { }) +interfaces.setupstrings = mark(interfaces.setupstrings or { }) interfaces.corenamespaces = mark(interfaces.corenamespaces or { }) local registerstorage = storage.register @@ -40,6 +42,7 @@ local variables = interfaces.variables local elements = interfaces.elements local formats = interfaces.formats local translations = interfaces.translations +local setupstrings = interfaces.setupstrings local corenamespaces = interfaces.corenamespaces local reporters = { } -- just an optimization @@ -48,6 +51,7 @@ registerstorage("interfaces/variables", variables, "interfaces.variabl registerstorage("interfaces/elements", elements, "interfaces.elements") registerstorage("interfaces/formats", formats, "interfaces.formats") registerstorage("interfaces/translations", translations, "interfaces.translations") +registerstorage("interfaces/setupstrings", setupstrings, "interfaces.setupstrings") registerstorage("interfaces/corenamespaces", corenamespaces, "interfaces.corenamespaces") interfaces.interfaces = { @@ -87,6 +91,7 @@ setmetatableindex(constants, valueiskey) setmetatableindex(elements, valueiskey) setmetatableindex(formats, valueiskey) setmetatableindex(translations, valueiskey) +setmetatableindex(setupstrings, valueiskey) function interfaces.registernamespace(n,namespace) corenamespaces[n] = namespace @@ -133,6 +138,12 @@ function interfaces.setformat(tag,values) add(formats,tag,values) end +local function getsetupstring(tag) + return setupstrings[tag] or tag +end + +interfaces.getsetupstring = getsetupstring + -- the old method: local replacer = lpeg.replacer { { "--", "%%a" } } @@ -198,61 +209,11 @@ end logs.setmessenger(context.verbatim.ctxreport) --- initialization - --- function interfaces.setuserinterface(interface,response) --- sharedstorage.currentinterface, currentinterface = interface, interface --- sharedstorage.currentresponse, currentresponse = response, response --- if environment.initex then --- local nofconstants = 0 --- for given, constant in next, complete.constants do --- constant = constant[interface] or constant.en or given --- constants[constant] = given -- breedte -> width --- contextsprint(prtcatcodes,"\\ui_c{",given,"}{",constant,"}") -- user interface constant --- nofconstants = nofconstants + 1 --- end --- local nofvariables = 0 --- for given, variable in next, complete.variables do --- variable = variable[interface] or variable.en or given --- variables[given] = variable -- ja -> yes --- contextsprint(prtcatcodes,"\\ui_v{",given,"}{",variable,"}") -- user interface variable --- nofvariables = nofvariables + 1 --- end --- local nofelements = 0 --- for given, element in next, complete.elements do --- element = element[interface] or element.en or given --- elements[element] = given --- contextsprint(prtcatcodes,"\\ui_e{",given,"}{",element,"}") -- user interface element --- nofelements = nofelements + 1 --- end --- local nofcommands = 0 --- for given, command in next, complete.commands do --- command = command[interface] or command.en or given --- if command ~= given then --- contextsprint(prtcatcodes,"\\ui_m{",given,"}{",command,"}") -- user interface macro --- end --- nofcommands = nofcommands + 1 --- end --- local nofformats = 0 --- for given, format in next, complete.messages.formats do --- formats[given] = format[interface] or format.en or given --- nofformats = nofformats + 1 --- end --- local noftranslations = 0 --- for given, translation in next, complete.messages.translations do --- translations[given] = translation[interface] or translation.en or given --- noftranslations = noftranslations + 1 --- end --- report_interface("definitions: %a constants, %a variables, %a elements, %a commands, %a formats, %a translations", --- nofconstants,nofvariables,nofelements,nofcommands,nofformats,noftranslations) --- else --- report_interface("the language(s) can only be set when making the format") --- end --- end +-- todo: use setmacro function interfaces.setuserinterface(interface,response) sharedstorage.currentinterface, currentinterface = interface, interface - sharedstorage.currentresponse, currentresponse = response, response + sharedstorage.currentresponse, currentresponse = response, response if environment.initex then local nofconstants = 0 local nofvariables = 0 @@ -260,6 +221,7 @@ function interfaces.setuserinterface(interface,response) local nofcommands = 0 local nofformats = 0 local noftranslations = 0 + local nofsetupstrings = 0 local t, n, f, s -- t, n, f, s = { }, 0, formatters["\\ui_c{%s}{%s}"], formatters["\\ui_s{%s}"] @@ -314,8 +276,14 @@ function interfaces.setuserinterface(interface,response) noftranslations = noftranslations + 1 end -- - report_interface("definitions: %a constants, %a variables, %a elements, %a commands, %a formats, %a translations", - nofconstants,nofvariables,nofelements,nofcommands,nofformats,noftranslations) + for given, setupstring in next, complete.setupstrings do + setupstring = setupstring[interface] or setupstring.en or given + setupstrings[given] = setupstring + nofsetupstrings = nofsetupstrings + 1 + end + -- + report_interface("definitions: %a constants, %a variables, %a elements, %a commands, %a formats, %a translations, %a setupstrings", + nofconstants,nofvariables,nofelements,nofcommands,nofformats,noftranslations,nofsetupstrings) else report_interface("the language(s) can only be set when making the format") end @@ -400,6 +368,14 @@ implement { arguments = "string", } +implement { + name = "getsetupstring", + actions = function(s) + contextsprint(vrbcatcodes,getsetupstring(s)) + end, + arguments = "string", +} + local function showassignerror(namespace,key,line) local ns, instance = match(namespace,"^(%d+)[^%a]+(%a*)") if ns then diff --git a/tex/context/base/mkiv/mult-ini.mkiv b/tex/context/base/mkiv/mult-ini.mkiv index 9d7db394c..8675834a5 100644 --- a/tex/context/base/mkiv/mult-ini.mkiv +++ b/tex/context/base/mkiv/mult-ini.mkiv @@ -392,6 +392,8 @@ \unexpanded\def\inlinemessage #1{\dontleavehmode{\tttf#1}} \unexpanded\def\displaymessage#1{\blank\inlinemessage{#1}\blank} +\let\getsetupstring\clf_getsetupstring + %D \macros %D {ifshowwarnings, ifshowmessages} %D diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 1d3ebe8d3..b39796806 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 7cc6c115e..eb4cadf97 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-dha.lua b/tex/context/base/mkiv/typo-dha.lua index fa17b1e06..25e92bd28 100644 --- a/tex/context/base/mkiv/typo-dha.lua +++ b/tex/context/base/mkiv/typo-dha.lua @@ -52,7 +52,7 @@ local nutstring = nuts.tostring local getnext = nuts.getnext local getprev = nuts.getprev -local getfont = nuts.getfont +local getchar = nuts.getchar local getid = nuts.getid local getsubtype = nuts.getsubtype local getlist = nuts.getlist @@ -73,8 +73,9 @@ local end_of_math = nuts.end_of_math local nodepool = nuts.pool local nodecodes = nodes.nodecodes -local mathcodes = nodes.mathcodes +local skipcodes = nodes.skipcodes +local glyph_code = nodecodes.glyph local math_code = nodecodes.math local penalty_code = nodecodes.penalty local kern_code = nodecodes.kern @@ -84,6 +85,8 @@ local vlist_code = nodecodes.vlist local dir_code = nodecodes.dir local localpar_code = nodecodes.localpar +local parfillskip_code = skipcodes.parfillskip + local new_textdir = nodepool.textdir local hasbit = number.hasbit @@ -158,7 +161,8 @@ local function process(start) local fences = { } while current do - local character, id = isglyph(current) + -- no isglyph here as we test for skips first + local id = getid(current) local next = getnext(current) if id == math_code then current = getnext(end_of_math(next)) @@ -176,8 +180,9 @@ local function process(start) prevattr = attr end end - if character then + if id == glyph_code then if attr and attr > 0 then + local character, font = isglyph(current) if character == 0 then -- skip signals setprop(current,"direction",true) @@ -198,7 +203,7 @@ local function process(start) end if direction == "on" then local mirror = charmirrors[character] - if mirror and fontchar[getfont(current)][mirror] then + if mirror and fontchar[font][mirror] then local class = charclasses[character] if class == "open" then if nextisright(current) then @@ -304,11 +309,15 @@ local function process(start) setprop(current,"direction",true) end elseif id == glue_code then - setprop(current,"direction",'g') + if getsubtype(current) == parfillskip_code then + setprop(current,"direction",'!') + else + setprop(current,"direction",'g') + end elseif id == kern_code then setprop(current,"direction",'k') elseif id == dir_code then - local dir = getfield(current,"dir") + local dir = getfield(current,"dir") if dir == "+TRT" then autodir = -1 elseif dir == "+TLT" then @@ -408,7 +417,7 @@ local function process(start) state = "r" done = true end - last = false + last = false elseif collapse then if cp == "k" or cp == "g" then last = last or current @@ -430,10 +439,13 @@ local function process(start) if next then current = next else - if state == "r" then - head = insert_node_after(head,current,stopdir("TRT")) - elseif state == "l" then - head = insert_node_after(head,current,stopdir("TLT")) + local sd = (state == "r" and stopdir("TRT")) or (state == "l" and stopdir("TLT")) + if sd then + if id == glue_code and getsubtype(current) == parfillskip_code then + head = insert_node_before(head,current,sd) + else + head = insert_node_after(head,current,sd) + end end break end diff --git a/tex/context/base/mkiv/typo-dir.mkiv b/tex/context/base/mkiv/typo-dir.mkiv index 7290c8313..c5fd6fa41 100644 --- a/tex/context/base/mkiv/typo-dir.mkiv +++ b/tex/context/base/mkiv/typo-dir.mkiv @@ -22,6 +22,7 @@ \registerctxluafile{typo-dha}{1.001} \registerctxluafile{typo-dua}{1.001} \registerctxluafile{typo-dub}{1.001} +\registerctxluafile{typo-duc}{1.001} \definesystemattribute[directions][public] diff --git a/tex/context/base/mkiv/typo-dua.lua b/tex/context/base/mkiv/typo-dua.lua index 4e2fc4600..f697ac562 100644 --- a/tex/context/base/mkiv/typo-dua.lua +++ b/tex/context/base/mkiv/typo-dua.lua @@ -75,9 +75,9 @@ local getnext = nuts.getnext local getid = nuts.getid local getsubtype = nuts.getsubtype local getlist = nuts.getlist +local getchar = nuts.getchar local getfield = nuts.getfield local getprop = nuts.getprop -local isglyph = nuts.isglyph -- or ischar local setfield = nuts.setfield local setprop = nuts.setprop @@ -100,7 +100,7 @@ local vlist_code = nodecodes.vlist local math_code = nodecodes.math local dir_code = nodecodes.dir local localpar_code = nodecodes.localpar -local parfillskip_code = skipcodes.skipcodes +local parfillskip_code = skipcodes.parfillskip ----- object_replacement = 0xFFFC -- object replacement character local maximum_stack = 60 -- probably spec but not needed @@ -204,7 +204,7 @@ local function build_list(head) -- todo: store node pointer ... saves loop local size = 0 while current do size = size + 1 - local chr, id = isglyph(current) + local id = getid(current) if getprop(current,"directions") then local skip = 0 local last = id @@ -224,7 +224,8 @@ local function build_list(head) -- todo: store node pointer ... saves loop else list[size] = { char = 0xFFFC, direction = "on", original = "on", level = 0, skip = skip, id = id, last = last } end - elseif chr then + elseif id == glyph_code then + local chr = getchar(current) local dir = directiondata[chr] list[size] = { char = chr, direction = dir, original = dir, level = 0 } current = getnext(current) diff --git a/tex/context/base/mkiv/typo-dub.lua b/tex/context/base/mkiv/typo-dub.lua index ac33173fd..7ac339799 100644 --- a/tex/context/base/mkiv/typo-dub.lua +++ b/tex/context/base/mkiv/typo-dub.lua @@ -63,10 +63,10 @@ local getnext = nuts.getnext local getid = nuts.getid local getsubtype = nuts.getsubtype local getlist = nuts.getlist +local getchar = nuts.getchar local getattr = nuts.getattr local getfield = nuts.getfield local getprop = nuts.getprop -local isglyph = nuts.isglyph -- or ischar local setfield = nuts.setfield local setprop = nuts.setprop @@ -89,7 +89,7 @@ local vlist_code = nodecodes.vlist local math_code = nodecodes.math local dir_code = nodecodes.dir local localpar_code = nodecodes.localpar -local parfillskip_code = skipcodes.skipcodes +local parfillskip_code = skipcodes.parfillskip local maximum_stack = 0xFF -- unicode: 60, will be jumped to 125, we don't care too much @@ -259,7 +259,7 @@ local function build_list(head) -- todo: store node pointer ... saves loop local size = 0 while current do size = size + 1 - local chr, id = isglyph(current) + local id = getid(current) if getprop(current,"directions") then local skip = 0 local last = id @@ -279,7 +279,8 @@ local function build_list(head) -- todo: store node pointer ... saves loop else list[size] = { char = 0xFFFC, direction = "on", original = "on", level = 0, skip = skip, id = id, last = last } end - elseif chr then + elseif id == glyph_code then + local chr = getchar(current) local dir = directiondata[chr] list[size] = { char = chr, direction = dir, original = dir, level = 0 } current = getnext(current) diff --git a/tex/context/base/mkiv/typo-duc.lua b/tex/context/base/mkiv/typo-duc.lua index 6f388eb34..fce40932f 100644 --- a/tex/context/base/mkiv/typo-duc.lua +++ b/tex/context/base/mkiv/typo-duc.lua @@ -63,11 +63,11 @@ local nutstring = nuts.tostring local getnext = nuts.getnext local getid = nuts.getid local getsubtype = nuts.getsubtype +local getchar = nuts.getchar local getlist = nuts.getlist local getattr = nuts.getattr local getfield = nuts.getfield local getprop = nuts.getprop -local isglyph = nuts.isglyph -- or ischar local setfield = nuts.setfield local setprop = nuts.setprop @@ -92,7 +92,7 @@ local vlist_code = nodecodes.vlist local math_code = nodecodes.math local dir_code = nodecodes.dir local localpar_code = nodecodes.localpar -local parfillskip_code = skipcodes.skipcodes +local parfillskip_code = skipcodes.parfillskip local maximum_stack = 0xFF -- unicode: 60, will be jumped to 125, we don't care too much @@ -261,9 +261,9 @@ local function build_list(head) -- todo: store node pointer ... saves loop local size = 0 while current do size = size + 1 - local chr, id = isglyph(current) + local id = getid(current) + local p = properties[current] local t - local p = properties[current] if p and p.directions then local skip = 0 local last = id @@ -279,40 +279,33 @@ local function build_list(head) -- todo: store node pointer ... saves loop end end if id == last then -- the start id --- t = { level = 0, skip = skip, id = id } t = { skip = skip, id = id } else t = { skip = skip, id = id, last = last } --- t = { level = 0, skip = skip, id = id, last = last } end setmetatable(t,mt_object) - elseif chr or id == glyph_code then + elseif id == glyph_code then + local chr = getchar(current) local dir = directiondata[chr] --- t = { level = 0, char = chr, direction = dir, original = dir, level = 0 } t = { char = chr, direction = dir, original = dir, level = 0 } current = getnext(current) -- if not list[dir] then list[dir] = true end -- not faster when we check for usage elseif id == glue_code then -- and how about kern --- t = { level = 0 } t = { } setmetatable(t,mt_space) current = getnext(current) elseif id == dir_code then local dir = getfield(current,"dir") if dir == "+TLT" then --- t = { level = 0 } t = { } setmetatable(t,mt_lre) elseif dir == "+TRT" then --- t = { level = 0 } t = { } setmetatable(t,mt_rle) elseif dir == "-TLT" or dir == "-TRT" then --- t = { level = 0 } t = { } setmetatable(t,mt_pdf) else --- t = { level = 0, id = id } t = { id = id } setmetatable(t,mt_object) end @@ -326,7 +319,6 @@ local function build_list(head) -- todo: store node pointer ... saves loop end skip = skip + 1 current = getnext(current) --- t = { level = 0, id = id, skip = skip } t = { id = id, skip = skip } setmetatable(t,mt_object) else @@ -346,10 +338,8 @@ local function build_list(head) -- todo: store node pointer ... saves loop if skip == 0 then t = { id = id } elseif id == last then -- the start id --- t = { level = 0, id = id, skip = skip } t = { id = id, skip = skip } else --- t = { level = 0, id = id, skip = skip, last = last } t = { id = id, skip = skip, last = last } end setmetatable(t,mt_object) diff --git a/tex/context/base/mkiv/util-str.lua b/tex/context/base/mkiv/util-str.lua index 95534c8d8..28b75dbc5 100644 --- a/tex/context/base/mkiv/util-str.lua +++ b/tex/context/base/mkiv/util-str.lua @@ -822,6 +822,8 @@ end -- aA b cC d eE f gG hH iI jJ lL mM N o p qQ r sS tT uU wW xX z +-- extensions : %!tag! + local builder = Cs { "start", start = ( ( diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex 80039ab23..9aa19b30c 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex 62e5bc306..809d8caad 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/context/modules/mkiv/x-setups-basics.mkiv b/tex/context/modules/mkiv/x-setups-basics.mkiv index c3adb6881..da4bc3262 100644 --- a/tex/context/modules/mkiv/x-setups-basics.mkiv +++ b/tex/context/modules/mkiv/x-setups-basics.mkiv @@ -12,482 +12,9 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -% we can make this module a bit cleaner using more recent features -% like sorting the xml directly .. will happen stepwise - -% \startluacode -% collectgarbage("stop") -% function collectgarbage() return 0 end -% \stopluacode - -% todo: for fun: pure lua interface, but as this style evolved over 15 years -% it's a waste of time -% -% todo: -% -% \setup{setupinterlinespace} -% \setup{setupinterlinespace:1} -% \setup{setupinterlinespace:2} -% -% cd:include -> filename -% cd:choice -% -% register, interaction - -\startmessages dutch library: setup - title: setup - formula: formule - number: getal - list: lijst - dimension: maat - mark: markering - reference: verwijzing - command: commando - file: file - name: naam - identifier: naam - text: tekst - section: sectie - singular: naam enkelvoud - plural: naam meervoud - matrix: n*m - see: zie - inherits: erft van - 1: de karakters < en > zijn globaal actief! - 2: -- wordt verwerkt - 3: -- is niet gedefinieerd - 4: -- wordt nogmaals verwerkt - optional: opt - displaymath: formule - index: ingang - math: formule - nothing: leeg - file: file - position: positie - reference: verwijzing - csname: naam - destination: bestemming - triplet: triplet - word: woord - content: inhoud - % - language: taal - processor: verwerker - style: letter - font: font - character: karakter - userdata: gebruikersdata - key: parameter - value: waarde - color: kleur - template: sjabloon - node: node - lpath: lpath - xmlsetup: xmlsetup - luafunction: luafunction - marking: markering - sectionblock: sectieblok - row: rij - column: kolom - url: url - first: eerste - last: laatste - setup: setup - buffer: buffer - true: true - false: false - category: category -\stopmessages - -\startmessages english library: setup - title: setup - formula: formula - number: number - list: list - dimension: dimension - mark: mark - reference: reference - command: command - file: file - name: name - identifier: identifier - text: text - section: section - singular: singular name - plural: plural name - matrix: n*m - see: see - inherits: inherits from - 1: the characters < and > are globally active! - 2: -- is processed - 3: -- is undefined - 4: -- is processed again - optional: opt - displaymath: formula - index: entry - math: formula - nothing: empty - file: file - position: position - reference: reference - csname: csname - destination: destination - triplet: triplet - word: word - content: content - % - language: language - processor: processor - style: style - font: font - character: character - userdata: userdata - key: key - value: value - color: color - template: template - node: node - lpath: lpath - xmlsetup: xmlsetup - luafunction: luafunction - marking: marking - sectionblock: sectionblock - row: row - column: column - url: url - first: first - last: last - setup: setup - buffer: buffer - true: true - false: false - category: category -\stopmessages - -\startmessages german library: setup - title: Setup - formula: Formel - number: Nummer - list: Liste - dimension: Dimension - mark: Beschriftung - reference: Referenz - command: Befehl - file: Datei - name: Name - identifier: Name - text: Text - section: Abschnitt - singular: singular - plural: plural - matrix: n*m - see: siehe - inherits: inherits from - 1: Die Zeichen < und > gelten global! - 2: -- wird verarbeitet - 3: -- ist undefiniert - 4: -- ist mehrmals verarbeitet - optional: opt - displaymath: formula - index: entry - math: formula - nothing: empty - file: file - position: position - reference: reference - csname: csname - destination: destination - triplet: triplet - word: word - content: content - % - language: sprache - processor: processor - style: style - font: font - character: character - userdata: userdata - key: key - value: value - color: color - template: template - node: node - lpath: lpath - xmlsetup: xmlsetup - luafunction: luafunction - marking: marking - sectionblock: sectionblock - row: row - column: column - url: url - first: first - last: last - setup: setup - buffer: buffer - true: true - false: false - category: category -\stopmessages - -\startmessages czech library: setup - title: setup - formula: rovnice - number: cislo - list: seznam - dimension: dimenze - mark: znacka - reference: reference - command: prikaz - file: soubor - name: jmeno - identifier: jmeno - text: text - section: sekce - singular: jmeno v singularu - plural: jmeno v pluralu - matrix: n*m - see: viz - inherits: inherits from - 1: znaky < a > jsou globalne aktivni! - 2: -- je zpracovano - 3: -- je nedefinovano - 4: -- je zpracovano znovu - optional: opt - displaymath: formula - index: entry - math: formula - nothing: empty - file: file - position: position - reference: reference - csname: csname - destination: destination - triplet: triplet - word: word - content: content - % - language: language - processor: processor - style: style - font: font - character: character - userdata: userdata - key: key - value: value - color: color - template: template - node: node - lpath: lpath - xmlsetup: xmlsetup - luafunction: luafunction - marking: marking - sectionblock: sectionblock - row: row - column: column - url: url - first: first - last: last - setup: setup - buffer: buffer - true: true - false: false - category: category -\stopmessages - -\startmessages italian library: setup - title: setup - formula: formula - number: number - list: list - dimension: dimension - mark: mark - reference: reference - command: command - file: file - name: name - identifier: name - text: text - section: section - singular: singular name - plural: plural name - matrix: n*m - see: see - inherits: inherits from - 1: the characters < and > are globally active! - 2: -- is processed - 3: -- is undefined - 4: -- is processed again - optional: opt - displaymath: formula - index: entry - math: formula - nothing: empty - file: file - position: position - reference: reference - csname: csname - destination: destination - triplet: triplet - word: word - content: content - % - language: language - processor: processor - style: style - font: font - character: character - userdata: userdata - key: key - value: value - color: color - template: template - node: node - lpath: lpath - xmlsetup: xmlsetup - luafunction: luafunction - marking: marking - sectionblock: sectionblock - row: row - column: column - url: url - first: first - last: last - setup: setup - buffer: buffer - true: true - false: false - category: category -\stopmessages - -\startmessages romanian library: setup - title: setari - formula: formula - number: numar - list: lista - dimension: dimensiune - mark: marcaj - reference: referinta - command: comanda - file: fisier - name: nume - identifier: nume - text: text - section: sectiune - singular: nume singular - plural: nume pluram - matrix: n*m - see: vezi - inherits: inherits from - 1: caracterele < si > sunt active global! - 2: este procesat -- - 3: -- este nedefinit - 4: -- este procesat din nou - optional: opt - displaymath: formula - index: entry - math: formula - nothing: empty - file: file - position: position - reference: reference - csname: csname - destination: destination - triplet: triplet - word: word - content: content - % - language: language - processor: processor - style: style - font: font - character: character - userdata: userdata - key: key - value: value - color: color - template: template - node: node - lpath: lpath - xmlsetup: xmlsetup - luafunction: luafunction - marking: marking - sectionblock: sectionblock - row: row - column: column - url: url - first: first - last: last - setup: setup - buffer: buffer - true: true - false: false - category: category -\stopmessages - -\startmessages french library: setup - title: réglage - formula: formule - number: numéro - list: liste - dimension: dimension - mark: marquage - reference: reference - command: commande - file: fichier - name: nom - identifier: identificateur - text: texte - section: section - singular: nom singulier - plural: nom pluriel - matrix: n*m - see: vois - inherits: herite de - 1: les caractères < et > sont globalement actifs ! - 2: -- est traité - 3: -- n'est pas défini - 4: -- est traité de nouveau - optional: opt - displaymath: formule - index: entrée - math: formule - nothing: vide - file: fichier - position: position - reference: réference - csname: csnom - destination: destination - triplet: triplet - word: mot - content: content - % - language: language - processor: processor - style: style - font: font - character: character - userdata: userdata - key: key - value: value - color: color - template: template - node: node - lpath: lpath - xmlsetup: xmlsetup - luafunction: luafunction - marking: marking - sectionblock: sectionblock - row: row - column: column - url: url - first: first - last: last - setup: setup - buffer: buffer - true: true - false: false - category: category -\stopmessages +% We can make this module a bit cleaner using more recent features +% or we go \LUA\ completely but as this style evolved over 15 years +% it's a waste of time. \unprotect @@ -501,17 +28,14 @@ \unexpanded\def\setupalwcolor{} \unexpanded\def\setupoptcolor{darkgray} +\unexpanded\def\setupvarword#1{{\sl\detokenize{#1}}} +\unexpanded\def\setupintword#1{\WORD{\detokenize{#1}}} +\unexpanded\def\setuptxtword#1{\detokenize{#1}} + \installcorenamespace{interfacesetup} -\installcorenamespace{interfacesetupreserved} \installsetuponlycommandhandler \??interfacesetup {setup} % \??interfacesetup -\unexpanded\def\cmd_define_reserved#1#2% - {\setvalue{\??interfacesetupreserved#1}{#2}} - -\unexpanded\def\cmd_reserved_value#1% - {\executeifdefined{\??interfacesetupreserved#1}{#1}} - \unexpanded\def\cmd_internal_value#1% {\dontleavehmode \begingroup @@ -525,7 +49,7 @@ \endgroup} \unexpanded\def\cmd_command_value#1% - {{\setupvarfont{\texescape...#1}}} + {{\setupvarfont{#1}}} \defineregister [texmacro] @@ -566,15 +90,10 @@ \let\currentSETUPprefix\empty } \edef\currentSETUPname{\xmlatt{#1}{name}} -% \doifelse {\xmlatt{#1}{generated}} {yes} { -% \def\currentSETUPgenerated{*} -% } { - \let\currentSETUPgenerated\empty -% } + \let\currentSETUPgenerated\empty \doifelsenothing {\xmlatt{#1}{variant}} { \let\currentSETUPvariant\empty } { - %\def\currentSETUPvariant{:\xmlatt{#1}{variant}} \def\currentSETUPvariant{:\xmllastatt} } \edef\currentSETUPfullname { @@ -593,6 +112,16 @@ \startluacode + local find, gsub = string.find, string.gsub + + local context = context + + local setupvarword = context.formatted.setupvarword + local setupintword = context.formatted.setupintword + local setuptxtword = context.formatted.setuptxtword + + local getsetupstring = interfaces.getsetupstring + -- normally a lookup is fast enough but here we can have many setups -- spread over many files so we do a little speedup here @@ -646,13 +175,12 @@ replace('cd:variable', 'type', variables) replace('cd:inherit', 'name', commands, elements) - end if tex.modes["setups:save"] and environment.currentrun == 1 then local s = tostring(x) - s = string.gsub(s,"\n*%s*(</cd:interface>)%s+(<cd:interface)", "\n\n %1\n\n %2") - s = string.gsub(s,"\n*%s*(</cd:interface>)%s+(</cd:interface>)","\n\n %1\n\n %2") + s = gsub(s,"\n*%s*(</cd:interface>)%s+(<cd:interface)", "\n\n %1\n\n %2") + s = gsub(s,"\n*%s*(</cd:interface>)%s+(</cd:interface>)","\n\n %1\n\n %2") io.savedata("context-"..interface..".xml",s) end @@ -679,6 +207,29 @@ context(n) end + local cmd = table.tohash { + "cd:noargument", + "cd:oneargument", + "cd:twoarguments", + "cd:threearguments", + } + + interfaces.implement { + name = "getsetupstring", + actions = function(s) + local g = getsetupstring(s) + if not find(s,"^cd:") then + setuptxtword(g) + elseif cmd[s] then + setupvarword(g) + else + setupintword(g) + end + end, + overload = true, + arguments = "string", + } + \stopluacode % <?xml version="1.0" encoding="UTF-8"?> @@ -694,12 +245,8 @@ \loadsetups[\xmlatt{#1}{filename}] \stopxmlsetups -% todo: option to expand - \startxmlsetups xml:setups:basics -% \xmlcommand {#1}{interface/interfacefile}{xml:setups:interfacefile} -% \xmlinclude {#1}{include}{filename} - \xmlincludeoptions {#1}{interfacefile|include}{filename}{recurse,basename} + \xmlincludeoptions{#1}{interfacefile|include}{filename}{recurse,basename} \xmlsetsetup{#1}{*}{xml:setups:*} \xmlfunction{#1}{setups_define} \stopxmlsetups @@ -981,37 +528,40 @@ \xmlatt{#1}{value}\ignorespaces \stopxmlsetups -\startxmlsetups xml:setups:content \showSETUPcomponent{#1}{content} {content} \stopxmlsetups -\startxmlsetups xml:setups:displaymath \showSETUPcomponent{#1}{displaymath}{display math}\stopxmlsetups -\startxmlsetups xml:setups:index \showSETUPcomponent{#1}{index} {index} \stopxmlsetups -\startxmlsetups xml:setups:math \showSETUPcomponent{#1}{math} {math} \stopxmlsetups -\startxmlsetups xml:setups:nothing \showSETUPcomponent{#1}{nothing} {nothing} \stopxmlsetups -\startxmlsetups xml:setups:file \showSETUPcomponent{#1}{file} {file name} \stopxmlsetups -\startxmlsetups xml:setups:position \showSETUPcomponent{#1}{position} {position} \stopxmlsetups -\startxmlsetups xml:setups:reference \showSETUPcomponent{#1}{reference} {reference} \stopxmlsetups -\startxmlsetups xml:setups:csname \showSETUPcomponent{#1}{csname} {csname} \stopxmlsetups -\startxmlsetups xml:setups:destination \showSETUPcomponent{#1}{destination}{destination} \stopxmlsetups -\startxmlsetups xml:setups:triplet \showSETUPcomponent{#1}{triplet} {triplet} \stopxmlsetups -\startxmlsetups xml:setups:word \showSETUPcomponent{#1}{word} {word} \stopxmlsetups -\startxmlsetups xml:setups:template \showSETUPcomponent{#1}{template} {template} \stopxmlsetups -\startxmlsetups xml:setups:angles \showSETUPcomponent{#1}{angles} {angles} \stopxmlsetups -\startxmlsetups xml:setups:apply \showSETUPcomponent{#1}{apply} {apply} \stopxmlsetups -\startxmlsetups xml:setups:twowords \showSETUPcomponent{#1}{twowords} {twowords} \stopxmlsetups -\startxmlsetups xml:setups:threewords \showSETUPcomponent{#1}{threewords} {threewords} \stopxmlsetups -\startxmlsetups xml:setups:text \showSETUPcomponent{#1}{text} {text} \stopxmlsetups -% \startxmlsetups xml:setups:to \showSETUPcomponent{#1}{to} {to} \stopxmlsetups +\startxmlsetups xml:setups:content \showSETUPcomponent{#1}{content} {content} \stopxmlsetups +\startxmlsetups xml:setups:displaymath \showSETUPcomponent{#1}{displaymath}{displaymath}\stopxmlsetups +\startxmlsetups xml:setups:index \showSETUPcomponent{#1}{index} {index} \stopxmlsetups +\startxmlsetups xml:setups:math \showSETUPcomponent{#1}{math} {math} \stopxmlsetups +\startxmlsetups xml:setups:nothing \showSETUPcomponent{#1}{nothing} {nothing} \stopxmlsetups +\startxmlsetups xml:setups:file \showSETUPcomponent{#1}{file} {file} \stopxmlsetups +\startxmlsetups xml:setups:position \showSETUPcomponent{#1}{position} {position} \stopxmlsetups +\startxmlsetups xml:setups:reference \showSETUPcomponent{#1}{reference} {reference} \stopxmlsetups +\startxmlsetups xml:setups:csname \showSETUPcomponent{#1}{csname} {csname} \stopxmlsetups +\startxmlsetups xml:setups:destination \showSETUPcomponent{#1}{destination}{destination}\stopxmlsetups +\startxmlsetups xml:setups:triplet \showSETUPcomponent{#1}{triplet} {triplet} \stopxmlsetups +\startxmlsetups xml:setups:word \showSETUPcomponent{#1}{word} {word} \stopxmlsetups +\startxmlsetups xml:setups:template \showSETUPcomponent{#1}{template} {template} \stopxmlsetups +\startxmlsetups xml:setups:angles \showSETUPcomponent{#1}{angles} {angles} \stopxmlsetups +\startxmlsetups xml:setups:apply \showSETUPcomponent{#1}{apply} {apply} \stopxmlsetups +\startxmlsetups xml:setups:twowords \showSETUPcomponent{#1}{twowords} {twowords} \stopxmlsetups +\startxmlsetups xml:setups:threewords \showSETUPcomponent{#1}{threewords} {threewords} \stopxmlsetups +\startxmlsetups xml:setups:text \showSETUPcomponent{#1}{text} {text} \stopxmlsetups + +% todo: cd:par => \\par +% todo: cd:sep => \\\\ \startxmlsetups xml:setups:delimiter \doifmode{setups-pass-one} { - \showSETUPline{\letterbackslash\xmlatt{#1}{name}} + \kern.5\emwidth + \letterbackslash\xmlatt{#1}{name} } \ignorespaces \stopxmlsetups \unexpanded\def\showSETUPcomponent#1#2#3% {\doifelsemode{setups-pass-one} - {\getvalue{showSETUP#2}{#1}} - {\simpleSETUPargument{#3}}} + {\getvalue{showSETUP#2}{#1}} % top line + {\simpleSETUPargument{#3}}} % column %D This is the second pass; here we generate the table. @@ -1080,9 +630,9 @@ \startxmlsetups xml:setups:parameter \doifmodeelse {setups-measure} { - \cmd_reserved_value{\xmlatt{#1}{name}}\par + \getsetupstring{\xmlatt{#1}{name}}\par } { - \startsecondSETUPcolumn{\cmd_reserved_value{\xmlatt{#1}{name}}}{=} + \startsecondSETUPcolumn{\getsetupstring{\xmlatt{#1}{name}}}{=} \ignorespaces \xmlflush{#1} \doifmode{interface:setup:defaults} { @@ -1111,21 +661,21 @@ \xmlmapvalue{setups:method}{none} {} \startxmlsetups xml:setups:constant:value - \cmd_reserved_value{\xmlatt{#1}{type}} + \getsetupstring{\xmlatt{#1}{type}} \stopxmlsetups \startxmlsetups xml:setups:constant \doifelsemode {setups-pass-one} { } { \doifsomethingelse{\xmlatt{#1}{prefix}} { - \cmd_reserved_value{\xmllastatt} + \getsetupstring{\xmllastatt} \xmlmappedvalue{setups:method}{\xmlatt{#1}{method}}{none} } { \doif {\xmlatt{#1}{default}} {yes} { \underbar % next needs to be {braced} } } - {\cmd_reserved_value{\xmlatt{#1}{type}}} + {\getsetupstring{\xmlatt{#1}{type}}} \space \ignorespaces } @@ -1135,7 +685,7 @@ \doifelsemode {setups-pass-one} { \expanded{\setupintfont{\xmlatt{#1}{value}}}\ignorespaces } { - \cmd_reserved_value{\xmlatt{#1}{value}} + \getsetupstring{\xmlatt{#1}{value}} \space \ignorespaces } @@ -1143,7 +693,7 @@ \startxmlsetups xml:setups:inherit \secondSETUPcolumn { - \cmd_text_value{\getmessage{setup}{inherits}} + \cmd_text_value{\getsetupstring{cd:inherits}} \enspace \letterbackslash \xmlatt{#1}{name} @@ -1158,67 +708,15 @@ \blank[\v!halfline] \ignorespaces} -\cmd_define_reserved {cd:command} {\cmd_internal_value{\getmessage{setup}{command}}} -\cmd_define_reserved {cd:dimension} {\cmd_internal_value{\getmessage{setup}{dimension}}} -\cmd_define_reserved {cd:file} {\cmd_internal_value{\getmessage{setup}{file}}} -\cmd_define_reserved {cd:buffer} {\cmd_internal_value{\getmessage{setup}{buffer}}} -\cmd_define_reserved {cd:name} {\cmd_internal_value{\getmessage{setup}{identifier}}} -\cmd_define_reserved {cd:character} {\cmd_internal_value{\getmessage{setup}{character}}} -\cmd_define_reserved {cd:mark} {\cmd_internal_value{\getmessage{setup}{mark}}} -\cmd_define_reserved {cd:number} {\cmd_internal_value{\getmessage{setup}{number}}} -\cmd_define_reserved {cd:first} {\cmd_internal_value{\getmessage{setup}{first}}} -\cmd_define_reserved {cd:last} {\cmd_internal_value{\getmessage{setup}{last}}} -\cmd_define_reserved {cd:reference} {\cmd_internal_value{\getmessage{setup}{reference}}} -\cmd_define_reserved {cd:plural} {\cmd_internal_value{\getmessage{setup}{plural}}} -\cmd_define_reserved {cd:singular} {\cmd_internal_value{\getmessage{setup}{singular}}} -\cmd_define_reserved {cd:text} {\cmd_internal_value{\getmessage{setup}{text}}} -\cmd_define_reserved {cd:formula} {\cmd_internal_value{\getmessage{setup}{formula}}} -\cmd_define_reserved {cd:file} {\cmd_internal_value{\getmessage{setup}{file}}} -\cmd_define_reserved {cd:matrix} {\cmd_internal_value{\getmessage{setup}{matrix}}} -\cmd_define_reserved {cd:list} {\cmd_internal_value{\getmessage{setup}{list}}} -\cmd_define_reserved {cd:section} {\cmd_internal_value{\getmessage{setup}{section}}} -\cmd_define_reserved {cd:language} {\cmd_internal_value{\getmessage{setup}{language}}} -\cmd_define_reserved {cd:section} {\cmd_internal_value{\getmessage{setup}{section}}} -\cmd_define_reserved {cd:language} {\cmd_internal_value{\getmessage{setup}{language}}} -\cmd_define_reserved {cd:processor} {\cmd_internal_value{\getmessage{setup}{processor}}} -\cmd_define_reserved {cd:style} {\cmd_internal_value{\getmessage{setup}{style}}} -\cmd_define_reserved {cd:font} {\cmd_internal_value{\getmessage{setup}{font}}} -\cmd_define_reserved {cd:character} {\cmd_internal_value{\getmessage{setup}{character}}} -\cmd_define_reserved {cd:userdata} {\cmd_internal_value{\getmessage{setup}{userdata}}} -\cmd_define_reserved {cd:key} {\cmd_internal_value{\getmessage{setup}{key}}} -\cmd_define_reserved {cd:value} {\cmd_internal_value{\getmessage{setup}{value}}} -\cmd_define_reserved {cd:color} {\cmd_internal_value{\getmessage{setup}{color}}} -\cmd_define_reserved {cd:template} {\cmd_internal_value{\getmessage{setup}{template}}} -\cmd_define_reserved {cd:node} {\cmd_internal_value{\getmessage{setup}{node}}} -\cmd_define_reserved {cd:lpath} {\cmd_internal_value{\getmessage{setup}{lpath}}} -\cmd_define_reserved {cd:setup} {\cmd_internal_value{\getmessage{setup}{setup}}} -\cmd_define_reserved {cd:xmlsetup} {\cmd_internal_value{\getmessage{setup}{xmlsetup}}} -\cmd_define_reserved {cd:luafunction} {\cmd_internal_value{\getmessage{setup}{luafunction}}} -\cmd_define_reserved {cd:marking} {\cmd_internal_value{\getmessage{setup}{marking}}} -\cmd_define_reserved {cd:sectionblock} {\cmd_internal_value{\getmessage{setup}{sectionblock}}} -\cmd_define_reserved {cd:row} {\cmd_internal_value{\getmessage{setup}{row}}} -\cmd_define_reserved {cd:column} {\cmd_internal_value{\getmessage{setup}{column}}} -\cmd_define_reserved {cd:url} {\cmd_internal_value{\getmessage{setup}{url}}} -\cmd_define_reserved {cd:true} {\cmd_internal_value{\getmessage{setup}{true}}} -\cmd_define_reserved {cd:false} {\cmd_internal_value{\getmessage{setup}{false}}} -\cmd_define_reserved {cd:category} {\cmd_internal_value{\getmessage{setup}{category}}} -\cmd_define_reserved {cd:csname} {\cmd_internal_value{\getmessage{setup}{csname}}} -\cmd_define_reserved {cd:content} {\cmd_internal_value{\getmessage{setup}{content}}} - -%cmd_define_reserved {cd:noargument} {\cmd_command_value {}} -\cmd_define_reserved {cd:oneargument} {\cmd_command_value {\texthash1}} -\cmd_define_reserved {cd:twoarguments} {\cmd_command_value {\texthash1\texthash2}} -\cmd_define_reserved {cd:threearguments} {\cmd_command_value {\texthash1\texthash2\texthash3}} - -\cmd_define_reserved {cd:sign} {[-+]} - %D Auxiliary. -\unexpanded\def\showSETUP#1#2#3% +\unexpanded\def\showSETUP#1#2% {\bgroup \doglobal\increment\currentSETUPargument \setbox0=\hbox - {\doifelse{\xmlatt{#1}{list}}{yes}{#3}{#2}}% + {\doifelse{\xmlatt{#1}{list}}{yes} + {\getsetupstring{s:#2}}% + {\getsetupstring{l:#2}}}% \setbox2=\hbox to \wd0 {\hss \raise1.25\exheight\hbox @@ -1232,7 +730,7 @@ \bgroup \txx \doif {\xmlatt{#1}{optional}} {yes} - {\cmd_internal_value{\getmessage{setup}{optional}}}% + {\getsetupstring{cd:optional}}% \egroup \hss}% \ht2\ht\strutbox @@ -1246,9 +744,9 @@ \egroup \ignorespaces} -\unexpanded\def\showSETUPline#1% +\unexpanded\def\showSETUPline#1#2% {\kern.5\emwidth - #1% + \getsetupstring{s:#2}% \ignorespaces} \unexpanded\def\showSETUPnumber @@ -1266,6 +764,8 @@ \xmlmapvalue {setups:keyword} {parentheses} {\showSETUPkeywordparentheses} \xmlmapvalue {setups:keyword} {none} {\showSETUPkeywordnone} +% todo: replace = by lower + \unexpanded\def\setupEQsymbol % we raise the number already {.\lower.25\exheight\hpack{=}.} @@ -1274,41 +774,33 @@ \starttexdefinition unexpanded showSETUPassignmentbraces #1 \ifcase\kindofsetup - \showSETUPline{\letterleftbrace\setupEQsymbol\letterrightbrace} + \showSETUPline{#1}{bracedassignment} \else - \showSETUP{#1} - {\letterleftbrace\setupEQsymbol\letterrightbrace} - {\letterleftbrace..,\setupEQsymbol,..\letterrightbrace} + \showSETUP {#1}{bracedassignment} \fi \stoptexdefinition \starttexdefinition unexpanded showSETUPassignmentbrackets #1 \ifcase\kindofsetup - \showSETUPline{[\setupEQsymbol]} + \showSETUPline{#1}{bracketedassignment} \else - \showSETUP{#1} - {[\setupEQsymbol]} - {[..,\setupEQsymbol,..]} + \showSETUP {#1}{bracketedassignment} \fi \stoptexdefinition \starttexdefinition unexpanded showSETUPkeywordparentheses #1 \ifcase\kindofsetup - \showSETUPline{(...)} + \showSETUPline{#1}{parenthesizedassignment} \else - \showSETUP{#1} - {(...)} - {(...,...)} + \showSETUP {#1}{parenthesizedassignment} \fi \stoptexdefinition \starttexdefinition unexpanded showSETUPkeywordnone #1 \ifcase\kindofsetup - \showSETUPline{...} + \showSETUPline{#1}{none} \else - \showSETUP{#1} - {...} - {.. ... ..} + \showSETUP {#1}{none} \fi \stoptexdefinition @@ -1330,21 +822,17 @@ \starttexdefinition unexpanded showSETUPkeywordbraces #1 \ifcase\kindofsetup - \showSETUPline{\letterleftbrace...\letterrightbrace} + \showSETUPline{#1}{braces} \else - \showSETUP{#1} - {\letterleftbrace...\letterrightbrace} - {\letterleftbrace...,...\letterrightbrace} + \showSETUP {#1}{braces} \fi \stoptexdefinition \starttexdefinition unexpanded showSETUPkeywordbrackets #1 \ifcase\kindofsetup - \showSETUPline{[...]} + \showSETUPline{#1}{brackets} \else - \showSETUP{#1} - {[...]} - {[...,...]} + \showSETUP {#1}{brackets} \fi \stoptexdefinition @@ -1358,121 +846,26 @@ % arguments -% \unexpanded\def\showSETUPargument#1% -% {\ifcase\kindofsetup -% \showSETUPline{% -% \letterleftbrace -% \xmlfilter{#1}{/cd:constant/command(xml:setups:constant:value)}% always one -% \letterrightbrace -% } -% \else -% \showSETUP{#1} -% {\letterleftbrace..\letterrightbrace} -% {\letterleftbrace..,...,..\letterrightbrace}% -% \fi} - -\unexpanded\def\showSETUPdisplaymath#1% - {\showSETUP{#1} - {\letterdollar\letterdollar...\letterdollar\letterdollar} - {\letterdollar\letterdollar...\letterdollar\letterdollar}} - -\unexpanded\def\showSETUPindex#1% - {\showSETUP{#1} - {\letterleftbrace...\letterrightbrace} - {\letterleftbrace..+...+..\letterrightbrace}} - -\unexpanded\def\showSETUPmath#1% - {\showSETUP{#1} - {\letterdollar...\letterdollar} - {\letterdollar...\letterdollar}} - -\unexpanded\def\showSETUPnothing#1% - {\showSETUP{#1} - {...} - {}} - -\unexpanded\def\showSETUPfile#1% - {\showSETUP{#1} - {~...~} - {}} - -\unexpanded\def\showSETUPposition#1% - {\showSETUP{#1} - {(...)} - {(...,...)}} - -\unexpanded\def\showSETUPtemplate#1 - {\showSETUP{#1} - {[\letterbar...\letterbar]} - {[\letterbar...\letterbar...\letterbar]}} - -\unexpanded\def\showSETUPangles#1% - {\showSETUP{#1} - {<<...>>} - {<<...>>}} - -\unexpanded\def\showSETUPreference#1% - {\showSETUP{#1} - {[...]} - {[...,...]}} - -\unexpanded\def\showSETUPapply#1% - {\showSETUP{#1} - {[\setupAPPLYsymbol]} - {[..,\setupAPPLYsymbol,...]}} - -\unexpanded\def\showSETUPtwowords#1% - {\showSETUP{#1} - {[..+..]} - {[..+..]}} - -\unexpanded\def\showSETUPthreewords#1% - {\showSETUP{#1} - {[..+..+..]} - {[..+..+..]}} - -\unexpanded\def\showSETUPcsname#1% - {\showSETUP{#1} - {{\cmd_command_value{}}} - {}} - -\unexpanded\def\showSETUPdestination#1% - {\showSETUP{#1} - {[\letterleftbrace..[ref]\letterrightbrace]} - {[..,\letterleftbrace..[ref,..]\letterrightbrace,..]}} - -\unexpanded\def\showSETUPtriplet#1% - {\showSETUP{#1} - {[x:y:z=]} - {[x:y:z=,..]}} - -\unexpanded\def\showSETUPword#1% - {\showSETUP{#1} - {\letterleftbrace...\letterrightbrace} - {\letterleftbrace.. ... ..\letterrightbrace}} - -\unexpanded\def\showSETUPcontent#1% - {\showSETUP{#1} - {\letterleftbrace...\letterrightbrace} - {\letterleftbrace.. ... ..\letterrightbrace}} - -\unexpanded\def\showSETUPtext#1% - {\showSETUP{#1} - {...} - {.. ... ..}} - -% \unexpanded\def\showSETUPto#1% -% {\showSETUP{#1} -% {\texescape to } -% {\texescape to }} - -\unexpanded\def\showSETUPto#1% - {\showSETUPline{\texescape to}} - -\unexpanded\def\showSETUPmacro#1% - {\showSETUP{#1} - {\texescape macro } - {\texescape macro }} +\unexpanded\def\showSETUPdisplaymath#1{\showSETUP {#1}{displaymath}} +\unexpanded\def\showSETUPindex #1{\showSETUP {#1}{index}} +\unexpanded\def\showSETUPmath #1{\showSETUP {#1}{math}} +\unexpanded\def\showSETUPnothing #1{\showSETUP {#1}{nothing}} +\unexpanded\def\showSETUPfile #1{\showSETUP {#1}{file}} +\unexpanded\def\showSETUPposition #1{\showSETUP {#1}{position}} +\unexpanded\def\showSETUPtemplate #1{\showSETUP {#1}{template}} +\unexpanded\def\showSETUPangles #1{\showSETUP {#1}{angle}} +\unexpanded\def\showSETUPreference #1{\showSETUP {#1}{reference}} +\unexpanded\def\showSETUPapply #1{\showSETUP {#1}{apply}} +\unexpanded\def\showSETUPtwowords #1{\showSETUP {#1}{twowords}} +\unexpanded\def\showSETUPthreewords #1{\showSETUP {#1}{threewords}} +\unexpanded\def\showSETUPcsname #1{\showSETUP {#1}{noargument}} +\unexpanded\def\showSETUPdestination#1{\showSETUP {#1}{destination}} +\unexpanded\def\showSETUPtriplet #1{\showSETUP {#1}{triplet}} +\unexpanded\def\showSETUPword #1{\showSETUP {#1}{word}} +\unexpanded\def\showSETUPcontent #1{\showSETUP {#1}{content}} +\unexpanded\def\showSETUPtext #1{\showSETUP {#1}{textual}} +\unexpanded\def\showSETUPto #1{\showSETUPline{#1}{to}} +\unexpanded\def\showSETUPmacro #1{\showSETUP {#1}{macro}} % A prelude to a rewrite and some more: @@ -1554,7 +947,7 @@ % official interface \unexpanded\def\cmdinternal#1% - {{\tttf\cmd_reserved_value{#1}}} % todo color .. highlight + {{\tttf\getsetupstring{#1}}} % todo color .. highlight \let\cmdbasicsetup\basicsetup \let\cmdshortsetup\shortsetup diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index de818d1da..b76b15cd6 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 : 04/12/16 10:12:07 +-- merge date : 04/13/16 16:46:44 do -- begin closure to overcome local limits and interference @@ -9292,15 +9292,15 @@ local function unpackoutlines(data) end otf.packoutlines=packoutlines otf.unpackoutlines=unpackoutlines -local function getinfo(maindata,sub,platformnames) +local function getinfo(maindata,sub,platformnames,rawfamilynames) local fontdata=sub and maindata.subfonts and maindata.subfonts[sub] or maindata local names=fontdata.names local info=nil if names then local metrics=fontdata.windowsmetrics or {} - local postscript=fontdata.postscript or {} - local fontheader=fontdata.fontheader or {} - local cffinfo=fontdata.cffinfo or {} + local postscript=fontdata.postscript or {} + local fontheader=fontdata.fontheader or {} + local cffinfo=fontdata.cffinfo or {} local filename=fontdata.filename local weight=getname(fontdata,"weight") or cffinfo.weight or metrics.weight local width=getname(fontdata,"width") or cffinfo.width or metrics.width @@ -9308,9 +9308,14 @@ local function getinfo(maindata,sub,platformnames) local fullname=getname(fontdata,"fullname") local family=getname(fontdata,"family") local subfamily=getname(fontdata,"subfamily") - local familyname=getname(fontdata,"typographicfamily") or family - local subfamilyname=getname(fontdata,"typographicsubfamily") or subfamily - local compatiblename=getname(fontdata,"compatiblefullname") + local familyname=getname(fontdata,"typographicfamily") + local subfamilyname=getname(fontdata,"typographicsubfamily") + local compatiblename=getname(fontdata,"compatiblefullname") + if rawfamilynames then + else + if not familyname then familyname=family end + if not subfamilyname then subfamilyname=subfamily end + end info={ subfontindex=fontdata.subfontindex or sub or 0, version=getname(fontdata,"version"), @@ -9606,9 +9611,11 @@ end function readers.getinfo(filename,specification) local subfont=nil local platformname=false + local rawfamilynames=false if type(specification)=="table" then subfont=tonumber(specification.subfont) platformnames=specification.platformnames + rawfamilynames=specification.rawfamilynames else subfont=tonumber(specification) end @@ -9620,15 +9627,15 @@ function readers.getinfo(filename,specification) if fontdata then local subfonts=fontdata.subfonts if not subfonts then - return getinfo(fontdata,nil,platformnames) + return getinfo(fontdata,nil,platformnames,rawfamilynames) elseif not subfont then local info={} for i=1,#subfonts do - info[i]=getinfo(fontdata,i,platformnames) + info[i]=getinfo(fontdata,i,platformnames,rawfamilynames) end return info elseif subfont>1 and subfont<=#subfonts then - return getinfo(fontdata,subfont,platformnames) + return getinfo(fontdata,subfont,platformnames,rawfamilynames) else return { filename=filename, |