From e75317d1924dd10388f154df7412a0ab201e455e Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 12 Dec 2019 02:01:50 +0100 Subject: 2019-12-12 01:07:00 --- tex/context/base/mkii/cont-new.mkii | 2 +- tex/context/base/mkii/context.mkii | 2 +- tex/context/base/mkii/mult-fr.mkii | 3 + tex/context/base/mkiv/char-tex.lua | 1 - tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/cont-run.lua | 5 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/context.mkxl | 2 +- tex/context/base/mkiv/lpdf-fmt.lua | 172 ++++++++++- tex/context/base/mkiv/lpdf-tag.lua | 40 ++- tex/context/base/mkiv/lpdf-wid.lua | 339 +++++++++++---------- tex/context/base/mkiv/luat-cnf.lua | 44 ++- tex/context/base/mkiv/status-files.pdf | Bin 26605 -> 26588 bytes tex/context/base/mkiv/status-lua.pdf | Bin 269165 -> 269277 bytes tex/context/base/mkiv/syst-ini.mkiv | 9 +- tex/context/base/mkiv/syst-ini.mkxl | 50 ++- tex/context/base/mkiv/util-zip.lua | 44 +-- tex/context/interface/mkii/keys-fr.xml | 3 + tex/context/interface/mkiv/i-context.pdf | Bin 893980 -> 894061 bytes tex/context/interface/mkiv/i-readme.pdf | Bin 61165 -> 61165 bytes tex/context/sample/third/dyrynk-cz.tex | 6 +- tex/context/sample/third/dyrynk-vlnka-cz.tex | 7 +- tex/context/sample/third/hviezdoslav-sk.tex | 39 +++ tex/context/sample/third/hviezdoslav-vlnka-sk.tex | 39 +++ tex/context/sample/third/jaros-sk.tex | 5 + tex/context/sample/third/jaros-vlnka-sk.tex | 5 + tex/context/sample/third/kollar-cz.tex | 1 - tex/context/sample/third/komensky-cz.tex | 2 +- tex/context/sample/third/komensky-vlnka-cz.tex | 2 +- tex/context/sample/third/slova-sk.tex | 5 + tex/context/sample/third/smrek-sk.tex | 40 +++ tex/context/sample/third/smrek-vlnka-sk.tex | 40 +++ tex/context/test/mkiv/pdf-a1a-2005.mkiv | 6 +- tex/context/test/mkiv/pdf-a1b-2005.mkiv | 12 +- tex/context/test/mkiv/pdf-a2a.mkiv | 14 +- tex/context/test/mkiv/pdf-a2b.mkiv | 48 +++ tex/context/test/mkiv/pdf-a2u.mkiv | 48 +++ tex/context/test/mkiv/pdf-a3a.mkiv | 16 +- tex/context/test/mkiv/pdf-a3b.mkiv | 47 +++ tex/context/test/mkiv/pdf-a3u.mkiv | 47 +++ tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 41 files changed, 890 insertions(+), 261 deletions(-) create mode 100644 tex/context/sample/third/hviezdoslav-sk.tex create mode 100644 tex/context/sample/third/hviezdoslav-vlnka-sk.tex create mode 100644 tex/context/sample/third/jaros-sk.tex create mode 100644 tex/context/sample/third/jaros-vlnka-sk.tex create mode 100644 tex/context/sample/third/slova-sk.tex create mode 100644 tex/context/sample/third/smrek-sk.tex create mode 100644 tex/context/sample/third/smrek-vlnka-sk.tex create mode 100644 tex/context/test/mkiv/pdf-a2b.mkiv create mode 100644 tex/context/test/mkiv/pdf-a2u.mkiv create mode 100644 tex/context/test/mkiv/pdf-a3b.mkiv create mode 100644 tex/context/test/mkiv/pdf-a3u.mkiv (limited to 'tex') diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index c68d0bd30..1a0170924 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2019.12.06 19:45} +\newcontextversion{2019.12.12 00:57} %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/mkii/context.mkii b/tex/context/base/mkii/context.mkii index cf49f51f0..c80c787d3 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2019.12.06 19:45} +\edef\contextversion{2019.12.12 00:57} %D For those who want to use this: diff --git a/tex/context/base/mkii/mult-fr.mkii b/tex/context/base/mkii/mult-fr.mkii index 02135bcbf..de8778e45 100644 --- a/tex/context/base/mkii/mult-fr.mkii +++ b/tex/context/base/mkii/mult-fr.mkii @@ -232,6 +232,7 @@ \setinterfacevariable{handwritten}{manuscript} \setinterfacevariable{hang}{suspend} \setinterfacevariable{hanging}{suspend} +\setinterfacevariable{hangingboth}{hangingboth} \setinterfacevariable{head}{tete} \setinterfacevariable{header}{entete} \setinterfacevariable{headintext}{headintext} @@ -1044,6 +1045,7 @@ \setinterfaceconstant{overprint}{overprint} \setinterfaceconstant{ownerpassword}{ownerpassword} \setinterfaceconstant{ownnumber}{numeroproprio} +\setinterfaceconstant{packcriterium}{packcriterium} \setinterfaceconstant{page}{page} \setinterfaceconstant{pageboundaries}{limitespage} \setinterfaceconstant{pagecolor}{couleurpage} @@ -1053,6 +1055,7 @@ \setinterfaceconstant{pageconversion}{pageconversion} \setinterfaceconstant{pageconversionset}{pageconversionset} \setinterfaceconstant{pageleft}{pageleft} +\setinterfaceconstant{pagemethod}{pagemethod} \setinterfaceconstant{pagenumber}{numeropage} \setinterfaceconstant{pageprefix}{pageprefix} \setinterfaceconstant{pageprefixconnector}{pageprefixconnector} diff --git a/tex/context/base/mkiv/char-tex.lua b/tex/context/base/mkiv/char-tex.lua index bbaf11875..b361a9a07 100644 --- a/tex/context/base/mkiv/char-tex.lua +++ b/tex/context/base/mkiv/char-tex.lua @@ -692,7 +692,6 @@ if not csletters then else mark(csletters) - end lpegpatterns.csletter = utfchartabletopattern(csletters) diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 32d0ff457..a461be673 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2019.12.06 19:45} +\newcontextversion{2019.12.12 00:57} %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/cont-run.lua b/tex/context/base/mkiv/cont-run.lua index 2634654fe..9a2b3db96 100644 --- a/tex/context/base/mkiv/cont-run.lua +++ b/tex/context/base/mkiv/cont-run.lua @@ -166,10 +166,7 @@ if sandboxing then -- We block some potential escapes from protection. - context [[ - \let\primitive \relax - \let\normalprimitive\relax - ]] + context [[\let\primitive\relax\let\normalprimitive\relax]] debug = { traceback = traceback, diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index fa33068b2..e3ee67729 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -45,7 +45,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2019.12.06 19:45} +\edef\contextversion{2019.12.12 00:57} \edef\contextkind {beta} %D Kind of special: diff --git a/tex/context/base/mkiv/context.mkxl b/tex/context/base/mkiv/context.mkxl index 38e339ec8..1a56b8e3b 100644 --- a/tex/context/base/mkiv/context.mkxl +++ b/tex/context/base/mkiv/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2019.12.06 19:45} +\edef\contextversion{2019.12.12 00:57} \edef\contextkind {beta} %D Kind of special: diff --git a/tex/context/base/mkiv/lpdf-fmt.lua b/tex/context/base/mkiv/lpdf-fmt.lua index 25a72fa49..f56b56b52 100644 --- a/tex/context/base/mkiv/lpdf-fmt.lua +++ b/tex/context/base/mkiv/lpdf-fmt.lua @@ -81,10 +81,13 @@ local prefixes = { cmyk = "DefaultCMYK", } -local formatspecification, formatname = nil, nil +local formatspecification = nil +local formatname = nil -- * correspondent document wide flags (write once) needed for permission tests +-- defaults as mt + local formats = utilities.storage.allocate { version = { external_icc_profiles = 1.4, -- 'p' in name; URL reference of output intent @@ -95,6 +98,7 @@ local formats = utilities.storage.allocate { optional_content = 1.5, transparency = 1.4, object_compression = 1.5, + attachments = 1.7, }, default = { pdf_version = 1.7, -- todo: block tex primitive @@ -113,10 +117,11 @@ local formats = utilities.storage.allocate { open_prepress_interface = true, -- unknown optional_content = true, -- todo: block at lua level transparency = true, -- todo: block at lua level - jbig2_compression = true, -- todo: block at lua level - jpeg2000_compression = true, -- todo: block at lua level + jbig2_compression = true, -- todo: block at lua level (dropped anyway) + jpeg2000_compression = true, -- todo: block at lua level (dropped anyway) include_cidsets = true, include_charsets = true, + attachments = true, inject_metadata = function() -- nothing end @@ -133,6 +138,7 @@ local formats = utilities.storage.allocate { internal_icc_profiles = true, include_cidsets = true, include_charsets = true, + attachments = false, inject_metadata = function() addtoinfo("GTS_PDFXVersion","PDF/X-1a:2001") injectxmpinfo("xml://rdf:RDF","PDF/X-1a:2001",false) @@ -149,6 +155,7 @@ local formats = utilities.storage.allocate { internal_icc_profiles = true, include_cidsets = true, include_charsets = true, + attachments = false, inject_metadata = function() addtoinfo("GTS_PDFXVersion","PDF/X-1a:2003") injectxmpinfo("xml://rdf:RDF","PDF/X-1a:2003",false) @@ -169,6 +176,7 @@ local formats = utilities.storage.allocate { include_intents = true, include_cidsets = true, include_charsets = true, + attachments = false, inject_metadata = function() addtoinfo("GTS_PDFXVersion","PDF/X-3:2002") end @@ -189,6 +197,7 @@ local formats = utilities.storage.allocate { jbig2_compression = true, include_cidsets = true, include_charsets = true, + attachments = false, inject_metadata = function() addtoinfo("GTS_PDFXVersion","PDF/X-3:2003") end @@ -213,6 +222,7 @@ local formats = utilities.storage.allocate { object_compression = true, include_cidsets = true, include_charsets = true, + attachments = false, inject_metadata = function() injectxmpinfo("xml://rdf:RDF","PDF/X-4",false) insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","1",false) @@ -240,6 +250,7 @@ local formats = utilities.storage.allocate { object_compression = true, include_cidsets = true, include_charsets = true, + attachments = false, inject_metadata = function() injectxmpinfo("xml://rdf:RDF","PDF/X-4p",false) insertxmpinfo("xml://rdf:Description/xmpMM:InstanceID","1",false) @@ -267,6 +278,7 @@ local formats = utilities.storage.allocate { object_compression = true, include_cidsets = true, include_charsets = true, + attachments = false, inject_metadata = function() -- todo end @@ -293,6 +305,7 @@ local formats = utilities.storage.allocate { object_compression = true, include_cidsets = true, include_charsets = true, + attachments = false, inject_metadata = function() -- todo end @@ -318,6 +331,7 @@ local formats = utilities.storage.allocate { object_compression = true, include_cidsets = true, include_charsets = true, + attachments = false, inject_metadata = function() -- todo end @@ -334,11 +348,12 @@ local formats = utilities.storage.allocate { 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 + 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, include_cidsets = true, include_charsets = true, + attachments = false, inject_metadata = function() injectxmpinfo("xml://rdf:RDF","1A",false) end @@ -359,11 +374,14 @@ local formats = utilities.storage.allocate { internal_icc_profiles = true, include_cidsets = true, include_charsets = true, + attachments = false, inject_metadata = function() injectxmpinfo("xml://rdf:RDF","1B",false) end }, - ["pdf/a-2a"] = { -- untested; only PDF/A Attachments are allowed + -- Only PDF/A Attachments are allowed but we don't check the attachments + -- for any quality: they are just blobs. + ["pdf/a-2a"] = { pdf_version = 1.7, format_name = "pdf/a-2a", xmp_file = "lpdf-pda.xml", @@ -378,17 +396,74 @@ local formats = utilities.storage.allocate { forms = true, tagging = true, internal_icc_profiles = true, - transparency = true, -- NEW + transparency = true, -- new jbig2_compression = true, - jpeg2000_compression = true, -- NEW - object_compression = true, + jpeg2000_compression = true, -- new + object_compression = true, -- new include_cidsets = false, include_charsets = false, + attachments = true, inject_metadata = function() injectxmpinfo("xml://rdf:RDF","2A",false) end }, - ["pdf/a-3a"] = { -- untested; NEW: any type of attachment is allowed + ["pdf/a-2b"] = { + pdf_version = 1.7, + format_name = "pdf/a-2b", + 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, + tagging = false, + internal_icc_profiles = true, + transparency = true, + jbig2_compression = true, + jpeg2000_compression = true, + object_compression = true, + include_cidsets = false, + include_charsets = false, + attachments = "externa", + inject_metadata = function() + injectxmpinfo("xml://rdf:RDF","2B",false) + end + }, + -- This is like the b variant, but it requires Unicode mapping of fonts + -- which we do anyway. + ["pdf/a-2u"] = { + pdf_version = 1.7, + format_name = "pdf/a-2u", + 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, + tagging = false, + internal_icc_profiles = true, + transparency = true, + jbig2_compression = true, + jpeg2000_compression = true, + object_compression = true, + include_cidsets = false, + include_charsets = false, + attachments = "external", + inject_metadata = function() + injectxmpinfo("xml://rdf:RDF","2U",false) + end + }, + -- Any type of attachment is allowed but we don't check the quality + -- of them. + ["pdf/a-3a"] = { pdf_version = 1.7, format_name = "pdf/a-3a", xmp_file = "lpdf-pda.xml", @@ -409,10 +484,63 @@ local formats = utilities.storage.allocate { object_compression = true, include_cidsets = false, include_charsets = false, + attachments = "internal", inject_metadata = function() injectxmpinfo("xml://rdf:RDF","3A",false) end }, + ["pdf/a-3b"] = { + pdf_version = 1.7, + format_name = "pdf/a-3b", + 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, + tagging = false, + internal_icc_profiles = true, + transparency = true, + jbig2_compression = true, + jpeg2000_compression = true, + object_compression = true, + include_cidsets = false, + include_charsets = false, + attachments = "external", + inject_metadata = function() + injectxmpinfo("xml://rdf:RDF","3B",false) + end + }, + ["pdf/a-3u"] = { + pdf_version = 1.7, + format_name = "pdf/a-3u", + 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, + tagging = false, + internal_icc_profiles = true, + transparency = true, + jbig2_compression = true, + jpeg2000_compression = true, + object_compression = true, + include_cidsets = false, + include_charsets = false, + attachments = "external", + inject_metadata = function() + injectxmpinfo("xml://rdf:RDF","3U",false) + end + }, ["pdf/ua-1"] = { -- based on PDF/A-3a, but no 'gts_flag' pdf_version = 1.7, format_name = "pdf/ua-1", @@ -433,6 +561,7 @@ local formats = utilities.storage.allocate { object_compression = true, include_cidsets = true, include_charsets = true, --- really ? + attachments = true, inject_metadata = function() injectxmpinfo("xml://rdf:RDF","3A",false) injectxmpinfo("xml://rdf:RDF","1",false) @@ -626,10 +755,16 @@ local function handledefaultprofile(s,spec) -- specification end end -local loadedintents, intents = { }, pdfarray() +local loadedintents = { } +local intents = pdfarray() local function handleoutputintent(s,spec) - local name, url, filename, id, outputcondition, info = s.info or s.filename or "", s.url or "", s.filename or "", s.id or "", s.outputcondition or "", s.info or "" + local url = s.url or "" + local filename = s.filename or "" + local name = s.info or filename + local id = s.id or "" + local outputcondition = s.outputcondition or "" + local info = s.info or "" if name == "" or id == "" then report_backend("error in output intent specification: %s",serialize(s,false)) elseif not loadedintents[name] then @@ -771,8 +906,13 @@ function codeinjections.setformat(s) -- cid sets can always omitted now, but those validators still complain so let's -- for a while keep it (for luigi): -- - lpdf.setomitcidset (formatspecification.include_cidsets == false and 1 or 0) - lpdf.setomitcharset(formatspecification.include_charsets == false and 1 or 0) + lpdf.setomitcidset (formatspecification.include_cidsets == false and 1 or 0) -- why a number + lpdf.setomitcharset(formatspecification.include_charsets == false and 1 or 0) -- why a number + -- + -- maybe block by pdf version + -- + codeinjections.settaggingsupport(formatspecification.tagging) + codeinjections.setattachmentsupport(formatspecification.attachments) -- -- context.setupcolors { -- not this way -- cmyk = spec.cmyk_colors and variables.yes or variables.no, @@ -847,6 +987,10 @@ function codeinjections.getformatoption(key) return formatspecification and formatspecification[key] end +-- function codeinjections.getformatspecification() +-- return formatspecification +-- end + function codeinjections.supportedformats() local t = { } for k, v in sortedhash(formats.data) do diff --git a/tex/context/base/mkiv/lpdf-tag.lua b/tex/context/base/mkiv/lpdf-tag.lua index d99e09243..61a6999c1 100644 --- a/tex/context/base/mkiv/lpdf-tag.lua +++ b/tex/context/base/mkiv/lpdf-tag.lua @@ -26,6 +26,7 @@ local nodeinjections = backends.pdf.nodeinjections local codeinjections = backends.pdf.codeinjections local enableaction = nodes.tasks.enableaction +local disableaction = nodes.tasks.disableaction local pdfdictionary = lpdf.dictionary local pdfarray = lpdf.array @@ -695,13 +696,36 @@ end -- this belongs elsewhere (export is not pdf related) -function codeinjections.enabletags(tg,lb) - structures.tags.handler = nodeinjections.addtags - enableaction("shipouts","structures.tags.handler") - enableaction("shipouts","nodes.handlers.accessibility") - enableaction("math","noads.handlers.tags") - -- maybe also textblock - if trace_tags then - report_tags("enabling structure tags") +local permitted = true +local enabled = false + +function codeinjections.settaggingsupport(option) + if option == false then + if enabled then + disableaction("shipouts","structures.tags.handler") + disableaction("shipouts","nodes.handlers.accessibility") -- maybe not this one + disableaction("math","noads.handlers.tags") + enabled = false + end + if permitted then + if trace_tags then + report_tags("blocking structure tags") + end + permitted = false + end + end +end + +function codeinjections.enabletags() + if permitted and not enabled then + structures.tags.handler = nodeinjections.addtags + enableaction("shipouts","structures.tags.handler") + enableaction("shipouts","nodes.handlers.accessibility") + enableaction("math","noads.handlers.tags") + -- maybe also textblock + if trace_tags then + report_tags("enabling structure tags") + end + enabled = true end end diff --git a/tex/context/base/mkiv/lpdf-wid.lua b/tex/context/base/mkiv/lpdf-wid.lua index a538a9ad2..96b36324f 100644 --- a/tex/context/base/mkiv/lpdf-wid.lua +++ b/tex/context/base/mkiv/lpdf-wid.lua @@ -222,6 +222,25 @@ local referenced = { } local ignorereferenced = true -- fuzzy pdf spec .. twice in attachment list, can become an option local tobesavedobjrefs = utilities.storage.allocate() local collectedobjrefs = utilities.storage.allocate() +local permitted = true +local enabled = true +local embedded = true + +function codeinjections.setattachmentsupport(option) + if option == false then + permitted = false + enabled = false + embedded = true + elseif not permitted then + -- already dealt with + elseif option == "internal" or option == true then + enabled = true + embedded = true + elseif option == "external" then + enabled = true + embedded = false + end +end local fileobjreferences = { collected = collectedobjrefs, @@ -238,7 +257,7 @@ end job.register('job.fileobjreferences.collected', tobesavedobjrefs, initializer) local function flushembeddedfiles() - if next(filestreams) then + if enabled and next(filestreams) then local e = pdfarray() for tag, reference in sortedhash(filestreams) do if not reference then @@ -259,178 +278,182 @@ end lpdf.registerdocumentfinalizer(flushembeddedfiles,"embeddedfiles") function codeinjections.embedfile(specification) - local data = specification.data - local filename = specification.file - local name = specification.name or "" - local title = specification.title or "" - local hash = specification.hash or filename - local keepdir = specification.keepdir -- can change - local usedname = specification.usedname - local filetype = specification.filetype - local compress = specification.compress - local mimetype = specification.mimetype or specification.mime - if filename == "" then - filename = nil - end - if compress == nil then - compress = true - end - if data then - local r = filestreams[hash] - if r == false then - return nil - elseif r then - return r - elseif not filename then - filename = specification.tag - if not filename or filename == "" then - filename = specification.registered + if enabled then + local data = specification.data + local filename = specification.file + local name = specification.name or "" + local title = specification.title or "" + local hash = specification.hash or filename + local keepdir = specification.keepdir -- can change + local usedname = specification.usedname + local filetype = specification.filetype + local compress = specification.compress + local mimetype = specification.mimetype or specification.mime + if filename == "" then + filename = nil + end + if compress == nil then + compress = true + end + if data then + local r = filestreams[hash] + if r == false then + return nil + elseif r then + return r + elseif not filename then + filename = specification.tag + if not filename or filename == "" then + filename = specification.registered + end + if not filename or filename == "" then + filename = hash + end end - if not filename or filename == "" then - filename = hash + else + if not filename then + return nil + end + local r = filestreams[hash] + if r == false then + return nil + elseif r then + return r + else + local foundname = resolvers.findbinfile(filename) or "" + if foundname == "" or not lfs.isfile(foundname) then + filestreams[filename] = false + return nil + else + specification.foundname = foundname + end end end - else - if not filename then - return nil + -- needs to cleaned up: + usedname = usedname ~= "" and usedname or filename or name + local basename = keepdir == true and usedname or file.basename(usedname) + local basename = gsub(basename,"%./","") + local savename = name ~= "" and name or basename + if not filetype or filetype == "" then + filetype = name and (filename and file.suffix(filename)) or "txt" end - local r = filestreams[hash] - if r == false then - return nil - elseif r then - return r + savename = file.addsuffix(savename,filetype) -- type is mandate for proper working in viewer + local a = pdfdictionary { + Type = pdfconstant("EmbeddedFile"), + Subtype = mimetype and mimetype ~= "" and pdfconstant(mimetype) or nil, + } + local f + if data then + f = pdfflushstreamobject(data,a) + specification.data = true -- signal that still data but already flushed else + local foundname = specification.foundname or filename + local attributes = lfs.attributes(foundname) + if attributes then + a.Params = { + Size = attributes.size, + ModDate = lpdf.pdftimestamp(attributes.modification), + } + end + f = pdfflushstreamfileobject(foundname,a,compress) + end + local d = pdfdictionary { + Type = pdfconstant("Filespec"), + F = pdfstring(savename), + -- UF = pdfstring(savename), + UF = pdfunicode(savename), + EF = pdfdictionary { F = pdfreference(f) }, + Desc = title ~= "" and pdfunicode(title) or nil, + AFRelationship = pdfconstant("Unspecified"), -- Supplement, Data, Source, Alternative, Data + } + local r = pdfreference(pdfflushobject(d)) + filestreams[hash] = r + return r + end +end + +function nodeinjections.attachfile(specification) + if enabled then + local registered = specification.registered or "" + local data = specification.data + local hash + local filename + if data then + hash = md5.HEX(data) + else + filename = specification.file + if not filename or filename == "" then + report_attachment("no file specified, using registered %a instead",registered) + filename = registered + specification.file = registered + end local foundname = resolvers.findbinfile(filename) or "" if foundname == "" or not lfs.isfile(foundname) then - filestreams[filename] = false + report_attachment("invalid filename %a, ignoring registered %a",filename,registered) return nil else specification.foundname = foundname end + hash = filename end - end - -- needs to cleaned up: - usedname = usedname ~= "" and usedname or filename or name - local basename = keepdir == true and usedname or file.basename(usedname) - local basename = gsub(basename,"%./","") - local savename = name ~= "" and name or basename - if not filetype or filetype == "" then - filetype = name and (filename and file.suffix(filename)) or "txt" - end - savename = file.addsuffix(savename,filetype) -- type is mandate for proper working in viewer - local a = pdfdictionary { - Type = pdfconstant("EmbeddedFile"), - Subtype = mimetype and mimetype ~= "" and pdfconstant(mimetype) or nil, - } - local f - if data then - f = pdfflushstreamobject(data,a) - specification.data = true -- signal that still data but already flushed - else - local foundname = specification.foundname or filename - local attributes = lfs.attributes(foundname) - if attributes then - a.Params = { - Size = attributes.size, - ModDate = lpdf.pdftimestamp(attributes.modification), - } + specification.hash = hash + nofattachments = nofattachments + 1 + local registered = specification.registered or "" + local title = specification.title or "" + local subtitle = specification.subtitle or "" + local author = specification.author or "" + if registered == "" then + registered = filename end - f = pdfflushstreamfileobject(foundname,a,compress) - end - local d = pdfdictionary { - Type = pdfconstant("Filespec"), - F = pdfstring(savename), - -- UF = pdfstring(savename), - UF = pdfunicode(savename), - EF = pdfdictionary { F = pdfreference(f) }, - Desc = title ~= "" and pdfunicode(title) or nil, - AFRelationship = pdfconstant("Unspecified"), -- Supplement, Data, Source, Alternative, Data - } - local r = pdfreference(pdfflushobject(d)) - filestreams[hash] = r - return r -end - -function nodeinjections.attachfile(specification) - local registered = specification.registered or "" - local data = specification.data - local hash - local filename - if data then - hash = md5.HEX(data) - else - filename = specification.file - if not filename or filename == "" then - report_attachment("no file specified, using registered %a instead",registered) - filename = registered - specification.file = registered + if author == "" and title ~= "" then + author = title + title = filename or "" + end + if author == "" then + author = filename or "" + end + if title == "" then + title = registered end - local foundname = resolvers.findbinfile(filename) or "" - if foundname == "" or not lfs.isfile(foundname) then - report_attachment("invalid filename %a, ignoring registered %a",filename,registered) - return nil + local aref = attachments[registered] + if not aref then + aref = codeinjections.embedfile(specification) + attachments[registered] = aref + end + local reference = specification.reference + if reference and aref then + tobesavedobjrefs[reference] = aref[1] + end + if not aref then + report_attachment("skipping attachment, registered %a",registered) + -- already reported + elseif specification.method == v_hidden then + referenced[hash] = "hidden" else - specification.foundname = foundname + referenced[hash] = "annotation" + local name, appearance = analyzesymbol(specification.symbol,attachment_symbols) + local d = pdfdictionary { + Subtype = pdfconstant("FileAttachment"), + FS = aref, + Contents = pdfunicode(title), + Name = name, + NM = pdfstring("attachment:"..nofattachments), + T = author ~= "" and pdfunicode(author) or nil, + Subj = subtitle ~= "" and pdfunicode(subtitle) or nil, + C = analyzecolor(specification.colorvalue,specification.colormodel), + CA = analyzetransparency(specification.transparencyvalue), + AP = appearance, + OC = analyzelayer(specification.layer), + } + local width = specification.width or 0 + local height = specification.height or 0 + local depth = specification.depth or 0 + local box = hpack_node(nodeinjections.annotation(width,height,depth,d())) + box.width = width + box.height = height + box.depth = depth + return box end - hash = filename - end - specification.hash = hash - nofattachments = nofattachments + 1 - local registered = specification.registered or "" - local title = specification.title or "" - local subtitle = specification.subtitle or "" - local author = specification.author or "" - if registered == "" then - registered = filename - end - if author == "" and title ~= "" then - author = title - title = filename or "" - end - if author == "" then - author = filename or "" - end - if title == "" then - title = registered - end - local aref = attachments[registered] - if not aref then - aref = codeinjections.embedfile(specification) - attachments[registered] = aref - end - local reference = specification.reference - if reference and aref then - tobesavedobjrefs[reference] = aref[1] - end - if not aref then - report_attachment("skipping attachment, registered %a",registered) - -- already reported - elseif specification.method == v_hidden then - referenced[hash] = "hidden" - else - referenced[hash] = "annotation" - local name, appearance = analyzesymbol(specification.symbol,attachment_symbols) - local d = pdfdictionary { - Subtype = pdfconstant("FileAttachment"), - FS = aref, - Contents = pdfunicode(title), - Name = name, - NM = pdfstring("attachment:"..nofattachments), - T = author ~= "" and pdfunicode(author) or nil, - Subj = subtitle ~= "" and pdfunicode(subtitle) or nil, - C = analyzecolor(specification.colorvalue,specification.colormodel), - CA = analyzetransparency(specification.transparencyvalue), - AP = appearance, - OC = analyzelayer(specification.layer), - } - local width = specification.width or 0 - local height = specification.height or 0 - local depth = specification.depth or 0 - local box = hpack_node(nodeinjections.annotation(width,height,depth,d())) - box.width = width - box.height = height - box.depth = depth - return box end end @@ -438,6 +461,8 @@ function codeinjections.attachmentid(filename) -- not used in context return filestreams[filename] end +-- Comments + local nofcomments = 0 local usepopupcomments = false diff --git a/tex/context/base/mkiv/luat-cnf.lua b/tex/context/base/mkiv/luat-cnf.lua index 88e7a7353..ebda6e8cd 100644 --- a/tex/context/base/mkiv/luat-cnf.lua +++ b/tex/context/base/mkiv/luat-cnf.lua @@ -61,16 +61,34 @@ function texconfig.init() libraries = { -- we set it here as we want libraries also 'indexed' basiclua = { - "string", "table", "coroutine", "debug", "file", "io", "lpeg", "math", "os", "package", "bit32", + -- always + "string", "table", "coroutine", "debug", "file", "io", "lpeg", "math", "os", "package", + -- bonus + "bit32", "utf8", }, - basictex = { -- noad - "callback", "font", "img", "lang", "lua", "node", "pdf", "status", "tex", "texconfig", "texio", "token", + basictex = { + -- always + "callback", "font", "lang", "lua", "node", "status", "tex", "texconfig", "texio", "token", + -- not in luametatex + "img", "pdf", }, extralua = { - "gzip", "zip", "zlib", "lfs", "ltn12", "mime", "socket", "md5", "fio", "unicode", "utf", + -- not in luametatex + "unicode", "utf", "gzip", "zip", "zlib", + -- in luametatex + "xzip", "xmath", "xcomplex", "basexx", + -- maybe some day in luametatex + "lz4", "lzo", + -- always (mime can go) + "lfs","socket", "mime", "md5", "sha2", "fio", "sio", }, extratex = { - "pdfe", "kpse", "mplib", + -- not in luametatex + "kpse", + -- always + "pdfe", "mplib", + -- in luametatex + "pdfdecode", "pngdecode", }, obsolete = { "epdf", @@ -123,16 +141,24 @@ function texconfig.init() -- shortcut and helper - local setbytecode = lua.setbytecode - local getbytecode = lua.getbytecode + local setbytecode = lua.setbytecode + local getbytecode = lua.getbytecode + local callbytecode = lua.callbytecode or function(i) + local b = getbytecode(i) + if b then + b() + return true + else + return false + end + end local function init(start) local i = start local t = os.clock() while true do - local b = getbytecode(i) + local b = callbytecode(i) if b then - b() ; setbytecode(i,nil) ; i = i + 1 else diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index 251d59539..9eaf11f05 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 24ef5be72..b30aaa78e 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/base/mkiv/syst-ini.mkiv b/tex/context/base/mkiv/syst-ini.mkiv index c8de22b28..0dd1fe29c 100644 --- a/tex/context/base/mkiv/syst-ini.mkiv +++ b/tex/context/base/mkiv/syst-ini.mkiv @@ -97,13 +97,12 @@ %D Initialization of primitives. \directlua { - local baseprimitives = tex.extraprimitives("core","tex") - local moreprimitives = tex.extraprimitives("etex","luatex") + local primitives = tex.extraprimitives("core","tex","etex","luatex") - tex.enableprimitives("",moreprimitives) + % table.sort(primitives) - tex.enableprimitives("normal",baseprimitives) - tex.enableprimitives("normal",moreprimitives) + tex.enableprimitives("", primitives) + tex.enableprimitives("normal",primitives) function tex.enableprimitives() end } diff --git a/tex/context/base/mkiv/syst-ini.mkxl b/tex/context/base/mkiv/syst-ini.mkxl index 0befec48c..0ea381d07 100644 --- a/tex/context/base/mkiv/syst-ini.mkxl +++ b/tex/context/base/mkiv/syst-ini.mkxl @@ -94,18 +94,48 @@ \chardef\statuswrite 128 -%D Initialization of primitives. +%D First we need to initialization the primitives. Because \CONTEXT\ is already a +%D pretty old macro package, we have a couple of issues with respect to primitives. +%D The \ETEX\ engine added a few as did \PDFTEX. The \LUATEX\ engine added even +%D more. This means that there can be a potential clash between primitives and +%D existing macros. The most noticeable ones are: +%D +%D \starttyping +%D \protected +%D \expanded +%D \unexpanded +%D \stoptyping +%D +%D Because we had macros like that before the primitives showed up. The protection +%D related macros were there before we even knew about extensions to the engine. +%D When the expansion related ones were introduced, we originally came up with +%D different names but due to requests we used the current names, somethng that in +%D retrospect was a bad idea: they should have gotten different names in \LUATEX, if +%D only because at that time only \CONTEXT\ was using them in rolling releases. +%D Anyway, we're now stuck with this situation, and it means that one should use the +%D \type {\normal...} variants in low level code: +%D +%D \starttyping +%D \normalexpanded +%D \normalprotected +%D \normalunexpanded +%D \stoptyping +%D +%D In the end not using different names in \LUATEX\ for these kind of backfires. It +%D makes not much sense to fix this in \LUAMETATEX\ because we're now to long on the +%D road. It is actually the reason why we have the option in \LUATEX\ to alias all +%D primitives in one go using a prefix. Actually this trick could be used to recover +%D a primitive meaning: just enable it with some prefix and \type {\let} the +%D original to that. But \unknown\ we prevent that trick below. +%D +%D The code below differs from \LUATEX: in \LUAMETATEX\ all primitives are already +%D available; it cannot limit itself to being \TEX\ or \ETEX. It could not do that +%D anyway because there are differences (no backend, to mention one). \directlua { - local baseprimitives = tex.extraprimitives("core","tex") - local moreprimitives = tex.extraprimitives("etex","luatex") - - tex.enableprimitives("",moreprimitives) - - tex.enableprimitives("normal",baseprimitives) - tex.enableprimitives("normal",moreprimitives) - - function tex.enableprimitives() end + local primitives = tex.extraprimitives() % "core","tex","etex","luatex" + tex.enableprimitives("normal",primitives) % could default to everything + function tex.enableprimitives() end % so we kind of protect what's there } \def\space{ } diff --git a/tex/context/base/mkiv/util-zip.lua b/tex/context/base/mkiv/util-zip.lua index 33f8d8a7e..f87e391a1 100644 --- a/tex/context/base/mkiv/util-zip.lua +++ b/tex/context/base/mkiv/util-zip.lua @@ -34,7 +34,7 @@ local band = bit32.band local rshift = bit32.rshift local lshift = bit32.lshift -local decompress, calculatecrc +local decompress, expandsize, calculatecrc -- if flate then -- @@ -44,17 +44,17 @@ local decompress, calculatecrc -- else local zlibdecompress = zlib.decompress + local zlibexpandsize = zlib.expandsize local zlibchecksum = zlib.crc32 - decompress = function(source,targetsize) - local target = zlibdecompress(source,-15) - if target then - return target - else - return false, 1 - end + decompress = function(source) + return zlibdecompress(source,-15) -- auto end + expandsize = zlibexpandsize and function(source,targetsize) + return zlibexpandsize(source,targetsize,-15) -- auto + end or decompress + calculatecrc = function(buffer,initial) return zlibchecksum(initial or 0,buffer) end @@ -183,8 +183,6 @@ local openzipfile, closezipfile, unzipfile, foundzipfile, getziphash, getziplist end end - local expandsize = xzip.expandsize - function unzipfile(z,filename,check) local hash = z.hash if not hash then @@ -483,19 +481,23 @@ if xzip then -- flate then do local l = list[i] local n = l.filename local d = unzipfile(z,n) -- true for check - local p = filejoin(path,n) - if mkdirs(dirname(p)) then - if steps then - total = total + #d - done = done + 1 - if done >= step then - done = 0 - logwriter(format("%4i files of %4i done, %10i bytes, %0.3f seconds",i,count,total,osclock()-time)) + if d then + local p = filejoin(path,n) + if mkdirs(dirname(p)) then + if steps then + total = total + #d + done = done + 1 + if done >= step then + done = 0 + logwriter(format("%4i files of %4i done, %10i bytes, %0.3f seconds",i,count,total,osclock()-time)) + end + elseif verbose then + logwriter(n) end - elseif verbose then - logwriter(n) + savedata(p,d) end - savedata(p,d) + else + logwriter(format("problem with file %s",n)) end end if steps then diff --git a/tex/context/interface/mkii/keys-fr.xml b/tex/context/interface/mkii/keys-fr.xml index c1f7b970b..8ba741a60 100644 --- a/tex/context/interface/mkii/keys-fr.xml +++ b/tex/context/interface/mkii/keys-fr.xml @@ -235,6 +235,7 @@ + @@ -1050,6 +1051,7 @@ + @@ -1059,6 +1061,7 @@ + diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf index e38499187..1cf1043ce 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 bdfaa028f..9cc078b86 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/sample/third/dyrynk-cz.tex b/tex/context/sample/third/dyrynk-cz.tex index e12a228b9..2a00c2348 100644 --- a/tex/context/sample/third/dyrynk-cz.tex +++ b/tex/context/sample/third/dyrynk-cz.tex @@ -5,9 +5,9 @@ slabou většiny našich knih. Často až překvapí rozpor mezi péčí, kterou věnoval umělec výzdobě knihy, a ledabylostí, s jakou ji tiskárna zhotovila. Bývá to podivná harmonie: výzdoba umělecká a sazba i tisk jako denních novin. Nejsou to malé závody, jichž výrobkům lze vytknouti tuto řemeslnou -chybu, i přední veliké tiskárny zhotovují takto >>krásné<< knihy. Stačí -prohlédnouti si podrobněji reprodukce v tomto díle, abychom se přesvědčili, -že to tvrzení není přehnané. +chybu, i přední veliké tiskárny zhotovují takto \quotation{krásné} knihy. +Stačí prohlédnouti si podrobněji reprodukce v tomto díle, abychom se +přesvědčili, že to tvrzení není přehnané. Přece však lze pozorovati potěšitelný obrat k lepšímu: některé české knihtiskárny se chlubí už správně vysazenými a dobře vytištěnými knihami. diff --git a/tex/context/sample/third/dyrynk-vlnka-cz.tex b/tex/context/sample/third/dyrynk-vlnka-cz.tex index 1d4df1e49..f0a385729 100644 --- a/tex/context/sample/third/dyrynk-vlnka-cz.tex +++ b/tex/context/sample/third/dyrynk-vlnka-cz.tex @@ -1,4 +1,3 @@ - Čeho jsem si zvlášť všímal při prohlížení knih, je typografické jejich zhotovení, technické provedení knihtiskařem, které po mém soudu je základem dobré knižní úpravy. A~tu nelze upřít, že řemeslná stránka je dosud stránkou @@ -6,9 +5,9 @@ slabou většiny našich knih. Často až překvapí rozpor mezi péčí, kterou věnoval umělec výzdobě knihy, a~ledabylostí, s~jakou ji tiskárna zhotovila. Bývá to podivná harmonie: výzdoba umělecká a~sazba i~tisk jako denních novin. Nejsou to malé závody, jichž výrobkům lze vytknouti tuto řemeslnou -chybu, i~přední veliké tiskárny zhotovují takto >>krásné<< knihy. Stačí -prohlédnouti si podrobněji reprodukce v~tomto díle, abychom se přesvědčili, -že to tvrzení není přehnané. +chybu, i~přední veliké tiskárny zhotovují takto \quotation{krásné} knihy. +Stačí prohlédnouti si podrobněji reprodukce v~tomto díle, abychom se +přesvědčili, že to tvrzení není přehnané. Přece však lze pozorovati potěšitelný obrat k~lepšímu: některé české knihtiskárny se chlubí už správně vysazenými a~dobře vytištěnými knihami. diff --git a/tex/context/sample/third/hviezdoslav-sk.tex b/tex/context/sample/third/hviezdoslav-sk.tex new file mode 100644 index 000000000..7c4482417 --- /dev/null +++ b/tex/context/sample/third/hviezdoslav-sk.tex @@ -0,0 +1,39 @@ +Pozdravujem vás, lesy, hory, +z tej duše pozdravujem vás! +Čo mrcha svet v nás skvári, zmorí, +zrak jeho urknul, zmámila +lož, ohlušila presila: +vy k žitiu privediete zas, +vy vzkriesite, vy zotavíte, +z jatrivých vyliečite rán, +v opravdu priamom, bratskom cite +otvoriac lono dokorán, +a srdečnosť kde odveká, +kde nikdy nevyspela zrada, +bez dotazu, kto on, čo hľadá, +na lono to, hľa, v objem sladký +ramenom láskyplnej matky +pritúliac verne človeka\dots +Len okamih tam pobudnutia: +už mŕtvie bôľ, už slabnú putá, +zrak čistí sa, tlak voľneje, +i oživujú nádeje; +len jeden pokyn, zášum lesný, +len jeden horskej riavy skok: +a duša už sa ladí k piesni, +tkne sa jej bičík prečudesný -- +a srdce hupká vozvysok; +len jedno orla skolotanie, +len jeden švihot sokola, +prez horu mužné zahvízdanie, +na holiach jeden záblesk vatry: +a nás už chváce povoľa, +duch už sa zažal, už sa jatrí, +plamenným krídlom šibe hor’, +jak v nebo naspäť meteor; +len chvíľka, ako vzdušný vlas +čo preletí nám ponad hlavu -- +a už ju máme, myseľ hravú: +zmladenej duše prez dúbravu +tak strie sa, ako dúhy pás\dots +\dots Z tej duše pozdravujem vás! diff --git a/tex/context/sample/third/hviezdoslav-vlnka-sk.tex b/tex/context/sample/third/hviezdoslav-vlnka-sk.tex new file mode 100644 index 000000000..5602be70f --- /dev/null +++ b/tex/context/sample/third/hviezdoslav-vlnka-sk.tex @@ -0,0 +1,39 @@ +Pozdravujem vás, lesy, hory, +z~tej duše pozdravujem vás! +Čo mrcha svet v~nás skvári, zmorí, +zrak jeho urknul, zmámila +lož, ohlušila presila: +vy k~žitiu privediete zas, +vy vzkriesite, vy zotavíte, +z~jatrivých vyliečite rán, +v~opravdu priamom, bratskom cite +otvoriac lono dokorán, +a~srdečnosť kde odveká, +kde nikdy nevyspela zrada, +bez dotazu, kto on, čo hľadá, +na lono to, hľa, v~objem sladký +ramenom láskyplnej matky +pritúliac verne človeka\dots +Len okamih tam pobudnutia: +už mŕtvie bôľ, už slabnú putá, +zrak čistí sa, tlak voľneje, +i~oživujú nádeje; +len jeden pokyn, zášum lesný, +len jeden horskej riavy skok: +a~duša už sa ladí k~piesni, +tkne sa jej bičík prečudesný -- +a~srdce hupká vozvysok; +len jedno orla skolotanie, +len jeden švihot sokola, +prez horu mužné zahvízdanie, +na holiach jeden záblesk vatry: +a~nás už chváce povoľa, +duch už sa zažal, už sa jatrí, +plamenným krídlom šibe hor’, +jak v~nebo naspäť meteor; +len chvíľka, ako vzdušný vlas +čo preletí nám ponad hlavu -- +a~už ju máme, myseľ hravú: +zmladenej duše prez dúbravu +tak strie sa, ako dúhy pás\dots +\dots Z~tej duše pozdravujem vás! diff --git a/tex/context/sample/third/jaros-sk.tex b/tex/context/sample/third/jaros-sk.tex new file mode 100644 index 000000000..bd2952501 --- /dev/null +++ b/tex/context/sample/third/jaros-sk.tex @@ -0,0 +1,5 @@ +Ja viem prečo si ty tak zrazu ochorel, na spoveď sa ti nechce! Či chce alebo +nie, to je teraz vedľajšie. Sama vidíš, že kľačať nemôžem \dots -- Hanbu ti +do kostola robiť nepôjdem, ešte by som niekoho postojačky urazil \dots -- A +s kým pôjdem na spoveď, vari sama? -- Keď nemáš s kým ísť, zober si psa. Aj +jemu sa možno treba vyspovedať. Nebreše, beťár, ako treba \dots diff --git a/tex/context/sample/third/jaros-vlnka-sk.tex b/tex/context/sample/third/jaros-vlnka-sk.tex new file mode 100644 index 000000000..ea564c3de --- /dev/null +++ b/tex/context/sample/third/jaros-vlnka-sk.tex @@ -0,0 +1,5 @@ +Ja viem prečo si ty tak zrazu ochorel, na spoveď sa ti nechce! Či chce alebo +nie, to je teraz vedľajšie. Sama vidíš, že kľačať nemôžem \dots -- Hanbu ti +do kostola robiť nepôjdem, ešte by som niekoho postojačky urazil \dots -- +A~s~kým pôjdem na spoveď, vari sama? -- Keď nemáš s~kým ísť, zober si psa. Aj +jemu sa možno treba vyspovedať. Nebreše, beťár, ako treba \dots diff --git a/tex/context/sample/third/kollar-cz.tex b/tex/context/sample/third/kollar-cz.tex index 5a4f63695..7382dd102 100644 --- a/tex/context/sample/third/kollar-cz.tex +++ b/tex/context/sample/third/kollar-cz.tex @@ -1,4 +1,3 @@ - Aj zde leží zem ta před okem mým slzy ronícím, někdy kolébka, nyní národu mého rakev. Stoj noho! posvátná místa jsou, kamkoli kráčíš, diff --git a/tex/context/sample/third/komensky-cz.tex b/tex/context/sample/third/komensky-cz.tex index f25bb47d9..96bfa609f 100644 --- a/tex/context/sample/third/komensky-cz.tex +++ b/tex/context/sample/third/komensky-cz.tex @@ -15,7 +15,7 @@ viděl, v levé ruce sázítko, pravou rukou vybírá (z přihrádek) literky a skládá je do sázítka v slova: když naplní sloupec, přenáší je na desku. Jakmile pak je naplněn počet sloupců pro jednu stranu archu, rozdělí je příložkami, ováže je a stáhne železnými rámy, aby se nerozpadly; a tím se -podle svého mínění sví povinnosti zhostil. +podle svého mínění své povinnosti zhostil. A tak tito všichni pracujíce vzájemně vykonávající jakoby hračkou podivuhodné dílo, lidem kdysi nepochopitelné, jen když mají všichni to, čeho diff --git a/tex/context/sample/third/komensky-vlnka-cz.tex b/tex/context/sample/third/komensky-vlnka-cz.tex index 17a2ab3f7..f9998f903 100644 --- a/tex/context/sample/third/komensky-vlnka-cz.tex +++ b/tex/context/sample/third/komensky-vlnka-cz.tex @@ -15,7 +15,7 @@ viděl, v~levé ruce sázítko, pravou rukou vybírá (z~přihrádek) literky a~skládá je do sázítka v~slova: když naplní sloupec, přenáší je na desku. Jakmile pak je naplněn počet sloupců pro jednu stranu archu, rozdělí je příložkami, ováže je a~stáhne železnými rámy, aby se nerozpadly; a~tím se -podle svého mínění sví povinnosti zhostil. +podle svého mínění své povinnosti zhostil. A~tak tito všichni pracujíce vzájemně vykonávající jakoby hračkou podivuhodné dílo, lidem kdysi nepochopitelné, jen když mají všichni to, čeho diff --git a/tex/context/sample/third/slova-sk.tex b/tex/context/sample/third/slova-sk.tex new file mode 100644 index 000000000..83d48ade3 --- /dev/null +++ b/tex/context/sample/third/slova-sk.tex @@ -0,0 +1,5 @@ +Slovenčina má veľa pekných slov: +ďateľ, kaďa, ďobať, loďka, Ďuro, habaďúra, vľavo, špľachot, voľby, veľhad, +veľký, veľmi, voľný , hobľovať, ďatľov, ľudový, vľúdne, vyhĺbiť, tĺcť, vĺča, +tĺčik, tĺk, vĺn, vkĺzla, dĺžka, pĺž, vŕba, kŕdeľ, sŕdc, kŕmiť, tŕnie, tŕň, +šťava, beťár, šťuka. diff --git a/tex/context/sample/third/smrek-sk.tex b/tex/context/sample/third/smrek-sk.tex new file mode 100644 index 000000000..29332cd86 --- /dev/null +++ b/tex/context/sample/third/smrek-sk.tex @@ -0,0 +1,40 @@ +Hľa, všetko pokrýva sneh rúškom zimy; +ženy a panny svieže, rudolíce +sa vyrojili hlučné na ulice; +ja hľadám jednu medzi tisícimi \dots + +\dots + +Celý svet miluje a vzýva ženu. +Lež básnik nadovšetko. Dante božský +i v pekle Beatricu svoju hľadal, +o Sandovej zas Musset verše skladal +a Verlaine ospevoval ženské bozky \dots + +\quotation{No, hľaďme, vy už k bozkom veslujete!} + +Nie pani, to tak prišlo samo sebou. +A i tak, bozk je vecou veľkolepou! +Prečo mu vyhýbať v tom chladnom svete? +Rty vaše, pani \dots Lež, ach -- odpustite! +Nálada táto zimná rozmar tvorí. +Len škoda, že ten večer je tak skorý \dots +Lež prečo hľadíte tak rozpačite? + +\quotation{Rozmýšľam práve, či by prijali ste, +keby vás pozvala aspoň k čaju. +Veď sa už všetci z parku rozchádzajú. +Kontúry mesta sú už veľmi hmlisté.} + +Vidíte, i tak by šiel možno s vami +a nečakal by ani na pozvanie. +Darmo, z vás žien vždy príťažlivosť vanie. +Ja vzbĺknem pri ženách jak otep slamy. + +\dots + +Som iba básnik, človek nepraktický, +parazit sŕdc, čo šťastie loví vždycky, +ale sám záruk šťastia sotva dáva. + +\dots diff --git a/tex/context/sample/third/smrek-vlnka-sk.tex b/tex/context/sample/third/smrek-vlnka-sk.tex new file mode 100644 index 000000000..eab79aa79 --- /dev/null +++ b/tex/context/sample/third/smrek-vlnka-sk.tex @@ -0,0 +1,40 @@ +Hľa, všetko pokrýva sneh rúškom zimy; +ženy a~panny svieže, rudolíce +sa vyrojili hlučné na ulice; +ja hľadám jednu medzi tisícimi \dots + +\dots + +Celý svet miluje a~vzýva ženu. +Lež básnik nadovšetko. Dante božský +i~v~pekle Beatricu svoju hľadal, +o~Sandovej zas Musset verše skladal +a~Verlaine ospevoval ženské bozky \dots + +\quotation{No, hľaďme, vy už k~bozkom veslujete!} + +Nie pani, to tak prišlo samo sebou. +A~i~tak, bozk je vecou veľkolepou! +Prečo mu vyhýbať v~tom chladnom svete? +Rty vaše, pani \dots Lež, ach -- odpustite! +Nálada táto zimná rozmar tvorí. +Len škoda, že ten večer je tak skorý \dots +Lež prečo hľadíte tak rozpačite? + +\quotation{Rozmýšľam práve, či by prijali ste, +keby vás pozvala aspoň k~čaju. +Veď sa už všetci z~parku rozchádzajú. +Kontúry mesta sú už veľmi hmlisté.} + +Vidíte, i~tak by šiel možno s~vami +a~nečakal by ani na pozvanie. +Darmo, z~vás žien vždy príťažlivosť vanie. +Ja vzbĺknem pri ženách jak otep slamy. + +\dots + +Som iba básnik, človek nepraktický, +parazit sŕdc, čo šťastie loví vždycky, +ale sám záruk šťastia sotva dáva. + +\dots diff --git a/tex/context/test/mkiv/pdf-a1a-2005.mkiv b/tex/context/test/mkiv/pdf-a1a-2005.mkiv index 90ac0c242..d7b2df9e0 100644 --- a/tex/context/test/mkiv/pdf-a1a-2005.mkiv +++ b/tex/context/test/mkiv/pdf-a1a-2005.mkiv @@ -1,6 +1,6 @@ % PDF/A-1a:2005 -\enabletrackers[structure.tags,backend.tags] +\enabletrackers[structure.tags,backend.tags,backend.xmp] \setupbackend [format=PDF/A-1a:2005, @@ -13,10 +13,12 @@ \setupcolors[cmyk=no] \definecolor[rgbblack][b=0.01] -\definecolor[transtest][r=1,g=1,t=.5] +\definecolor[transtest][r=1,g=1,t=0.25]% transparency is not allowed \placebookmarks[chapter][all][force=yes] + + \starttext \starttextcolor[rgbblack] diff --git a/tex/context/test/mkiv/pdf-a1b-2005.mkiv b/tex/context/test/mkiv/pdf-a1b-2005.mkiv index f23942a97..9b0669c61 100644 --- a/tex/context/test/mkiv/pdf-a1b-2005.mkiv +++ b/tex/context/test/mkiv/pdf-a1b-2005.mkiv @@ -1,6 +1,6 @@ % PDF/A-1b:2005 -\enabletrackers[structure.tags,backend.tags,backend.xmp] +\enabletrackers[backend.xmp] \setupbackend [format=PDF/A-1b:2005, @@ -9,21 +9,20 @@ % profile={sRGB.icc,default_gray.icc}] level=0] -\setuptagging[state=start] % needed even for 'b'-version - \setupcolors[cmyk=no] \definecolor[rgbblack][b=0.01] -\definecolor[transtest][r=1,g=1,t=.5] +\definecolor[transtest][r=1,g=1,t=.25]% transparency is not allowed + + \starttext \starttextcolor[rgbblack] % forced /DeviceGray causes problems; we need a trigger -Text is needed, otherwise tagging base entries are not applied. +Test it. \stoptextcolor -%\startTEXpage \hbox\bgroup \blackrule[width=1cm,height=1cm,color=red] \blackrule[width=1cm,height=1cm,color=green] @@ -32,6 +31,5 @@ Text is needed, otherwise tagging base entries are not applied. \blackrule[width=1cm,height=1cm,color=transtest]\hskip-.5cm \blackrule[width=1cm,height=1cm,color=transtest] \egroup -%\stopTEXpage \stoptext diff --git a/tex/context/test/mkiv/pdf-a2a.mkiv b/tex/context/test/mkiv/pdf-a2a.mkiv index a0e181e69..35f1453eb 100644 --- a/tex/context/test/mkiv/pdf-a2a.mkiv +++ b/tex/context/test/mkiv/pdf-a2a.mkiv @@ -1,6 +1,6 @@ % PDF/A-2a -\enabletrackers[structure.tags,backend.tags] +\enabletrackers[structure.tags,backend.tags,backend.xmp] \setupbackend [format=PDF/A-2a, @@ -10,12 +10,17 @@ \setuptagging[state=start] +\setupinteraction[state=start]% needed for attachment +%\setupattachment[method=hidden] + \setupcolors[cmyk=no] \definecolor[rgbblack][b=0.01] -\definecolor[transtest][r=1,g=1,t=.5] +\definecolor[transtest][r=1,g=1,t=.25] \placebookmarks[chapter][all][force=yes] + + \starttext \starttextcolor[rgbblack] @@ -37,4 +42,9 @@ Test it \blackrule[width=1cm,height=1cm,color=transtest] \egroup + +% inclusion of PDF/A is allowed; TODO: test if ANY version (even newer) is allowed +%\attachment[file={attachment_pdf-a1a-2005.pdf}, type={application/pdf}] +\attachment[file={attachment_pdf-a1b-2005.pdf}, type={application/pdf}] + \stoptext diff --git a/tex/context/test/mkiv/pdf-a2b.mkiv b/tex/context/test/mkiv/pdf-a2b.mkiv new file mode 100644 index 000000000..5c0d72244 --- /dev/null +++ b/tex/context/test/mkiv/pdf-a2b.mkiv @@ -0,0 +1,48 @@ +% PDF/A-2b + +\enabletrackers[backend.xmp] + +\setupbackend + [format=PDF/A-2b, + intent=sRGB IEC61966-2.1, % use entry here; otherwise problems with predefined default profile + profile={sRGB.icc,default_gray.icc}, + level=0] + +\setupinteraction[state=start]% needed for attachment +%\setupattachment[method=hidden] + +\setupcolors[cmyk=no] +\definecolor[rgbblack][b=0.01] +\definecolor[transtest][r=1,g=1,t=.25] + +\placebookmarks[chapter][all][force=yes] + + + +\starttext + +\starttextcolor[rgbblack] + +\startchapter[title=aa,bookmark=bb,list=cc,marking=dd] + +Test it + +\stopchapter + +\stoptextcolor + +\hbox\bgroup + \blackrule[width=1cm,height=1cm,color=red] + \blackrule[width=1cm,height=1cm,color=green] + \blackrule[width=1cm,height=1cm,color=blue] + \blackrule[width=1cm,height=1cm,color=rgbblack] + \blackrule[width=1cm,height=1cm,color=transtest]\hskip-.5cm + \blackrule[width=1cm,height=1cm,color=transtest] +\egroup + + +% inclusion of PDF/A is allowed; TODO: test if ANY version (even newer) is allowed +\attachment[file={attachment_pdf-a1a-2005.pdf}, type={application/pdf}] +%\attachment[file={attachment_pdf-a1b-2005.pdf}, type={application/pdf}] + +\stoptext diff --git a/tex/context/test/mkiv/pdf-a2u.mkiv b/tex/context/test/mkiv/pdf-a2u.mkiv new file mode 100644 index 000000000..0b20abfe1 --- /dev/null +++ b/tex/context/test/mkiv/pdf-a2u.mkiv @@ -0,0 +1,48 @@ +% PDF/A-2u + +\enabletrackers[backend.xmp] + +\setupbackend + [format=PDF/A-2u, + intent=sRGB IEC61966-2.1, % use entry here; otherwise problems with predefined default profile + profile={sRGB.icc,default_gray.icc}, + level=0] + +\setupinteraction[state=start]% needed for attachment +%\setupattachment[method=hidden] + +\setupcolors[cmyk=no] +\definecolor[rgbblack][b=0.01] +\definecolor[transtest][r=1,g=1,t=.25] + +\placebookmarks[chapter][all][force=yes] + + + +\starttext + +\starttextcolor[rgbblack] + +\startchapter[title=aa,bookmark=bb,list=cc,marking=dd] + +Test it + +\stopchapter + +\stoptextcolor + +\hbox\bgroup + \blackrule[width=1cm,height=1cm,color=red] + \blackrule[width=1cm,height=1cm,color=green] + \blackrule[width=1cm,height=1cm,color=blue] + \blackrule[width=1cm,height=1cm,color=rgbblack] + \blackrule[width=1cm,height=1cm,color=transtest]\hskip-.5cm + \blackrule[width=1cm,height=1cm,color=transtest] +\egroup + + +% inclusion of PDF/A is allowed; TODO: test if ANY version (even newer) is allowed +\attachment[file={attachment_pdf-a1a-2005.pdf}, type={application/pdf}] +%\attachment[file={attachment_pdf-a1b-2005.pdf}, type={application/pdf}] + +\stoptext diff --git a/tex/context/test/mkiv/pdf-a3a.mkiv b/tex/context/test/mkiv/pdf-a3a.mkiv index 7efb28e3c..3d5dd48ca 100644 --- a/tex/context/test/mkiv/pdf-a3a.mkiv +++ b/tex/context/test/mkiv/pdf-a3a.mkiv @@ -1,9 +1,6 @@ % PDF/A-3a -\nopdfcompression - - -\enabletrackers[structure.tags,backend.tags] +\enabletrackers[structure.tags,backend.tags,backend.xmp] \setupbackend [format=PDF/A-3a, @@ -13,12 +10,17 @@ \setuptagging[state=start] +\setupinteraction[state=start]% needed for attachment +%\setupattachment[method=hidden] + \setupcolors[cmyk=no] \definecolor[rgbblack][b=0.01] -\definecolor[transtest][r=1,g=1,t=.5] +\definecolor[transtest][r=1,g=1,t=.25] \placebookmarks[chapter][all][force=yes] + + \starttext \starttextcolor[rgbblack] @@ -40,4 +42,8 @@ Test it \blackrule[width=1cm,height=1cm,color=transtest] \egroup + +% inclusion of any file type is allowed +\attachment[file=cow.pdf, type={application/pdf}] + \stoptext diff --git a/tex/context/test/mkiv/pdf-a3b.mkiv b/tex/context/test/mkiv/pdf-a3b.mkiv new file mode 100644 index 000000000..31bbaeaba --- /dev/null +++ b/tex/context/test/mkiv/pdf-a3b.mkiv @@ -0,0 +1,47 @@ +% PDF/A-3b + +\enabletrackers[backend.xmp] + +\setupbackend + [format=PDF/A-3b, + intent=sRGB IEC61966-2.1, % use entry here; otherwise problems with predefined default profile + profile={sRGB.icc,default_gray.icc}, + level=0] + +\setupinteraction[state=start]% needed for attachment +%\setupattachment[method=hidden] + +\setupcolors[cmyk=no] +\definecolor[rgbblack][b=0.01] +\definecolor[transtest][r=1,g=1,t=.25] + +\placebookmarks[chapter][all][force=yes] + + + +\starttext + +\starttextcolor[rgbblack] + +\startchapter[title=aa,bookmark=bb,list=cc,marking=dd] + +Test it + +\stopchapter + +\stoptextcolor + +\hbox\bgroup + \blackrule[width=1cm,height=1cm,color=red] + \blackrule[width=1cm,height=1cm,color=green] + \blackrule[width=1cm,height=1cm,color=blue] + \blackrule[width=1cm,height=1cm,color=rgbblack] + \blackrule[width=1cm,height=1cm,color=transtest]\hskip-.5cm + \blackrule[width=1cm,height=1cm,color=transtest] +\egroup + + +% inclusion of any file type is allowed +\attachment[file=cow.pdf, type={application/pdf}] + +\stoptext diff --git a/tex/context/test/mkiv/pdf-a3u.mkiv b/tex/context/test/mkiv/pdf-a3u.mkiv new file mode 100644 index 000000000..098d027fd --- /dev/null +++ b/tex/context/test/mkiv/pdf-a3u.mkiv @@ -0,0 +1,47 @@ +% PDF/A-3u + +\enabletrackers[backend.xmp] + +\setupbackend + [format=PDF/A-3u, + intent=sRGB IEC61966-2.1, % use entry here; otherwise problems with predefined default profile + profile={sRGB.icc,default_gray.icc}, + level=0] + +\setupinteraction[state=start]% needed for attachment +%\setupattachment[method=hidden] + +\setupcolors[cmyk=no] +\definecolor[rgbblack][b=0.01] +\definecolor[transtest][r=1,g=1,t=.25] + +\placebookmarks[chapter][all][force=yes] + + + +\starttext + +\starttextcolor[rgbblack] + +\startchapter[title=aa,bookmark=bb,list=cc,marking=dd] + +Test it + +\stopchapter + +\stoptextcolor + +\hbox\bgroup + \blackrule[width=1cm,height=1cm,color=red] + \blackrule[width=1cm,height=1cm,color=green] + \blackrule[width=1cm,height=1cm,color=blue] + \blackrule[width=1cm,height=1cm,color=rgbblack] + \blackrule[width=1cm,height=1cm,color=transtest]\hskip-.5cm + \blackrule[width=1cm,height=1cm,color=transtest] +\egroup + + +% inclusion of any file type is allowed +\attachment[file=cow.pdf, type={application/pdf}] + +\stoptext diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 2b4755b3f..281eb84d7 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 : 12/06/19 19:45:18 +-- merge date : 12/12/19 00:57:44 do -- begin closure to overcome local limits and interference -- cgit v1.2.3