diff options
author | Hans Hagen <pragma@wxs.nl> | 2016-12-02 10:51:35 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-12-02 10:51:35 +0100 |
commit | e677a7fb12047017595fb29e212463dcb1cb2fa6 (patch) | |
tree | 7b9aa8df35083a9e7df4d20b1bba8e2d0ceb251b | |
parent | b8a38bef2eaacea0dd17897dc99f1ef09b46a7e3 (diff) | |
download | context-e677a7fb12047017595fb29e212463dcb1cb2fa6.tar.gz |
2016-12-02 10:19:00
24 files changed, 148 insertions, 51 deletions
diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf Binary files differindex 7f39be6ea..88f54b7f9 100644 --- a/doc/context/documents/general/qrcs/setup-cs.pdf +++ b/doc/context/documents/general/qrcs/setup-cs.pdf diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf Binary files differindex 90a033beb..a6076aa5b 100644 --- a/doc/context/documents/general/qrcs/setup-de.pdf +++ b/doc/context/documents/general/qrcs/setup-de.pdf diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf Binary files differindex 67f49ef4a..f915404b9 100644 --- a/doc/context/documents/general/qrcs/setup-en.pdf +++ b/doc/context/documents/general/qrcs/setup-en.pdf diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf Binary files differindex 88e21c5f7..a76b2a0ff 100644 --- a/doc/context/documents/general/qrcs/setup-fr.pdf +++ b/doc/context/documents/general/qrcs/setup-fr.pdf diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf Binary files differindex eec48601a..3904b0d69 100644 --- a/doc/context/documents/general/qrcs/setup-it.pdf +++ b/doc/context/documents/general/qrcs/setup-it.pdf diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf Binary files differindex 4e1817460..630a9c2fe 100644 --- a/doc/context/documents/general/qrcs/setup-nl.pdf +++ b/doc/context/documents/general/qrcs/setup-nl.pdf diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf Binary files differindex 599542102..74b255263 100644 --- a/doc/context/documents/general/qrcs/setup-ro.pdf +++ b/doc/context/documents/general/qrcs/setup-ro.pdf diff --git a/metapost/context/base/mpiv/mp-node.mpiv b/metapost/context/base/mpiv/mp-node.mpiv index e511ca20c..c7b0bcabe 100644 --- a/metapost/context/base/mpiv/mp-node.mpiv +++ b/metapost/context/base/mpiv/mp-node.mpiv @@ -18,14 +18,15 @@ if known context_node : endinput ; fi ; boolean context_node ; context_node := true ; -% returns a picture +% returns a pair suffix if the path is unknown vardef makenode@#(suffix p)(text t) = save i ; numeric i ; for a = t : - if not known i : % first argument is the index + if unknown i : % first argument is the index i = a ; if not picture p.pic[i] : picture p.pic[] ; fi + if not pair p.pos[i] : pair p.pos[] ; fi % % note that one needs to declare "path p[] ; picture p[]pic[] ;" % before calling node() if one is to use a pseudo-array for p @@ -45,11 +46,19 @@ vardef makenode@#(suffix p)(text t) = fi ; fi endfor + p.pos[i] if known p : := point i of p ; fi enddef ; +% returns a picture + vardef node@#(suffix p)(text t) = - makenode@#(p)(t) ; + if pair makenode@#(p)(t) : + % nop: gobble the function return. + fi for a = t : + if (unknown p) and (known p.pos[a]) : + makenodepath(p) ; + fi if known p.pic[a] : p.pic[a] if known p : shifted point a of p fi else : @@ -65,8 +74,14 @@ vardef fromto@#(expr d)(suffix p)(expr f)(suffix q)(text s) = save r, t, l ; path r[] ; numeric t ; picture l ; for a = s : - if not known t : + if unknown t : t = a ; + if (unknown p) and (known p.pos[f]) : + makenodepath(p) ; + fi + if (unknown q) and (known q.pos[t]) : + makenodepath(q) ; + fi r0 = if ((not numeric d) and (point f of p = point f of q) and (point t of p = point t of q)) : @@ -114,3 +129,46 @@ vardef fromto@#(expr d)(suffix p)(expr f)(suffix q)(text s) = r2 fi enddef ; + +% returns pair: bounding point of the node picture + +vardef nodeboundingpoint@#(suffix p)(expr i) = + if known p.pic[i] : + boundingpoint@#(p.pic[i]) + else : + origin + fi +enddef ; + +% returns pair: scaled laboff direction + +vardef relative@#(expr s) = + (mfun_laboff@# scaled s) +enddef ; + +% returns pair: vector between nodes (+ optional scale) + +vardef betweennodes@#(suffix p)(expr f)(suffix q)(text s) = + save t ; numeric t ; + for a = s : + if unknown t : + t = a ; + nodeboundingpoint@#(q,t) + nodeboundingpoint@#(p,f) + else : + + relative@#(a) + fi + endfor +enddef ; + +% build a path from the node positions. +% Must be continuous in index starting at 0. + +vardef makenodepath(suffix p) = + if unknown p : + save i ; i = -1 ; + p = forever : exitif unknown p.pos[incr i] ; + p.pos[i] -- + endfor cycle ; + fi +enddef ; + diff --git a/metapost/context/base/mpiv/mp-tool.mpiv b/metapost/context/base/mpiv/mp-tool.mpiv index 68bc0a9c7..809384ef7 100644 --- a/metapost/context/base/mpiv/mp-tool.mpiv +++ b/metapost/context/base/mpiv/mp-tool.mpiv @@ -871,7 +871,7 @@ secondarydef p intersection_point q = begingroup save x_, y_ ; (x_,y_) = p intersectiontimes q ; - if x_<0 : + if x_ < 0 : intersection_found := false ; center p % origin else : @@ -3262,25 +3262,21 @@ primarydef p crossingunder q = fi endfor elseif path p : - save n, m, t, a, b, c, r, h ; + save n, m, t, a, b, c, r, bcuttings, hold ; numeric n, m, t[] ; - path a, b, c, r, hold[] ; + path a, b, c, r, bcuttings, hold[] ; c := makepath(currentpen scaled crossingscale) ; r := if picture q : boundingbox fi q ; t[0] := n := m := 0 ; a := p ; -save last ; numeric last ; last := infinity ; - forever : % find all intersections + % The cutbefore/cutafter using c below prevents endless loops! + %forever : % find all intersections + for i=1 upto 100 : % limit the number, until we can make this robust clearxy ; z = a intersectiontimes r ; -exitif x = last ; % prevent loop -last := x ; -% maybe we need a threshold for x ; -% message(decimal x & "+" & decimal m) ; - if (x < 0) and (m > 0) : + if x < 0 : + exitif m < 1 ; a := hold[m] ; m := m - 1 ; clearxy ; z = a intersectiontimes r ; - else : - exitif x < 0 ; fi (t[incr n], whatever) = p intersectiontimes point x of a ; if x = 0 : @@ -3288,18 +3284,26 @@ last := x ; elseif x = length a : a := a cutafter c shifted point x of a ; else : % before or after? - b := subpath (0,x) of a cutafter c shifted point x of a ; + b := subpath (0,x) of a cutafter c shifted point x of a ; + bcuttings := cuttings ; a := subpath (x,length a) of a cutbefore c shifted point x of a ; clearxy ; z = a intersectiontimes r ; if x < 0 : a := b ; + cuttings := bcuttings ; else : - clearxy ; z = b intersectiontimes r ; - if x >= 0 : - hold[incr m] := b ; + if length bcuttings > 0 : + clearxy ; z = b intersectiontimes r ; + if x >= 0 : + hold[incr m] := b ; + fi fi fi fi + if length cuttings = 0 : + exitif m < 1 ; + a := hold[m] ; m := m - 1 ; + fi endfor if n = 0 : % No crossings, we return the PATH @@ -3316,6 +3320,16 @@ last := x ; for i=if cycle p: 2 else: 1 fi upto n : % skip the first segment if cyclic % as it gets repeated (fully) at the end. + if crossingoption > 0 : + if crossingoption = 1 : + addto pic doublepath c shifted point t[i] of p + withpen currentpen withtransparency(1,.5) ; + elseif crossingoption = 2 : + addto pic also + infotext (incr m,crossingscale/5) + shifted point t[i] of p ; + fi + fi a := subpath (t[i-1],t[i]) of p if i > 1 : cutbefore (c shifted point t[i-1] of p) @@ -3324,16 +3338,6 @@ last := x ; cutafter (c shifted point t[i] of p) fi ; if (not picture q) or (a outsideof q) : - if crossingoption > 0 : - addto pic also infotext ( - if crossingoption = 1 : - incr(m) - elseif crossingoption = 2 : - i if cycle p: -1 fi - fi - ,crossingscale/5) - shifted point t[i] of p ; ; - fi ; addto pic doublepath a withpen currentpen ; fi endfor diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index d995f06c7..aadba04f8 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{2016.11.28 13:30} +\newcontextversion{2016.12.02 10:13} %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 11f36726e..6a800c93c 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{2016.11.28 13:30} +\edef\contextversion{2016.12.02 10:13} %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 3f2c6f62d..6b1defa95 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.11.28 13:30} +\newcontextversion{2016.12.02 10: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 ba9036a15..554d63830 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.11.28 13:30} +\edef\contextversion{2016.12.02 10:13} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-oto.lua b/tex/context/base/mkiv/font-oto.lua index 177382f58..13568799b 100644 --- a/tex/context/base/mkiv/font-oto.lua +++ b/tex/context/base/mkiv/font-oto.lua @@ -237,12 +237,12 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis if kind == "gsub_single" then for i=1,#steps do for unicode, data in next, steps[i].coverage do - if not changed[unicode] then + -- if not changed[unicode] then -- fails for multiple subs in some math fonts if trace_singles then report_substitution(feature,sequence,descriptions,unicode,data) end changed[unicode] = data - end + -- end end end elseif kind == "gsub_alternate" then diff --git a/tex/context/base/mkiv/grph-inc.lua b/tex/context/base/mkiv/grph-inc.lua index e9bf17bf0..d948d9ad8 100644 --- a/tex/context/base/mkiv/grph-inc.lua +++ b/tex/context/base/mkiv/grph-inc.lua @@ -1249,9 +1249,14 @@ function figures.done(data) local box = texgetbox(nr) ds.width = box.width ds.height = box.height - ds.xscale = ds.width /(du.width or 1) - ds.yscale = ds.height/(du.height or 1) - ds.page = ds.page or du.page or dr.page -- sort of redundant but can be limited + -- somehow this fails on some of tacos files + -- ds.xscale = ds.width /(du.width or 1) + -- ds.yscale = ds.height/(du.height or 1) + -- so we add some extra safeguards + ds.xscale = ds.width /(du.width and du.width>0 and du.width or du.xsize) or 1 + ds.yscale = ds.height/(du.height and du.height>0 and du.height or du.ysize) or 1 + -- sort of redundant but can be limited + ds.page = ds.page or du.page or dr.page return data end diff --git a/tex/context/base/mkiv/math-ini.mkiv b/tex/context/base/mkiv/math-ini.mkiv index cf8dbf625..fbaac052c 100644 --- a/tex/context/base/mkiv/math-ini.mkiv +++ b/tex/context/base/mkiv/math-ini.mkiv @@ -373,12 +373,14 @@ % sense now so we have commands to deal with it \unexpanded\def\mathaltcalligraphic{\math_set_font_alternate{calligraphic}\cal} % set via goody file +\unexpanded\def\mathaltitalic {\math_set_font_alternate{italic}} % set via goody file \unexpanded\def\mathslashedzero {\begingroup\math_set_font_alternate{zero}∅\endgroup} % set via goody file or automatic \unexpanded\def\mathdotless {\math_set_font_alternate{dotless}} % set via goody file or automatic \unexpanded\def\mathdotlessi {\begingroup\mathdotless i\endgroup} \unexpanded\def\mathdotlessj {\begingroup\mathdotless j\endgroup} \let\mathaltcal\mathaltcalligraphic +\let\mathaltit \mathaltitalic %let\textslashedzero\slashedzero \unexpanded\def\autoslashedzero{\mathortext\mathslashedzero\textslashedzero} \let\textdotlessi \dotlessi \unexpanded\def\autodotlessi {\mathortext\mathdotlessi \textdotlessi} @@ -398,7 +400,7 @@ \let\setmathfontstylealternate \math_set_font_style_alternate \let\setmathfontstylealternative\math_set_font_style_alternate -\let\mathalternate \math_set_font_alternate +\let\mathalternate \math_set_font_alternate \unexpanded\def\mathupright {\math_set_attribute\s!regular\s!tf\math_set_font_style_alternate\s!tf} \unexpanded\def\mathitalic {\math_set_attribute\s!regular\s!it\math_set_font_style_alternate\s!it} diff --git a/tex/context/base/mkiv/mlib-pps.lua b/tex/context/base/mkiv/mlib-pps.lua index 883e2d5fb..efafb99fd 100644 --- a/tex/context/base/mkiv/mlib-pps.lua +++ b/tex/context/base/mkiv/mlib-pps.lua @@ -933,15 +933,16 @@ local function cm(object) local op = object.path if op then local first, second, fourth = op[1], op[2], op[4] - local tx, ty = first.x_coord , first.y_coord - local sx, sy = second.x_coord - tx, fourth.y_coord - ty - local rx, ry = second.y_coord - ty, fourth.x_coord - tx - if sx == 0 then sx = 0.00001 end - if sy == 0 then sy = 0.00001 end - return sx, rx, ry, sy, tx, ty - else - return 1, 0, 0, 1, 0, 0 -- weird case + if fourth then + local tx, ty = first.x_coord , first.y_coord + local sx, sy = second.x_coord - tx, fourth.y_coord - ty + local rx, ry = second.y_coord - ty, fourth.x_coord - tx + if sx == 0 then sx = 0.00001 end + if sy == 0 then sy = 0.00001 end + return sx, rx, ry, sy, tx, ty + end end + return 1, 0, 0, 1, 0, 0 -- weird case end -- color diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex a452c1190..e53b08be3 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 0695b4d0f..ecc21a8c9 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/type-set.mkiv b/tex/context/base/mkiv/type-set.mkiv index 47d6e3257..1ef137d39 100644 --- a/tex/context/base/mkiv/type-set.mkiv +++ b/tex/context/base/mkiv/type-set.mkiv @@ -127,4 +127,6 @@ \definefilesynonym [type-imp-coloredsheep.mkiv] [type-imp-koeielettersot.mkiv] \definefilesynonym [type-imp-koeieletters.mkiv] [type-imp-koeielettersot.mkiv] +\definefilesynonym [type-imp-stixtwo.mkiv] [type-imp-stix.mkiv] + \protect \endinput diff --git a/tex/context/fonts/mkiv/stix-two-math.lfg b/tex/context/fonts/mkiv/stix-two-math.lfg new file mode 100644 index 000000000..ded97f92e --- /dev/null +++ b/tex/context/fonts/mkiv/stix-two-math.lfg @@ -0,0 +1,27 @@ +return { + name = "stix-two-math", + version = "1.00", + comment = "Goodies that complement stix two opentype.", + author = "Hans Hagen", + copyright = "ConTeXt development team", + mathematics = { + -- these tags are suggestions and can still change + alternates = { + calligraphic = { feature = 'ss01', value = 1, comment = "Mathematical Alternative Calligraphic Characters" }, + 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 + arrow = { feature = 'ss05', value = 1, comment = "Mathematical Alternative Smaller Arrows" }, + narrower = { feature = 'ss06', value = 1, comment = "Mathematical Alternative Narrower Elements" }, -- narrower/shorter element etc + small = { feature = 'ss07', value = 1, comment = "Mathematical Alternative Smaller Operators" }, + 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 = "" }, + circled = { feature = 'ss16', value = 1, comment = "Mathematical Alternative Circled Operators" }, + }, + }, +} + + diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex 67f49ef4a..f915404b9 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 afdf58c3b..d67885e35 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index d2c032c5b..f6060cfce 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 : 11/28/16 13:30:27 +-- merge date : 12/02/16 10:13:47 do -- begin closure to overcome local limits and interference @@ -16382,12 +16382,10 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis if kind=="gsub_single" then for i=1,#steps do for unicode,data in next,steps[i].coverage do - if not changed[unicode] then if trace_singles then report_substitution(feature,sequence,descriptions,unicode,data) end changed[unicode]=data - end end end elseif kind=="gsub_alternate" then |