diff options
author | Hans Hagen <pragma@wxs.nl> | 2021-12-10 12:12:32 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2021-12-10 12:12:32 +0100 |
commit | fe714093ebb95e4a870282782e2124cff2e546e5 (patch) | |
tree | 3ffe691c3ed50e03ab62b52dc240c21caa3f4178 | |
parent | 9c5a6d1bc8ad88a74f8d5243ed057819ce6bec2d (diff) | |
download | context-fe714093ebb95e4a870282782e2124cff2e546e5.tar.gz |
2021-12-10 11:31:00
39 files changed, 954 insertions, 191 deletions
diff --git a/doc/context/scripts/mkiv/context.html b/doc/context/scripts/mkiv/context.html index 15fa7985c..567b9b165 100644 --- a/doc/context/scripts/mkiv/context.html +++ b/doc/context/scripts/mkiv/context.html @@ -115,6 +115,10 @@ <tr><th/><td/><td/></tr> <tr><th>--extra=name</th><td></td><td>process extra (mtx-context-... in distribution)</td></tr> <tr><th>--extras</th><td></td><td>show extras</td></tr> + <tr><th/><td/><td/></tr> + <tr><th>--ownerpassword</th><td></td><td></td></tr> + <tr><th>--userpassword</th><td></td><td></td></tr> + <tr><th>--permissions</th><td></td><td></td></tr> <tr><th colspan="3">special</th></tr> <tr><th/><td/><td/></tr> <tr><th>--pdftex</th><td></td><td>process file with texexec using pdftex</td></tr> diff --git a/doc/context/scripts/mkiv/context.man b/doc/context/scripts/mkiv/context.man index 93cd877be..7f6e97fda 100644 --- a/doc/context/scripts/mkiv/context.man +++ b/doc/context/scripts/mkiv/context.man @@ -188,6 +188,15 @@ process extra (mtx-context-... in distribution) .TP .B --extras show extras +.TP +.B --ownerpassword + +.TP +.B --userpassword + +.TP +.B --permissions + .SH OPTIONS: SPECIAL .TP .B --pdftex diff --git a/doc/context/scripts/mkiv/context.xml b/doc/context/scripts/mkiv/context.xml index cc13bf7df..c2e7c1c0b 100644 --- a/doc/context/scripts/mkiv/context.xml +++ b/doc/context/scripts/mkiv/context.xml @@ -223,6 +223,17 @@ <short>show extras</short> </flag> </subcategory> + <subcategory> + <flag name="ownerpassword"> + encrypt the (pdf) file using this master password + </flag> + <flag name="userpassword"> + use an additional password for opening the document + </flag> + <flag name="permissions"> + list of: print, modify, extract, add, fillin, assemble, quality + </flag> + </subcategory> </category> <category name="special"> <subcategory> diff --git a/doc/context/scripts/mkiv/mtx-context.html b/doc/context/scripts/mkiv/mtx-context.html index 15fa7985c..567b9b165 100644 --- a/doc/context/scripts/mkiv/mtx-context.html +++ b/doc/context/scripts/mkiv/mtx-context.html @@ -115,6 +115,10 @@ <tr><th/><td/><td/></tr> <tr><th>--extra=name</th><td></td><td>process extra (mtx-context-... in distribution)</td></tr> <tr><th>--extras</th><td></td><td>show extras</td></tr> + <tr><th/><td/><td/></tr> + <tr><th>--ownerpassword</th><td></td><td></td></tr> + <tr><th>--userpassword</th><td></td><td></td></tr> + <tr><th>--permissions</th><td></td><td></td></tr> <tr><th colspan="3">special</th></tr> <tr><th/><td/><td/></tr> <tr><th>--pdftex</th><td></td><td>process file with texexec using pdftex</td></tr> diff --git a/doc/context/scripts/mkiv/mtx-context.man b/doc/context/scripts/mkiv/mtx-context.man index 93cd877be..7f6e97fda 100644 --- a/doc/context/scripts/mkiv/mtx-context.man +++ b/doc/context/scripts/mkiv/mtx-context.man @@ -188,6 +188,15 @@ process extra (mtx-context-... in distribution) .TP .B --extras show extras +.TP +.B --ownerpassword + +.TP +.B --userpassword + +.TP +.B --permissions + .SH OPTIONS: SPECIAL .TP .B --pdftex diff --git a/doc/context/scripts/mkiv/mtx-context.xml b/doc/context/scripts/mkiv/mtx-context.xml index cc13bf7df..c2e7c1c0b 100644 --- a/doc/context/scripts/mkiv/mtx-context.xml +++ b/doc/context/scripts/mkiv/mtx-context.xml @@ -223,6 +223,17 @@ <short>show extras</short> </flag> </subcategory> + <subcategory> + <flag name="ownerpassword"> + encrypt the (pdf) file using this master password + </flag> + <flag name="userpassword"> + use an additional password for opening the document + </flag> + <flag name="permissions"> + list of: print, modify, extract, add, fillin, assemble, quality + </flag> + </subcategory> </category> <category name="special"> <subcategory> diff --git a/doc/context/scripts/mkiv/mtx-pdf.html b/doc/context/scripts/mkiv/mtx-pdf.html new file mode 100644 index 000000000..2932b942c --- /dev/null +++ b/doc/context/scripts/mkiv/mtx-pdf.html @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<!-- compare with lmx framework variant --> + +<!-- + filename : context-base.xml + comment : companion to mtx-server-ctx-startup.tex + author : Hans Hagen, PRAGMA-ADE, Hasselt NL + copyright: PRAGMA ADE / ConTeXt Development Team + license : see context related readme files +--> + +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> + <head> + <title>ConTeXt PDF Helpers 0.10</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <style type="text/css"> + body { color: #FFFFFF; background-color: #808080; font-family: optima, verdana, futura, "lucida sans", arial, geneva, helvetica, sans; font-size: 12px; line-height: 18px; } a:link, a:active, a:visited { color: #FFFFFF; } a.dir-view:link, a.dir-view:active, a.dir-view:visited { color: #FFFFFF; text-decoration: underline; } .valid { color: #00FF00; } .invalid { color: #FF0000; } .invisible { visibility: hidden; } button, .commonlink, .smallbutton { font-weight: bold; font-size: 12px; text-decoration: none; color: #000000; border-color: #7F7F7F; border-style: solid; border-width: .125ex; background-color: #FFFFFF; padding: .5ex; } .smallbutton { width: 1em; } a.commonlink:link, a.commonlink:active, a.commonlink:visited, a.smalllink:link, a.smalllink:active, a.smalllink:visited { font-weight: bold; font-size: 12px; text-decoration: none; color: #000000; } h1, .title { font-style: normal; font-weight: normal; font-size: 18px; line-height: 18px; margin-bottom: 20px; } h2, .subtitle { font-style: normal; font-weight: normal; font-size: 12px; margin-top: 18px; margin-bottom: 18px; } table { line-height: 18px; font-size: 12px; margin: 0; } th { font-weight: bold; text-align: left; padding-bottom: 6px; } .tc { font-weight: bold; text-align: left; } p, li { max-width: 60em; } .empty-line { margin-top: 4px; } .more-room { margin-right: 1.5em; } .much-more-room { margin-right: 3em; } #main { position: absolute; left: 10%; top: 10%; right: 10%; bottom: 10%; z-index: 2; width: 80%; height: 80%; padding: 0%; margin: 0%; overflow: auto; border-style: none; border-width: 0; background-color: #3F3F3F; } #main-settings { margin: 12px; x_max-width: 60em; line-height: 18px; font-size: 12px; } #left { position: absolute; top : 10%; left: 0%; bottom: 0%; right: 90%; z-index: 1; width: 10%; height: 90%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #4F6F6F; } #right { position: absolute; top : 0%; left: 90%; bottom: 10%; right: 0%; z-index: 1; width: 10%; height: 90%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #4F6F6F; _margin-left: -15px; } #bottom { position: absolute; left: 10%; right: 0%; top: 90%; bottom: 0%; z-index: 1; width: 90%; height: 10%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #6F6F8F; } #top { position: absolute; left: 0%; right: 10%; top: 0%; bottom: 90%; z-index: 1; width: 90%; height: 10%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #6F6F8F; } #top-one { position: absolute; bottom: 50%; width: 100%; buggedheight: 100%; } #top-two { position: relative; margin-bottom: -9px; margin-left: 12px; margin-right: 12px; line-height: 18px; text-align: right; vertical-align: middle; } #bottom-one { position: absolute; bottom: 50%; width: 100%; buggedheight: 100%; } #bottom-two { position: relative; margin-bottom: -9px; margin-left: 12px; margin-right: 12px; line-height: 18px; text-align: left; vertical-align: middle; } #left-one { position: absolute; width: 100%; buggedheight: 100%; } #left-two { position: relative; margin-top: 12px; line-height: 18px; text-align: center; vertical-align: top; } #right-one { display: table; height: 100%; width: 100%; } #right-two { display: table-row; height: 100%; width: 100%; } #right-three { display: table-cell; width: 100%; vertical-align: bottom; _position: absolute; _top: 100%; } #right-four { text-align: center; margin-bottom: 2ex; _position: relative; _top: -100%; } #more-top { position: absolute; top: 0%; left: 90%; bottom: 90%; right: 0%; z-index: 3; width: 10%; height: 10%; padding: 0%; margin: 0%; border-style: none; border-width: 0; } #more-top-settings { text-align: center; } #more-right-settings { margin-right: 12px; margin-left: 12px; line-height: 18px; font-size: 10px; text-align: center; } #right-safari { _display: table; width: 100%; height: 100%; } + </style> + <style type="text/css"> + </style> + </head> + <body> + <div id="top"> <div id="top-one"> + <div id="top-two">ConTeXt PDF Helpers 0.10 </div> + </div> + </div> + <div id="bottom"> <div id="bottom-one"> + <div id="bottom-two">wiki: http://contextgarden.net | mail: ntg-context@ntg.nl | website: http://www.pragma-ade.nl</div> + </div> + </div> + <div id="left"></div> + <div id="right"></div> + <div id="main"> + <div id='main-settings'> + <h1>Command line options</h1> +<table> + <tr><th style="width: 10em">flag</th><th style="width: 8em">value</th><th>description</th></tr> + <tr><th/><td/><td/></tr> + <tr><th>--info</th><td></td><td>show some info about the given file</td></tr> + <tr><th>--metadata</th><td></td><td>show metadata xml blob</td></tr> + <tr><th>--pretty</th><td></td><td>replace newlines in metadata</td></tr> + <tr><th>--fonts</th><td></td><td>show used fonts (--detail)</td></tr> + <tr><th>--object</th><td></td><td>show object"/></td></tr> + <tr><th/><td/><td/></tr> + </table> +<br/> + </div> + </div> + </body> +</html> diff --git a/doc/context/scripts/mkiv/mtx-pdf.man b/doc/context/scripts/mkiv/mtx-pdf.man new file mode 100644 index 000000000..ea74f2aa1 --- /dev/null +++ b/doc/context/scripts/mkiv/mtx-pdf.man @@ -0,0 +1,39 @@ +.TH "mtx-pdf" "1" "01-01-2021" "version 0.10" "ConTeXt PDF Helpers" +.SH NAME + mtx-pdf - ConTeXt PDF Helpers +.SH SYNOPSIS +.B mtxrun --script pdf [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B ConTeXt PDF Helpers +.SH OPTIONS +.TP +.B --info +show some info about the given file +.TP +.B --metadata +show metadata xml blob +.TP +.B --pretty +replace newlines in metadata +.TP +.B --fonts +show used fonts (--detail) +.TP +.B --object +show object"/> +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/doc/context/scripts/mkiv/mtx-pdf.xml b/doc/context/scripts/mkiv/mtx-pdf.xml new file mode 100644 index 000000000..08b04d85e --- /dev/null +++ b/doc/context/scripts/mkiv/mtx-pdf.xml @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<application> + <metadata> + <entry name="name">mtx-pdf</entry> + <entry name="detail">ConTeXt PDF Helpers</entry> + <entry name="version">0.10</entry> + </metadata> + <flags> + <category name="basic"> + <subcategory> + <flag name="info"><short>show some info about the given file</short></flag> + <flag name="metadata"><short>show metadata xml blob</short></flag> + <flag name="pretty"><short>replace newlines in metadata</short></flag> + <flag name="fonts"><short>show used fonts (<ref name="detail)"/></short></flag> + <flag name="object"><short>show object"/></short></flag> + </subcategory> + <subcategory> + <example><command>mtxrun --script pdf --info foo.pdf</command></example> + <example><command>mtxrun --script pdf --metadata foo.pdf</command></example> + <example><command>mtxrun --script pdf --metadata --pretty foo.pdf</command></example> + <example><command>mtxrun --script pdf --stream=4 foo.pdf</command></example> + </subcategory> + </category> + </flags> +</application> diff --git a/doc/context/sources/general/manuals/luametatex/luametatex.tex b/doc/context/sources/general/manuals/luametatex/luametatex.tex index 9958db10a..69bfc9509 100644 --- a/doc/context/sources/general/manuals/luametatex/luametatex.tex +++ b/doc/context/sources/general/manuals/luametatex/luametatex.tex @@ -102,6 +102,16 @@ \enableexperiments[fonts.compact] % \enabledirectives[fonts.injections.method=advance] % tricky ... not all xoffsets are advance robust +% This is only for testing, use the command line (or banner line) instead. +% +% \startluacode +% lpdf.setencryption { +% ownerpassword = "password", +% userpassword = "", +% permissions = "print,quality" +% } +% \stopluacode + \pushoverloadmode \unprotect % test code \protect \popoverloadmode diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index 5a67f4f2a..125750c26 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -792,6 +792,10 @@ function scripts.context.run(ctxdata,filename) local trackers = combine("trackers") local experiments = combine("experiments") -- + local ownerpassword = environment.ownerpassword or analysis.ownerpassword + local userpassword = environment.userpassword or analysis.userpassword + local permissions = environment.permissions or analysis.permissions + -- if formatfile and scriptfile then local suffix = validstring(getargument("suffix")) local resultname = validstring(getargument("result")) @@ -858,6 +862,10 @@ function scripts.context.run(ctxdata,filename) export = a_export and true or nil, nocompression = a_nocompression and true or nil, texmfbinpath = os.selfdir, + -- + ownerpassword = ownerpassword, + userpassword = userpassword, + permissions = permissions, } -- for k, v in next, environment.arguments do diff --git a/scripts/context/lua/mtx-context.xml b/scripts/context/lua/mtx-context.xml index cc13bf7df..c2e7c1c0b 100644 --- a/scripts/context/lua/mtx-context.xml +++ b/scripts/context/lua/mtx-context.xml @@ -223,6 +223,17 @@ <short>show extras</short> </flag> </subcategory> + <subcategory> + <flag name="ownerpassword"> + encrypt the (pdf) file using this master password + </flag> + <flag name="userpassword"> + use an additional password for opening the document + </flag> + <flag name="permissions"> + list of: print, modify, extract, add, fillin, assemble, quality + </flag> + </subcategory> </category> <category name="special"> <subcategory> diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index a75c6488c..1a1bc2734 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -25393,7 +25393,7 @@ do -- create closure to overcome 200 locals limit package.loaded["libs-ini"] = package.loaded["libs-ini"] or true --- original size: 6525, stripped down to: 4064 +-- original size: 6524, stripped down to: 4064 if not modules then modules={} end modules ['libs-ini']={ version=1.001, @@ -25948,8 +25948,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1029804 --- stripped bytes : 405639 +-- original bytes : 1029803 +-- stripped bytes : 405638 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index a75c6488c..1a1bc2734 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -25393,7 +25393,7 @@ do -- create closure to overcome 200 locals limit package.loaded["libs-ini"] = package.loaded["libs-ini"] or true --- original size: 6525, stripped down to: 4064 +-- original size: 6524, stripped down to: 4064 if not modules then modules={} end modules ['libs-ini']={ version=1.001, @@ -25948,8 +25948,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1029804 --- stripped bytes : 405639 +-- original bytes : 1029803 +-- stripped bytes : 405638 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index a75c6488c..1a1bc2734 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -25393,7 +25393,7 @@ do -- create closure to overcome 200 locals limit package.loaded["libs-ini"] = package.loaded["libs-ini"] or true --- original size: 6525, stripped down to: 4064 +-- original size: 6524, stripped down to: 4064 if not modules then modules={} end modules ['libs-ini']={ version=1.001, @@ -25948,8 +25948,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1029804 --- stripped bytes : 405639 +-- original bytes : 1029803 +-- stripped bytes : 405638 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index a75c6488c..1a1bc2734 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -25393,7 +25393,7 @@ do -- create closure to overcome 200 locals limit package.loaded["libs-ini"] = package.loaded["libs-ini"] or true --- original size: 6525, stripped down to: 4064 +-- original size: 6524, stripped down to: 4064 if not modules then modules={} end modules ['libs-ini']={ version=1.001, @@ -25948,8 +25948,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1029804 --- stripped bytes : 405639 +-- original bytes : 1029803 +-- stripped bytes : 405638 -- end library merge diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 876eacdfc..801541637 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{2021.12.03 15:17} +\newcontextversion{2021.12.10 11:29} %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 48af7f8e3..2aa9cee0d 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{2021.12.03 15:17} +\edef\contextversion{2021.12.10 11:29} %D For those who want to use this: diff --git a/tex/context/base/mkii/mult-de.mkii b/tex/context/base/mkii/mult-de.mkii index 60671069c..43a265056 100644 --- a/tex/context/base/mkii/mult-de.mkii +++ b/tex/context/base/mkii/mult-de.mkii @@ -79,6 +79,7 @@ \setinterfacevariable{anchor}{anchor} \setinterfacevariable{and}{und} \setinterfacevariable{answerarea}{answerarea} +\setinterfacevariable{append}{append} \setinterfacevariable{appendices}{anhaenge} \setinterfacevariable{appendix}{anhang} \setinterfacevariable{april}{april} @@ -150,6 +151,7 @@ \setinterfacevariable{commands}{befehle} \setinterfacevariable{comment}{kommentar} \setinterfacevariable{component}{komponente} +\setinterfacevariable{compress}{compress} \setinterfacevariable{compressseparator}{compressseparator} \setinterfacevariable{compressstopper}{compressstopper} \setinterfacevariable{concept}{konzept} @@ -186,6 +188,7 @@ \setinterfacevariable{enumeration}{nummerierung} \setinterfacevariable{environment}{umgebung} \setinterfacevariable{even}{gerade} +\setinterfacevariable{explicit}{explicit} \setinterfacevariable{export}{export} \setinterfacevariable{external}{extern} \setinterfacevariable{extremestretch}{extremestretch} @@ -207,6 +210,8 @@ \setinterfacevariable{fixed}{fest} \setinterfacevariable{flexible}{flexibel} \setinterfacevariable{float}{gleitobjekt} +\setinterfacevariable{flushbackward}{flushbackward} +\setinterfacevariable{flushforward}{flushforward} \setinterfacevariable{flushinner}{flushinner} \setinterfacevariable{flushleft}{flushleft} \setinterfacevariable{flushouter}{flushouter} @@ -310,6 +315,7 @@ \setinterfacevariable{lefthanging}{lefthanging} \setinterfacevariable{leftmargin}{linkerrand} \setinterfacevariable{leftpage}{linkerseite} +\setinterfacevariable{lefttext}{linkertext} \setinterfacevariable{lefttoright}{lefttoright} \setinterfacevariable{legend}{legende} \setinterfacevariable{less}{less} @@ -434,6 +440,7 @@ \setinterfacevariable{postscript}{postscript} \setinterfacevariable{precedingpage}{precedingpage} \setinterfacevariable{preference}{einstellung} +\setinterfacevariable{prepend}{prepend} \setinterfacevariable{preview}{vorschau} \setinterfacevariable{previous}{vorig} \setinterfacevariable{previousevenpage}{vorigegeradeseite} @@ -470,6 +477,7 @@ \setinterfacevariable{righthanging}{righthanging} \setinterfacevariable{rightmargin}{rechterrand} \setinterfacevariable{rightpage}{rechterseite} +\setinterfacevariable{righttext}{rechtertext} \setinterfacevariable{righttoleft}{righttoleft} \setinterfacevariable{roman}{antiqua} \setinterfacevariable{romannumerals}{roemischezahlen} @@ -1236,6 +1244,7 @@ \setinterfaceconstant{splitoffset}{splitoffset} \setinterfaceconstant{spot}{spot} \setinterfaceconstant{stack}{stack} +\setinterfaceconstant{stacking}{stacking} \setinterfaceconstant{stackname}{stackname} \setinterfaceconstant{start}{start} \setinterfaceconstant{starter}{starter} @@ -1273,6 +1282,7 @@ \setinterfaceconstant{tab}{tab} \setinterfaceconstant{text}{text} \setinterfaceconstant{textalign}{textalign} +\setinterfaceconstant{textalternative}{textalternative} \setinterfaceconstant{textcolor}{textfarbe} \setinterfaceconstant{textcommand}{textbefehl} \setinterfaceconstant{textdistance}{textdistance} @@ -1364,6 +1374,8 @@ \setinterfaceelement{load}{laden} \setinterfaceelement{local}{lokal} \setinterfaceelement{makeup}{umbruch} +\setinterfaceelement{namednotation}{namednotation} +\setinterfaceelement{namedtyping}{namedtyping} \setinterfaceelement{next}{folgende} \setinterfaceelement{place}{platziere} \setinterfaceelement{previous}{vorige} @@ -1532,6 +1544,7 @@ \setinterfacecommand{definereferencelist}{definierereferenzliste} \setinterfacecommand{defineregister}{definiereregister} \setinterfacecommand{definerule}{definerule} +\setinterfacecommand{definesavebuffer}{startsavebuffer} \setinterfacecommand{definesection}{definiereabschnitt} \setinterfacecommand{definesectionblock}{definiereabschnittsblock} \setinterfacecommand{definesorting}{definieresortieren} @@ -1708,6 +1721,9 @@ \setinterfacecommand{moveformula}{moveformula} \setinterfacecommand{moveongrid}{amgitterneuausrichten} \setinterfacecommand{movesidefloat}{movesidefloat} +\setinterfacecommand{namedconstruction}{namedconstruction} +\setinterfacecommand{nameddescription}{nameddescription} +\setinterfacecommand{namedenumeration}{namedenumeration} \setinterfacecommand{navigating}{navigating} \setinterfacecommand{nodimension}{keindimension} \setinterfacecommand{noheaderandfooterlines}{keinekopfundfusszeilen} @@ -2079,6 +2095,13 @@ \setinterfacecommand{startmakeup}{startumbruch} \setinterfacecommand{startmarginblock}{startmarginalblock} \setinterfacecommand{startmarginrule}{startmarginallinie} +\setinterfacecommand{startnamedconstruction}{startnamedconstruction} +\setinterfacecommand{startnameddescription}{startnameddescription} +\setinterfacecommand{startnamedenumeration}{startnamedenumeration} +\setinterfacecommand{startnamedmatrix}{startnamedmatrix} +\setinterfacecommand{startnamedsection}{startnamedsection} +\setinterfacecommand{startnamedsubformulas}{startnamedsubformulas} +\setinterfacecommand{startnamedtyping}{startnamedtyping} \setinterfacecommand{startnarrower}{startenger} \setinterfacecommand{startopposite}{startgegenueber} \setinterfacecommand{startoverlay}{startoverlay} @@ -2122,6 +2145,13 @@ \setinterfacecommand{stopmakeup}{stopumbruch} \setinterfacecommand{stopmarginblock}{stopmarginalblock} \setinterfacecommand{stopmarginrule}{stopmarginallinie} +\setinterfacecommand{stopnamedconstruction}{stopnamedconstruction} +\setinterfacecommand{stopnameddescription}{stopnameddescription} +\setinterfacecommand{stopnamedenumeration}{stopnamedenumeration} +\setinterfacecommand{stopnamedmatrix}{stopnamedmatrix} +\setinterfacecommand{stopnamedsection}{stopnamedsection} +\setinterfacecommand{stopnamedsubformulas}{stopnamedsubformulas} +\setinterfacecommand{stopnamedtyping}{stopnamedtyping} \setinterfacecommand{stopnarrower}{stopenger} \setinterfacecommand{stopopposite}{stopgegenueber} \setinterfacecommand{stopoverlay}{stopoverlay} diff --git a/tex/context/base/mkiv/char-def.lua b/tex/context/base/mkiv/char-def.lua index c8dac09c5..5ed2f0198 100644 --- a/tex/context/base/mkiv/char-def.lua +++ b/tex/context/base/mkiv/char-def.lua @@ -2449,7 +2449,7 @@ characters.data={ linebreak="al", shcode={ 0x73, 0x73 }, synonyms={ "eszett" }, - uccode={ 0x73, 0x73 }, + uccode={ 0x53, 0x53 }, unicodeslot=0xDF, }, { diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 92172d354..1b143ffb7 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{2021.12.03 15:17} +\newcontextversion{2021.12.10 11:29} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index fa300cafd..7c32ed6d8 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -49,7 +49,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2021.12.03 15:17} +\edef\contextversion{2021.12.10 11:29} %D Kind of special: diff --git a/tex/context/base/mkiv/libs-ini.lua b/tex/context/base/mkiv/libs-ini.lua index d3cfe634f..cf696f4e9 100644 --- a/tex/context/base/mkiv/libs-ini.lua +++ b/tex/context/base/mkiv/libs-ini.lua @@ -17,7 +17,6 @@ local find = string.find -- here we implement the resolver - local nameonly = file.nameonly local joinfile = file.join local addsuffix = file.addsuffix diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 41707d50a..a7f20d3e8 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 40471b66f..43b1fbf13 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkxl/back-imp-pdf.mkxl b/tex/context/base/mkxl/back-imp-pdf.mkxl index a9cffc6cb..f2afe61da 100644 --- a/tex/context/base/mkxl/back-imp-pdf.mkxl +++ b/tex/context/base/mkxl/back-imp-pdf.mkxl @@ -91,7 +91,7 @@ %D as one can best stick to the defaults that also adapt to specific standards. \untraced\permanent\protected\def\nopdfcompression {\clf_setpdfcompression\zerocount\zerocount} -\untraced\permanent\protected\def\onlypdfobjectcompression{\clf_setpdfcompression\zerocount\plusthree} +\untraced\permanent\protected\def\onlypdfobjectcompression{\clf_setpdfcompression\plusthree\zerocount} \untraced\permanent\protected\def\maximumpdfcompression {\clf_setpdfcompression\plusnine \plusnine } \untraced\permanent\protected\def\normalpdfcompression {\clf_setpdfcompression\plusthree\plusthree} diff --git a/tex/context/base/mkxl/back-imp-pdp.lmt b/tex/context/base/mkxl/back-imp-pdp.lmt index c7acc82a8..4c5d61b22 100644 --- a/tex/context/base/mkxl/back-imp-pdp.lmt +++ b/tex/context/base/mkxl/back-imp-pdp.lmt @@ -33,7 +33,7 @@ local cardinal_value = values.cardinal local immediate_code = tex.flagcodes.immediate -local trace = false trackers.register("backend", function(v) trace = v end) +local trace = false trackers.register("backend.primitives", function(v) trace = v end) local report = logs.reporter("backend") local nodepool = nodes.pool @@ -213,7 +213,7 @@ local extensions = { } local function pdf_extension() - local w = scanword() + local w = scanword(false) if w then local e = extensions[w] if e then @@ -234,11 +234,11 @@ local feedbacks = { } local function pdf_feedback() - local w = scanword() + local w = scanword(false) if w then local f = feedbacks[w] if f then - f() + return f() else report("\\pdffeedback: unsupported %a",w) end @@ -259,7 +259,7 @@ local variables = { } local function pdf_variable() - local w = scanword() + local w = scanword(false) if w then local f = variables[w] if f then @@ -274,8 +274,8 @@ end -- kept (also because tikz needs including the pdftex primitives): -implement { name = "pdfextension", actions = pdf_extension, public = true, untraced = true, protected = true } -implement { name = "pdffeedback", actions = pdf_feedback, public = true, untraced = true } -- expandable / todo : value +implement { name = "pdfextension", actions = pdf_extension, public = true, untraced = true } -- , protected = true } +implement { name = "pdffeedback", actions = pdf_feedback, public = true, usage = "value", untraced = true } -- expandable / todo : value implement { name = "pdfvariable", actions = pdf_variable, public = true, untraced = true } -- expandable / todo : value implement { name = "pdfliteral", actions = pdf_literal, public = true, untraced = true, protected = true } implement { name = "pdfobj", actions = pdf_obj, public = true, usage = "value", protected = true } diff --git a/tex/context/base/mkxl/back-ini.lmt b/tex/context/base/mkxl/back-ini.lmt index fc91fb31c..110a1b3dc 100644 --- a/tex/context/base/mkxl/back-ini.lmt +++ b/tex/context/base/mkxl/back-ini.lmt @@ -139,3 +139,9 @@ backends.included = included function backends.getcallbackstate() return { count = status.late_callbacks or 0 } end + +-- + +function backends.setencryption(specification) + codeinjections.setencryption(specification) +end diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index 95430abf6..bd8833c4e 100644 --- a/tex/context/base/mkxl/cont-new.mkxl +++ b/tex/context/base/mkxl/cont-new.mkxl @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2021.12.03 15:17} +\newcontextversion{2021.12.10 11:29} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl index 914f4bfd9..81310b47a 100644 --- a/tex/context/base/mkxl/context.mkxl +++ b/tex/context/base/mkxl/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \immutable\edef\contextformat {\jobname} -\immutable\edef\contextversion{2021.12.03 15:17} +\immutable\edef\contextversion{2021.12.10 11:29} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error @@ -398,7 +398,7 @@ \loadmkxlfile{tabl-tab} % thrd-tab stripped and merged \loadmkxlfile{tabl-tbl} -\loadmkxlfile{tabl-ntb} +\doiffileelse{tabl-ntb-new.mkxl}{\loadmkxlfile{tabl-ntb-new}}{\loadmkxlfile{tabl-ntb}} \loadmkxlfile{tabl-nte} \loadmkxlfile{tabl-ltb} \loadmkxlfile{tabl-frm} diff --git a/tex/context/base/mkxl/lpdf-ini.lmt b/tex/context/base/mkxl/lpdf-ini.lmt index 6bee9e17b..9357ebe75 100644 --- a/tex/context/base/mkxl/lpdf-ini.lmt +++ b/tex/context/base/mkxl/lpdf-ini.lmt @@ -57,7 +57,7 @@ if not modules then modules = { } end modules ['lpdf-ini'] = { local setmetatable, getmetatable, type, next, tostring, tonumber, rawset = setmetatable, getmetatable, type, next, tostring, tonumber, rawset local concat = table.concat -local char, byte, format, sub = string.char, string.byte, string.format, string.sub +local char, byte, format, sub, tohex = string.char, string.byte, string.format, string.sub, string.tohex local utfchar, utfbyte, utfvalues = utf.char, utf.byte, utf.values local sind, cosd, max, min = math.sind, math.cosd, math.max, math.min local sort, sortedhash = table.sort, table.sortedhash @@ -71,7 +71,6 @@ local report_finalizing = logs.reporter("backend","finalizing") local report_blocked = logs.reporter("backend","blocked") local implement = interfaces and interfaces.implement - local context = context -- In ConTeXt MkIV we use utf8 exclusively so all strings get mapped onto a hex @@ -81,7 +80,7 @@ local context = context pdf = type(pdf) == "table" and pdf or { } local factor = number.dimenfactors.bp -local pdfbackend = backends.registered.pdf +local pdfbackend = backends and backends.registered.pdf or { } local codeinjections = pdfbackend.codeinjections local nodeinjections = pdfbackend.nodeinjections @@ -224,6 +223,8 @@ do end end + -- we could make a helper for this + local more = 0 local pattern = C(4) / function(s) -- needs checking ! @@ -1167,7 +1168,7 @@ end -- return formatters["BT /Span << /ActualText (CONTEXT) >> BDC [<feff>] TJ % t EMC ET"](code) -do +if implement then local f_actual_text_p = formatters["BT /Span << /ActualText <feff%s> >> BDC %s EMC ET"] local f_actual_text_b = formatters["BT /Span << /ActualText <feff%s> >> BDC"] @@ -1232,17 +1233,21 @@ end -- Bah, tikz uses \immediate for some reason which is probably a bug, so the usage -- will deal with that. However, we will not provide the serialization. -implement { name = "pdfbackendcurrentresources", public = true, untraced = true, actions = { lpdf.collectedresources, context } } -implement { name = "pdfbackendsetcatalog", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtocatalog } -implement { name = "pdfbackendsetinfo", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b,c) lpdf.addtoinfo(a,b,c) end } -- gets adapted -implement { name = "pdfbackendsetname", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtonames } -implement { name = "pdfbackendsetpageattribute", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtopageattributes } -implement { name = "pdfbackendsetpagesattribute", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtopagesattributes } -implement { name = "pdfbackendsetpageresource", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtopageresources } -implement { name = "pdfbackendsetextgstate", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b) lpdf.adddocumentextgstate (a,pdfverbose(b)) end } -implement { name = "pdfbackendsetcolorspace", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b) lpdf.adddocumentcolorspace(a,pdfverbose(b)) end } -implement { name = "pdfbackendsetpattern", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b) lpdf.adddocumentpattern (a,pdfverbose(b)) end } -implement { name = "pdfbackendsetshade", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b) lpdf.adddocumentshade (a,pdfverbose(b)) end } +if implement then + + implement { name = "pdfbackendcurrentresources", public = true, untraced = true, actions = { lpdf.collectedresources, context } } + implement { name = "pdfbackendsetcatalog", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtocatalog } + implement { name = "pdfbackendsetinfo", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b,c) lpdf.addtoinfo(a,b,c) end } -- gets adapted + implement { name = "pdfbackendsetname", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtonames } + implement { name = "pdfbackendsetpageattribute", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtopageattributes } + implement { name = "pdfbackendsetpagesattribute", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtopagesattributes } + implement { name = "pdfbackendsetpageresource", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtopageresources } + implement { name = "pdfbackendsetextgstate", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b) lpdf.adddocumentextgstate (a,pdfverbose(b)) end } + implement { name = "pdfbackendsetcolorspace", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b) lpdf.adddocumentcolorspace(a,pdfverbose(b)) end } + implement { name = "pdfbackendsetpattern", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b) lpdf.adddocumentpattern (a,pdfverbose(b)) end } + implement { name = "pdfbackendsetshade", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b) lpdf.adddocumentshade (a,pdfverbose(b)) end } + +end -- more helpers: copy from lepd to lpdf diff --git a/tex/context/base/mkxl/lpdf-lmt.lmt b/tex/context/base/mkxl/lpdf-lmt.lmt index 61eac9517..321dea935 100644 --- a/tex/context/base/mkxl/lpdf-lmt.lmt +++ b/tex/context/base/mkxl/lpdf-lmt.lmt @@ -65,33 +65,34 @@ local pdfimmediateobject -- forward reference local pdfincludeimage -- forward reference -local pdf_pages = pdfconstant("Pages") -local pdf_page = pdfconstant("Page") -local pdf_xobject = pdfconstant("XObject") -local pdf_form = pdfconstant("Form") -local pdf_pattern = pdfconstant("Pattern") - -local fonthashes = fonts.hashes -local characters = fonthashes.characters -local descriptions = fonthashes.descriptions -local parameters = fonthashes.parameters -local properties = fonthashes.properties - -local report = logs.reporter("backend") -local report_objects = logs.reporter("backend","objects") -local report_fonts = logs.reporter("backend","fonts") - -local trace_objects = false trackers.register("backend.objects", function(v) trace_objects = v end) -local trace_details = false trackers.register("backend.details", function(v) trace_details = v end) -local trace_indices = false trackers.register("backend.fonts.details", function(v) trace_indices = v end) +local pdf_pages = pdfconstant("Pages") +local pdf_page = pdfconstant("Page") +local pdf_xobject = pdfconstant("XObject") +local pdf_form = pdfconstant("Form") +local pdf_pattern = pdfconstant("Pattern") + +local fonthashes = fonts.hashes +local characters = fonthashes.characters +local descriptions = fonthashes.descriptions +local parameters = fonthashes.parameters +local properties = fonthashes.properties + +local report = logs.reporter("backend") +local report_objects = logs.reporter("backend","objects") +local report_fonts = logs.reporter("backend","fonts") +local report_encryption = logs.reporter("backend","encryption") + +local trace_objects = false trackers.register("backend.objects", function(v) trace_objects = v end) +local trace_details = false trackers.register("backend.details", function(v) trace_details = v end) +local trace_indices = false trackers.register("backend.fonts.details", function(v) trace_indices = v end) -- These two tables used a font id as index and will be metatabled in lpdf-emb.lmt: -local usedfontnames = { } -local usedfontobjects = { } +local usedfontnames = { } +local usedfontobjects = { } -lpdf.usedfontnames = usedfontnames -lpdf.usedfontobjects = usedfontobjects +lpdf.usedfontnames = usedfontnames +lpdf.usedfontobjects = usedfontobjects -- experiment: @@ -116,7 +117,9 @@ local flushers = { } -- used variables -local pdf_h, pdf_v +local pdf_h = 0 +local pdf_v = 0 + local need_tm, need_tf, need_font, cur_tmrx, cur_factor local need_width, need_mode, done_width, done_mode local mode @@ -502,38 +505,6 @@ do return v end) - -- we need to use descriptions ... otherwise we get wrong dimensions when we use - -- characters[n].xoffset or virtual stuff - - -- local descriptionwidths = setmetatableindex(function(t,font) - -- local d = descriptions[font] - -- local c = characters[font] - -- local f = parameters[font].hfactor or parameters[font].factor - -- local v = setmetatableindex(function(t,char) - -- local w - -- local e = d and d[char] - -- if e then - -- w = e.width - -- if w then - -- w = w * f - -- end - -- end - -- if not w then - -- e = c and c[char] - -- if e then - -- w = e.width or 0 - -- end - -- end - -- if not w then - -- w = 0 - -- end - -- t[char] = w - -- return w - -- end) - -- t[font] = v - -- return v - -- end) - -- it's about time to get rid of the pdftex based model but i'll wait with that till after -- the first release so that we have some test period ... when we go compact even less @@ -1718,13 +1689,10 @@ local wrapupdocument, registerpage do pdfflushobject(page.objnum,object) end lpdf.addtocatalog("Pages",pdfreference(parent)) - end end -pdf_h, pdf_v = 0, 0 - local function initialize(driver,details) reset_variables(details) reset_buffer() @@ -1735,7 +1703,309 @@ end -- todo: more clever resource management: a bit tricky as we can inject -- stuff in the page stream -local compact = false +local compact = false +local encryptstream = false +local encryptobject = false +local encdict = nil +local majorversion = 1 +local minorversion = 7 + +-- Encryption + +-- This stuff is poorly documented so it took a while to figure out a way that made +-- loading in a few programe working. Of course one you see the solution one can +-- claim that it's easy and trivial. In the end we could even make acrobat accepting +-- the file: it doesn't like the catalog to be in an object stream which to me +-- smells like a bug. + +do + + -- move up (some already) or better: lpdf-aes.lmt or so + + local byte, sub, bytes, tohex, tobytes = string.byte, string.sub, string.bytes, string.tohex, string.tobytes + local P, S, V, Cs, lpegmatch, patterns = lpeg.P, lpeg.S, lpeg.V, lpeg.Cs, lpeg.match, lpeg.patterns + + local digest256 = sha2.digest256 + local digest384 = sha2.digest384 + local digest512 = sha2.digest512 + + local aesencode = aes.encode + local aesdecode = aes.decode + local aesrandom = aes.random + + -- random and padding functions are gone here + + local function validpassword(str) + return #str > 127 and sub(str,1,127) or str + end + + local encryptionkey = false + local objectparser = false + + do + + local function ps_encrypt(str) + -- string is already unescaped + str = aesencode(str,encryptionkey,true,true,true) + return "<" .. tohex(str) .. ">" + end + + local function hex_encrypt(str) + -- string needs to be decoded + str = tobytes(str) + str = aesencode(str,encryptionkey,true,true,true) + return "<" .. tohex(str) .. ">" + end + + local whitespace = S("\000\009\010\012\013\032")^1 + local anything = patterns.anything + local space = patterns.space + local spacing = whitespace^0 + local newline = patterns.eol + local cardinal = patterns.cardinal + + local p_psstring = ( + P("(") + * Cs(P { ( P("\\")/"" * anything + P("(") * V(1) * P(")") + (1 - P(")")) )^0 }) + * P(")") + ) / ps_encrypt + + local p_hexstring = ( + P("<") + * Cs((1-P(">"))^1) + * P(">") + ) / hex_encrypt + + local p_comment = P("%") * (1-newline)^1 * newline^1 + local p_name = P("/") * (1 - whitespace - S("<>/[]()"))^1 + local p_number = patterns.number + local p_boolean = P("true") + P("false") + local p_null = P("null") + local p_reference = cardinal * spacing * cardinal * spacing * P("R") + + local p_other = p_name + p_reference + p_psstring + p_hexstring + p_number + + p_boolean + p_null + p_comment + + local p_dictionary = { "dictionary", + dictionary = ( + P("<<") + * (spacing * p_name * spacing * V("whatever"))^0 + * spacing + * P(">>") + ), + array = ( + P("[") + * (spacing * V("whatever"))^0 + * spacing + * P("]") + ), + whatever = ( + V("dictionary") + + V("array") + + p_other + ), + } + + local p_object = P { "object", + dictionary = p_dictionary.dictionary, + array = p_dictionary.array, + whatever = p_dictionary.whatever, + object = spacing * (V("dictionary") + V("array") + p_other) + } + + -- local p_object = cardinal + -- * spacing + -- * cardinal + -- * spacing + -- * P("obj") + -- * p_object + -- * P(1)^0 + -- + -- objectparser = Cs(p_object^1) + + objectparser = Cs(p_object^1) + + end + + local function makehash(password,salt,userkey) + local k = digest256(password .. salt .. (userkey or "")) + local n = 0 + while true do + local k1 = rep(password .. k .. (userkey or ""),64) + local k2 = sub(k,1,16) + local iv = sub(k,17,32) + local e = aesencode(k1,k2,iv) + local m = 0 + local i = 1 + for b in bytes(e) do + m = m + b + if i == 16 then + break + else + i = i + 1 + end + end + m = m % 3 + if m == 0 then + k = digest256(e) + elseif m == 1 then + k = digest384(e) + else + k = digest512(e) + end + n = n + 1 + if n >= 64 and byte(sub(e,-1)) <= (n - 32) then + break + end + end + return sub(k,1,32) + end + + local options = { + -- unknown = 0x0001, -- bit 1 + -- unknown = 0x0002, -- bit 2 + print = 0x0004, -- bit 3 + modify = 0x0008, -- bit 4 + extract = 0x0010, -- bit 5 + add = 0x0020, -- bit 6 + -- unknown = 0x0040, -- bit 7 + -- unknown = 0x0080, -- bit 8 + fillin = 0x0100, -- bit 9 + access = 0x0200, -- bit 10 + assemble = 0x0400, -- bit 11 + quality = 0x0800, -- bit 12 + -- unknown = 0x1000, -- bit 13 + -- unknown = 0x2000, -- bit 14 + -- unknown = 0x4000, -- bit 15 + -- unknown = 0x8000, -- bit 16 + } + + -- 1111 0000 1100 0011 + + local mandate = 0x0200 + local defaults = options.print | options.extract | options.quality + + -- majorversion = 2 + -- minorversion = 0 + + function lpdf.setencryption(specification) + if not encryptstream then + local ownerpassword = specification.ownerpassword + local userpassword = specification.userpassword + local optionlist = specification.permissions + if type(ownerpassword) == "string" and ownerpassword ~= "" then + -- + if type(userpassword) ~= "string" then + userpassword = "" + end + userpassword = validpassword(userpassword) + ownerpassword = validpassword(ownerpassword) + -- + encryptionkey = aesrandom(32) -- used earlier on + -- + local permissions = mandate + if optionlist then + optionlist = utilities.parsers.settings_to_array(optionlist) + for i=1,#optionlist do + local p = options[optionlist[i]] + if p then + permissions = permissions | p + end + end + else + permissions = permissions | defaults + end + -- + permissions = permissions | 0xF0C3 -- needs work + -- + optionlist = { } + for k, v in table.sortedhash(options) do + if permissions & v == v then + optionlist[#optionlist+1] = k + end + end + -- + local uservalidationsalt = aesrandom(8) + local userkeysalt = aesrandom(8) + local userhash = makehash(userpassword,uservalidationsalt) + local userkey = userhash .. uservalidationsalt .. userkeysalt -- U + local userintermediate = makehash(userpassword,userkeysalt) + local useraes = aesencode(encryptionkey,userintermediate) -- UE + -- + local ownervalidationsalt = aesrandom(8) + local ownerkeysalt = aesrandom(8) + local ownerhash = makehash(ownerpassword,ownervalidationsalt,userkey) + local ownerkey = ownerhash .. ownervalidationsalt .. ownerkeysalt -- O + local ownerintermediate = makehash(ownerpassword,ownerkeysalt,userkey) + local owneraes = aesencode(encryptionkey,ownerintermediate) -- OE + -- + -- still not ok test in qpdf + -- + local permissionsstring = sio.tocardinal4(0xFFFFFFFF) + .. sio.tocardinal4(permissions) + .. "T" -- EncryptMetadata + .. "adb" + .. aesrandom(4) + local permissionsaes = aesencode(permissionsstring,encryptionkey) + -- + permissionsaes = tohex(permissionsaes) + userkey = tohex(userkey) + ownerkey = tohex(ownerkey) + useraes = tohex(useraes) + owneraes = tohex(owneraes) + -- + encdict = pdfdictionary { + Filter = pdfconstant("Standard"), + V = 5, -- variant + R = 6, -- revision + Length = 256, -- not needed + StmF = pdfconstant("StdCF"), + StrF = pdfconstant("StdCF"), + P = permissions, + Perms = pdfliteral(permissionsaes,true), -- #16 + U = pdfliteral(userkey, true), -- #48 + O = pdfliteral(ownerkey, true), -- #48 + UE = pdfliteral(useraes, true), -- #32 + OE = pdfliteral(owneraes, true), -- #32 + CF = { + StdCF = { + AuthEvent = pdfconstant("DocOpen"), + CFM = pdfconstant("AESV3"), + Length = 32, -- #encryptionkey + } + }, + -- bonus + EncryptMetadata = true, + } + -- + encryptstream = function(str) + return aesencode(str,encryptionkey,true,true,true) -- random-iv add-iv add-padding + end + encryptobject = function(obj) + if obj then + if type(obj) == "table" then + obj = obj() + end + return lpegmatch(objectparser,obj) or obj + end + end + -- + report_encryption("stream objects get encrypted") + if not objectstream then + report_encryption("strings are not encrypted, enable object streams") + end + report_encryption("permissions: % t",optionlist) + if userpassword == "" then + report_encryption("no user password") + end + -- + end + end + end + + backends.registered.pdf.codeinjections.setencryption = lpdf.setencryption + +end do @@ -1791,7 +2061,6 @@ do end end) - end local flushdeferred -- defined later @@ -2003,8 +2272,6 @@ local cache = false local info = "" local catalog = "" local lastdeferred = false -local majorversion = 1 -local minorversion = 7 directives.register("backend.pdf.threshold",function(v) if v then @@ -2142,13 +2409,17 @@ local addtocache, flushcache, cache do else fb = f_stream_b_d_u end - local s = #data - local b = fb(cache,strobj(),s) + local size = #data + if encryptstream then + data = encryptstream(data) + size = #data + end + local b = fb(cache,strobj(),size) local e = s_stream_e flush(f,b) flush(f,data) flush(f,e) - offset = offset + #b + s + #e + offset = offset + #b + size + #e data, d = { }, 0 list, l = { }, 0 coffset = 0 @@ -2257,6 +2528,7 @@ do nolength = true -- data = string.formatters["<< %s >>stream\n%s\nendstream"](attr,data) end + return pdfdeferredobject { objnum = objnum, immediate = true, @@ -2342,6 +2614,9 @@ local function flushnormalobj(data,n) nofobjects = nofobjects + 1 n = nofobjects end + if encryptobject then + data = encryptobject(data) + end data = f_object(n,data) if level == 0 then objects[n] = offset @@ -2371,12 +2646,21 @@ local function flushstreamobj(data,n,dict,comp,nolength) if comp ~= false then comp = compress and size > threshold end + if encryptobject then + dict = encryptobject(dict) + end if level == 0 then local b = nil local e = s_stream_e if nolength then + -- probleem: we need to adapt length! b = f_stream_b_d_r(n,dict) -- raw object, already treated - else + if encryptstream then +print("check length") + data = encryptstream(data) + size = #data + end + else if comp then local compdata = compressdata(data,size) if compdata then @@ -2391,6 +2675,10 @@ local function flushstreamobj(data,n,dict,comp,nolength) comp = false end end + if encryptstream then + data = encryptstream(data) + size = #data + end if comp then b = dict and f_stream_b_d_c(n,dict,size) or f_stream_b_n_c(n,size) else @@ -2404,6 +2692,10 @@ local function flushstreamobj(data,n,dict,comp,nolength) offset = offset + #b + size + #e else if nolength then + if encryptstream then +print("check length") + data = encryptstream(data) + end data = f_stream_d_r(n,dict,data) -- raw object, already treated else if comp then @@ -2420,6 +2712,10 @@ local function flushstreamobj(data,n,dict,comp,nolength) comp = false end end + if encryptstream then + data = encryptstream(data) + size = #data + end if comp then data = dict and f_stream_d_c(n,dict,size,data) or f_stream_n_c(n,size,data) else @@ -2555,10 +2851,17 @@ local openfile, closefile do -- local banner <const> = "%\xCC\xD5\xC1\xD4\xC5\xD8\xD0\xC4\xC6\010" -- LUATEXPDF (+128) local banner <const> = "%\xC3\xCF\xCE\xD4\xC5\xD8\xD4\xD0\xC4\xC6\010" -- CONTEXTPDF (+128) - - -- local removefile = os.remove - openfile = function(filename) + -- + local arguments = environment.arguments + if arguments.ownerpassword then + lpdf.setencryption { + ownerpassword = arguments.ownerpassword, + userpassword = arguments.userpassword, + permissions = arguments.permissions, + } + end + -- if inmemory then local n = 0 f = { } @@ -2631,9 +2934,17 @@ local openfile, closefile do local xrefoffset = offset local lastfree = 0 local noffree = 0 + -- + local os = objectstream + if encryptstream then + objectstream = false + end local catalog = lpdf.getcatalog() + objectstream = os + -- local info = lpdf.getinfo() local trailerid = lpdf.gettrailerid() + if objectstream then flushdeferred() flushcache() @@ -2752,38 +3063,70 @@ local openfile, closefile do local data = concat(objects,"",0,nofobjects) local size = #data local xref = pdfdictionary { - Type = pdfconstant("XRef"), - Size = nofobjects + 1, - W = pdfarray { 1, nofbytes, 1 }, - Root = catalog, - Info = info, - ID = trailerid and pdfarray { pdfliteral(trailerid,true), pdfliteral(trailerid,true) } or nil, + Type = pdfconstant("XRef"), + Size = nofobjects + 1, + W = pdfarray { 1, nofbytes, 1 }, + Root = catalog, + Info = info, + ID = trailerid and pdfarray { pdfliteral(trailerid,true), pdfliteral(trailerid,true) } or nil, + Encrypt = encdict or nil, } local fb - if compress then - local comp = compressdata(data,size) - if comp then - data = comp - size = #data - fb = f_stream_b_d_c + -- if encryptstream then + -- if compress then + -- local comp = compressdata(data,size) + -- if comp then + -- data = comp + -- size = #data + -- fb = f_stream_b_d_c + -- xref.Filter = pdfarray { + -- pdfconstant("Crypt"), -- identity + -- pdfconstant("FlateDecode") + -- } + -- else + -- xref.Filter = pdfconstant("Crypt") -- identity + -- end + -- else + -- xref.Filter = pdfconstant("Crypt") -- identity + -- end + -- fb = f_stream_b_d_u + -- else + if compress then + local comp = compressdata(data,size) + if comp then + data = comp + size = #data + fb = f_stream_b_d_c + else + fb = f_stream_b_d_u + end else fb = f_stream_b_d_u end - else - fb = f_stream_b_d_u - end + -- end + -- no encryption of data here flush(f,fb(nofobjects,xref(),size)) flush(f,data) flush(f,s_stream_e) flush(f,f_startxref(xrefoffset)) else flushdeferred() + -- + -- if encryptstream then + -- -- unencrypted ! + -- local eo = encryptobject + -- encryptobject = false + -- encdict = pdfreference(pdfimmediateobject(tostring(encdict))) + -- encryptobject = eo + -- end + -- xrefoffset = offset flush(f,f_xref(nofobjects+1)) local trailer = pdfdictionary { - Size = nofobjects+1, - Root = catalog, - Info = info, + Size = nofobjects + 1, + Root = catalog, + Info = info, + Encrypt = encdict or nil, } for i=1,nofobjects do local o = objects[i] @@ -2994,7 +3337,6 @@ do -- end -- todo: prevent twice - local function prepare(driver) if not environment.initex then -- diff --git a/tex/context/base/mkxl/lpdf-mis.lmt b/tex/context/base/mkxl/lpdf-mis.lmt index 6d99b215d..a3a78c49f 100644 --- a/tex/context/base/mkxl/lpdf-mis.lmt +++ b/tex/context/base/mkxl/lpdf-mis.lmt @@ -20,7 +20,7 @@ local format, gsub, formatters = string.format, string.gsub, string.formatters local concat, flattened = table.concat, table.flattened local settings_to_array = utilities.parsers.settings_to_array -local pdfbackend = backends.registered.pdf +local pdfbackend = backends and backends.registered.pdf or { } local nodeinjections = pdfbackend.nodeinjections local codeinjections = pdfbackend.codeinjections local registrations = pdfbackend.registrations diff --git a/tex/context/base/mkxl/node-rul.mkxl b/tex/context/base/mkxl/node-rul.mkxl index 208ea430e..5f9eef7cb 100644 --- a/tex/context/base/mkxl/node-rul.mkxl +++ b/tex/context/base/mkxl/node-rul.mkxl @@ -171,6 +171,8 @@ % +\csname\??barattribute#1\ifcsname\??bar#1:\number\c_node_rules_index\s!parent\endcsname:\number\c_node_rules_index\fi\endcsname % \relax} +%D \overbar{Über} \underbar{Unterstrich \underbar{steigt \overbar{auf} den \underbar{Unterberg}}}. +%D %D \underbar {\underbar {\samplefile{tufte}}}\par %D \underbar {\underdot {\samplefile{tufte}}}\par %D \underbar {\underdot {\samplefile{tufte}}}\par @@ -179,10 +181,12 @@ %D \underbar {\underdots{\samplefile{tufte}}}\par %D \underdots{\underdots{\samplefile{tufte}}}\par -\newcount\c_node_rules_index % can barindex go? +\newcount \c_node_rules_index +\integerdef \c_node_rules_used \zerocount +\mutable\let\m_node_rules_previous_bar\empty \permanent\protected\def\node_rules_set#1% maybe reverse the 1000 (also maybe use more attributes instead of settings) - {\let\previousbar\currentbar + {\let\m_node_rules_previous_bar\currentbar \edef\currentbar{#1}% \usebarstyleandcolor\c!foregroundstyle\c!foregroundcolor % maybe: \usebarstyleandcolor\c!textgroundstyle\c!textcolor @@ -190,19 +194,32 @@ % \expandafter\let\expandafter\c_node_rules_index\csname\??barindex#1\endcsname \advance\c_node_rules_index\plusone \clf_enablerules % will be relaxed - \ifempty\previousbar + \edef\p_level{\barparameter\c!level}% + \ifx\p_level\v!yes + \integerdef\c_node_rules_used\c_node_rules_index \c_attr_ruled - \orelse\ifx\previousbar\currentbar + \orelse\ifx\p_level\v!auto + \integerdef\c_node_rules_used\c_node_rules_index + \ifempty\m_node_rules_previous_bar + \c_attr_ruled + \orelse\ifx\m_node_rules_previous_bar\currentbar + \c_attr_ruled + \else + \clf_enableextrarules % will be relaxed + \c_attr_ruledextra + \fi + \orelse\ifchknum\p_level\or + \integerdef\c_node_rules_used\p_level \c_attr_ruled \else - \clf_enableextrarules % will be relaxed - \c_attr_ruledextra + \integerdef\c_node_rules_used\c_node_rules_index + \c_attr_ruled \fi - \numexpr - \plusthousand*\c_node_rules_index - % optimizing this one needs testing - +\csname\??barattribute#1\ifcsname\??bar#1:\number\c_node_rules_index\s!parent\endcsname:\number\c_node_rules_index\fi\endcsname - \relax} + \numexpr + \plusthousand*\c_node_rules_used + % optimizing this one needs testing + +\csname\??barattribute#1\ifcsname\??bar#1:\number\c_node_rules_index\s!parent\endcsname:\number\c_node_rules_used\fi\endcsname + \relax} \permanent\protected\def\resetbar {\c_attr_ruled \attributeunsetvalue @@ -247,6 +264,7 @@ \setupbars [\c!method=0, % new: 0=center nested, 1=stack nested \c!continue=\v!no, + \c!level=\v!yes, \c!empty=, % new: yes = hide text \c!offset=0, % upwards, replaces: topoffset bottomoffset \c!dy=0, @@ -379,6 +397,7 @@ \definebar [undergraphic] [\c!mp=rules:under:dash, + \c!level=\v!auto, \c!offset=-.2, \c!dy=.4, \c!continue=\v!yes, diff --git a/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv b/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv index 0ee8a3a65..1c9788a98 100644 --- a/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv +++ b/tex/context/fonts/mkiv/type-imp-newcomputermodern.mkiv @@ -49,8 +49,8 @@ \starttypescript [\s!math][newcomputermodern] [\s!name] % \loadfontgoodies[newcomputermodern-math] ,\s!goodies=newcomputermodern-math - \definefontsynonym[\s!MathRoman] [\s!file:newcmmath-regular][\s!features={\s!math\mathsizesuffix,mathextra}] - \definefontsynonym[\s!MathRomanBold][\s!file:newcmmath-regular][\s!features={\s!math\mathsizesuffix,newcomputermodern-math-bold,mathextra}] + \definefontsynonym[\s!MathRoman] [\s!file:newcmmath-regular][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=lm] + \definefontsynonym[\s!MathRomanBold][\s!file:newcmmath-regular][\s!features={\s!math\mathsizesuffix,newcomputermodern-math-bold,mathextra}\s!goodies=lm] \stoptypescript \starttypescript [\s!serif] [newcomputermodern-book] [\s!name] diff --git a/tex/context/interface/mkii/keys-de.xml b/tex/context/interface/mkii/keys-de.xml index ab68cfb9b..579cc352d 100644 --- a/tex/context/interface/mkii/keys-de.xml +++ b/tex/context/interface/mkii/keys-de.xml @@ -82,6 +82,7 @@ <cd:variable name='anchor' value='anchor'/> <cd:variable name='and' value='und'/> <cd:variable name='answerarea' value='answerarea'/> + <cd:variable name='append' value='append'/> <cd:variable name='appendices' value='anhaenge'/> <cd:variable name='appendix' value='anhang'/> <cd:variable name='april' value='april'/> @@ -153,6 +154,7 @@ <cd:variable name='commands' value='befehle'/> <cd:variable name='comment' value='kommentar'/> <cd:variable name='component' value='komponente'/> + <cd:variable name='compress' value='compress'/> <cd:variable name='compressseparator' value='compressseparator'/> <cd:variable name='compressstopper' value='compressstopper'/> <cd:variable name='concept' value='konzept'/> @@ -189,6 +191,7 @@ <cd:variable name='enumeration' value='nummerierung'/> <cd:variable name='environment' value='umgebung'/> <cd:variable name='even' value='gerade'/> + <cd:variable name='explicit' value='explicit'/> <cd:variable name='export' value='export'/> <cd:variable name='external' value='extern'/> <cd:variable name='extremestretch' value='extremestretch'/> @@ -210,6 +213,8 @@ <cd:variable name='fixed' value='fest'/> <cd:variable name='flexible' value='flexibel'/> <cd:variable name='float' value='gleitobjekt'/> + <cd:variable name='flushbackward' value='flushbackward'/> + <cd:variable name='flushforward' value='flushforward'/> <cd:variable name='flushinner' value='flushinner'/> <cd:variable name='flushleft' value='flushleft'/> <cd:variable name='flushouter' value='flushouter'/> @@ -313,6 +318,7 @@ <cd:variable name='lefthanging' value='lefthanging'/> <cd:variable name='leftmargin' value='linkerrand'/> <cd:variable name='leftpage' value='linkerseite'/> + <cd:variable name='lefttext' value='linkertext'/> <cd:variable name='lefttoright' value='lefttoright'/> <cd:variable name='legend' value='legende'/> <cd:variable name='less' value='less'/> @@ -437,6 +443,7 @@ <cd:variable name='postscript' value='postscript'/> <cd:variable name='precedingpage' value='precedingpage'/> <cd:variable name='preference' value='einstellung'/> + <cd:variable name='prepend' value='prepend'/> <cd:variable name='preview' value='vorschau'/> <cd:variable name='previous' value='vorig'/> <cd:variable name='previousevenpage' value='vorigegeradeseite'/> @@ -473,6 +480,7 @@ <cd:variable name='righthanging' value='righthanging'/> <cd:variable name='rightmargin' value='rechterrand'/> <cd:variable name='rightpage' value='rechterseite'/> + <cd:variable name='righttext' value='rechtertext'/> <cd:variable name='righttoleft' value='righttoleft'/> <cd:variable name='roman' value='antiqua'/> <cd:variable name='romannumerals' value='roemischezahlen'/> @@ -1242,6 +1250,7 @@ <cd:constant name='splitoffset' value='splitoffset'/> <cd:constant name='spot' value='spot'/> <cd:constant name='stack' value='stack'/> + <cd:constant name='stacking' value='stacking'/> <cd:constant name='stackname' value='stackname'/> <cd:constant name='start' value='start'/> <cd:constant name='starter' value='starter'/> @@ -1279,6 +1288,7 @@ <cd:constant name='tab' value='tab'/> <cd:constant name='text' value='text'/> <cd:constant name='textalign' value='textalign'/> + <cd:constant name='textalternative' value='textalternative'/> <cd:constant name='textcolor' value='textfarbe'/> <cd:constant name='textcommand' value='textbefehl'/> <cd:constant name='textdistance' value='textdistance'/> @@ -1373,6 +1383,8 @@ <cd:element name='load' value='laden'/> <cd:element name='local' value='lokal'/> <cd:element name='makeup' value='umbruch'/> + <cd:element name='namednotation' value='namednotation'/> + <cd:element name='namedtyping' value='namedtyping'/> <cd:element name='next' value='folgende'/> <cd:element name='place' value='platziere'/> <cd:element name='previous' value='vorige'/> @@ -1544,6 +1556,7 @@ <cd:command name='definereferencelist' value='definierereferenzliste'/> <cd:command name='defineregister' value='definiereregister'/> <cd:command name='definerule' value='definerule'/> + <cd:command name='definesavebuffer' value='startsavebuffer'/> <cd:command name='definesection' value='definiereabschnitt'/> <cd:command name='definesectionblock' value='definiereabschnittsblock'/> <cd:command name='definesorting' value='definieresortieren'/> @@ -1720,6 +1733,9 @@ <cd:command name='moveformula' value='moveformula'/> <cd:command name='moveongrid' value='amgitterneuausrichten'/> <cd:command name='movesidefloat' value='movesidefloat'/> + <cd:command name='namedconstruction' value='namedconstruction'/> + <cd:command name='nameddescription' value='nameddescription'/> + <cd:command name='namedenumeration' value='namedenumeration'/> <cd:command name='navigating' value='navigating'/> <cd:command name='nodimension' value='keindimension'/> <cd:command name='noheaderandfooterlines' value='keinekopfundfusszeilen'/> @@ -2091,6 +2107,13 @@ <cd:command name='startmakeup' value='startumbruch'/> <cd:command name='startmarginblock' value='startmarginalblock'/> <cd:command name='startmarginrule' value='startmarginallinie'/> + <cd:command name='startnamedconstruction' value='startnamedconstruction'/> + <cd:command name='startnameddescription' value='startnameddescription'/> + <cd:command name='startnamedenumeration' value='startnamedenumeration'/> + <cd:command name='startnamedmatrix' value='startnamedmatrix'/> + <cd:command name='startnamedsection' value='startnamedsection'/> + <cd:command name='startnamedsubformulas' value='startnamedsubformulas'/> + <cd:command name='startnamedtyping' value='startnamedtyping'/> <cd:command name='startnarrower' value='startenger'/> <cd:command name='startopposite' value='startgegenueber'/> <cd:command name='startoverlay' value='startoverlay'/> @@ -2134,6 +2157,13 @@ <cd:command name='stopmakeup' value='stopumbruch'/> <cd:command name='stopmarginblock' value='stopmarginalblock'/> <cd:command name='stopmarginrule' value='stopmarginallinie'/> + <cd:command name='stopnamedconstruction' value='stopnamedconstruction'/> + <cd:command name='stopnameddescription' value='stopnameddescription'/> + <cd:command name='stopnamedenumeration' value='stopnamedenumeration'/> + <cd:command name='stopnamedmatrix' value='stopnamedmatrix'/> + <cd:command name='stopnamedsection' value='stopnamedsection'/> + <cd:command name='stopnamedsubformulas' value='stopnamedsubformulas'/> + <cd:command name='stopnamedtyping' value='stopnamedtyping'/> <cd:command name='stopnarrower' value='stopenger'/> <cd:command name='stopopposite' value='stopgegenueber'/> <cd:command name='stopoverlay' value='stopoverlay'/> diff --git a/tex/context/modules/mkxl/m-circuitikz.mkxl b/tex/context/modules/mkxl/m-circuitikz.mkxl new file mode 100644 index 000000000..9a105ff09 --- /dev/null +++ b/tex/context/modules/mkxl/m-circuitikz.mkxl @@ -0,0 +1,137 @@ +%D \module +%D [ file=m-circuitikz, +%D version=2021.12.03, +%D title=\CONTEXT\ Extra Modules, +%D subtitle=CURCUITIKZ support, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D A fixed variant of the t-curcuitikz module distributed with tikz. This one +%D is for \LMTX. + +\usemodule[m][tikz] + +\startmodule[circuitikz] + +\def\pgfcircversion {1.4.4} +\def\pgfcircversiondate {2021/10/31} + +\usetikzlibrary[calc] +\usetikzlibrary[arrows.meta, bending] +\usetikzlibrary[fpu] % may be needed for use fpu reciprocal (v1.0.1) + +\tikzinputfile{pgfcirc.defines.tex} +\tikzinputfile{pgfcircutils.tex} +\tikzinputfile{pgfcircpath.tex} + +\tikzinputfile{pgfcircshapes.tex} +\tikzinputfile{pgfcircmonopoles.tex} +\tikzinputfile{pgfcircbipoles.tex} +\tikzinputfile{pgfcirctripoles.tex} +\tikzinputfile{pgfcircquadpoles.tex} +\tikzinputfile{pgfcircmultipoles.tex} + +\tikzinputfile{pgfcirclabel.tex} +\tikzinputfile{pgfcircvoltage.tex} +\tikzinputfile{pgfcirccurrent.tex} +\tikzinputfile{pgfcircflow.tex} + +% defaults + +\setupmodule + [current=european, + voltage=european, + resistor=american, + inductor=cute, + logic=american, + siunitx=true, + arrowmos=false] + +% can be done nicer ... todo + +\processaction + [\currentmoduleparameter{voltage}] + [european=>\ctikzset{voltage=european}, + american=>\ctikzset{voltage=american}] + +\processaction + [\currentmoduleparameter{current}] + [european=>\ctikzset{ current=european}, + american=>\ctikzset{ current=american}] + +\processaction + [\currentmoduleparameter{label}] + [straight=>\ctikzset{label/align = straight}, + align=>\ctikzset{label/align = rotate}, + smart=>\ctikzset{label/align = smart}] + +\processaction + [\currentmoduleparameter{resistor}] + [european=>\ctikzset{ resistor=european}, + american=>\ctikzset{ resistor=american}] + +\processaction + [\currentmoduleparameter{inductor}] + [european=>\ctikzset{ inductor=european}, + american=>\ctikzset{ inductor=american}, + cute=>\ctikzset{ inductor=cute}] + +\processaction + [\currentmoduleparameter{diode}] + [full=>\ctikzset{ diode=full}, + empty=>\ctikzset{ diode=empty}] + +\processaction + [\currentmoduleparameter{logic}] + [european=>\ctikzset{ logic ports=european}, + american=>\ctikzset{ logic ports=american}] + +% hm, we have units built in and in mkii one can load the units module +% ... always been so ... + +\processaction + [\currentmoduleparameter{siunitx}] + [true=>\def\SI #1#2{#1\,#2} + \def\ampere {\rm{A}} + \def\volt {\rm{V}} + \def\ohm {\Omega} + \def\siemens {\rm{S}} + \def\farad {\rm{F}} + \def\henry {\rm{H}} + \def\second {\rm{s}} + \def\coulomb {\rm{C}} + \def\siemens {\rm{S}} + \def\radians {\rm{rad}} + \def\milli {\rm{m}} + \def\micro {\mu} + \def\nano {\rm{n}} + \def\pico {\rm{p}} + \def\kilo {\rm{k}} + \def\mega {\rm{M}} + \def\giga {\rm{G}} + \def\tera {\rm{T}}] + +\unprotect + +\processaction + [\currentmoduleparameter{arrowmos}] + [true=>\pgf@circuit@mos@arrowstrue, + false=>\pgf@circuit@mos@arrowsfalse] + +\protect + +\ctikzset{tripoles/op amp/font/.initial=\switchtobodyfont[small]} + +\aliased\let\stopcircuitikz\relax + +\permanent\protected\def\startcircuitikz#1\stopcircuitikz + {\starttikzpicture#1\stoptikzpicture} + +\stopmodule + +\endinput diff --git a/tex/context/modules/mkxl/m-tikz.mkxl b/tex/context/modules/mkxl/m-tikz.mkxl index 5b1f6e76c..df8d44f49 100644 --- a/tex/context/modules/mkxl/m-tikz.mkxl +++ b/tex/context/modules/mkxl/m-tikz.mkxl @@ -22,43 +22,52 @@ \protect \fi - -\pushoverloadmode - - \pushcatcodetable - - \setcatcodetable\texcatcodes - - \catcode`\@=11 - \catcode`\|=12 - \catcode`\!=12 - - \input t-pgf.tex - \input t-pgffor.tex - \input tikz.code.tex - - \popcatcodetable - -\popoverloadmode +\permanent\protected\def\starttikzinput + {\pushoverloadmode + \pushcatcodetable + \setcatcodetable\texcatcodes + \unprotect + \catcode`\@=11 + \catcode`\|=12 + \catcode`\!=12 + \autoparagraphmode\zerocount} + +\permanent\protected\def\stoptikzinput + {\autoparagraphmode\plusone + \protect + \popcatcodetable + \popoverloadmode} + +\permanent\protected\def\tikzinputfile#1% + {\starttikzinput + \input{#1}\relax + \stoptikzinput} + +\tikzinputfile{t-pgf.tex} +\tikzinputfile{t-pgffor.tex} +\tikzinputfile{tikz.code.tex} \permanent\protected\def\tikzerrormessage#1#2#3% {\writestatus{#1}{#2}} -% For now we need this but we need to educate the user to wrap settings -% in the wrappers. So some day the next line will go. I need to check what -% commands are possible outside a picture. +% For now we need this but we need to educate the user to wrap settings in the +% wrappers. So some day the next line will go. I need to check what commands are +% possible outside a picture. \overloadmode\zerocount \permanent\protected\def\starttikzsettings - {\pushoverloadmode} + {\pushoverloadmode + \autoparagraphmode\zerocount} \permanent\protected\def\stoptikzsettings - {\popoverloadmode} + {\autoparagraphmode\plusone + \popoverloadmode} \permanent\protected\def\starttikzpicture {\dontleavehmode \hcontainer\bgroup + \autoparagraphmode\zerocount % \pushoverloadmode \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi \tikzpicture} @@ -68,33 +77,18 @@ % \popoverloadmode \egroup} -% \input t-pgf.tex - \ifx\pgfdefined\undefined \let\pgfdefined\relax - % \input t-pgfcor.tex - \ifx\pgfcoredefined\undefined - \let\pgfcoredefined=\relax - - \input t-pgfsys.tex - - \edef\pgfcoreatcode {\the\catcode`\@} - \edef\pgfcorebarcode {\the\catcode`\|} - \edef\pgfcoreexclaimcode{\the\catcode`\!} - - \catcode`\@=11 - \catcode`\|=12 - \catcode`\!=12 + \let\pgfcoredefined\relax - \input pgfcore.code.tex - - \catcode`\@=\pgfcoreatcode - \catcode`\|=\pgfcorebarcode - \catcode`\!=\pgfcoreexclaimcode + \tikzinputfile{pgfsys.code.tex} + \tikzinputfile{pgfsyssoftpath.code.tex} + \tikzinputfile{pgfsysprotocol.code.tex} + \tikzinputfile{pgfcore.code.tex} \let\startpgfpicture \pgfpicture \let\stoppgfpicture \endpgfpicture \let\startpgfscope \pgfscope \let\stoppgfscope \endpgfscope @@ -105,6 +99,13 @@ \fi + \let\normalusepgfmodule\usepgfmodule + + \protected\def\usepgfmodule[#1]% + {\starttikzinput + \normalusepgfmodule[#1]% + \stoptikzinput} + \usepgfmodule[shapes,plot] \fi diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index e50c388b9..2427e3389 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 : 2021-12-03 15:17 +-- merge date : 2021-12-10 11:29 do -- begin closure to overcome local limits and interference |