From 66c43ffc47e4bf28c112bc5c593d1853212f7715 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 16 Apr 2008 17:34:00 +0200 Subject: stable 2008.04.16 17:34 --- metapost/context/base/mp-mlib.mp | 14 ++- scripts/context/lua/mtxrun.lua | 3 + tex/context/base/colo-new.mkiv | 4 + tex/context/base/cont-new.tex | 2 +- tex/context/base/context.tex | 2 +- tex/context/base/core-spa.mkiv | 6 +- tex/context/base/font-fbk.lua | 4 +- tex/context/base/font-syn.lua | 11 ++- tex/context/base/m-chemic.tex | 2 +- tex/context/base/math-ini.lua | 6 +- tex/context/base/meta-ini.mkiv | 20 ++-- tex/context/base/mlib-pdf.lua | 24 ++--- tex/context/base/mlib-pps.lua | 198 +++++++++++++++++++------------------- tex/context/interface/keys-cz.xml | 2 +- tex/context/interface/keys-de.xml | 2 +- tex/context/interface/keys-en.xml | 2 +- tex/context/interface/keys-fr.xml | 2 +- tex/context/interface/keys-it.xml | 2 +- tex/context/interface/keys-nl.xml | 2 +- tex/context/interface/keys-ro.xml | 2 +- 20 files changed, 165 insertions(+), 145 deletions(-) diff --git a/metapost/context/base/mp-mlib.mp b/metapost/context/base/mp-mlib.mp index 4ebe576e6..03d30ba99 100644 --- a/metapost/context/base/mp-mlib.mp +++ b/metapost/context/base/mp-mlib.mp @@ -1,3 +1,15 @@ +%D \module +%D [ file=mp-mlib.mp, +%D version=2008.03.21, +%D title=\CONTEXT\ \METAPOST\ graphics, +%D subtitle=specials, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See licen-en.pdf for +%C details. if unknown mplib : endinput ; fi ; if known context_mlib : endinput ; fi ; @@ -119,12 +131,12 @@ def nographictext (expr t) text rest = draw unitsquare withprescript "gt" withpostscript t ; enddef ; - def doexternalfigure (expr filename) text transformation = draw unitsquare transformation withprescript "fg" withpostscript filename ; enddef ; extra_beginfig := extra_beginfig & "currentgraphictext := 0 ; " ; +extra_endfig := extra_endfig & "finishsavingdata ; " ; boolean cmykcolors ; cmykcolors := true ; boolean spotcolors ; spotcolors := true ; diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index f08c0f812..ed263f916 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -7623,11 +7623,14 @@ function os.currentplatform() else currentplatform = "osx-ppc" end + elseif unixvariant and unixvariant:find("FreeBSD") then + currentplatform = "freebsd" end end return currentplatform end + -- it starts here input.runners = { } diff --git a/tex/context/base/colo-new.mkiv b/tex/context/base/colo-new.mkiv index d7cf33c51..d054095fe 100644 --- a/tex/context/base/colo-new.mkiv +++ b/tex/context/base/colo-new.mkiv @@ -66,6 +66,10 @@ \setcolormodel{gray}% \fi} +\appendtoks + \dosetupcolormodel +\to \everyjob + % Currently in mkiv transparency is implemented independent of color. This costs % a bit more processing time but gives the possibility to apply transparency % independently in the future. Is this useful? If not we may as well combine them diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 4304bfc8b..2a4f9ac50 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2008.04.15 22:29} +\newcontextversion{2008.04.16 17:34} %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.tex b/tex/context/base/context.tex index 0bbda991d..cf6aec247 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -42,7 +42,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2008.04.15 22:29} +\edef\contextversion{2008.04.16 17:34} %D For those who want to use this: diff --git a/tex/context/base/core-spa.mkiv b/tex/context/base/core-spa.mkiv index 6eb99c1f9..1352e2582 100644 --- a/tex/context/base/core-spa.mkiv +++ b/tex/context/base/core-spa.mkiv @@ -99,7 +99,7 @@ \gdef\setcharacterspacing[##1]{\dosetattribute{spacing}{\csname\??ch:##1\endcsname}}% \setcharacterspacing} -\setvalue{\??ch:\s!reset}{\doresetattribute{spacing}} +\letvalue{\??ch:\s!reset}\minusone \definecharacterspacing [frenchpunctuation] % name may change / unit is em @@ -143,7 +143,7 @@ \gdef\setcharacterkerning[##1]{\dosetattribute{kern}{\csname\??ck:##1\endcsname}}% \setcharacterkerning} -\setvalue{\??ck:\s!reset}{\doresetattribute{kern}} +\letvalue{\??ck:\s!reset}\minusone \definecharacterkerning[extrakerning] @@ -217,7 +217,7 @@ \gdef\setbreakpoints[##1]{\dosetattribute{breakpoint}{\csname\??bp:##1\endcsname}}% \setbreakpoints} -\setvalue{\??bp:\s!reset}{\doresetattribute{breakpoint}} +\letvalue{\??bp:\s!reset}\minusone \definebreakpoints[compound] diff --git a/tex/context/base/font-fbk.lua b/tex/context/base/font-fbk.lua index 960c96a14..0d1ae6218 100644 --- a/tex/context/base/font-fbk.lua +++ b/tex/context/base/font-fbk.lua @@ -109,6 +109,7 @@ end fonts.vf.aux.combine.force_composed = false function fonts.vf.aux.compose_characters(g) -- todo: scaling depends on call location + -- this assumes that slot 1 is self, there will be a proper self some day local chars = g.characters local fastcopy = table.fastcopy local xchar = chars[string.byte("X")] @@ -118,9 +119,6 @@ function fonts.vf.aux.compose_characters(g) -- todo: scaling depends on call loc local force = fonts.vf.aux.combine.force_composed local fallbacks = characters.context.fallbacks local special, red, green, blue, black = fonts.vf.aux.combine.initialize_trace() -if not g.fonts then - g.fonts = { { name = g.name, size = g.size or -1000 } } -- fallback -end for i,c in pairs(characters.data) do if force or not chars[i] then local s = c.specials diff --git a/tex/context/base/font-syn.lua b/tex/context/base/font-syn.lua index f751947b8..ec62048a7 100644 --- a/tex/context/base/font-syn.lua +++ b/tex/context/base/font-syn.lua @@ -282,18 +282,19 @@ do local reloaded = false - function fonts.names.resolve(name, sub) - if not name then + function fonts.names.resolve(askedname, sub) + if not askedname then return nil, nil elseif fonts.names.enabled then + askedname = askedname:lower() fonts.names.load() - local name, filename, is_sub = found(name:lower()) - if not filename and not reloaded and fonts.name.autoreload then + local name, filename, is_sub = found(askedname) + if not filename and not reloaded and fonts.names.autoreload then fonts.names.loaded = false reloaded = true io.flush() fonts.names.load(true) - name, filename, is_sub = found(name:lower()) + name, filename, is_sub = found(askedname) end if is_sub then return filename, name diff --git a/tex/context/base/m-chemic.tex b/tex/context/base/m-chemic.tex index 21cabe8b3..25eb62db5 100644 --- a/tex/context/base/m-chemic.tex +++ b/tex/context/base/m-chemic.tex @@ -14,7 +14,7 @@ \ifx\directlua\undefined \ifx\psaxes\undefined \ifx\beginpicture\undefined -   \usemodule[pictex] + \usemodule[pictex] \fi \fi \else \usemodule[pictex] diff --git a/tex/context/base/math-ini.lua b/tex/context/base/math-ini.lua index d3f2b87ae..60a91071f 100644 --- a/tex/context/base/math-ini.lua +++ b/tex/context/base/math-ini.lua @@ -359,8 +359,10 @@ mathematics.slots.current = mathematics.slots.traditional --~ end function mathematics.utfmathclass(chr, default) - return characters.data[utf.byte(chr)].mathclass or default or "unknown" + local cd = characters.data[utf.byte(chr)] + return (cd and cd.mathclass) or default or "unknown" end function mathematics.utfmathcommand(chr, default) - return characters.data[utf.byte(chr)].mathname or default or "unknown" + local cd = characters.data[utf.byte(chr)] + return (cd and cd.mathname) or default or "unknown" end diff --git a/tex/context/base/meta-ini.mkiv b/tex/context/base/meta-ini.mkiv index aa9e64e80..8793e6e20 100644 --- a/tex/context/base/meta-ini.mkiv +++ b/tex/context/base/meta-ini.mkiv @@ -59,11 +59,12 @@ %D the code. Otherwise maintainance becomes a pain and after all, %D the \MKII\ code will not change. -\let\useMETAFUNformattrue \relax \let\useMETAFUNformatfalse\relax -\let \longMPlinestrue \relax \let \longMPlinesfalse\relax -\let \runMPgraphicstrue \relax \let \runMPgraphicsfalse\relax -\let\runMPTEXgraphicstrue \relax \let\runMPTEXgraphicsfalse\relax -\let \MPstaticgraphictrue \relax \let \MPstaticgraphicfalse\relax +\let \useMETAFUNformattrue\relax \let \useMETAFUNformatfalse\relax +\let \longMPlinestrue\relax \let \longMPlinesfalse\relax +\let \runMPgraphicstrue\relax \let \runMPgraphicsfalse\relax +\let \runMPTEXgraphicstrue\relax \let \runMPTEXgraphicsfalse\relax +\let \MPstaticgraphictrue\relax \let \MPstaticgraphicfalse\relax +\let\forceMPTEXgraphictrue\relax \let\forceMPTEXgraphicfalse\relax \let \obeyMPlines\relax \let \forceMPTEXcheck\gobbleoneargument @@ -612,11 +613,10 @@ def data_mpy_file = "\MPdataMPYfile" enddef ; \stopMPextensions -\newcount\currentMPgraphic \currentMPgraphic\zerocount +\chardef\currentMPgraphic\plusone \def\getMPdata - {%\let\MPdata\secondoftwoarguments - \long\def\MPdata##1##2{\ifnum##1=\currentMPgraphic\relax##2\fi}% + {\let\MPdata\secondoftwoarguments \startreadingfile \startnointerference \readlocfile\MPdataMPDfile\donothing\donothing @@ -776,8 +776,8 @@ %D built in, but by means of specials we can supply the %D information needed to handle them naturaly. -\newif\ifMPcmykcolors \MPcmykcolorstrue -\newif\ifMPspotcolors \MPspotcolorstrue +% \newif\ifMPcmykcolors \MPcmykcolorstrue +% \newif\ifMPspotcolors \MPspotcolorstrue \startMPinitializations cmykcolors:=\ifMPcmykcolors true\else false\fi; diff --git a/tex/context/base/mlib-pdf.lua b/tex/context/base/mlib-pdf.lua index c3f2307e4..8d77a2ec8 100644 --- a/tex/context/base/mlib-pdf.lua +++ b/tex/context/base/mlib-pdf.lua @@ -313,7 +313,7 @@ function metapost.flush(result,flusher) -- pdf flusher, table en dan concat is s -- cs = currentobject.color if cs and #cs > 0 then - t[#t+1], cr = colorconverter(cs,objecttype) + t[#t+1], cr = colorconverter(cs) end -- if before then object, t = before() end @@ -400,7 +400,7 @@ function metapost.flush(result,flusher) -- pdf flusher, table en dan concat is s t[#t+1] = "Q" end end - if cr and currentobject.color then -- and o < #objects + if cr then t[#t+1] = cr end if after then object, t = after() end @@ -493,17 +493,17 @@ function metapost.totable(result) end function metapost.colorconverter() - return function(c,type) - if type == "fill" then - if #c == 4 then return format("%.3f %.3f %.3f %.3f k", c[1],c[2],c[3],c[4]), "0 g" - elseif #c == 3 then return format("%.3f %.3f %.3f rg", c[1],c[2],c[3]), "0 g" - else return format("%.3f g", c[1]), "0 g" - end + return function(cr) + local n = #cr + if n == 4 then + local c, m, y, k = cr[1], cr[2], cr[3], cr[4] + return format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k), "0 g 0 G" + elseif n == 3 then + local r, g, b = cr[1], cr[2], cr[3] + return format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b), "0 g 0 G" else - if #c == 4 then return format("%.3f %.3f %.3f %.3f K", c[1],c[2],c[3],c[4]), "0 G" - elseif #c == 3 then return format("%.3f %.3f %.3f RG", c[1],c[2],c[3]), "0 G" - else return format("%.3f G", c[1]), "0 G" - end + local s = cr[1] + return format("%.3f g %.3f G",s,s), "0 g 0 G" end end end diff --git a/tex/context/base/mlib-pps.lua b/tex/context/base/mlib-pps.lua index b2d65e7cb..a2d64e225 100644 --- a/tex/context/base/mlib-pps.lua +++ b/tex/context/base/mlib-pps.lua @@ -6,16 +6,15 @@ if not modules then modules = { } end modules ['mlib-pps'] = { -- prescript, pos license = "see context related readme files", } --- todo - -local format, join = string.format, table.concat +local format, join, round = string.format, table.concat, math.round local sprint = tex.sprint -local round = math.round -local rgbtocmyk = colors.rgbtocmyk -local rgbtogray = colors.rgbtogray -local cmyktorgb = colors.cmyktorgb -local cmyktogray = colors.cmyktogray +colors = colors or { } + +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 = metapost or { } metapost.specials = metapost.specials or { } @@ -55,15 +54,15 @@ function metapost.colorhandler(cs, object, result, colorconverter) if not data then -- elseif what == 1 then - result[#result+1], cr = colorconverter({ data[2], data[3], data[4], data[5]}, object.type) + result[#result+1], cr = colorconverter({ data[2], data[3], data[4], data[5] }) elseif what == 2 then ctx.registerspotcolor(data[2]) result[#result+1] = ctx.pdfcolor(colors.model,colors.register('color',nil,'spot',data[2],data[3],data[4],data[5])) else if what == 3 then - result[#result+1], cr = colorconverter({ data[3], data[4], data[5]}, object.type) + result[#result+1], cr = colorconverter({ data[3], data[4], data[5]}) elseif what == 4 then - result[#result+1], cr = colorconverter({ data[3], data[4], data[5], data[6]}, object.type) + result[#result+1], cr = colorconverter({ data[3], data[4], data[5], data[6]}) elseif what == 5 then ctx.registerspotcolor(data[3]) result[#result+1] = ctx.pdfcolor(colors.model,colors.register('color',nil,'spot',data[3],data[4],data[5],data[6])) @@ -384,62 +383,65 @@ function metapost.specials.ts(specification,object,result,flusher) end function metapost.colorconverter() + -- it no longer pays off to distinguish between outline and fill + -- (we now have both too, e.g. in arrows) local model = colors.model if model == "all" then - return function(c,type) - if type == "fill" then - if #c == 4 then return format("%.3f %.3f %.3f %.3f k", c[1],c[2],c[3],c[4]), "0 g" - elseif #c == 3 then return format("%.3f %.3f %.3f rg", c[1],c[2],c[3]), "0 g" - else return format("%.3f g", c[1]), "0 g" - end + return function(cr) + local n = #cr + if n == 1 then + local s = cr[1] + return format("%.3f g %.3f G",s,s), "0 g 0 G" + elseif n == 4 then + local c, m, y, k = cr[1], cr[2], cr[3], cr[4] + return format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k), "0 g 0 G" else - if #c == 4 then return format("%.3f %.3f %.3f %.3f K", c[1],c[2],c[3],c[4]), "0 G" - elseif #c == 3 then return format("%.3f %.3f %.3f RG", c[1],c[2],c[3]), "0 G" - else return format("%.3f G", c[1]), "0 G" - end + local r, g, b = cr[1], cr[2], cr[3] + return format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b), "0 g 0 G" end end elseif model == "rgb" then - return function(c,type) - if type == "fill" then - if #c == 4 then return format("%.3f %.3f %.3f rg",cmyktorgb(c[1],c[2],c[3],c[4])), "0 g" - elseif #c == 3 then return format("%.3f %.3f %.3f rg", c[1],c[2],c[3]), "0 g" - else return format("%.3f g", c[1]), "0 g" - end + return function(cr) + local n = #cr + if n == 1 then + local s = cr[1] + return format("%.3f g %.3f G",s,s), "0 g 0 G" + end + local r, g, b + if n == 4 then + r, g, b = cmyktorgb(cr[1],cr[2],cr[3],cr[4]) else - if #c == 4 then return format("%.3f %.3f %.3f RG",cmyktorgb(c[1],c[2],c[3],c[4])), "0 G" - elseif #c == 3 then return format("%.3f %.3f %.3f RG", c[1],c[2],c[3]), "0 G" - else return format("%.3f G", c[1]), "0 G" - end + r, g, b = cr[1],cr[2],cr[3] end + return format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b), "0 g 0 G" end elseif model == "cmyk" then - return function(c,type) - if type == "fill" then - if #c == 4 then return format("%.3f %.3f %.3f %.3f k", c[1],c[2],c[3],c[4]), "0 g" - elseif #c == 3 then return format("%.3f %.3f %.3f %.3f k",rgbtocmyk(c[1],c[2],c[3])), "0 g" - else return format("%.3f g", c[1]), "0 g" - end + return function(cr) + local n = #cr + if n == 1 then + local s = cr[1] + return format("%.3f g %.3f G",s,s), "0 g 0 G" + end + local c, m, y, k + if n == 4 then + c, m, y, k = cr[1], cr[2], cr[3], cr[4] else - if #c == 4 then return format("%.3f %.3f %.3f %.3f K", c[1],c[2],c[3],c[4]), "0 G" - elseif #c == 3 then return format("%.3f %.3f %.3f %.3f K",rgbtocmyk(c[1],c[2],c[3])), "0 G" - else return format("%.3f G", c[1]), "0 G" - end + c, m, y, k = rgbtocmyk(cr[1],cr[2],cr[3]) end + return format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k), "0 g 0 G" end else - return function(c,type) - if type == "fill" then - if #c == 4 then return format("%.3f g",cmyktogray(c[1],c[2],c[3],c[4])), "0 g" - elseif #c == 3 then return format("%.3f g",rgbtogray (c[1],c[2],c[3])), "0 g" - else return format("%.3f g", c[1]), "0 g" - end + return function(cr) + local s + local n = #cr + if n == 4 then + s = cmyktogray(cr[1],cr[2],cr[3],cr[4]) + elseif n == 3 then + s = rgbtogray(cr[1],cr[2],cr[3]) else - if #c == 4 then return format("%.3f G",cmyktogray(c[1],c[2],c[3],colors[4])), "0 G" - elseif #c == 3 then return format("%.3f G",rgbtogray (c[1],c[2],c[3])), "0 G" - else return format("%.3f G", c[1]), "0 G" - end + s = cr[1] end + return format("%.3f g %.3f G",s,s), "0 g 0 G" end end end @@ -457,71 +459,69 @@ end metapost.reducetogray = true function metapost.colorconverter() + -- it no longer pays off to distinguish between outline and fill + -- (we now have both too, e.g. in arrows) local model = colors.model local reduce = metapost.reducetogray if model == "all" then - return function(c,type) - local n = #c - if reduce and n == 3 then if c[1] == c[2] and c[1] == c[3] then n = 1 end end - if type == "fill" then - if n == 4 then return format("%.3f %.3f %.3f %.3f k", c[1],c[2],c[3],c[4]), "0 g" - elseif n == 3 then return format("%.3f %.3f %.3f rg", c[1],c[2],c[3]), "0 g" - else return format("%.3f g", c[1]), "0 g" - end + return function(cr) + local n = #cr + if reduce and n == 3 then if cr[1] == cr[2] and cr[1] == cr[3] then n = 1 end end + if n == 1 then + local s = cr[1] + return format("%.3f g %.3f G",s,s) + elseif n == 4 then + local c, m, y, k = cr[1], cr[2], cr[3], cr[4] + return format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k) else - if n == 4 then return format("%.3f %.3f %.3f %.3f K", c[1],c[2],c[3],c[4]), "0 G" - elseif n == 3 then return format("%.3f %.3f %.3f RG", c[1],c[2],c[3]), "0 G" - else return format("%.3f G", c[1]), "0 G" - end + local r, g, b = cr[1], cr[2], cr[3] + return format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b) end end elseif model == "rgb" then - return function(c,type) - local n = #c - if reduce and n == 3 then if c[1] == c[2] and c[1] == c[3] then n = 1 end end - if type == "fill" then - if n == 4 then return format("%.3f %.3f %.3f rg",cmyktorgb(c[1],c[2],c[3],c[4])), "0 g" - elseif n == 3 then return format("%.3f %.3f %.3f rg", c[1],c[2],c[3]), "0 g" - else return format("%.3f g", c[1]), "0 g" - end + return function(cr) + local n = #cr + if reduce and n == 3 then if cr[1] == cr[2] and cr[1] == cr[3] then n = 1 end end + if n == 1 then + local s = cr[1] + return format("%.3f g %.3f G",s,s) + end + local r, g, b + if n == 4 then + r, g, b = cmyktorgb(cr[1],cr[2],cr[3],cr[4]) else - if n == 4 then return format("%.3f %.3f %.3f RG",cmyktorgb(c[1],c[2],c[3],c[4])), "0 G" - elseif n == 3 then return format("%.3f %.3f %.3f RG", c[1],c[2],c[3]), "0 G" - else return format("%.3f G", c[1]), "0 G" - end + r, g, b = cr[1],cr[2],cr[3] end + return format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b) end elseif model == "cmyk" then - return function(c,type) - local n = #c - if reduce and n == 3 then if c[1] == c[2] and c[1] == c[3] then n = 1 end end - if type == "fill" then - if n == 4 then return format("%.3f %.3f %.3f %.3f k", c[1],c[2],c[3],c[4]), "0 g" - elseif n == 3 then return format("%.3f %.3f %.3f %.3f k",rgbtocmyk(c[1],c[2],c[3])), "0 g" - else return format("%.3f g", c[1]), "0 g" - end + return function(cr) + local n = #cr + if reduce and n == 3 then if cr[1] == cr[2] and cr[1] == cr[3] then n = 1 end end + if n == 1 then + local s = cr[1] + return format("%.3f g %.3f G",s,s) + end + local c, m, y, k + if n == 4 then + c, m, y, k = cr[1], cr[2], cr[3], cr[4] else - if n == 4 then return format("%.3f %.3f %.3f %.3f K", c[1],c[2],c[3],c[4]), "0 G" - elseif n == 3 then return format("%.3f %.3f %.3f %.3f K",rgbtocmyk(c[1],c[2],c[3])), "0 G" - else return format("%.3f G", c[1]), "0 G" - end + c, m, y, k = rgbtocmyk(cr[1],cr[2],cr[3]) end + return format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k) end else - return function(c,type) - local n = #c - if reduce and n == 3 then if c[1] == c[2] and c[1] == c[3] then n = 1 end end - if type == "fill" then - if n == 4 then return format("%.3f g",cmyktogray(c[1],c[2],c[3],c[4])), "0 g" - elseif n == 3 then return format("%.3f g",rgbtogray (c[1],c[2],c[3])), "0 g" - else return format("%.3f g", c[1]), "0 g" - end + return function(cr) + local n = #cr + if reduce and n == 3 then if cr[1] == cr[2] and cr[1] == cr[3] then n = 1 end end + if n == 4 then + s = cmyktogray(cr[1],cr[2],cr[3],cr[4]) + elseif n == 3 then + s = rgbtogray(cr[1],cr[2],cr[3]) else - if n == 4 then return format("%.3f G",cmyktogray(c[1],c[2],c[3],c[4])), "0 G" - elseif n == 3 then return format("%.3f G",rgbtogray (c[1],c[2],c[3])), "0 G" - else return format("%.3f G", c[1]), "0 G" - end + s = cr[1] end + return format("%.3f g %.3f G",s,s) end end end diff --git a/tex/context/interface/keys-cz.xml b/tex/context/interface/keys-cz.xml index bda7c06bd..a2108f1e5 100644 --- a/tex/context/interface/keys-cz.xml +++ b/tex/context/interface/keys-cz.xml @@ -1,6 +1,6 @@ - + diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml index 52db3de60..0a85bb17e 100644 --- a/tex/context/interface/keys-de.xml +++ b/tex/context/interface/keys-de.xml @@ -1,6 +1,6 @@ - + diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml index 1a199b682..d85a3b7b2 100644 --- a/tex/context/interface/keys-en.xml +++ b/tex/context/interface/keys-en.xml @@ -1,6 +1,6 @@ - + diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml index 5630bfa35..367608830 100644 --- a/tex/context/interface/keys-fr.xml +++ b/tex/context/interface/keys-fr.xml @@ -1,6 +1,6 @@ - + diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml index df32ab3ac..5188c2818 100644 --- a/tex/context/interface/keys-it.xml +++ b/tex/context/interface/keys-it.xml @@ -1,6 +1,6 @@ - + diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml index 5360c60ac..011e6aa05 100644 --- a/tex/context/interface/keys-nl.xml +++ b/tex/context/interface/keys-nl.xml @@ -1,6 +1,6 @@ - + diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml index cfdc9424d..ece576eba 100644 --- a/tex/context/interface/keys-ro.xml +++ b/tex/context/interface/keys-ro.xml @@ -1,6 +1,6 @@ - + -- cgit v1.2.3