From b17f22aa285224dcf5b1dbccd795bc73b9a16426 Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 19 May 2011 06:40:13 +0300 Subject: beta 2011.05.18 22:26 --- tex/context/base/back-pdf.lua | 6 ++++- tex/context/base/colo-ini.lua | 39 ++++++++++++++++++++++++++-- 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/l-table.lua | 16 +++++++----- tex/context/base/spac-ver.mkiv | 2 +- tex/context/base/status-files.pdf | Bin 23577 -> 23581 bytes tex/context/base/status-lua.pdf | Bin 154401 -> 154400 bytes tex/generic/context/luatex-fonts-merged.lua | 17 +++++++----- 11 files changed, 68 insertions(+), 20 deletions(-) (limited to 'tex') diff --git a/tex/context/base/back-pdf.lua b/tex/context/base/back-pdf.lua index 33cb8c975..32f5d3504 100644 --- a/tex/context/base/back-pdf.lua +++ b/tex/context/base/back-pdf.lua @@ -207,6 +207,11 @@ end -- beware: xpdf/okular/evince cannot handle the spot->process shade +-- 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. + local processcolors local function registersomespotcolor(name,noffractions,names,p,colorspace,range,funct) @@ -365,7 +370,6 @@ local function indexcolorref(name) -- actually, names (parent) is the hash end function registrations.rgbspotcolor(name,noffractions,names,p,r,g,b) ---~ print(name,noffractions,names,p,r,g,b) if noffractions == 1 then registersomespotcolor(name,noffractions,names,p,pdf_device_rgb,pdf_rbg_range,format(rgb_function,r,g,b)) else diff --git a/tex/context/base/colo-ini.lua b/tex/context/base/colo-ini.lua index c4e802ff5..7e0a4ac76 100644 --- a/tex/context/base/colo-ini.lua +++ b/tex/context/base/colo-ini.lua @@ -445,7 +445,7 @@ function colors.mpcolor(model,ca,ta,default) -- will move to mlib-col elseif model == 4 then return format("transparent(%s,%s,cmyk(%s,%s,%s,%s))",tv[1],tv[2],cv[6],cv[7],cv[8],cv[9]) else - return format("transparent(%s,%s,multitonecolor(\"%s\",%s,\"%s\",\"%s\"))",tv[1],tv[2],cv[10],cv[11],cv[12],cv[13]) + return format('transparent(%s,%s,multitonecolor("%s",%s,"%s","%s"))',tv[1],tv[2],cv[10],cv[11],cv[12],cv[13]) end else if model == 2 then @@ -455,7 +455,7 @@ function colors.mpcolor(model,ca,ta,default) -- will move to mlib-col elseif model == 4 then return format("cmyk(%s,%s,%s,%s)",cv[6],cv[7],cv[8],cv[9]) else - return format("multitonecolor(\"%s\",%s,\"%s\",\"%s\")",cv[10],cv[11],cv[12],cv[13]) + return format('multitonecolor("%s",%s,"%s","%s")',cv[10],cv[11],cv[12],cv[13]) end end else @@ -464,6 +464,41 @@ function colors.mpcolor(model,ca,ta,default) -- will move to mlib-col end end +--~ function colors.mpcolor(model,ca,ta,default) -- will move to mlib-col +--~ local cv = colors.supported and colors.value(ca) -- faster when direct colors.values[ca] +--~ if cv then +--~ local tv = transparencies.supported and transparencies.value(ta) +--~ if model == 1 then +--~ model = cv[1] +--~ end +--~ model = forcedmodel(model) +--~ if tv then +--~ if model == 2 then +--~ return format("(%s,%s,%s) withtransparency (%s,%s)",tv[1],tv[2],cv[3],cv[4],cv[5]) +--~ elseif model == 3 then +--~ return format("(%s,%s,%s) withtransparency (%s,%s)",tv[1],tv[2],cv[3],cv[4],cv[5]) +--~ elseif model == 4 then +--~ return format("(%s,%s,%s,%s) withtransparency(%s,%s)",tv[1],tv[2],cv[6],cv[7],cv[8],cv[9]) +--~ else +--~ return format('multitonecolor("%s",%s,"%s","%s") withtransparency (%s,%s)',tv[1],tv[2],cv[10],cv[11],cv[12],cv[13]) +--~ end +--~ else +--~ if model == 2 then +--~ return format("(%s,%s,%s)",cv[3],cv[4],cv[5]) +--~ elseif model == 3 then +--~ return format("(%s,%s,%s)",cv[3],cv[4],cv[5]) +--~ elseif model == 4 then +--~ return format("cmyk(%s,%s,%s,%s)",cv[6],cv[7],cv[8],cv[9]) +--~ else +--~ return format('multitonecolor("%s",%s,"%s","%s")',cv[10],cv[11],cv[12],cv[13]) +--~ end +--~ end +--~ else +--~ default = default or 0 -- rgb ! +--~ return format("(%s,%s,%s)",default,default,default) +--~ end +--~ end + function colors.formatcolor(ca,separator) local cv = colors.value(ca) if cv then diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index 1a81454d6..a147f13e5 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.05.18 18:04} +\newcontextversion{2011.05.18 22:26} %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 3bda269ef..3de057567 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.05.18 18:04} +\newcontextversion{2011.05.18 22:26} %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 7312bdcf5..1613819a6 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.05.18 18:04} +\edef\contextversion{2011.05.18 22:26} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 8f3586dea..74ea5ff80 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.05.18 18:04} +\edef\contextversion{2011.05.18 22:26} %D For those who want to use this: diff --git a/tex/context/base/l-table.lua b/tex/context/base/l-table.lua index 8fdb36a7f..9f5bf6eda 100644 --- a/tex/context/base/l-table.lua +++ b/tex/context/base/l-table.lua @@ -10,6 +10,7 @@ local type, next, tostring, tonumber, ipairs, table, string = type, next, tostri local concat, sort, insert, remove = table.concat, table.sort, table.insert, table.remove local format, find, gsub, lower, dump, match = string.format, string.find, string.gsub, string.lower, string.dump, string.match local getmetatable, setmetatable = getmetatable, setmetatable +local getinfo = debug.getinfo -- Starting with version 5.2 Lua no longer provide ipairs, which makes -- sense. As we already used the for loop and # in most places the @@ -357,6 +358,8 @@ end -- problem: there no good number_to_string converter with the best resolution +local function dummy() end + local function do_serialize(root,name,depth,level,indexed) if level > 0 then depth = depth .. " " @@ -551,19 +554,20 @@ local function do_serialize(root,name,depth,level,indexed) end elseif t == "function" then if functions then + local f = getinfo(v).what == "C" and dump(dummy) or dump(v) + -- local f = getinfo(v).what == "C" and dump(function(...) return v(...) end) or dump(v) if tk == "number" then -- or find(k,"^%d+$") then if hexify then - handle(format("%s [0x%04X]=loadstring(%q),",depth,k,dump(v))) + handle(format("%s [0x%04X]=loadstring(%q),",depth,k,f)) else - handle(format("%s [%s]=loadstring(%q),",depth,k,dump(v))) + handle(format("%s [%s]=loadstring(%q),",depth,k,f)) end elseif tk == "boolean" then - handle(format("%s [%s]=loadstring(%q),",depth,tostring(k),dump(v))) + handle(format("%s [%s]=loadstring(%q),",depth,tostring(k),f)) elseif noquotes and not reserved[k] and find(k,"^%a[%w%_]*$") then - handle(format("%s %s=loadstring(%q),",depth,k,dump(v))) + handle(format("%s %s=loadstring(%q),",depth,k,f)) else - -- handle(format("%s [%q]=loadstring(%q),",depth,k,dump(v))) - handle(format("%s [%q]=loadstring(%q),",depth,k,debug.getinfo(v).what == "C" and "C code" or dump(v))) + handle(format("%s [%q]=loadstring(%q),",depth,k,f)) end end else diff --git a/tex/context/base/spac-ver.mkiv b/tex/context/base/spac-ver.mkiv index d04ed6724..897e9c9d7 100644 --- a/tex/context/base/spac-ver.mkiv +++ b/tex/context/base/spac-ver.mkiv @@ -1374,7 +1374,7 @@ \resetsystemmode\v!grid \resetsnapvalue} -\def\docheckgridsnappinyes +\def\docheckgridsnappingyes {\gridsnappingtrue \setsystemmode\v!grid \autosetsnapvalue\askedgridmode} diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index fb377d90e..dbec9b2f0 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 ac8fc6ac3..f867291bf 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index 7e954182a..3036e2f81 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 : 05/18/11 18:04:18 +-- merge date : 05/18/11 22:26:32 do -- begin closure to overcome local limits and interference @@ -783,6 +783,7 @@ local type, next, tostring, tonumber, ipairs, table, string = type, next, tostri local concat, sort, insert, remove = table.concat, table.sort, table.insert, table.remove local format, find, gsub, lower, dump, match = string.format, string.find, string.gsub, string.lower, string.dump, string.match local getmetatable, setmetatable = getmetatable, setmetatable +local getinfo = debug.getinfo -- Starting with version 5.2 Lua no longer provide ipairs, which makes -- sense. As we already used the for loop and # in most places the @@ -1130,6 +1131,8 @@ end -- problem: there no good number_to_string converter with the best resolution +local function dummy() end + local function do_serialize(root,name,depth,level,indexed) if level > 0 then depth = depth .. " " @@ -1324,18 +1327,20 @@ local function do_serialize(root,name,depth,level,indexed) end elseif t == "function" then if functions then + local f = getinfo(v).what == "C" and dump(dummy) or dump(v) + -- local f = getinfo(v).what == "C" and dump(function(...) return v(...) end) or dump(v) if tk == "number" then -- or find(k,"^%d+$") then if hexify then - handle(format("%s [0x%04X]=loadstring(%q),",depth,k,dump(v))) + handle(format("%s [0x%04X]=loadstring(%q),",depth,k,f)) else - handle(format("%s [%s]=loadstring(%q),",depth,k,dump(v))) + handle(format("%s [%s]=loadstring(%q),",depth,k,f)) end elseif tk == "boolean" then - handle(format("%s [%s]=loadstring(%q),",depth,tostring(k),dump(v))) + handle(format("%s [%s]=loadstring(%q),",depth,tostring(k),f)) elseif noquotes and not reserved[k] and find(k,"^%a[%w%_]*$") then - handle(format("%s %s=loadstring(%q),",depth,k,dump(v))) + handle(format("%s %s=loadstring(%q),",depth,k,f)) else - handle(format("%s [%q]=loadstring(%q),",depth,k,dump(v))) + handle(format("%s [%q]=loadstring(%q),",depth,k,f)) end end else -- cgit v1.2.3