From cf7755dd328463401bd066ec19cd62e95c225a0c Mon Sep 17 00:00:00 2001 From: Marius Date: Wed, 27 Apr 2011 22:40:13 +0300 Subject: beta 2011.04.27 21:17 --- metapost/context/base/mp-mlib.mp | 9 +++++- tex/context/base/back-pdf.lua | 9 ++++++ tex/context/base/buff-ver.mkiv | 3 ++ tex/context/base/char-def.lua | 2 +- tex/context/base/colo-ini.lua | 41 ++++++++++++++++++++++++++-- tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context.mkii | 2 +- tex/context/base/context.mkiv | 2 +- tex/context/base/core-env.lua | 8 ++++++ tex/context/base/font-ini.mkiv | 4 +-- tex/context/base/m-barcodes.mkiv | 4 +-- tex/context/base/mlib-pps.lua | 25 +++++++++++++++-- tex/context/base/s-fnt-10.mkiv | 2 +- tex/context/base/s-fnt-23.mkiv | 26 ++++++++++++++---- tex/context/base/s-fnt-25.mkiv | 2 +- tex/context/base/s-fnt-31.mkiv | 2 +- tex/context/base/s-inf-03.mkiv | 3 +- tex/context/base/s-pre-62.tex | 19 ++++++++++--- tex/context/base/scrn-wid.mkvi | 2 +- tex/context/base/status-files.pdf | Bin 23618 -> 23497 bytes tex/context/base/status-lua.pdf | Bin 155255 -> 154238 bytes tex/context/fonts/px-math.lfg | 6 ++++ tex/context/fonts/tx-math.lfg | 4 +++ tex/generic/context/luatex-fonts-merged.lua | 2 +- 25 files changed, 150 insertions(+), 31 deletions(-) diff --git a/metapost/context/base/mp-mlib.mp b/metapost/context/base/mp-mlib.mp index 11f096c18..9929cfde5 100644 --- a/metapost/context/base/mp-mlib.mp +++ b/metapost/context/base/mp-mlib.mp @@ -397,7 +397,7 @@ def dographictext (expr t) = enddef ; def nographictext (expr t) text rest = - draw unitsquare withprescript "gt_stage=trial" withpostscript t ; + draw unitsquare withprescript "gt_stage=trial" withpostscript t enddef ; % def savegraphictext (expr str) = @@ -406,6 +406,13 @@ enddef ; % def erasegraphictextfile = % enddef ; +% Layers + +def onlayer primary name = + withprescript "la_name=" & name +enddef ; + + % Figures % def externalfigure primary filename = diff --git a/tex/context/base/back-pdf.lua b/tex/context/base/back-pdf.lua index f6f82c7f5..7c736ebaf 100644 --- a/tex/context/base/back-pdf.lua +++ b/tex/context/base/back-pdf.lua @@ -87,6 +87,15 @@ end local cache = { } +function codeinjections.startlayer(name) + codeinjections.useviewerlayer(name) + return format("/OC /%s BDC",name) +end + +function codeinjections.stoplayer(name) + return "EMC" +end + function nodeinjections.startlayer(name) local c = cache[name] if not c then diff --git a/tex/context/base/buff-ver.mkiv b/tex/context/base/buff-ver.mkiv index 114cb2128..c8f07ddb4 100644 --- a/tex/context/base/buff-ver.mkiv +++ b/tex/context/base/buff-ver.mkiv @@ -43,6 +43,7 @@ \setvalue{\??tp:\c!space:\v!on }{\let\obeyedspace\specialcontrolspace} \setvalue{\??tp:\c!space:\v!stretch }{\let\obeyedspace\specialstretchedspace} \setvalue{\??tp:\c!space:\v!normal }{} +\setvalue{\??tp:\c!space:\v!fixed }{\let\obeyedspace\specialfixedspace} \setvalue{\??tp:\c!blank:\v!standard }{\ctxparskip} \setvalue{\??tp:\c!blank:\v!small }{\smallskipamount} @@ -381,6 +382,7 @@ %D works all right, but a decent hyphenation support of %D \type{\tt} text will be implemented soon. +\def\specialfixedspace {\kern\interwordspace\relax} \def\specialobeyedspace {\hskip\interwordspace\relax} % better than spaceskip \def\specialstretchedspace{\hskip.5\interwordspace\!!plus.125\interwordstretch\relax} % more but not less \def\specialcontrolspace {\hskip\zeropoint\hbox{\normalcontrolspace}\hskip\zeropoint\relax} @@ -753,6 +755,7 @@ regime = "\currentregime", tab = "\typingparameter\c!tab", method = "\typingparameter\c!option", + escape = \!!bs\typingparameter\c!escape\!!es, nature = "display", }}% \dostoptagged diff --git a/tex/context/base/char-def.lua b/tex/context/base/char-def.lua index 7494822ef..dec5581cc 100644 --- a/tex/context/base/char-def.lua +++ b/tex/context/base/char-def.lua @@ -403,7 +403,7 @@ characters.data={ description="COMMA", direction="cs", linebreak="is", - mathclass="punctuation", + mathclass="punctuation", -- redundant mathspec={ { class="punctuation", diff --git a/tex/context/base/colo-ini.lua b/tex/context/base/colo-ini.lua index 635a13ec5..b6f82e4ba 100644 --- a/tex/context/base/colo-ini.lua +++ b/tex/context/base/colo-ini.lua @@ -394,10 +394,18 @@ function colors.definemultitonecolor(name,multispec,colorspec,selfspec) nn[max] = format("%s_%1.3g",k,tonumber(v) or 0) -- 0 can't happen end if max > 0 then - dd, pp, nn = concat(dd,','), concat(pp,','), concat(nn,'_') + nn = concat(nn,'_') local parent = gsub(lower(nn),"[^%d%a%.]+","_") - colors.defineprocesscolor(parent,colorspec..","..selfspec,true,true) + if max == 2 and (not colorspec or colorspec == "") then + colors.defineduocolor(parent,pp[1],l_color[dd[1]],pp[2],l_color[dd[2]],true,true) + else + if selfspec ~= "" then + colorspec = colorspec .. "," .. selfspec + end + colors.defineprocesscolor(parent,colorspec,true,true) + end local cp = attributes_list[a_color][parent] + dd, pp = concat(dd,','), concat(pp,',') if cp then do_registerspotcolor(parent, name, cp, "", max, dd, pp) do_registermultitonecolor(parent, name, cp, "", max, dd, pp) @@ -590,6 +598,35 @@ function colors.defineintermediatecolor(name,fraction,c_one,c_two,a_one,a_two,sp end end +local function f(one,two,i,fraction_one,fraction_two) + local o, t = one[i], two[i] + local otf = fraction_one * o + fraction_two * t + if otf > 1 then + otf = 1 + end + return otf +end + +function colors.defineduocolor(name,fraction_one,c_one,fraction_two,c_two,global,freeze) + local one, two = colors.value(c_one), colors.value(c_two) + if one and two then + fraction_one = tonumber(fraction_one) or 1 + fraction_two = tonumber(fraction_two) or 1 + local csone, cstwo = one[1], two[1] + local ca + if csone == 2 then + ca = register_color(name,'gray',f(one,two,2,fraction_one,fraction_two)) + elseif csone == 3 then + ca = register_color(name,'rgb', f(one,two,3,fraction_one,fraction_two),f(one,two,4,fraction_one,fraction_two),f(one,two,5,fraction_one,fraction_two)) + elseif csone == 4 then + ca = register_color(name,'cmyk',f(one,two,6,fraction_one,fraction_two),f(one,two,7,fraction_one,fraction_two),f(one,two,8,fraction_one,fraction_two),f(one,two,9,fraction_one,fraction_two)) + else + ca = register_color(name,'gray',f(one,two,2,fraction_one,fraction_two)) + end + definecolor(name,ca,global,freeze) + end +end + -- for the moment downward compatible local patterns = { "colo-imp-%s.mkiv", "colo-imp-%s.tex", "colo-%s.mkiv", "colo-%s.tex" } diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index c4a47e4f6..98227c10f 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.04.24 15:15} +\newcontextversion{2011.04.27 21:17} %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/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 3cc07b3ba..f5ca0c9e6 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.04.24 15:15} +\newcontextversion{2011.04.27 21:17} %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/context.mkii b/tex/context/base/context.mkii index 18043685f..ca722a491 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.04.24 15:15} +\edef\contextversion{2011.04.27 21:17} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index d71f8ec89..ee33d0b8f 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2011.04.24 15:15} +\edef\contextversion{2011.04.27 21:17} %D For those who want to use this: diff --git a/tex/context/base/core-env.lua b/tex/context/base/core-env.lua index bc260bc36..694b2f07c 100644 --- a/tex/context/base/core-env.lua +++ b/tex/context/base/core-env.lua @@ -74,6 +74,14 @@ setmetatableindex(tex.ifs, function(t,k) return csname_id(k) ~= undefined and create(k)[2] == iftrue -- inefficient, this create, we need a helper end) +function tex.settrue(name) + texcount[name] = 0 +end + +function tex.setfalse(name) + texcount[name] = 1 +end + ---- arg = P("{") * C(patterns.nested) * P("}") + Cc("") local sep = S("), ") diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv index b0efeaee1..8eb10e3ae 100644 --- a/tex/context/base/font-ini.mkiv +++ b/tex/context/base/font-ini.mkiv @@ -4262,7 +4262,7 @@ {\ifcsname\??cf:#1\c!style\endcsname \getparameters[\??cf:#1][#2]% \else - \getparameters[\??cf:#1][\c!style,\c!color=,#2]% so we define but without commands (todo for all define related things) + \getparameters[\??cf:#1][\c!style=,\c!color=,#2]% so we define but without commands (todo for all define related things) \fi} % commands @@ -4276,7 +4276,7 @@ \def\dostyleassignment#1% {\groupedcommand - {\getparameters[\??cf][\c!style,\c!color=,#1]% + {\getparameters[\??cf][\c!style=,\c!color=,#1]% \dostartattributes\??cf\c!style\c!color} {\dostopattributes}} diff --git a/tex/context/base/m-barcodes.mkiv b/tex/context/base/m-barcodes.mkiv index fd98cec75..b6a54089f 100644 --- a/tex/context/base/m-barcodes.mkiv +++ b/tex/context/base/m-barcodes.mkiv @@ -112,11 +112,11 @@ end % \usemodule[barcodes] +\doifnotmode{demo}{\endinput} + \starttext \startTEXpage \barcode[type=isbn,code=978-94-90688-01-1] \stopTEXpage \stoptext -\endinput - diff --git a/tex/context/base/mlib-pps.lua b/tex/context/base/mlib-pps.lua index bbdd0bbd5..c4ebf5c31 100644 --- a/tex/context/base/mlib-pps.lua +++ b/tex/context/base/mlib-pps.lua @@ -13,8 +13,10 @@ if not modules then modules = { } end modules ['mlib-pps'] = { -- -- todo: report max textexts -local format, gmatch, concat, round, match = string.format, string.gmatch, table.concat, math.round, string.match +local format, gmatch, match = string.format, string.gmatch, string.match local tonumber, type = tonumber, type +local round = math.round +local insert, concat = table.insert, table.concat local Cs, Cf, C, Cg, Ct, P, S, V, Carg = lpeg.Cs, lpeg.Cf, lpeg.C, lpeg.Cg, lpeg.Ct, lpeg.P, lpeg.S, lpeg.V, lpeg.Carg local lpegmatch = lpeg.match @@ -853,6 +855,7 @@ local function tr_process(object,prescript,before,after) local cs = object.color if cs and #cs > 0 then local sp_name = prescript.sp_name + local b, a if sp_name then local sp_fractions = prescript.sp_fractions or 1 local sp_components = prescript.sp_components or "" @@ -862,10 +865,24 @@ local function tr_process(object,prescript,before,after) -- beware, we do scale the spotcolors but not the alternative representation sp_value = lpeg.match(value,sp_value,1,cf) or sp_value end - before[#before+1], after[#after+1] = spotcolorconverter(sp_name,sp_fractions,sp_components,sp_value) + -- should be codeinjections + b, a = spotcolorconverter(sp_name,sp_fractions,sp_components,sp_value) else - before[#before+1], after[#after+1] = colorconverter(cs) + -- should be codeinjections + b, a = colorconverter(cs) end + before[#before+1] = b + after[#after+1] = a + end +end + +-- layers (nasty: we need to keep the 'grouping' right + +local function la_process(object,prescript,before,after) + local la_name = prescript.la_name + if la_name then + before[#before+1] = backends.codeinjections.startlayer(la_name) + insert(after,1,backends.codeinjections.stoplayer()) end end @@ -884,6 +901,8 @@ appendaction(processoractions,"system",ps_process) appendaction(processoractions,"system",fg_process) appendaction(processoractions,"system",tr_process) -- last, as color can be reset +appendaction(processoractions,"system",la_process) + -- no auto here resetter = sequencers.compile(resetteractions ) diff --git a/tex/context/base/s-fnt-10.mkiv b/tex/context/base/s-fnt-10.mkiv index d5f097300..07f5d4729 100644 --- a/tex/context/base/s-fnt-10.mkiv +++ b/tex/context/base/s-fnt-10.mkiv @@ -135,7 +135,7 @@ end \page \egroup} -\doifnotmode{demo} {\endinput} +% \doifnotmode{demo} {\endinput} \starttext diff --git a/tex/context/base/s-fnt-23.mkiv b/tex/context/base/s-fnt-23.mkiv index 8714d9b50..1dc7367a4 100644 --- a/tex/context/base/s-fnt-23.mkiv +++ b/tex/context/base/s-fnt-23.mkiv @@ -26,7 +26,8 @@ last_data = tfmdata local charnum = tonumber(n) if not charnum then - charnum = tfmdata.unicodes[n] + -- charnum = tfmdata.unicodes[n] + charnum = fonts.helpers.nametoslot(n) end local c = tfmdata.characters[charnum] local d = tfmdata.descriptions[charnum] @@ -265,12 +266,25 @@ \starttext -\startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0x62A} \stopTEXpage -\startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0x2004} \stopTEXpage -\startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0xF0299} \stopTEXpage -\startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{NameMe.1190} \stopTEXpage +% \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0x62A} \stopTEXpage +% \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0x2004} \stopTEXpage +% \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{0xF0299} \stopTEXpage +% \startTEXpage \ShowGlyphShape{simplenaskhi}{100bp}{NameMe.1190} \stopTEXpage -\ShowAllGlyphShapes{simplenaskhi}{100bp} +% \ShowAllGlyphShapes{simplenaskhi}{100bp} % \ShowAllGlyphShapes{xits}{100bp} +\switchtobodyfont[cambria,10pt] + +\startTEXpage[offset=10pt] \ShowGlyphShape{name:cambria-math} {40bp}{0x00066} \stopTEXpage +\startTEXpage[offset=10pt] \ShowGlyphShape{name:cambria-math} {40bp}{0x1D453} \stopTEXpage +\startTEXpage[offset=10pt] \ShowGlyphShape{name:cambria-math} {40bp}{0x1D43F} \stopTEXpage +\startTEXpage[offset=10pt] \ShowGlyphShape{name:cambria-math}{100bp}{0x1D444} \stopTEXpage +\startTEXpage[offset=10pt] \ShowGlyphShape{name:cambria-math}{100bp}{0x1D447} \stopTEXpage +\startTEXpage[offset=10pt] \ShowGlyphShape{name:cambria-math}{100bp}{0x02112} \stopTEXpage +\startTEXpage[offset=10pt] \ShowGlyphShape{name:cambria-math}{100bp}{0x1D432} \stopTEXpage +\startTEXpage[offset=10pt] \ShowGlyphShape{name:cambria-math}{100bp}{0x1D43D} \stopTEXpage +\startTEXpage[offset=10pt] \ShowGlyphShape{name:cambria-math}{100bp}{0x1D44A} \stopTEXpage +\startTEXpage[offset=10pt] \ShowGlyphShape{name:cambria-math}{100bp}{0x1D45D} \stopTEXpage + \stoptext diff --git a/tex/context/base/s-fnt-25.mkiv b/tex/context/base/s-fnt-25.mkiv index 6a9924616..159d8325d 100644 --- a/tex/context/base/s-fnt-25.mkiv +++ b/tex/context/base/s-fnt-25.mkiv @@ -182,7 +182,7 @@ function document.showmathfont(id,slot) end \stopluacode -\endinput +\doifnotmode{demo}{\endinput} \starttext \setupbodyfont[cambria, 12pt] \showmathfontcharacters diff --git a/tex/context/base/s-fnt-31.mkiv b/tex/context/base/s-fnt-31.mkiv index d081c6273..3cd689d97 100644 --- a/tex/context/base/s-fnt-31.mkiv +++ b/tex/context/base/s-fnt-31.mkiv @@ -159,7 +159,7 @@ end "xits-math.otf", "LMMath10-Regular@lmroman10-math", "pxmath@px-math", - "LinLibertine_Re-4.7.5.otf", + -- "LinLibertine_Re-4.7.5.otf", } \stopluacode diff --git a/tex/context/base/s-inf-03.mkiv b/tex/context/base/s-inf-03.mkiv index bfcf5650b..85440f0db 100644 --- a/tex/context/base/s-inf-03.mkiv +++ b/tex/context/base/s-inf-03.mkiv @@ -113,10 +113,11 @@ end \startstandardmakeup \vfill + \pagereference[global] \startnarrower[5mm] \raggedcenter \TitlePageFont \setupinterlinespace - \getbuffer + \getbuffer % luabuffer \par \stopnarrower \vfill diff --git a/tex/context/base/s-pre-62.tex b/tex/context/base/s-pre-62.tex index 8bcfb48ee..8e50af529 100644 --- a/tex/context/base/s-pre-62.tex +++ b/tex/context/base/s-pre-62.tex @@ -18,10 +18,21 @@ \usetypescriptfile [type-ghz] -\definetypeface[mainface][rm][serif][melior] [default][encoding=texnansi] -\definetypeface[mainface][tt][mono] [modern] [default][encoding=texnansi,rscale=1.05] -\definetypeface[mainface][ss][serif][melior] [default][encoding=texnansi] -\definetypeface[mainface][mm][math] [palatino][default][encoding=texnansi,rscale=0.95] +\doifmodeelse {mkiv} { + + \definetypeface[mainface][rm][serif][melior] [default] + \definetypeface[mainface][tt][mono] [modern] [default][rscale=1.05] + \definetypeface[mainface][ss][serif][melior] [default] + \definetypeface[mainface][mm][math] [palatino][default][rscale=0.95] + +} { + + \definetypeface[mainface][rm][serif][melior] [default][encoding=texnansi] + \definetypeface[mainface][tt][mono] [modern] [default][encoding=texnansi,rscale=1.05] + \definetypeface[mainface][ss][serif][melior] [default][encoding=texnansi] + \definetypeface[mainface][mm][math] [palatino][default][encoding=texnansi,rscale=0.95] + +} \setupbodyfont [mainface,14.4pt] diff --git a/tex/context/base/scrn-wid.mkvi b/tex/context/base/scrn-wid.mkvi index 7f2ea7d42..72f5255bb 100644 --- a/tex/context/base/scrn-wid.mkvi +++ b/tex/context/base/scrn-wid.mkvi @@ -255,7 +255,7 @@ \unexpanded\def\useattachment {\doquadrupleempty\scrn_attachment_use} -\def\scrn_attachmen_use[#tag][#title][#name][#file]% +\def\scrn_attachment_use[#tag][#title][#name][#file]% {\iffourthargument \registerattachment[#tag][title=#title,name=#name,file=#file]% \else\ifthirdargument diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 93d096609..718a1f80c 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 019198df2..1ba545510 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/fonts/px-math.lfg b/tex/context/fonts/px-math.lfg index b261f0701..6beb83bfd 100644 --- a/tex/context/fonts/px-math.lfg +++ b/tex/context/fonts/px-math.lfg @@ -18,7 +18,13 @@ return { { name = "pxex.tfm", vector = "tex-ex", extension = true } , { name = "pxsya.tfm", vector = "tex-ma" }, { name = "pxsyb.tfm", vector = "tex-mb" }, + { name = "texgyrepagella-bold.otf", vector = "tex-bf", skewchar=0x7F } , + { name = "texgyrepagella-bolditalic.otf", vector = "tex-bi" } , + { name = "lmsans10-regular.otf", vector = "tex-ss", optional=true }, + { name = "lmmono10-regular.otf", vector = "tex-tt", optional=true }, }, } } } + + diff --git a/tex/context/fonts/tx-math.lfg b/tex/context/fonts/tx-math.lfg index f1d532773..8423aaaf4 100644 --- a/tex/context/fonts/tx-math.lfg +++ b/tex/context/fonts/tx-math.lfg @@ -18,6 +18,10 @@ return { { name = "txex.tfm", vector = "tex-ex", extension = true } , { name = "txsya.tfm", vector = "tex-ma" }, { name = "txsyb.tfm", vector = "tex-mb" }, + { name = "texgyretermes-bold.otf", vector = "tex-bf", skewchar=0x7F } , + { name = "texgyretermes-bolditalic.otf", vector = "tex-bi" } , + { name = "lmsans10-regular.otf", vector = "tex-ss", optional=true }, + { name = "lmmono10-regular.otf", vector = "tex-tt", optional=true }, } } } diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index e937af22d..7a77e861c 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 04/24/11 15:15:27 +-- merge date : 04/27/11 21:17:43 do -- begin closure to overcome local limits and interference -- cgit v1.2.3