diff options
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/attr-col.lua | 31 | ||||
-rw-r--r-- | tex/context/base/colo-ini.lua | 149 | ||||
-rw-r--r-- | tex/context/base/colo-ini.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4386 -> 4385 bytes | |||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/lpdf-col.lua | 11 | ||||
-rw-r--r-- | tex/context/base/math-stc.mkvi | 2 | ||||
-rw-r--r-- | tex/context/base/mlib-pps.lua | 164 | ||||
-rw-r--r-- | tex/context/base/mult-fun.lua | 20 | ||||
-rw-r--r-- | tex/context/base/mult-low.lua | 1 | ||||
-rw-r--r-- | tex/context/base/mult-mps.lua | 28 | ||||
-rw-r--r-- | tex/context/base/publ-imp-apa.mkvi | 7 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24940 -> 24940 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.pdf | bin | 333195 -> 333149 bytes | |||
-rw-r--r-- | tex/context/base/syst-ini.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/tabl-ntb.mkiv | 8 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 2 |
18 files changed, 271 insertions, 160 deletions
diff --git a/tex/context/base/attr-col.lua b/tex/context/base/attr-col.lua index 7c6b7909b..9dcc991ac 100644 --- a/tex/context/base/attr-col.lua +++ b/tex/context/base/attr-col.lua @@ -246,7 +246,11 @@ end --~ return { 5, .5, .5, .5, .5, 0, 0, 0, .5, parent, f, d, p } --~ end +local p_split = lpeg.tsplitat(",") +local lpegmatch = lpeg.match + function colors.spot(parent,f,d,p) + -- inspect(parent) inspect(f) inspect(d) inspect(p) if type(p) == "number" then local n = list[numbers.color][parent] -- hard coded ref to color number if n then @@ -261,6 +265,33 @@ function colors.spot(parent,f,d,p) end else -- todo, multitone (maybe p should be a table) + local ps = lpegmatch(p_split,p) + local ds = lpegmatch(p_split,d) + local c, m, y, k = 0, 0, 0, 0 + local done = false + for i=1,#ps do + local p = tonumber(ps[i]) + local d = ds[i] + if p and d then + local n = list[numbers.color][d] -- hard coded ref to color number + if n then + local v = values[n] + if v then + c = c + p*v[6] + m = m + p*v[7] + y = y + p*v[8] + k = k + p*v[8] + done = true + end + end + end + end + if done then + local r, g, b = cmyktorgb(c,m,y,k) + local s = cmyktogray(c,m,y,k) + local f = tonumber(f) + return { 5, s, r, g, b, c, m, y, k, parent, f, d, p } + end end return { 5, .5, .5, .5, .5, 0, 0, 0, .5, parent, f, d, p } end diff --git a/tex/context/base/colo-ini.lua b/tex/context/base/colo-ini.lua index 174ee9546..9ccbc6cb3 100644 --- a/tex/context/base/colo-ini.lua +++ b/tex/context/base/colo-ini.lua @@ -248,12 +248,14 @@ end local registered = { } -local function do_registerspotcolor(parent,name,parentnumber,e,f,d,p) +local function do_registerspotcolor(parent,parentnumber,e,f,d,p) if not registered[parent] then local v = colorvalues[parentnumber] if v then local model = colors.default -- else problems with shading etc - if model == 1 then model = v[1] end + if model == 1 then + model = v[1] + end if e and e ~= "" then registrations.spotcolorname(parent,e) -- before registration of the color end @@ -269,23 +271,25 @@ local function do_registerspotcolor(parent,name,parentnumber,e,f,d,p) end end -local function do_registermultitonecolor(parent,name,parentnumber,e,f,d,p) -- same as spot but different template - if not registered[parent] then - local v = colorvalues[parentnumber] - if v then - local model = colors.default -- else problems with shading etc - if model == 1 then model = v[1] end - if model == 2 then - registrations.grayindexcolor(parent,f,d,p,v[2]) - elseif model == 3 then - registrations.rgbindexcolor (parent,f,d,p,v[3],v[4],v[5]) - elseif model == 4 then - registrations.cmykindexcolor(parent,f,d,p,v[6],v[7],v[8],v[9]) - end - end - registered[parent] = true - end -end +-- local function do_registermultitonecolor(parent,name,parentnumber,e,f,d,p) -- same as spot but different template +-- if not registered[parent] then +-- local v = colorvalues[parentnumber] +-- if v then +-- local model = colors.default -- else problems with shading etc +-- if model == 1 then +-- model = v[1] +-- end +-- if model == 2 then +-- registrations.grayindexcolor(parent,f,d,p,v[2]) +-- elseif model == 3 then +-- registrations.rgbindexcolor (parent,f,d,p,v[3],v[4],v[5]) +-- elseif model == 4 then +-- registrations.cmykindexcolor(parent,f,d,p,v[6],v[7],v[8],v[9]) +-- end +-- end +-- registered[parent] = true +-- end +-- end function colors.definesimplegray(name,s) return register_color(name,'gray',s) -- we still need to get rid of 'color' @@ -396,16 +400,16 @@ end function colors.definespotcolor(name,parent,str,global) if parent == "" or find(parent,"=",1,true) then - colors.registerspotcolor(name, parent) + colors.registerspotcolor(name, parent) -- does that work? no attr elseif name ~= parent then local cp = attributes_list[a_color][parent] if cp then local t = settings_to_hash_strict(str) if t then local tp = tonumber(t.p) or 1 - do_registerspotcolor(parent, name, cp, t.e, 1, "", tp) -- p not really needed, only diagnostics + do_registerspotcolor(parent,cp,t.e,1,"",tp) -- p not really needed, only diagnostics if name and name ~= "" then - definecolor(name, register_color(name,'spot', parent, 1, "", tp), true) + definecolor(name,register_color(name,'spot',parent,1,"",tp),true) local ta, tt = t.a, t.t if ta and tt then definetransparent(name, transparencies.register(name,transparent[ta] or tonumber(ta) or 1,tonumber(tt) or 1), global) @@ -428,13 +432,56 @@ function colors.registerspotcolor(parent, str) local t = settings_to_hash_strict(str) e = (t and t.e) or "" end - do_registerspotcolor(parent, "dummy", cp, e, 1, "", 1) -- p not really needed, only diagnostics + do_registerspotcolor(parent, cp, e, 1, "", 1) -- p not really needed, only diagnostics + end +end + +local function f(i,colors,fraction) + local otf = 0 + for c=1,#colors do + otf = otf + (tonumber(fraction[c]) or 1) * colors[c][i] + end + if otf > 1 then + otf = 1 + end + return otf +end + +local function definemixcolor(makename,name,fractions,cs,global,freeze) + local values = { } + for i=1,#cs do -- do fraction in here + local v = colorvalues[cs[i]] + if not v then + return + end + values[i] = v + end + if #values > 0 then + csone = values[1][1] + local ca + if csone == 2 then + ca = register_color(name,'gray',f(2,values,fractions)) + elseif csone == 3 then + ca = register_color(name,'rgb', f(3,values,fractions), + f(4,values,fractions), + f(5,values,fractions)) + elseif csone == 4 then + ca = register_color(name,'cmyk',f(6,values,fractions), + f(7,values,fractions), + f(8,values,fractions), + f(9,values,fractions)) + else + ca = register_color(name,'gray',f(2,values,fractions)) + end + definecolor(name,ca,global,freeze) + else + report_colors("invalid specification of components for color %a",makename) end end function colors.definemultitonecolor(name,multispec,colorspec,selfspec) local dd, pp, nn, max = { }, { }, { }, 0 - for k,v in gmatch(multispec,"(%a+)=([^%,]*)") do -- use settings_to_array + for k,v in gmatch(multispec,"([^=,]+)=([^%,]*)") do -- use settings_to_array max = max + 1 dd[max] = k pp[max] = v @@ -445,7 +492,7 @@ function colors.definemultitonecolor(name,multispec,colorspec,selfspec) local parent = gsub(lower(nn),"[^%d%a%.]+","_") if not colorspec or colorspec == "" then local cc = { } for i=1,max do cc[i] = l_color[dd[i]] end - colors.definemixcolor(parent,pp,cc,global,freeze) -- can become local + definemixcolor(name,parent,pp,cc,global,freeze) -- can become local else if selfspec ~= "" then colorspec = colorspec .. "," .. selfspec @@ -455,7 +502,7 @@ function colors.definemultitonecolor(name,multispec,colorspec,selfspec) 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_registerspotcolor(parent, cp, "", max, dd, pp) definecolor(name, register_color(name, 'spot', parent, max, dd, pp), true) local t = settings_to_hash_strict(selfspec) if t and t.a and t.t then @@ -469,8 +516,9 @@ function colors.definemultitonecolor(name,multispec,colorspec,selfspec) colorset[name] = true-- maybe we can store more end --- will move to mlib-col as colors in m,p are somewhat messy due to the fact --- that we cannot cast +-- will move to mlib-col as colors in mp are somewhat messy due to the fact +-- that we cannot cast .. so we really need to use (s,s,s) for gray in order +-- to be able to map onto 'color' local function mpcolor(model,ca,ta,default) local cv = colorvalues[ca] @@ -488,7 +536,8 @@ local function mpcolor(model,ca,ta,default) elseif model == 4 then return formatters["transparent(%s,%s,cmyk(%s,%s,%s,%s))"](tv[1],tv[2],cv[6],cv[7],cv[8],cv[9]) elseif model == 5 then - return formatters['transparent(%s,%s,multitonecolor("%s",%s,"%s","%s"))'](tv[1],tv[2],cv[10],cv[11],cv[12],cv[13]) + -- return formatters['transparent(%s,%s,multitonecolor("%s",%s,"%s","%s"))'](tv[1],tv[2],cv[10],cv[11],cv[12],cv[13]) + return formatters['transparent(%s,%s,namedcolor("%s"))'](tv[1],tv[2],cv[10]) else -- see ** in meta-ini.mkiv: return formatters["transparent(%s,%s,(%s))"](tv[1],tv[2],cv[2]) return formatters["transparent(%s,%s,(%s,%s,%s))"](tv[1],tv[2],cv[3],cv[4],cv[5]) end @@ -500,7 +549,8 @@ local function mpcolor(model,ca,ta,default) elseif model == 4 then return formatters["cmyk(%s,%s,%s,%s)"](cv[6],cv[7],cv[8],cv[9]) elseif model == 5 then - return formatters['multitonecolor("%s",%s,"%s","%s")'](cv[10],cv[11],cv[12],cv[13]) + -- return formatters['multitonecolor("%s",%s,"%s","%s")'](cv[10],cv[11],cv[12],cv[13]) + return formatters['namedcolor("%s")'](cv[10]) else -- see ** in meta-ini.mkiv: return formatters["%s"]((cv[2])) return formatters["(%s,%s,%s)"](cv[3],cv[4],cv[5]) end @@ -738,45 +788,6 @@ function colors.defineintermediatecolor(name,fraction,c_one,c_two,a_one,a_two,sp end end -local function f(i,colors,fraction) - local otf = 0 - for c=1,#colors do - otf = otf + (tonumber(fraction[c]) or 1) * colors[c][i] - end - if otf > 1 then - otf = 1 - end - return otf -end - -function colors.definemixcolor(name,fractions,cs,global,freeze) - local values = { } - for i=1,#cs do -- do fraction in here - local v = colorvalues[cs[i]] - if not v then - return - end - values[i] = v - end - local csone = values[1][1] - local ca - if csone == 2 then - ca = register_color(name,'gray',f(2,values,fractions)) - elseif csone == 3 then - ca = register_color(name,'rgb', f(3,values,fractions), - f(4,values,fractions), - f(5,values,fractions)) - elseif csone == 4 then - ca = register_color(name,'cmyk',f(6,values,fractions), - f(7,values,fractions), - f(8,values,fractions), - f(9,values,fractions)) - else - ca = register_color(name,'gray',f(2,values,fractions)) - end - definecolor(name,ca,global,freeze) -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/colo-ini.mkiv b/tex/context/base/colo-ini.mkiv index 375c2c502..c713d8803 100644 --- a/tex/context/base/colo-ini.mkiv +++ b/tex/context/base/colo-ini.mkiv @@ -1055,7 +1055,7 @@ \let\colorformatseparator\space -\def\MPcolor #1{\ctxcommand{mpcolor(\number\attribute\colormodelattribute,\number\colo_helpers_inherited_current_ca{#1},\number\colo_helpers_inherited_current_ta{#1})}} +\def\MPcolor #1{\ctxcommand {mpcolor(\number\attribute\colormodelattribute,\number\colo_helpers_inherited_current_ca{#1},\number\colo_helpers_inherited_current_ta{#1})}} \def\MPoptions #1{\ctxcommand{mpoptions(\number\attribute\colormodelattribute,\number\colo_helpers_inherited_current_ca{#1},\number\colo_helpers_inherited_current_ta{#1})}} \def\thecolorattribute #1{\number\csname\??colorattribute \ifcsname\??colorattribute \currentcolorprefix#1\endcsname\currentcolorprefix#1\else\ifcsname\??colorattribute #1\endcsname#1\fi\fi\endcsname} diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 11606f012..e6f9bc78b 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{2015.01.13 15:54} +\newcontextversion{2015.01.19 11:20} %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/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 94f3b95b8..49608c313 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 83adbddb2..32280f374 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2015.01.13 15:54} +\edef\contextversion{2015.01.19 11:20} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/lpdf-col.lua b/tex/context/base/lpdf-col.lua index 924414d40..030291c29 100644 --- a/tex/context/base/lpdf-col.lua +++ b/tex/context/base/lpdf-col.lua @@ -184,7 +184,7 @@ local f_gray_function = formatters["%s mul"] local documentcolorspaces = pdfdictionary() -local spotcolorhash = { } -- not needed +local spotcolorhash = { } -- not needed local spotcolornames = { } local indexcolorhash = { } local delayedindexcolors = { } @@ -202,7 +202,7 @@ end -- This should become delayed i.e. only flush when used; in that case we need -- need to store the specification and then flush them when accesssomespotcolor -- is called. At this moment we assume that splotcolors that get defined are --- also used which keeps the overhad small anyway. +-- also used which keeps the overhad small anyway. Tricky for mp ... local processcolors @@ -240,6 +240,7 @@ local function registersomespotcolor(name,noffractions,names,p,colorspace,range, local colorants = pdfdictionary() for n in gmatch(names,"[^,]+") do local name = spotcolornames[n] or n + -- the cmyk names assume that they are indeed these colors if n == "cyan" then name = "Cyan" elseif n == "magenta" then @@ -250,9 +251,15 @@ local function registersomespotcolor(name,noffractions,names,p,colorspace,range, name = "Black" else local sn = spotcolorhash[name] or spotcolorhash[n] + if not sn then + report_color("defining %a as colorant",name) + colors.definespotcolor("",name,"p=1",true) + sn = spotcolorhash[name] or spotcolorhash[n] + end if sn then colorants[name] = pdfreference(sn) else + -- maybe some day generate colorants (spot colors for multi) automatically report_color("unknown colorant %a, using black instead",name or n) name = "Black" end diff --git a/tex/context/base/math-stc.mkvi b/tex/context/base/math-stc.mkvi index 54824c58b..e7c775ae4 100644 --- a/tex/context/base/math-stc.mkvi +++ b/tex/context/base/math-stc.mkvi @@ -160,7 +160,7 @@ \c!distance=\mathstackersparameter\c!voffset, % distance between symbol and base (can be different from voffset) \c!minheight=\exheight, \c!mindepth=\zeropoint, - \c!minwidth=\emwidth, + \c!minwidth=.5\emwidth, \c!order=\v!normal, \c!strut=, \c!color=, % todo: when I need it diff --git a/tex/context/base/mlib-pps.lua b/tex/context/base/mlib-pps.lua index fea1225ad..c144a2501 100644 --- a/tex/context/base/mlib-pps.lua +++ b/tex/context/base/mlib-pps.lua @@ -7,7 +7,7 @@ if not modules then modules = { } end modules ['mlib-pps'] = { } local format, gmatch, match, split = string.format, string.gmatch, string.match, string.split -local tonumber, type = tonumber, type +local tonumber, type, unpack = tonumber, type, unpack local round = math.round local insert, remove, concat = table.insert, table.remove, 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 @@ -39,11 +39,19 @@ local report_textexts = logs.reporter("metapost","textexts") local report_scripts = logs.reporter("metapost","scripts") local colors = attributes.colors +local defineprocesscolor = colors.defineprocesscolor +local definespotcolor = colors.definespotcolor +local definemultitonecolor = colors.definemultitonecolor +local colorvalue = colors.value -local rgbtocmyk = colors.rgbtocmyk or function() return 0,0,0,1 end -local cmyktorgb = colors.cmyktorgb or function() return 0,0,0 end -local rgbtogray = colors.rgbtogray or function() return 0 end -local cmyktogray = colors.cmyktogray or function() return 0 end +local transparencies = attributes.transparencies +local registertransparency = transparencies.register +local transparencyvalue = transparencies.value + +local rgbtocmyk = colors.rgbtocmyk -- or function() return 0,0,0,1 end +local cmyktorgb = colors.cmyktorgb -- or function() return 0,0,0 end +local rgbtogray = colors.rgbtogray -- or function() return 0 end +local cmyktogray = colors.cmyktogray -- or function() return 0 end metapost.makempy = metapost.makempy or { nofconverted = 0 } local makempy = metapost.makempy @@ -58,11 +66,6 @@ local innertransparency = nooutertransparency local pdfcolor = lpdf.color local pdftransparency = lpdf.transparency -local registercolor = colors.register -local registerspotcolor = colors.registerspotcolor - -local transparencies = attributes.transparencies -local registertransparency = transparencies.register function metapost.setoutercolor(mode,colormodel,colorattribute,transparencyattribute) -- has always to be called before conversion @@ -84,6 +87,8 @@ function metapost.setoutercolor(mode,colormodel,colorattribute,transparencyattri innertransparency = outertransparency -- not yet used end +-- todo: get this from the lpdf module + local f_f = formatters["%F"] local f_f3 = formatters["%.3F"] @@ -93,6 +98,8 @@ local f_cmyk = formatters["%.3F %.3F %.3F %.3F k %.3F %.3F %.3F %.3F K"] local f_cm = formatters["q %F %F %F %F %F %F cm"] local f_shade = formatters["MpSh%s"] +local f_spot = formatters["/%s cs /%s CS %s SCN %s scn"] + local function checked_color_pair(color,...) if not color then return innercolor, outercolor @@ -142,15 +149,6 @@ local function normalize(ca,cb) end end --- todo: check for the same colorspace (actually a backend issue), now we can --- have several similar resources --- --- normalize(ca,cb) fails for spotcolors - -local function spotcolorconverter(parent, n, d, p) - registerspotcolor(parent) - return pdfcolor(colors.model,registercolor(nil,'spot',parent,n,d,p)), outercolor -end local commasplitter = tsplitat(",") @@ -1045,9 +1043,9 @@ local function sh_process(object,prescript,before,after) local sh_type = prescript.sh_type if sh_type then nofshades = nofshades + 1 - local domain = lpegmatch(domainsplitter,prescript.sh_domain) - local centera = lpegmatch(centersplitter,prescript.sh_center_a) - local centerb = lpegmatch(centersplitter,prescript.sh_center_b) + local domain = lpegmatch(domainsplitter,prescript.sh_domain or "0 1") + local centera = lpegmatch(centersplitter,prescript.sh_center_a or "0 0") + local centerb = lpegmatch(centersplitter,prescript.sh_center_b or "0 0") -- local sh_color_a = prescript.sh_color_a or "1" local sh_color_b = prescript.sh_color_b or "1" @@ -1096,8 +1094,9 @@ local function sh_process(object,prescript,before,after) local coordinates = { centera[1], centera[2], centerb[1], centerb[2] } lpdf.linearshade(name,domain,ca,cb,1,colorspace,coordinates,separation) -- backend specific (will be renamed) elseif sh_type == "circular" then - local radiusa = tonumber(prescript.sh_radius_a) - local radiusb = tonumber(prescript.sh_radius_b) + local factor = tonumber(prescript.sh_factor) or 1 + local radiusa = factor * tonumber(prescript.sh_radius_a) + local radiusb = factor * tonumber(prescript.sh_radius_b) local coordinates = { centera[1], centera[2], radiusa, centerb[1], centerb[2], radiusb } lpdf.circularshade(name,domain,ca,cb,1,colorspace,coordinates,separation) -- backend specific (will be renamed) else @@ -1179,6 +1178,12 @@ local value = Cs ( ( local t_list = attributes.list[attributes.private('transparency')] local c_list = attributes.list[attributes.private('color')] +local remappers = { + [1] = formatters["s=%s"], + [3] = formatters["r=%s,g=%s,b=%s"], + [4] = formatters["c=%s,m=%s,y=%s,k=%s"], +} + local function tr_process(object,prescript,before,after) -- before can be shortcut to t local tr_alternative = prescript.tr_alternative @@ -1194,56 +1199,83 @@ local function tr_process(object,prescript,before,after) local sp_type = prescript.sp_type if not sp_type then c_b, c_a = colorconverter(cs) - elseif sp_type == "spot" or sp_type == "multitone" then - local sp_name = prescript.sp_name or "black" - local sp_fractions = prescript.sp_fractions or 1 - local sp_components = prescript.sp_components or "" - local sp_value = prescript.sp_value or "1" - local cf = cs[1] - if cf ~= 1 then - -- beware, we do scale the spotcolors but not the alternative representation - sp_value = lpegmatch(value,sp_value,1,cf) or sp_value - end - c_b, c_a = spotcolorconverter(sp_name,sp_fractions,sp_components,sp_value) - elseif sp_type == "named" then - -- we might move this to another namespace .. also, named can be a spotcolor - -- so we need to check for that too ... also we need to resolve indirect - -- colors so we might need the second pass for this (draw dots with \MPcolor) + else local sp_name = prescript.sp_name or "black" - if not tr_alternative then - -- todo: sp_name is not yet registered at this time - local t = t_list[sp_name] -- string or attribute - local v = t and attributes.transparencies.value(t) - if v then - before[#before+1] = formatters["/Tr%s gs"](registertransparency(nil,v[1],v[2],true)) - after[#after+1] = "/Tr0 gs" -- outertransparency + if sp_type == "spot" then + local sp_value = prescript.sp_value or "s:1" + local sp_temp = formatters["mp:%s"](sp_value) + local s = split(sp_value,":") + local r = remappers[#s] + defineprocesscolor(sp_temp,r and r(unpack(s)) or "s=0",true,true) + definespotcolor(sp_name,sp_temp,"p=1",true) + sp_type = "named" + elseif sp_type == "multitone" then + local sp_value = prescript.sp_value or "s:1" + local sp_spec = { } + local sp_list = split(sp_value," ") + for i=1,#sp_list do + local v = sp_list[i] + local t = formatters["mp:%s"](v) + local s = split(v,":") + local r = remappers[#s] + defineprocesscolor(t,r and r(unpack(s)) or "s=0",true,true) + local tt = formatters["ms:%s"](v) + definespotcolor(tt,t,"p=1",true) + sp_spec[#sp_spec+1] = formatters["%s=1"](t) end + sp_spec = concat(sp_spec,",") + definemultitonecolor(sp_name,sp_spec,"","",true) + sp_type = "named" end - local c = c_list[sp_name] -- string or attribute - local v = c and attributes.colors.value(c) - if v then - -- all=1 gray=2 rgb=3 cmyk=4 - local colorspace = v[1] - local f = cs[1] - if colorspace == 2 then - local s = f*v[2] - c_b, c_a = checked_color_pair(f_gray,s,s) - elseif colorspace == 3 then - local r, g, b = f*v[3], f*v[4], f*v[5] - c_b, c_a = checked_color_pair(f_rgb,r,g,b,r,g,b) - elseif colorspace == 4 or colorspace == 1 then - local c, m, y, k = f*v[6], f*v[7], f*v[8], f*v[9] - c_b, c_a = checked_color_pair(f_cmyk,c,m,y,k,c,m,y,k) - else - local s = f*v[2] - c_b, c_a = checked_color_pair(f_gray,s,s) + if sp_type == "named" then + -- we might move this to another namespace .. also, named can be a spotcolor + -- so we need to check for that too ... also we need to resolve indirect + -- colors so we might need the second pass for this (draw dots with \MPcolor) + if not tr_alternative then + -- todo: sp_name is not yet registered at this time + local t = t_list[sp_name] -- string or attribute + local v = t and transparencyvalue(t) + if v then + before[#before+1] = formatters["/Tr%s gs"](registertransparency(nil,v[1],v[2],true)) + after[#after+1] = "/Tr0 gs" -- outertransparency + end + end + local c = c_list[sp_name] -- string or attribute + local v = c and colorvalue(c) + if v then + -- all=1 gray=2 rgb=3 cmyk=4 + local colorspace = v[1] + local f = cs[1] + if colorspace == 2 then + local s = f*v[2] + c_b, c_a = checked_color_pair(f_gray,s,s) + elseif colorspace == 3 then + local r, g, b = f*v[3], f*v[4], f*v[5] + c_b, c_a = checked_color_pair(f_rgb,r,g,b,r,g,b) + elseif colorspace == 4 or colorspace == 1 then + local c, m, y, k = f*v[6], f*v[7], f*v[8], f*v[9] + c_b, c_a = checked_color_pair(f_cmyk,c,m,y,k,c,m,y,k) + elseif colorspace == 5 then + -- not all viewers show the fractions ok + local name = v[10] + local value = split(v[13],",") + if f ~= 1 then + for i=1,#value do + value[i] = f * (tonumber(value[i]) or 1) + end + end + value = concat(value," ") + c_b, c_a = checked_color_pair(f_spot,name,name,value,value) + else + local s = f*v[2] + c_b, c_a = checked_color_pair(f_gray,s,s) + end end end - -- end if c_a and c_b then before[#before+1] = c_b - after[#after+1] = c_a + after [#after +1] = c_a end end end diff --git a/tex/context/base/mult-fun.lua b/tex/context/base/mult-fun.lua index 4e8b9fc88..4ba583dfe 100644 --- a/tex/context/base/mult-fun.lua +++ b/tex/context/base/mult-fun.lua @@ -39,9 +39,10 @@ return { "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", - "withshading", "withlinearshading", "withcircularshading", - "withfromshadecolor", "withtoshadecolor", "shadedinto", - "withshade", "withcircularshade", "withlinearshade", + "withshade", "withcircularshade", "withlinearshade", -- old but kept + "defineshade", "shaded", + -- "withshading", "withlinearshading", "withcircularshading", "withfromshadecolor", "withtoshadecolor", + "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", @@ -57,13 +58,12 @@ return { "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", - "infont", -- redefined usign textext - -- "property", "withproperties", "properties", -- not yet - "set_linear_vector", "set_circular_vector", - "linear_shade", "circular_shade", - "define_linear_shade", "define_circular_shade", - "define_circular_linear_shade", "define_circular_linear_shade", - "define_sampled_linear_shade", "define_sampled_circular_shade", + "infont", -- redefined using textext + -- "set_linear_vector", "set_circular_vector", + -- "linear_shade", "circular_shade", + -- "define_linear_shade", "define_circular_shade", + -- "define_circular_linear_shade", "define_circular_linear_shade", + -- "define_sampled_linear_shade", "define_sampled_circular_shade", "space", "crlf", "dquote", "SPACE", "CRLF", "DQUOTE", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", diff --git a/tex/context/base/mult-low.lua b/tex/context/base/mult-low.lua index cbabec353..460128d96 100644 --- a/tex/context/base/mult-low.lua +++ b/tex/context/base/mult-low.lua @@ -85,6 +85,7 @@ return { "fontexheight", "fontemwidth", "fontextraspace", "slantperpoint", "interwordspace", "interwordstretch", "interwordshrink", "exheight", "emwidth", "extraspace", "mathsupdisplay", "mathsupnormal", "mathsupcramped", "mathsubnormal", "mathsubcombined", "mathaxisheight", + "muquad", -- -- maybe a different class -- diff --git a/tex/context/base/mult-mps.lua b/tex/context/base/mult-mps.lua index 0f893f895..c5e4b04ac 100644 --- a/tex/context/base/mult-mps.lua +++ b/tex/context/base/mult-mps.lua @@ -130,4 +130,32 @@ return { -- "pen_lft", "pen_rt", "pen_top", "pen_bot", -- "pen_count_", }, + metafont = { + -- :: =: =:| =:|> |=: |=:> |=:| |=:|> |=:|>> ||: + "autorounding", "beginchar", "blacker", "boundarychar", "capsule_def", + "capsule_end", "change_width", "chardp", "chardx", "chardy", "charexists", + "charext", "charht", "charic", "charlist", "charwd", "cull", "cullit", + "currenttransform", "define_blacker_pixels", "define_corrected_pixels", + "define_good_x_pixels", "define_good_y_pixels", + "define_horizontal_corrected_pixels", "define_pixels", + "define_whole_blacker_pixels", "define_whole_pixels", + "define_whole_vertical_blacker_pixels", "define_whole_vertical_pixels", + "designsize", "display", "endchar", "extensible", "extra_beginchar", + "extra_endchar", "extra_setup", "fillin", "font_coding_scheme", + "font_extra_space", "font_identifier", "font_normal_shrink", + "font_normal_space", "font_normal_stretch", "font_quad", "font_size", + "font_slant", "font_x_height", "fontdimen", "fontmaking", "gfcorners", + "granularity", "grayfont", "headerbyte", "hppp", "hround", "imagerules", + "italcorr", "kern", "labelfont", "ligtable", "lowres_fix", "makebox", + "makegrid", "maketicks", "mode_def", "mode_setup", "nodisplays", + "notransforms", "numspecial", "o_correction", "openit", "openwindow", + "proofing", "proofoffset", "proofrule", "proofrulethickness", "rulepen", + "screenchars", "screenrule", "screenstrokes", "showit", "slantfont", + "smode", "smoothing", "titlefont", "totalweight", "tracingedges", + "tracingpens", "turningcheck", "unitpixel", "vppp", "vround", "xoffset", + "yoffset", + }, + disabled = { + "verbatimtex" + } } diff --git a/tex/context/base/publ-imp-apa.mkvi b/tex/context/base/publ-imp-apa.mkvi index 5e6cc20db..d7dc4db9a 100644 --- a/tex/context/base/publ-imp-apa.mkvi +++ b/tex/context/base/publ-imp-apa.mkvi @@ -29,6 +29,10 @@ % set all APA compliant values (may be redundant but we do not count on defaults.) +\setupbtxlist + [alternative=hanging, + margin=3em] + \setupbtxlistvariant [\c!namesep={,\space}, \c!lastnamesep={,\nobreakspace\textampersand\space}, @@ -127,8 +131,7 @@ \setupbtxrendering [sorttype=authoryear, - numbering=no, - hang=20] % how to get hanging to work? ... answer: it's descriptions ... + numbering=no] % Should the following be loaded by default? diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex e1ff4721b..bf1ab3f94 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 7a39ff91d..80ba54d56 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/syst-ini.mkiv b/tex/context/base/syst-ini.mkiv index 29a97b6bd..af3a0310c 100644 --- a/tex/context/base/syst-ini.mkiv +++ b/tex/context/base/syst-ini.mkiv @@ -386,6 +386,8 @@ \newmuskip\zeromuskip \zeromuskip = 0mu \newmuskip\onemuskip \onemuskip = 1mu +\newmuskip\muquad \muquad = 18mu + \let\points \onepoint \let\halfpoint\halfapoint diff --git a/tex/context/base/tabl-ntb.mkiv b/tex/context/base/tabl-ntb.mkiv index 973992ff1..2f37961ea 100644 --- a/tex/context/base/tabl-ntb.mkiv +++ b/tex/context/base/tabl-ntb.mkiv @@ -1305,12 +1305,8 @@ \normalexpanded {\t_tabl_ntb_row {\the\t_tabl_ntb_row - \ifnum\scratchcounter=\plusone - \tabl_ntb_plus - \else - % span - \tabl_ntb_span{\the\scratchcounter}% - \fi}}% + \tabl_ntb_span{\the\scratchcounter}% + \tabl_ntb_plus}}% \fi} \setvalue{\??naturaltablecell\the\c_tabl_ntb_cell}#1#2% diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index f0d5ff50e..3aceddaa1 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 : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 01/13/15 15:54:38 +-- merge date : 01/19/15 11:20:20 do -- begin closure to overcome local limits and interference |