From 3f599d96c767ef409f79e1b154bb02d37702a2e1 Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Wed, 6 Jul 2016 10:41:50 +0200 Subject: 2016-07-06 10:04:00 --- tex/context/base/context-version.pdf | Bin 4251 -> 4254 bytes tex/context/base/mkiv/attr-col.lua | 35 +- tex/context/base/mkiv/colo-ini.lua | 37 +- tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context.mkiv | 5 +- tex/context/base/mkiv/font-otj.lua | 5 +- tex/context/base/mkiv/font-ots.lua | 51 +- tex/context/base/mkiv/lpdf-fmt.lua | 632 ++++++++++----------- tex/context/base/mkiv/node-fin.mkiv | 47 +- tex/context/base/mkiv/status-files.pdf | Bin 9195 -> 9083 bytes tex/context/base/mkiv/status-lua.pdf | Bin 366666 -> 366661 bytes tex/context/interface/mkiv/i-context.pdf | Bin 821456 -> 821334 bytes tex/context/interface/mkiv/i-readme.pdf | Bin 60789 -> 60784 bytes tex/context/modules/common/s-abr-01.tex | 3 +- tex/generic/context/luatex/luatex-fonts-merged.lua | 49 +- 15 files changed, 482 insertions(+), 384 deletions(-) diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index f2a17f470..1540c94a5 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/mkiv/attr-col.lua b/tex/context/base/mkiv/attr-col.lua index 4a32884cb..2562eb944 100644 --- a/tex/context/base/mkiv/attr-col.lua +++ b/tex/context/base/mkiv/attr-col.lua @@ -14,7 +14,7 @@ if not modules then modules = { } end modules ['attr-col'] = { local type, tonumber = type, tonumber local concat = table.concat -local min, max, floor = math.min, math.max, math.floor +local min, max, floor, mod = math.min, math.max, math.floor, math.mod local attributes = attributes local nodes = nodes @@ -170,13 +170,31 @@ end -- http://en.wikipedia.org/wiki/HSI_color_space -- http://nl.wikipedia.org/wiki/HSV_(kleurruimte) +-- h /= 60; // sector 0 to 5 +-- i = floor( h ); +-- f = h - i; // factorial part of h + local function hsvtorgb(h,s,v) - -- h = h % 360 - local hd = h/60 - local hf = floor(hd) - local hi = hf % 6 - -- local f = hd - hi - local f = hd - hf + if s > 1 then + s = 1 + elseif s < 0 then + s = 0 + elseif s == 0 then + return v, v, v + end + if v > 1 then + s = 1 + elseif v < 0 then + v = 0 + end + if h < 0 then + h = 0 + elseif h >= 360 then + h = mod(h,360) + end + local hd = h / 60 + local hi = floor(hd) + local f = hd - hi local p = v * (1 - s) local q = v * (1 - f * s) local t = v * (1 - (1 - f) * s) @@ -193,7 +211,8 @@ local function hsvtorgb(h,s,v) elseif hi == 5 then return v, p, q else - print("error in hsv -> rgb",hi,h,s,v) + print("error in hsv -> rgb",h,s,v) + return 0, 0, 0 end end diff --git a/tex/context/base/mkiv/colo-ini.lua b/tex/context/base/mkiv/colo-ini.lua index 655176f7e..32f095a3d 100644 --- a/tex/context/base/mkiv/colo-ini.lua +++ b/tex/context/base/mkiv/colo-ini.lua @@ -65,6 +65,12 @@ storage.register("attributes/colors/sets", colorsets, "attributes.colors.sets" storage.register("attributes/colors/valid", valid, "attributes.colors.valid") storage.register("attributes/colors/counts", counts, "attributes.colors.counts") +local function currentmodel() + return texgetattribute(a_colormodel) +end + +colors.currentmodel = currentmodel + local function synccolor(name) valid[name] = true end @@ -223,11 +229,16 @@ local transparent = { luminosity = 16, } -local gray_okay, rgb_okay, cmyk_okay, spot_okay, multichannel_okay, forced = true, true, true, true, true, false +local gray_okay = true +local rgb_okay = true +local cmyk_okay = true +local spot_okay = true +local multi_okay = true +local forced = false -function colors.forcesupport(gray,rgb,cmyk,spot,multichannel) -- pdfx driven - gray_okay, rgb_okay, cmyk_okay, spot_okay, multichannel_okay, forced = gray, rgb, cmyk, spot, multichannel, true - report_colors("supported models: gray %a, rgb %a, cmyk %a, spot %a",gray,rgb,cmyk,spot) -- multichannel=%l multichannel +function colors.forcesupport(gray,rgb,cmyk,spot,multi) -- pdfx driven + gray_okay, rgb_okay, cmyk_okay, spot_okay, multi_okay, forced = gray, rgb, cmyk, spot, multi, true + report_colors("supported models: gray %a, rgb %a, cmyk %a, spot %a",gray,rgb,cmyk,spot) end local function forcedmodel(model) -- delayed till the backend but mp directly @@ -289,7 +300,7 @@ 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 + local model = currentmodel() if model == 1 then model = v[1] end @@ -312,7 +323,7 @@ end -- if not registered[parent] then -- local v = colorvalues[parentnumber] -- if v then --- local model = colors.default -- else problems with shading etc +-- local model = currentmodel() -- if model == 1 then -- model = v[1] -- end @@ -333,8 +344,8 @@ function colors.definesimplegray(name,s) end local hexdigit = R("09","AF","af") -local hexnumber = hexdigit * hexdigit / function(s) return tonumber(s,16)/255 end + Cc(0) -local hexpattern = hexnumber^-3 * P(-1) +local hexnumber = hexdigit * hexdigit / function(s) return tonumber(s,16)/255 end +local hexpattern = hexnumber * (P(-1) + hexnumber * hexnumber * P(-1)) local hexcolor = Cc("H") * P("#") * hexpattern local left = P("(") @@ -397,7 +408,11 @@ local function defineprocesscolor(name,str,global,freeze) -- still inconsistent local x = settings.x or h if x then r, g, b = lpegmatch(hexpattern,x) -- can be inlined - definecolor(name, register_color(name,'rgb',r,g,b), global) + if r and g and b then + definecolor(name, register_color(name,'rgb',r,g,b), global) + else + definecolor(name, register_color(name,'gray',r or 0), global) + end else definecolor(name, register_color(name,'gray',tonumber(s) or 0), global) end @@ -616,10 +631,6 @@ end local colornamespace = getnamespace("colornumber") local paletnamespace = getnamespace("colorpalet") -function colors.currentmodel() - return texgetattribute(a_colormodel) -end - local function namedcolorattributes(name) local space = texgetattribute(a_colormodel) local prefix = texgettoks("t_colo_prefix") diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 7d7ae8d8c..638d92a01 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.07.05 13:02} +\newcontextversion{2016.07.06 10:01} %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 d19702d21..3e54ba8c7 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.07.05 13:02} +\edef\contextversion{2016.07.06 10:01} \edef\contextkind {beta} %D For those who want to use this: @@ -145,6 +145,8 @@ \loadmarkfile{cldf-int} % interface +\loadmarkfile{trac-ctx} % maybe move up + % \loadmarkfile{luat-ini} \loadmarkfile{toks-tra} @@ -175,7 +177,6 @@ \loadmarkfile{trac-tex} \loadmarkfile{trac-deb} % will move up -\loadmarkfile{trac-ctx} % maybe move up %loadmarkfile{blob-ini} % not to be used, we only use a helper diff --git a/tex/context/base/mkiv/font-otj.lua b/tex/context/base/mkiv/font-otj.lua index d1408fd52..3bbed0918 100644 --- a/tex/context/base/mkiv/font-otj.lua +++ b/tex/context/base/mkiv/font-otj.lua @@ -30,13 +30,14 @@ if not nodes.properties then return end local next, rawget = next, rawget local fastcopy = table.fastcopy +local floor = math.floor local registertracker = trackers.register local trace_injections = false registertracker("fonts.injections", function(v) trace_injections = v end) local trace_marks = false registertracker("fonts.injections.marks", function(v) trace_marks = v end) local trace_cursive = false registertracker("fonts.injections.cursive", function(v) trace_cursive = v end) -local trace_spaces = false registertracker("otf.spaces", function(v) trace_spaces = v end) +local trace_spaces = false registertracker("fonts.injections.spaces", function(v) trace_spaces = v end) -- use_advance is just an experiment: it makes copying glyphs (instead of new_glyph) dangerous @@ -1448,7 +1449,7 @@ local function injectspaces(head) rightkerns = trig.right local par = fontdata[font].parameters -- fallback for generic factor = par.factor - threshold = par.spacing.width - 1 -- get rid of rounding errors + threshold = floor(par.spacing.width - 2) -- get rid of rounding errors lastfont = font end diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua index d63d524cc..2c84b0c49 100644 --- a/tex/context/base/mkiv/font-ots.lua +++ b/tex/context/base/mkiv/font-ots.lua @@ -239,6 +239,7 @@ local cursonce = true local fonthashes = fonts.hashes local fontdata = fonthashes.identifiers +local fontfeatures = fonthashes.features local otffeatures = fonts.constructors.features.otf local registerotffeature = otffeatures.register @@ -3596,12 +3597,29 @@ otf.handlers = handlers -- used in devanagari local setspacekerns = nodes.injections.setspacekerns if not setspacekerns then os.exit() end -function otf.handlers.trigger_space_kerns(head,start,dataset,sequence,_,_,_,_,font,attr) - -- if not setspacekerns then - -- setspacekerns = nodes.injections.setspacekerns - -- end - setspacekerns(font,sequence) - return head, start, true +if fontfeatures then + + function otf.handlers.trigger_space_kerns(head,start,dataset,sequence,_,_,_,_,font,attr) + local features = fontfeatures[font] + local enabled = features.spacekern == true and features.kern == true + if enabled then + setspacekerns(font,sequence) + end + return head, start, enabled + end + +else -- generic (no hashes) + + function otf.handlers.trigger_space_kerns(head,start,dataset,sequence,_,_,_,_,font,attr) + local shared = identifiers[font].shared + local features = shared and shared.features + local enabled = features and features.spacekern == true and features.kern == true + if enabled then + setspacekerns(font,sequence) + end + return head, start, enabled + end + end local function hasspacekerns(data) @@ -3636,11 +3654,13 @@ otf.readers.registerextender { end } +-- we merge the lookups but we still honor the language / script + local function spaceinitializer(tfmdata,value) -- attr local resources = tfmdata.resources local spacekerns = resources and resources.spacekerns - if spacekerns == nil then - local properties = tfmdata.properties + local properties = tfmdata.properties + if value and spacekerns == nil then if properties and properties.hasspacekerns then local sequences = resources.sequences local left = { } @@ -3653,7 +3673,20 @@ local function spaceinitializer(tfmdata,value) -- attr if steps then local kern = sequence.features.kern if kern then - feat = feat or kern -- or maybe merge + if feat then + for script, languages in next, kern do + local f = feat[k] + if f then + for l in next, languages do + f[l] = true + end + else + feat[script] = languages + end + end + else + feat = kern + end for i=1,#steps do local step = steps[i] local coverage = step.coverage diff --git a/tex/context/base/mkiv/lpdf-fmt.lua b/tex/context/base/mkiv/lpdf-fmt.lua index b1d9a4b0c..62b7eb91e 100644 --- a/tex/context/base/mkiv/lpdf-fmt.lua +++ b/tex/context/base/mkiv/lpdf-fmt.lua @@ -11,7 +11,7 @@ if not modules then modules = { } end modules ['lpdf-fmt'] = { -- context --directives="backend.format=PDF/X-1a:2001" --trackers=backend.format yourfile local lower, gmatch, format, find = string.lower, string.gmatch, string.format, string.find -local concat, serialize = table.concat, table.serialize +local concat, serialize, sortedhash = table.concat, table.serialize, table.sortedhash local trace_format = false trackers.register("backend.format", function(v) trace_format = v end) local trace_variables = false trackers.register("backend.variables", function(v) trace_variables = v end) @@ -85,7 +85,7 @@ local formatspecification, formatname = nil, nil -- * correspondent document wide flags (write once) needed for permission tests local formats = utilities.storage.allocate { - ["version"] = { + version = { external_icc_profiles = 1.4, -- 'p' in name; URL reference of output intent jbig2_compression = 1.4, jpeg2000_compression = 1.5, -- not supported yet @@ -95,7 +95,7 @@ local formats = utilities.storage.allocate { transparency = 1.4, object_compression = 1.5, }, - ["default"] = { + default = { pdf_version = 1.7, -- todo: block tex primitive format_name = "default", xmp_file = "lpdf-pdx.xml", @@ -118,294 +118,296 @@ local formats = utilities.storage.allocate { -- nothing end }, - ["pdf/x-1a:2001"] = { - pdf_version = 1.3, - format_name = "PDF/X-1a:2001", - xmp_file = "lpdf-pdx.xml", - gts_flag = "GTS_PDFX", - gray_scale = true, - cmyk_colors = true, - spot_colors = true, - internal_icc_profiles = true, - inject_metadata = function() - addtoinfo("GTS_PDFXVersion","PDF/X-1a:2001") - injectxmpinfo("xml://rdf:RDF","PDF/X-1a:2001",false) - end - }, - ["pdf/x-1a:2003"] = { - pdf_version = 1.4, - format_name = "PDF/X-1a:2003", - xmp_file = "lpdf-pdx.xml", - gts_flag = "GTS_PDFX", - gray_scale = true, - cmyk_colors = true, - spot_colors = true, - internal_icc_profiles = true, - inject_metadata = function() - addtoinfo("GTS_PDFXVersion","PDF/X-1a:2003") - injectxmpinfo("xml://rdf:RDF","PDF/X-1a:2003",false) - end - }, - ["pdf/x-3:2002"] = { - pdf_version = 1.3, - format_name = "PDF/X-3:2002", - xmp_file = "lpdf-pdx.xml", - gts_flag = "GTS_PDFX", - gray_scale = true, - cmyk_colors = true, - rgb_colors = true, - calibrated_rgb_colors = true, - spot_colors = true, - cielab_colors = true, - internal_icc_profiles = true, - include_intents = true, - inject_metadata = function() - addtoinfo("GTS_PDFXVersion","PDF/X-3:2002") - end - }, - ["pdf/x-3:2003"] = { - pdf_version = 1.4, - format_name = "PDF/X-3:2003", - xmp_file = "lpdf-pdx.xml", - gts_flag = "GTS_PDFX", - gray_scale = true, - cmyk_colors = true, - rgb_colors = true, - calibrated_rgb_colors = true, - spot_colors = true, - cielab_colors = true, - internal_icc_profiles = true, - include_intents = true, - jbig2_compression = true, - inject_metadata = function() - addtoinfo("GTS_PDFXVersion","PDF/X-3:2003") - end - }, - ["pdf/x-4"] = { - pdf_version = 1.6, - format_name = "PDF/X-4", - xmp_file = "lpdf-pdx.xml", - gts_flag = "GTS_PDFX", - gray_scale = true, - cmyk_colors = true, - rgb_colors = true, - calibrated_rgb_colors = true, - spot_colors = true, - cielab_colors = true, - internal_icc_profiles = true, - include_intents = true, - optional_content = true, - transparency = true, - jbig2_compression = true, - jpeg2000_compression = true, - object_compression = true, - inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","PDF/X-4",false) - insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","1",false) - insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","default",false) - end - }, - ["pdf/x-4p"] = { - pdf_version = 1.6, - format_name = "PDF/X-4p", - xmp_file = "lpdf-pdx.xml", - gts_flag = "GTS_PDFX", - gray_scale = true, - cmyk_colors = true, - rgb_colors = true, - calibrated_rgb_colors = true, - spot_colors = true, - cielab_colors = true, - internal_icc_profiles = true, - external_icc_profiles = true, - include_intents = true, - optional_content = true, - transparency = true, - jbig2_compression = true, - jpeg2000_compression = true, - object_compression = true, - inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","PDF/X-4p",false) - insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","1",false) - insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","default",false) - end - }, - ["pdf/x-5g"] = { - pdf_version = 1.6, - format_name = "PDF/X-5g", - xmp_file = "lpdf-pdx.xml", - gts_flag = "GTS_PDFX", - gray_scale = true, - cmyk_colors = true, - rgb_colors = true, - calibrated_rgb_colors = true, - spot_colors = true, - cielab_colors = true, - internal_icc_profiles = true, - include_intents = true, - open_prepress_interface = true, - optional_content = true, - transparency = true, - jbig2_compression = true, - jpeg2000_compression = true, - object_compression = true, - inject_metadata = function() - -- todo - end - }, - ["pdf/x-5pg"] = { - pdf_version = 1.6, - format_name = "PDF/X-5pg", - xmp_file = "lpdf-pdx.xml", - gts_flag = "GTS_PDFX", - gray_scale = true, - cmyk_colors = true, - rgb_colors = true, - calibrated_rgb_colors = true, - spot_colors = true, - cielab_colors = true, - internal_icc_profiles = true, - external_icc_profiles = true, - include_intents = true, - open_prepress_interface = true, - optional_content = true, - transparency = true, - jbig2_compression = true, - jpeg2000_compression = true, - object_compression = true, - inject_metadata = function() - -- todo - end - }, - ["pdf/x-5n"] = { - pdf_version = 1.6, - format_name = "PDF/X-5n", - xmp_file = "lpdf-pdx.xml", - gts_flag = "GTS_PDFX", - gray_scale = true, - cmyk_colors = true, - rgb_colors = true, - calibrated_rgb_colors = true, - spot_colors = true, - cielab_colors = true, - internal_icc_profiles = true, - include_intents = true, - optional_content = true, - transparency = true, - jbig2_compression = true, - jpeg2000_compression = true, - nchannel_colorspace = true, - object_compression = true, - inject_metadata = function() - -- todo - end - }, - ["pdf/a-1a:2005"] = { - pdf_version = 1.4, - format_name = "pdf/a-1a:2005", - xmp_file = "lpdf-pda.xml", - gts_flag = "GTS_PDFA1", - gray_scale = true, - cmyk_colors = true, - rgb_colors = true, - spot_colors = true, - calibrated_rgb_colors = true, -- unknown - cielab_colors = true, -- unknown - include_intents = true, - forms = true, -- NEW; forms are allowed (with limitations); no JS, other restrictions are unknown (TODO) - tagging = true, -- NEW; the only difference to PDF/A-1b - internal_icc_profiles = true, - inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","1A",false) - end - }, - ["pdf/a-1b:2005"] = { - pdf_version = 1.4, - format_name = "pdf/a-1b:2005", - xmp_file = "lpdf-pda.xml", - gts_flag = "GTS_PDFA1", - gray_scale = true, - cmyk_colors = true, - rgb_colors = true, - spot_colors = true, - calibrated_rgb_colors = true, -- unknown - cielab_colors = true, -- unknown - include_intents = true, - forms = true, - internal_icc_profiles = true, - inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","1B",false) - end - }, - ["pdf/a-2a"] = { -- untested; only PDF/A Attachments are allowed - pdf_version = 1.7, - format_name = "pdf/a-2a", - xmp_file = "lpdf-pda.xml", - gts_flag = "GTS_PDFA2", - gray_scale = true, - cmyk_colors = true, - rgb_colors = true, - spot_colors = true, - calibrated_rgb_colors = true, -- unknown - cielab_colors = true, -- unknown - include_intents = true, - forms = true, - tagging = true, - internal_icc_profiles = true, - transparency = true, -- NEW - jbig2_compression = true, - jpeg2000_compression = true, -- NEW - object_compression = true, - inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","2A",false) - end - }, - ["pdf/a-3a"] = { -- untested; NEW: any type of attachment is allowed - pdf_version = 1.7, - format_name = "pdf/a-3a", - xmp_file = "lpdf-pda.xml", - gts_flag = "GTS_PDFA3", - gray_scale = true, - cmyk_colors = true, - rgb_colors = true, - spot_colors = true, - calibrated_rgb_colors = true, -- unknown - cielab_colors = true, -- unknown - include_intents = true, - forms = true, - tagging = true, - internal_icc_profiles = true, - transparency = true, - jbig2_compression = true, - jpeg2000_compression = true, - object_compression = true, - inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","3A",false) - end - }, - ["pdf/ua-1"] = { -- based on PDF/A-3a, but no 'gts_flag' - pdf_version = 1.7, - format_name = "pdf/ua-1", - xmp_file = "lpdf-pua.xml", - gray_scale = true, - cmyk_colors = true, - rgb_colors = true, - spot_colors = true, - calibrated_rgb_colors = true, -- unknown - cielab_colors = true, -- unknown - include_intents = true, - forms = true, - tagging = true, - internal_icc_profiles = true, - transparency = true, - jbig2_compression = true, - jpeg2000_compression = true, - object_compression = true, - inject_metadata = function() - injectxmpinfo("xml://rdf:RDF","3A",false) - injectxmpinfo("xml://rdf:RDF","1",false) - end - }, + data = { + ["pdf/x-1a:2001"] = { + pdf_version = 1.3, + format_name = "PDF/X-1a:2001", + xmp_file = "lpdf-pdx.xml", + gts_flag = "GTS_PDFX", + gray_scale = true, + cmyk_colors = true, + spot_colors = true, + internal_icc_profiles = true, + inject_metadata = function() + addtoinfo("GTS_PDFXVersion","PDF/X-1a:2001") + injectxmpinfo("xml://rdf:RDF","PDF/X-1a:2001",false) + end + }, + ["pdf/x-1a:2003"] = { + pdf_version = 1.4, + format_name = "PDF/X-1a:2003", + xmp_file = "lpdf-pdx.xml", + gts_flag = "GTS_PDFX", + gray_scale = true, + cmyk_colors = true, + spot_colors = true, + internal_icc_profiles = true, + inject_metadata = function() + addtoinfo("GTS_PDFXVersion","PDF/X-1a:2003") + injectxmpinfo("xml://rdf:RDF","PDF/X-1a:2003",false) + end + }, + ["pdf/x-3:2002"] = { + pdf_version = 1.3, + format_name = "PDF/X-3:2002", + xmp_file = "lpdf-pdx.xml", + gts_flag = "GTS_PDFX", + gray_scale = true, + cmyk_colors = true, + rgb_colors = true, + calibrated_rgb_colors = true, + spot_colors = true, + cielab_colors = true, + internal_icc_profiles = true, + include_intents = true, + inject_metadata = function() + addtoinfo("GTS_PDFXVersion","PDF/X-3:2002") + end + }, + ["pdf/x-3:2003"] = { + pdf_version = 1.4, + format_name = "PDF/X-3:2003", + xmp_file = "lpdf-pdx.xml", + gts_flag = "GTS_PDFX", + gray_scale = true, + cmyk_colors = true, + rgb_colors = true, + calibrated_rgb_colors = true, + spot_colors = true, + cielab_colors = true, + internal_icc_profiles = true, + include_intents = true, + jbig2_compression = true, + inject_metadata = function() + addtoinfo("GTS_PDFXVersion","PDF/X-3:2003") + end + }, + ["pdf/x-4"] = { + pdf_version = 1.6, + format_name = "PDF/X-4", + xmp_file = "lpdf-pdx.xml", + gts_flag = "GTS_PDFX", + gray_scale = true, + cmyk_colors = true, + rgb_colors = true, + calibrated_rgb_colors = true, + spot_colors = true, + cielab_colors = true, + internal_icc_profiles = true, + include_intents = true, + optional_content = true, + transparency = true, + jbig2_compression = true, + jpeg2000_compression = true, + object_compression = true, + inject_metadata = function() + injectxmpinfo("xml://rdf:RDF","PDF/X-4",false) + insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","1",false) + insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","default",false) + end + }, + ["pdf/x-4p"] = { + pdf_version = 1.6, + format_name = "PDF/X-4p", + xmp_file = "lpdf-pdx.xml", + gts_flag = "GTS_PDFX", + gray_scale = true, + cmyk_colors = true, + rgb_colors = true, + calibrated_rgb_colors = true, + spot_colors = true, + cielab_colors = true, + internal_icc_profiles = true, + external_icc_profiles = true, + include_intents = true, + optional_content = true, + transparency = true, + jbig2_compression = true, + jpeg2000_compression = true, + object_compression = true, + inject_metadata = function() + injectxmpinfo("xml://rdf:RDF","PDF/X-4p",false) + insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","1",false) + insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","default",false) + end + }, + ["pdf/x-5g"] = { + pdf_version = 1.6, + format_name = "PDF/X-5g", + xmp_file = "lpdf-pdx.xml", + gts_flag = "GTS_PDFX", + gray_scale = true, + cmyk_colors = true, + rgb_colors = true, + calibrated_rgb_colors = true, + spot_colors = true, + cielab_colors = true, + internal_icc_profiles = true, + include_intents = true, + open_prepress_interface = true, + optional_content = true, + transparency = true, + jbig2_compression = true, + jpeg2000_compression = true, + object_compression = true, + inject_metadata = function() + -- todo + end + }, + ["pdf/x-5pg"] = { + pdf_version = 1.6, + format_name = "PDF/X-5pg", + xmp_file = "lpdf-pdx.xml", + gts_flag = "GTS_PDFX", + gray_scale = true, + cmyk_colors = true, + rgb_colors = true, + calibrated_rgb_colors = true, + spot_colors = true, + cielab_colors = true, + internal_icc_profiles = true, + external_icc_profiles = true, + include_intents = true, + open_prepress_interface = true, + optional_content = true, + transparency = true, + jbig2_compression = true, + jpeg2000_compression = true, + object_compression = true, + inject_metadata = function() + -- todo + end + }, + ["pdf/x-5n"] = { + pdf_version = 1.6, + format_name = "PDF/X-5n", + xmp_file = "lpdf-pdx.xml", + gts_flag = "GTS_PDFX", + gray_scale = true, + cmyk_colors = true, + rgb_colors = true, + calibrated_rgb_colors = true, + spot_colors = true, + cielab_colors = true, + internal_icc_profiles = true, + include_intents = true, + optional_content = true, + transparency = true, + jbig2_compression = true, + jpeg2000_compression = true, + nchannel_colorspace = true, + object_compression = true, + inject_metadata = function() + -- todo + end + }, + ["pdf/a-1a:2005"] = { + pdf_version = 1.4, + format_name = "pdf/a-1a:2005", + xmp_file = "lpdf-pda.xml", + gts_flag = "GTS_PDFA1", + gray_scale = true, + cmyk_colors = true, + rgb_colors = true, + spot_colors = true, + calibrated_rgb_colors = true, -- unknown + cielab_colors = true, -- unknown + include_intents = true, + forms = true, -- NEW; forms are allowed (with limitations); no JS, other restrictions are unknown (TODO) + tagging = true, -- NEW; the only difference to PDF/A-1b + internal_icc_profiles = true, + inject_metadata = function() + injectxmpinfo("xml://rdf:RDF","1A",false) + end + }, + ["pdf/a-1b:2005"] = { + pdf_version = 1.4, + format_name = "pdf/a-1b:2005", + xmp_file = "lpdf-pda.xml", + gts_flag = "GTS_PDFA1", + gray_scale = true, + cmyk_colors = true, + rgb_colors = true, + spot_colors = true, + calibrated_rgb_colors = true, -- unknown + cielab_colors = true, -- unknown + include_intents = true, + forms = true, + internal_icc_profiles = true, + inject_metadata = function() + injectxmpinfo("xml://rdf:RDF","1B",false) + end + }, + ["pdf/a-2a"] = { -- untested; only PDF/A Attachments are allowed + pdf_version = 1.7, + format_name = "pdf/a-2a", + xmp_file = "lpdf-pda.xml", + gts_flag = "GTS_PDFA2", + gray_scale = true, + cmyk_colors = true, + rgb_colors = true, + spot_colors = true, + calibrated_rgb_colors = true, -- unknown + cielab_colors = true, -- unknown + include_intents = true, + forms = true, + tagging = true, + internal_icc_profiles = true, + transparency = true, -- NEW + jbig2_compression = true, + jpeg2000_compression = true, -- NEW + object_compression = true, + inject_metadata = function() + injectxmpinfo("xml://rdf:RDF","2A",false) + end + }, + ["pdf/a-3a"] = { -- untested; NEW: any type of attachment is allowed + pdf_version = 1.7, + format_name = "pdf/a-3a", + xmp_file = "lpdf-pda.xml", + gts_flag = "GTS_PDFA3", + gray_scale = true, + cmyk_colors = true, + rgb_colors = true, + spot_colors = true, + calibrated_rgb_colors = true, -- unknown + cielab_colors = true, -- unknown + include_intents = true, + forms = true, + tagging = true, + internal_icc_profiles = true, + transparency = true, + jbig2_compression = true, + jpeg2000_compression = true, + object_compression = true, + inject_metadata = function() + injectxmpinfo("xml://rdf:RDF","3A",false) + end + }, + ["pdf/ua-1"] = { -- based on PDF/A-3a, but no 'gts_flag' + pdf_version = 1.7, + format_name = "pdf/ua-1", + xmp_file = "lpdf-pua.xml", + gray_scale = true, + cmyk_colors = true, + rgb_colors = true, + spot_colors = true, + calibrated_rgb_colors = true, -- unknown + cielab_colors = true, -- unknown + include_intents = true, + forms = true, + tagging = true, + internal_icc_profiles = true, + transparency = true, + jbig2_compression = true, + jpeg2000_compression = true, + object_compression = true, + inject_metadata = function() + injectxmpinfo("xml://rdf:RDF","3A",false) + injectxmpinfo("xml://rdf:RDF","1",false) + end + }, + } } lpdf.formats = formats -- it does not hurt to have this one visible @@ -701,7 +703,7 @@ function codeinjections.setformat(s) local option = s.option or "" local filename = s.file or "" if format ~= "" then - local spec = formats[lower(format)] + local spec = formats.data[lower(format)] if spec then formatspecification = spec formatname = spec.format_name @@ -769,7 +771,7 @@ function codeinjections.setformat(s) handleiccprofile("color profile",spec,profile,filename,handledefaultprofile,options,true) handleiccprofile("output intent",spec,intent,filename,handleoutputintent,options,false) if trace_variables then - for k, v in table.sortedhash(formats.default) do + for k, v in sortedhash(formats.default) do local v = formatspecification[k] if type(v) ~= "function" then report_backend("%a = %a",k,v or false) @@ -813,30 +815,28 @@ end function codeinjections.supportedformats() local t = { } - for k, v in table.sortedhash(formats) do - if find(k,"pdf",1,true) then - t[#t+1] = k - end + for k, v in sortedhash(formats.data) do + t[#t+1] = k end return t end ---~ The following is somewhat cleaner but then we need to flag that there are ---~ color spaces set so that the page flusher does not optimize the (at that ---~ moment) still empty array away. So, next(d_colorspaces) should then become ---~ a different test, i.e. also on flag. I'll add that when we need more forward ---~ referencing. ---~ ---~ local function embedprofile = handledefaultprofile ---~ ---~ local function flushembeddedprofiles() ---~ for colorspace, filename in next, defaults do ---~ embedprofile(colorspace,filename) ---~ end ---~ end ---~ ---~ local function handledefaultprofile(s) ---~ defaults[lower(s.colorspace)] = s.filename ---~ end ---~ ---~ lpdf.registerdocumentfinalizer(flushembeddedprofiles,1,"embedded color profiles") +-- The following is somewhat cleaner but then we need to flag that there are +-- color spaces set so that the page flusher does not optimize the (at that +-- moment) still empty array away. So, next(d_colorspaces) should then become +-- a different test, i.e. also on flag. I'll add that when we need more forward +-- referencing. +-- +-- local function embedprofile = handledefaultprofile +-- +-- local function flushembeddedprofiles() +-- for colorspace, filename in next, defaults do +-- embedprofile(colorspace,filename) +-- end +-- end +-- +-- local function handledefaultprofile(s) +-- defaults[lower(s.colorspace)] = s.filename +-- end +-- +-- lpdf.registerdocumentfinalizer(flushembeddedprofiles,1,"embedded color profiles") diff --git a/tex/context/base/mkiv/node-fin.mkiv b/tex/context/base/mkiv/node-fin.mkiv index 413a00722..6c5bf17f1 100644 --- a/tex/context/base/mkiv/node-fin.mkiv +++ b/tex/context/base/mkiv/node-fin.mkiv @@ -34,46 +34,47 @@ \definesystemattribute[trigger][public] -\newcount\attributeboxcount +\newcount\c_syst_attr_trigger \edef\startinheritattributes{\attribute\triggerattribute\plusone} \edef\stopinheritattributes {\attribute\triggerattribute\attributeunsetvalue} -\def\doattributedcopy{\afterassignment\dodoattributedcopy\attributeboxcount} -\def\doattributedbox {\afterassignment\dodoattributedbox \attributeboxcount} +\def\syst_attr_trigger_copy_yes{\afterassignment\syst_attr_trigger_copy_indeed\c_syst_attr_trigger} +\def\syst_attr_trigger_dump_yes{\afterassignment\syst_attr_trigger_dump_indeed\c_syst_attr_trigger} -\def\dodoattributedcopy - {\startinheritattributes - \ifvbox\attributeboxcount - \vpack{\unvcopy\attributeboxcount}% +\def\syst_attr_trigger_copy_indeed + {\ifvbox\c_syst_attr_trigger + \vpack attr \triggerattribute \plusone {\unvcopy\c_syst_attr_trigger}% \else - \hpack{\unhcopy\attributeboxcount}% - \fi - \stopinheritattributes} - -\def\dodoattributedbox - {\startinheritattributes - \ifvbox\attributeboxcount - \vpack{\unvbox\attributeboxcount}% + \hpack attr \triggerattribute \plusone {\unhcopy\c_syst_attr_trigger}% + \fi} + +\def\syst_attr_trigger_dump_indeed + {\ifvbox\c_syst_attr_trigger + \vpack attr \triggerattribute \plusone {\unvbox\c_syst_attr_trigger}% \else - \hpack{\unhbox\attributeboxcount}% - \fi - \stopinheritattributes} + \hpack attr \triggerattribute \plusone {\unhbox\c_syst_attr_trigger}% + \fi} -\def\enableattributeinheritance +\unexpanded\def\enableattributeinheritance {\clf_enablestatetriggering - \let\attributedcopy\doattributedcopy - \let\attributedbox \doattributedbox} + \let\attributedcopy\syst_attr_trigger_copy_yes + \let\attributedbox \syst_attr_trigger_dump_yes} -\def\disableattributeinheritance +\unexpanded\def\disableattributeinheritance {\clf_disablestatetriggering \let\attributedcopy\copy \let\attributedbox \box} \disableattributeinheritance +\installtexdirective + {attributes.inheritance} + {\enableattributeinheritance} + {\disableattributeinheritance} + % \appendtoks -% \enableattributeinheritance % will become default +% \enableattributeinheritance % might become default % \to\everyjob \protect \endinput diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index c0cf6d6ee..8c60658b7 100644 Binary files a/tex/context/base/mkiv/status-files.pdf and b/tex/context/base/mkiv/status-files.pdf differ diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf index 9e254b013..530e006b4 100644 Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf index 43e672cda..5ba2f6509 100644 Binary files a/tex/context/interface/mkiv/i-context.pdf and b/tex/context/interface/mkiv/i-context.pdf differ diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf index 754c377b4..2f0e5163d 100644 Binary files a/tex/context/interface/mkiv/i-readme.pdf and b/tex/context/interface/mkiv/i-readme.pdf differ diff --git a/tex/context/modules/common/s-abr-01.tex b/tex/context/modules/common/s-abr-01.tex index 00a1a5c1e..156b9b938 100644 --- a/tex/context/modules/common/s-abr-01.tex +++ b/tex/context/modules/common/s-abr-01.tex @@ -127,7 +127,8 @@ \logo [GUST] {Gust} \logo [GCC] {gcc} \logo [GWTEX] {gw\TeX} -\logo [HSB] {hsb} +\logo [HSB] {hsb} % ? +\logo [HSV] {hsv} \logo [HTML] {html} \logo [HTTP] {http} \logo [HZ] {hz} diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 48b828e01..e33f42574 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 : 07/05/16 13:02:59 +-- merge date : 07/06/16 10:01:19 do -- begin closure to overcome local limits and interference @@ -16263,11 +16263,12 @@ if not modules then modules={} end modules ['font-otj']={ if not nodes.properties then return end local next,rawget=next,rawget local fastcopy=table.fastcopy +local floor=math.floor local registertracker=trackers.register local trace_injections=false registertracker("fonts.injections",function(v) trace_injections=v end) local trace_marks=false registertracker("fonts.injections.marks",function(v) trace_marks=v end) local trace_cursive=false registertracker("fonts.injections.cursive",function(v) trace_cursive=v end) -local trace_spaces=false registertracker("otf.spaces",function(v) trace_spaces=v end) +local trace_spaces=false registertracker("fonts.injections.spaces",function(v) trace_spaces=v end) local use_advance=false directives.register("fonts.injections.advance",function(v) use_advance=v end) local report_injections=logs.reporter("fonts","injections") local report_spaces=logs.reporter("fonts","spaces") @@ -17467,7 +17468,7 @@ local function injectspaces(head) rightkerns=trig.right local par=fontdata[font].parameters factor=par.factor - threshold=par.spacing.width-1 + threshold=floor(par.spacing.width-2) lastfont=font end for n in traverse_id(glue_code,tonut(head)) do @@ -18051,6 +18052,7 @@ local getligaindex=injections.getligaindex local cursonce=true local fonthashes=fonts.hashes local fontdata=fonthashes.identifiers +local fontfeatures=fonthashes.features local otffeatures=fonts.constructors.features.otf local registerotffeature=otffeatures.register local onetimemessage=fonts.loggers.onetimemessage or function() end @@ -20873,9 +20875,25 @@ otf.nodemodeinitializer=featuresinitializer otf.featuresprocessor=featuresprocessor otf.handlers=handlers local setspacekerns=nodes.injections.setspacekerns if not setspacekerns then os.exit() end -function otf.handlers.trigger_space_kerns(head,start,dataset,sequence,_,_,_,_,font,attr) - setspacekerns(font,sequence) - return head,start,true +if fontfeatures then + function otf.handlers.trigger_space_kerns(head,start,dataset,sequence,_,_,_,_,font,attr) + local features=fontfeatures[font] + local enabled=features.spacekern==true and features.kern==true + if enabled then + setspacekerns(font,sequence) + end + return head,start,enabled + end +else + function otf.handlers.trigger_space_kerns(head,start,dataset,sequence,_,_,_,_,font,attr) + local shared=identifiers[font].shared + local features=shared and shared.features + local enabled=features and features.spacekern==true and features.kern==true + if enabled then + setspacekerns(font,sequence) + end + return head,start,enabled + end end local function hasspacekerns(data) local sequences=data.resources.sequences @@ -20909,8 +20927,8 @@ otf.readers.registerextender { local function spaceinitializer(tfmdata,value) local resources=tfmdata.resources local spacekerns=resources and resources.spacekerns - if spacekerns==nil then - local properties=tfmdata.properties + local properties=tfmdata.properties + if value and spacekerns==nil then if properties and properties.hasspacekerns then local sequences=resources.sequences local left={} @@ -20923,7 +20941,20 @@ local function spaceinitializer(tfmdata,value) if steps then local kern=sequence.features.kern if kern then - feat=feat or kern + if feat then + for script,languages in next,kern do + local f=feat[k] + if f then + for l in next,languages do + f[l]=true + end + else + feat[script]=languages + end + end + else + feat=kern + end for i=1,#steps do local step=steps[i] local coverage=step.coverage -- cgit v1.2.3