diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-09-12 09:56:30 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-09-12 09:56:30 +0200 |
commit | fbf22006525c920e93b9f671c2af3d4df2be902e (patch) | |
tree | 34d00873adf1442775edd4aa8cd5edc7da73919f /tex/context/base | |
parent | bfc2e20d0dfa0dfaf04b0c2c81aed20638f21c91 (diff) | |
download | context-fbf22006525c920e93b9f671c2af3d4df2be902e.tar.gz |
2016-09-12 08:18:00
Diffstat (limited to 'tex/context/base')
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4253 -> 4259 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/back-exp.lua | 98 | ||||
-rw-r--r-- | tex/context/base/mkiv/back-ini.lua | 19 | ||||
-rw-r--r-- | tex/context/base/mkiv/char-tex.lua | 3 | ||||
-rw-r--r-- | tex/context/base/mkiv/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/font-dsp.lua | 3 | ||||
-rw-r--r-- | tex/context/base/mkiv/font-pre.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/lpdf-ini.lua | 4 | ||||
-rw-r--r-- | tex/context/base/mkiv/lpdf-xmp.lua | 11 | ||||
-rw-r--r-- | tex/context/base/mkiv/math-ali.mkiv | 34 | ||||
-rw-r--r-- | tex/context/base/mkiv/mult-fun.lua | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/status-files.pdf | bin | 9305 -> 9189 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/status-lua.pdf | bin | 368824 -> 368972 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/typo-krn.lua | 15 |
15 files changed, 116 insertions, 79 deletions
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 1d505a4c9..d5ddbb215 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/mkiv/back-exp.lua b/tex/context/base/mkiv/back-exp.lua index b12247546..82142910b 100644 --- a/tex/context/base/mkiv/back-exp.lua +++ b/tex/context/base/mkiv/back-exp.lua @@ -38,7 +38,7 @@ local sub, gsub = string.sub, string.gsub local validstring = string.valid local lpegmatch = lpeg.match local utfchar, utfvalues = utf.char, utf.values -local concat, insert, remove, merge = table.concat, table.insert, table.remove, table.merge +local concat, insert, remove, merge, sort = table.concat, table.insert, table.remove, table.merge, table.sort local sortedhash = table.sortedhash local formatters = string.formatters local todimen = number.todimen @@ -71,6 +71,8 @@ local v_hidden = variables.hidden local implement = interfaces.implement +local included = backends.included + local settings_to_array = utilities.parsers.settings_to_array local setmetatableindex = table.setmetatableindex @@ -604,7 +606,9 @@ do setattribute(di,"language",languagenames[texgetcount("mainlanguagenumber")]) if not less_state then setattribute(di,"file",tex.jobname) - setattribute(di,"date",os.date()) + if included.date then + setattribute(di,"date",backends.timestamp()) + end setattribute(di,"context",environment.version) setattribute(di,"version",exportversion) setattribute(di,"xmlns:m",mathmlns) @@ -771,7 +775,7 @@ do function finalizers.descriptions(tree) local n = 0 - for id, tag in next, descriptions do + for id, tag in sortedhash(descriptions) do local sym = symbols[id] if sym then n = n + 1 @@ -1858,16 +1862,26 @@ do local f_metadata = formatters["%w<metavariable name=%q>%s</metavariable>\n"] local f_metadata_end = formatters["%w</metadata>\n"] - --- we could share the r tables ... but it's fast enough anyway - local function attributes(a) - local r = { } -- can be shared + local r = { } local n = 0 for k, v in next, a do n = n + 1 r[n] = f_attribute(k,v) -- lpegmatch(p_escaped,v) end - return concat(r,"",1,n) + sort(r) + return concat(r,"") + end + + local function properties(a) + local r = { } + local n = 0 + for k, v in next, a do + n = n + 1 + r[n] = f_property(exportproperties,k,v) + end + sort(r) + return concat(r,"") end local depth = 0 @@ -1959,23 +1973,15 @@ do if not p then -- skip elseif exportproperties == v_yes then - for k, v in next, p do - n = n + 1 - r[n] = f_attribute(k,v) - end + r[n] = attributes(p) else - for k, v in next, p do - n = n + 1 - r[n] = f_property(exportproperties,k,v) - end + r[n] = properties(p) end end local a = di.attributes if a then - for k, v in next, a do - n = n + 1 - r[n] = f_attribute(k,v) - end + n = n + 1 + r[n] = attributes(a) end if n == 0 then if nature == "inline" or inline > 0 then @@ -2227,7 +2233,7 @@ do for i=2,#trees do local currenttree = trees[i] local currentdata = currenttree.data - local currentpar = currenttree.parnumber + local currentpar = currenttree.parnumber local previouspar = trees[i-1].parnumber currenttree.collapsed = true -- is the next ok? @@ -2905,7 +2911,7 @@ local xmlpreamble = [[ return replacetemplate(xmlpreamble, { standalone = standalone and "yes" or "no", filename = tex.jobname, - date = os.date(), + date = included.date and backends.timestamp(), contextversion = environment.version, exportversion = exportversion, }) @@ -3156,40 +3162,50 @@ local htmltemplate = [[ end) local function makeclass(tg,at) - local detail = at.detail - local chain = at.chain - local result - at.detail = nil - at.chain = nil + local detail = at.detail + local chain = at.chain + local extra = nil + local classes = { } + local nofclasses = 0 + at.detail = nil + at.chain = nil + for k, v in next, at do + if not private[k] then + nofclasses = nofclasses + 1 + classes[nofclasses] = k .. "-" .. v + end + end if detail and detail ~= "" then if chain and chain ~= "" then if chain ~= detail then - result = { classes[tg .. " " .. chain .. " " .. detail] } -- we need to remove duplicates + extra = classes[tg .. " " .. chain .. " " .. detail] elseif tg ~= detail then - result = { tg, detail } - else - result = { tg } + extra = detail end elseif tg ~= detail then - result = { tg, detail } - else - result = { tg } + extra = detail end elseif chain and chain ~= "" then if tg ~= chain then - result = { tg, chain } + extra = chain + end + end + -- in this order + if nofclasses > 0 then + sort(classes) + classes = concat(classes," ") + if extra then + return tg .. " " .. extra .. " " .. classes else - result = { tg } + return tg .. " " .. classes end else - result = { tg } - end - for k, v in next, at do - if not private[k] then - result[#result+1] = k .. "-" .. v + if extra then + return tg .. " " .. extra + else + return tg end end - return concat(result, " ") end local function remap(specification,source,target) diff --git a/tex/context/base/mkiv/back-ini.lua b/tex/context/base/mkiv/back-ini.lua index e8af4d9d9..fc0074540 100644 --- a/tex/context/base/mkiv/back-ini.lua +++ b/tex/context/base/mkiv/back-ini.lua @@ -120,3 +120,22 @@ interfaces.implement { nodes.tasks.setaction("shipouts","nodes.handlers.accessibility",v == interfaces.variables.yes) end } + +-- moved to here + +local included = table.setmetatableindex( { + context = true, + id = true, + metadata = true, + date = true, + id = true, + pdf = true, +}, function(t,k) + return true +end) + +backends.included = included + +function backends.timestamp() + return os.date("%Y-%m-%dT%X") .. os.timezone(true) +end diff --git a/tex/context/base/mkiv/char-tex.lua b/tex/context/base/mkiv/char-tex.lua index c1b04abfa..3e0d02bc1 100644 --- a/tex/context/base/mkiv/char-tex.lua +++ b/tex/context/base/mkiv/char-tex.lua @@ -591,7 +591,8 @@ if not csletters then elseif is_mark[category] then texsetlccode(u,u,u) -- for hyphenation end - elseif isletter and u >= 32 and u <= 65536 then + -- elseif isletter and u >= 32 and u <= 65536 then + elseif isletter then csletters[utfchar(u)] = u -- local lc, uc = chr.lccode, chr.uccode diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 92a4ad6e8..7a4ffd2d3 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.09.09 08:21} +\newcontextversion{2016.09.12 08:13} %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.mkiv b/tex/context/base/mkiv/context.mkiv index 67664a557..c2a273351 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.09.09 08:21} +\edef\contextversion{2016.09.12 08:13} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-dsp.lua b/tex/context/base/mkiv/font-dsp.lua index 1c81e5e22..cd2816893 100644 --- a/tex/context/base/mkiv/font-dsp.lua +++ b/tex/context/base/mkiv/font-dsp.lua @@ -1933,7 +1933,7 @@ function readers.gdef(f,fontdata,specification) end end -- mark sets : todo: just make the same as class sets above - if marksetsoffset then + if marksetsoffset and marksetsoffset > tableoffset then -- zero offset means no table setposition(f,marksetsoffset) local format = readushort(f) if format == 1 then @@ -1942,7 +1942,6 @@ function readers.gdef(f,fontdata,specification) for i=1,nofsets do sets[i] = readulong(f) end - -- somehow this fails on e.g. notosansethiopic-bold.ttf for i=1,nofsets do local offset = sets[i] if offset ~= 0 then diff --git a/tex/context/base/mkiv/font-pre.mkiv b/tex/context/base/mkiv/font-pre.mkiv index a9910e0c9..f12625c46 100644 --- a/tex/context/base/mkiv/font-pre.mkiv +++ b/tex/context/base/mkiv/font-pre.mkiv @@ -249,7 +249,7 @@ % liga=yes, % makes no sense % tlig=yes, % makes no sense % trep=yes, % makes no sense - mathnolimitsmode={0,750}, % this looks okay on the average font + mathnolimitsmode={0,800}, % this looks okay on the average font mathalternates=yes, mathitalics=yes, % we pass them % mathgaps=yes, diff --git a/tex/context/base/mkiv/lpdf-ini.lua b/tex/context/base/mkiv/lpdf-ini.lua index f395a32f9..18d29774b 100644 --- a/tex/context/base/mkiv/lpdf-ini.lua +++ b/tex/context/base/mkiv/lpdf-ini.lua @@ -1018,7 +1018,7 @@ end do - local timestamp = os.date("%Y-%m-%dT%X") .. os.timezone(true) + local timestamp = backends.timestamp() function lpdf.timestamp() return timestamp @@ -1029,7 +1029,7 @@ do n = converters.totime(n) if n then converters.settime(n) - timestamp = os.date("%Y-%m-%dT%X",os.time(n)) .. os.timezone(true) + timestamp = backends.timestamp() end end return timestamp diff --git a/tex/context/base/mkiv/lpdf-xmp.lua b/tex/context/base/mkiv/lpdf-xmp.lua index c8b86d384..4dd2e72f2 100644 --- a/tex/context/base/mkiv/lpdf-xmp.lua +++ b/tex/context/base/mkiv/lpdf-xmp.lua @@ -94,16 +94,7 @@ pdf.setsuppressoptionalinfo( -- + 512 -- pdfnoid ) -local included = table.setmetatableindex( { - context = true, - id = true, - metadata = true, - date = true, - id = true, - pdf = true, -}, function(t,k) - return true -end) +local included = backends.included function lpdf.settrailerid(v) if v then diff --git a/tex/context/base/mkiv/math-ali.mkiv b/tex/context/base/mkiv/math-ali.mkiv index b77af6383..d57a0b955 100644 --- a/tex/context/base/mkiv/math-ali.mkiv +++ b/tex/context/base/mkiv/math-ali.mkiv @@ -230,12 +230,9 @@ \def\math_handle_eqalign_no_l_aligned{\math_both_eqalign_no_aligned\math_prepare_l_eqalign_no} \def\math_finish_eqalign_no {\crcr\egroup} -\let \reqalignno \math_handle_eqalign_no_r_normal -\let \leqalignno \math_handle_eqalign_no_l_normal -\let\alignreqalignno \math_handle_eqalign_no_r_aligned -\let\alignleqalignno \math_handle_eqalign_no_l_aligned -\let \eqalignno \math_handle_eqalign_no_r_normal -\let \aligneqalignno \math_handle_eqalign_no_r_aligned +\let\reqalignno\relax +\let\leqalignno\relax +\let\eqalignno \relax %D Here we implement the user interface part. We start with basic math alignments: @@ -245,8 +242,7 @@ \def\math_alignment_NC_first#1\NR {\glet\math_alignment_NC\math_alignment_NC_rest - %\scratchtoks{\math_number_left_of_eqalign\aligntab#1\NR}% - \scratchtoks{\aligntab#1\NR}% + \scratchtoks{\math_number_left_of_eqalign\aligntab#1\NR}% \math_number_left_of_eqalign not used yet \dodoubleempty\math_alignment_NC_first_indeed} \def\math_alignment_NC_first_indeed[#1][#2]% @@ -395,19 +391,27 @@ \ifcase\lastnamedcs \or \hfill \or \relax \or \hfill \fi \fi} +\newconditional\c_math_alignment_local_number % not used but when true puts in front (todo) + \def\math_number_right_of_eqalign {\ifcase\wd\b_strc_formulas_number\else - \ifcase\c_strc_math_number_location\or\or + \ifconditional\c_math_alignment_local_number + \ifcase\c_strc_math_number_location\or\or + \box\b_strc_formulas_number + \fi + \else \box\b_strc_formulas_number \fi \fi} -% \def\math_number_left_of_eqalign -% {\ifcase\wd\b_strc_formulas_number\else -% \ifcase\c_strc_math_number_location\or -% \box\b_strc_formulas_number -% \fi -% \fi} +\def\math_number_left_of_eqalign + {\ifcase\wd\b_strc_formulas_number\else + \ifconditional\c_math_alignment_local_number + \ifcase\c_strc_math_number_location\or + \box\b_strc_formulas_number + \fi + \fi + \fi} \def\math_eqalign_set_column#1% we could just add to the preamble (as with other alignments) {\expandafter\let\csname\??mathalignmentvariant\number\c_math_eqalign_column\expandafter\endcsname diff --git a/tex/context/base/mkiv/mult-fun.lua b/tex/context/base/mkiv/mult-fun.lua index 19abe1bcd..299bcc0dd 100644 --- a/tex/context/base/mkiv/mult-fun.lua +++ b/tex/context/base/mkiv/mult-fun.lua @@ -94,7 +94,7 @@ return { -- "pushcurrentpicture", "popcurrentpicture", -- - "arrowpath", + "arrowpath", "resetarrows", -- "colorlike", "dowithpath", "rangepath", "straightpath", "addbackground", -- "cleanstring", "asciistring", "setunstringed", "getunstringed", "unstringed", -- "showgrid", diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 422b93537..ab7944b82 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 726f5ef16..a490ae3e4 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-krn.lua b/tex/context/base/mkiv/typo-krn.lua index 5a42caeca..6a2aed9a2 100644 --- a/tex/context/base/mkiv/typo-krn.lua +++ b/tex/context/base/mkiv/typo-krn.lua @@ -102,7 +102,8 @@ typesetters.kerns = typesetters.kerns or { } local kerns = typesetters.kerns local report = logs.reporter("kerns") -local trace_ligatures = false trackers.register("typesetters.kerns.ligatures",function(v) trace_ligatures = v end) +local trace_ligatures = false trackers.register("typesetters.kerns.ligatures", function(v) trace_ligatures = v end) +local trace_ligatures_d = false trackers.register("typesetters.kerns.ligatures.detail",function(v) trace_ligatures_d = v end) -- use_advance is just an experiment: it makes copying glyphs (instead of new_glyph) dangerous @@ -144,18 +145,24 @@ function kerns.keepligature(n) -- might become default local c = getchar(n) local d = fontdescriptions[f][c].name if a > 0 and contextsetups[a].keepligatures == v_auto then - report("font %!font:name!, glyph %a, slot %X -> ligature %s, by %s feature %a",f,d,c,"kept","dynamic","keepligatures") + if trace_ligatures_d then + report("font %!font:name!, glyph %a, slot %X -> ligature %s, by %s feature %a",f,d,c,"kept","dynamic","keepligatures") + end setcolor(n,"darkred") return true end local k = fontfeatures[f].keepligatures if k == v_auto then - report("font %!font:name!, glyph %a, slot %X -> ligature %s, by %s feature %a",f,d,c,"kept","static","keepligatures") + if trace_ligatures_d then + report("font %!font:name!, glyph %a, slot %X -> ligature %s, by %s feature %a",f,d,c,"kept","static","keepligatures") + end setcolor(n,"darkgreen") return true end if not k then - report("font %!font:name!, glyph %a, slot %X -> ligature %s, by %s feature %a",f,d,c,"split","static","keepligatures") + if trace_ligatures_d then + report("font %!font:name!, glyph %a, slot %X -> ligature %s, by %s feature %a",f,d,c,"split","static","keepligatures") + end resetcolor(n) return false end |