summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--context/data/scite/context/documents/scite-context-readme.pdfbin212702 -> 212528 bytes
-rw-r--r--context/data/scite/context/documents/scite-context-readme.tex160
-rw-r--r--context/data/scite/context/scite-ctx-context.properties50
-rw-r--r--context/data/scite/context/scite-ctx-example.properties24
-rw-r--r--context/data/scite/context/scite-ctx-templates.lua31
-rw-r--r--context/data/scite/context/scite-ctx.lua249
-rw-r--r--doc/context/documents/general/manuals/interaction.pdfbin312578 -> 316342 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-cs.pdfbin853517 -> 853357 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-de.pdfbin854115 -> 853974 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-en.pdfbin857465 -> 857333 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-fr.pdfbin849774 -> 849625 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-it.pdfbin856480 -> 856329 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-cs.pdfbin347104 -> 346962 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-de.pdfbin431389 -> 431242 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-en.pdfbin344995 -> 344856 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-fr.pdfbin347524 -> 347385 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-it.pdfbin346521 -> 346375 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-nl.pdfbin345548 -> 345409 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-ro.pdfbin508390 -> 508246 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-nl.pdfbin846824 -> 846683 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-ro.pdfbin851605 -> 851446 bytes
-rw-r--r--doc/context/scripts/mkiv/mtx-pdf.html52
-rw-r--r--doc/context/scripts/mkiv/mtx-pdf.man36
-rw-r--r--doc/context/scripts/mkiv/mtx-pdf.xml23
-rw-r--r--doc/context/sources/general/manuals/interaction/interaction-javascript.tex43
-rw-r--r--scripts/context/lua/mtx-pdf.lua150
-rw-r--r--scripts/context/lua/mtxrun.lua6
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua6
-rw-r--r--scripts/context/stubs/unix/mtxrun6
-rw-r--r--scripts/context/stubs/win64/mtxrun.lua6
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkii/mult-de.mkii1
-rw-r--r--tex/context/base/mkii/mult-en.mkii1
-rw-r--r--tex/context/base/mkiv/back-exp.lua6
-rw-r--r--tex/context/base/mkiv/back-swf.mkiv101
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv4
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/font-cff.lua2
-rw-r--r--tex/context/base/mkiv/font-one.lua1
-rw-r--r--tex/context/base/mkiv/font-oup.lua57
-rw-r--r--tex/context/base/mkiv/grph-inc.mkiv2
-rw-r--r--tex/context/base/mkiv/java-imp-example.mkiv (renamed from tex/context/base/mkiv/java-imp-exa.mkiv)5
-rw-r--r--tex/context/base/mkiv/java-imp-fields.mkiv (renamed from tex/context/base/mkiv/java-imp-fld.mkiv)8
-rw-r--r--tex/context/base/mkiv/java-imp-highlight.mkiv (renamed from tex/context/base/mkiv/java-imp-rhh.mkiv)2
-rw-r--r--tex/context/base/mkiv/java-imp-print.mkiv (renamed from tex/context/base/mkiv/java-imp-fil.mkiv)4
-rw-r--r--tex/context/base/mkiv/java-imp-steps.mkiv (renamed from tex/context/base/mkiv/java-imp-stp.mkiv)2
-rw-r--r--tex/context/base/mkiv/java-imp-videoplayer.mkiv82
-rw-r--r--tex/context/base/mkiv/java-imp-vplayer.mkiv105
-rw-r--r--tex/context/base/mkiv/java-ini.mkiv9
-rw-r--r--tex/context/base/mkiv/lang-dis.lua3
-rw-r--r--tex/context/base/mkiv/lang-mis.mkiv6
-rw-r--r--tex/context/base/mkiv/lpdf-pde.lua14
-rw-r--r--tex/context/base/mkiv/lpdf-swf.lua6
-rw-r--r--tex/context/base/mkiv/lpdf-wid.lua7
-rw-r--r--tex/context/base/mkiv/math-ini.lua7
-rw-r--r--tex/context/base/mkiv/pack-mrl.mkiv87
-rw-r--r--tex/context/base/mkiv/page-sid.mkiv17
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin26068 -> 26105 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin269399 -> 269460 bytes
-rw-r--r--tex/context/base/mkiv/strc-ref.lua26
-rw-r--r--tex/context/base/mkiv/symb-imp-fontawesome.mkiv33
-rw-r--r--tex/context/base/mkiv/tabl-ntb.mkiv76
-rw-r--r--tex/context/base/mkiv/trac-log.lua9
-rw-r--r--tex/context/base/mkiv/util-sql-imp-sqlite.lua13
-rw-r--r--tex/context/fonts/mkiv/type-imp-plex.mkiv227
-rw-r--r--tex/context/interface/mkii/keys-de.xml1
-rw-r--r--tex/context/interface/mkii/keys-en.xml1
-rw-r--r--tex/context/interface/mkiv/context-en.xml4
-rw-r--r--tex/context/interface/mkiv/i-context.pdfbin857465 -> 857333 bytes
-rw-r--r--tex/context/interface/mkiv/i-floats.xml4
-rw-r--r--tex/context/interface/mkiv/i-readme.pdfbin60771 -> 60774 bytes
-rw-r--r--tex/context/modules/mkiv/m-matrix.mkiv153
-rw-r--r--tex/context/modules/mkiv/s-fonts-system.lua144
-rw-r--r--tex/context/modules/mkiv/s-fonts-system.mkiv13
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua32
76 files changed, 1488 insertions, 635 deletions
diff --git a/context/data/scite/context/documents/scite-context-readme.pdf b/context/data/scite/context/documents/scite-context-readme.pdf
index 3abc5f16d..834cd54da 100644
--- a/context/data/scite/context/documents/scite-context-readme.pdf
+++ b/context/data/scite/context/documents/scite-context-readme.pdf
Binary files differ
diff --git a/context/data/scite/context/documents/scite-context-readme.tex b/context/data/scite/context/documents/scite-context-readme.tex
index d9fca8640..fe5120264 100644
--- a/context/data/scite/context/documents/scite-context-readme.tex
+++ b/context/data/scite/context/documents/scite-context-readme.tex
@@ -1,7 +1,8 @@
% interface=en modes=icon,screen language=uk
-\usemodule[art-01]
-\usemodule[abr-02]
+\usemodule[article-basic]
+\usemodule[abbreviations-smallcaps]
+\usemodule[scite]
\unexpanded\def\METAPOST{MetaPost}
\unexpanded\def\METAFUN {MetaFun}
@@ -60,21 +61,21 @@
\startmode[icon,screen]
- \setuppapersize[S66][S66]
+ \setuppapersize[S66][S66]
- \setupbodyfont[10pt]
+ \setupbodyfont[10pt]
\stopmode
\startmode[icon]
- \starttext
+ \starttext
- \startTEXpage
- \useMPgraphic{TitlePage}{darkness=0.4}
- \stopTEXpage
+ \startTEXpage
+ \useMPgraphic{TitlePage}{darkness=0.4}
+ \stopTEXpage
- \stoptext
+ \stoptext
\stopmode
@@ -104,12 +105,12 @@
\definedfont[SerifBold sa 2.48]IN CONTEXT MkIV\kern.25\bodyfontsize}
\startTEXpage
- \tightlayer[TitlePage]
+ \tightlayer[TitlePage]
\stopTEXpage
% main text
-\subject{Warning}
+\startsubject[title={Warning}]
\SCITE\ version 3.61 works ok but 3.62 crashes. It'a a real pity that \SCITE\
doesn't have the scintillua lexer built in, which would also make integration a
@@ -117,7 +118,7 @@ bit nicer by sharing the \LUA\ instance. The \CONTEXT\ lexing discussed here is
the lexing I assume when using \CONTEXT\ \MKIV, but alas it's not easy to get it
running on \UNIX\ and on \MACOSX\ there is no \LUA\ lexing available.
-\subject{About \SCITE}
+\startsubject[title={About \SCITE}]
For a long time at \PRAGMA\ we used \TEXEDIT, an editor we'd written in \MODULA.
It had some project management features and recognized the project structure in
@@ -154,7 +155,9 @@ under:
Normally a user will not have to dive into the implementation details but in
principle you can tweak the properties files to suit your purpose.
-\subject{The look and feel}
+\stopsubject
+
+\startsubject[title={The look and feel}]
The color scheme that we use is consistent over the lexers but we use more colors
that in the traditional lexing. For instance, \TEX\ primitives, low level \TEX\
@@ -175,7 +178,9 @@ for instance because they have an uppercase character. In \in {figure}
[maxheight=1.2\textwidth,
maxwidth=.9\textheight]}}
-\subject{Installing \SCITE}
+\stopsubject
+
+\startsubject[title={Installing \SCITE}]
Installing \SCITE\ is straightforward. We are most familiar with \MSWINDOWS\ but
for other operating systems installation is not much different. First you need to
@@ -220,7 +225,9 @@ On \LINUX\ the files end up in:
Where the second path is the path we will put more files.
-\subject{Installing \type {scintillua}}
+\stopsubject
+
+\startsubject[title={Installing \type {scintillua}}]
Next you need to install the lpeg lexers. \footnote {Versions later than 2.11
will not run on \MSWINDOWS\ 2K. In that case you need to comment the external
@@ -258,7 +265,9 @@ a case you should downgrade or use \type {wine} with the \MSWINDOWS\ binaries
instead. After installation you need to restart \SCITE\ in order to see if things
work out as expected.
-\subject{Installing the \CONTEXT\ lexers}
+\stopsubject
+
+\startsubject[title={Installing the \CONTEXT\ lexers}]
When we started using this nice extension, we ran into issues and as a
consequence shipped a patched \LUA\ code. We also needed some more control as we
@@ -321,7 +330,9 @@ as well).
% \item rxvt (a console, only needed on \UNIX)
% \stopitemize
-\subject{Fonts}
+\stopsubject
+
+\startsubject[title={Fonts}]
The configuration file defaults to the Dejavu fonts. These free fonts are part of
the \CONTEXT\ suite (also known as the standalone distribution). Of course you
@@ -333,13 +344,17 @@ in:
<contextroot>/tex/texmf/fonts/truetype/public/dejavu
\stoptyping
-\subject{Extensions}
+\stopsubject
+
+\startsubject[title={Extensions}]
Just a quick note to some extensions. If you select a part of the text (normally
you do this with the shift key pressed) and you hit \type {Shift-F11}, you get a
menu with some options. More (robust) ones will be provided at some point.
-\subject{Spell checking}
+\stopsubject
+
+\startsubject[title={Spell checking}]
If you want to have spell checking, you need have files with correct words on
each line. The first line of a file determines the language:
@@ -427,7 +442,9 @@ usual \XML\ marker line:
<?context-directive editor language uk ?>
\stoptyping
-\subject{Interface selection}
+\stopsubject
+
+\startsubject[title={Interface selection}]
In a similar fashion you can drive the interface checking:
@@ -435,7 +452,9 @@ In a similar fashion you can drive the interface checking:
% interface=nl
\stoptyping
-\subject{Property files}
+\stopsubject
+
+\startsubject[title={Property files}]
The internal lexers are controlled by the property files while the external ones
are steered with themes. Unfortunately there is hardly any access to properties
@@ -444,7 +463,9 @@ programs like \type {mtxrun}. This means that we cannot use configuration files
in the \CONTEXT\ distribution directly. Hopefully this changes with future
releases.
-\subject{The external lexers}
+\stopsubject
+
+\startsubject[title={The external lexers}]
These are the more advanced lexers. They provide more detail and the \CONTEXT\
lexer also supports nested \METAPOST\ and \LUA. Currently there is no detailed
@@ -475,7 +496,9 @@ indicates that there is a special space character there, for instance \type
{0xA0}, the nonbreakable space. Of course we assume that you use \UTF8 as input
encoding.
-\subject{The internal lexers}
+\stopsubject
+
+\startsubject[title={The internal lexers}]
\SCITE\ has quite some built in lexers. A lexer is responsible for highlighting
the syntax of your document. The way a \TEX\ file is treated is configured in the
@@ -563,7 +586,9 @@ seen as a command. When set to zero, only the primitive \type {\if}'s will be
treated. In order not to confuse you, when this property is set to one, the lexer
will not color an \type {\ifwhatever} that follows an \type {\newif}.
-\subject{The \METAPOST\ lexer}
+\stopsubject
+
+\startsubject[title={The \METAPOST\ lexer}]
The \METAPOST\ lexer is set up slightly different from its \TEX\ counterpart,
first of all because \METAPOST\ is more a language that \TEX. As with the \TEX\
@@ -626,7 +651,9 @@ The lexer is able to recognize \type {btex}||\type {etex} and will treat anythin
in between as just text. The same happens with strings (between \type {"}). Both
act on a per line basis.
-\subject{Using \ConTeXt}
+\stopsubject
+
+\startsubject[title={Using \ConTeXt}]
When \type {mtxrun} is in your path, \CONTEXT\ should run out of the box. You can
find \type {mtxrun} in:
@@ -640,7 +667,9 @@ or in a similar path that suits the operating system that you use.
When you hit \type{CTRL-12} your document will be processed. Take a look at the
\type {Tools} menu to see what more is provided.
-\subject{Extensions (using \LUA)}
+\stopsubject
+
+\startsubject[title={Extensions (using \LUA)}]
When the \LUA\ extensions are loaded, you will see a message in the log pane that
looks like:
@@ -676,79 +705,38 @@ in a (chosen) language. This is handy when you occasionally have to key in (snip
a language you're not familiar with. More alphabets will be added (we take data from some
\CONTEXT\ language relates files).
-\subject{Templates}
+\stopsubject
-There is an experimental template mechanism. One option is to define templates in
-a properties file. The property file \type {scite-ctx-context} contains
-definitions like:
+\startsubject[title={Templates}]
-\starttyping
-command.25.$(file.patterns.context)=insert_template \
-$(ctx.template.list.context)
+It is possible to define (and use) templates. There is a demo file in the distribution called
+\type {scite-ctx-templates.lua}. You can put a similar file in your working path or one or two
+levels up from there. If not found, the default (demo) file will be used. a manu is called up
+with \type {ctrl-i}.
-ctx.template.list.context=\
- itemize=structure.itemize.context|\
- tabulate=structure.tabulate.context|\
- natural TABLE=structure.TABLE.context|\
- use MP graphic=graphics.usemp.context|\
- reuse MP graphic=graphics.reusemp.context|\
- typeface definition=fonts.typeface.context
+A template file is a \LUA\ file and looks like this:
-ctx.template.structure.itemize.context=\
-\startitemize\n\
-\item ?\n\
-\item ?\n\
-\item ?\n\
-\stopitemize\n
-\stoptyping
+\typefile{../scite-ctx-templates.lua}
-The file \type {scite-ctx-example} defines \XML\ variants:
+In \XML\ sources you can add a line:
\starttyping
-command.25.$(file.patterns.example)=insert_template \
-$(ctx.template.list.example)
-
-ctx.template.list.example=\
- bold=font.bold.example|\
- emphasized=font.emphasized.example|\
- |\
- inline math=math.inline.example|\
- display math=math.display.example|\
- |\
- itemize=structure.itemize.example
-
-ctx.template.structure.itemize.example=\
-<itemize>\n\
-<item>?</item>\n\
-<item>?</item>\n\
-<item>?</item>\n\
-</itemize>\n
+<?context-directive job ctxtemplate mytemplates.lua ?>
\stoptyping
-For larger projects it makes sense to keep templates with the project. In one of
-our projects we have a directory in the path where the project files are kept
-which holds template files:
+The file will be searched for in the current direct and upto two levels higher. When no file
+is found the \TEX\ distribution is checked.
-\starttyping
-..../ctx-templates/achtergronden.xml
-..../ctx-templates/bewijs.xml
-\stoptyping
-
-One could define a template menu like we did previously:
+The files \type {scite-ctx-example} and \type {scite-ctx-context} define the menu commands,
+like:
\starttyping
-ctx.templatelist.example=\
- achtergronden=mathadore.achtergronden|\
- bewijs=mathadore.bewijs|\
-
-ctx.template.mathadore.achtergronden.file=smt-achtergronden.xml
-ctx.template.mathadore.bewijs.file=smt-bewijs.xml
+command.25.$(file.patterns.example)=insert_template
\stoptyping
-However, when no such menu is defined, we will automatically scan the directory
-and build the menu without user intervention.
+\stopsubject
-\subject{Using \SCITE}
+\startsubject[title={Using \SCITE}]
The following keybindings are available in \SCITE. Most of this list is taken
from the on|-|line help pages.
@@ -821,7 +809,9 @@ from the on|-|line help pages.
\page
-\subject{Affiliation}
+\stopsubject
+
+\startsubject[title={Affiliation}]
\starttabulate[|l|l|]
\NC author \NC Hans Hagen \NC \NR
diff --git a/context/data/scite/context/scite-ctx-context.properties b/context/data/scite/context/scite-ctx-context.properties
index f984f5104..40ad49ded 100644
--- a/context/data/scite/context/scite-ctx-context.properties
+++ b/context/data/scite/context/scite-ctx-context.properties
@@ -1,49 +1 @@
-command.name.25.$(file.patterns.context)=Whatever
-command.25.$(file.patterns.context)=insert_template $(ctx.template.list.context)
-
-ctx.template.list.context=\
- itemize=structure.itemize.context|\
- tabulate=structure.tabulate.context|\
- natural TABLE=structure.TABLE.context|\
- use MP graphic=graphics.usemp.context|\
- reuse MP graphic=graphics.reusemp.context|\
- typeface definition=fonts.typeface.context
-
-ctx.template.structure.itemize.context=\
-\startitemize\n\
-\item ?\n\
-\item ?\n\
-\item ?\n\
-\stopitemize\n
-
-ctx.template.structure.tabulate.context=\
-\starttabulate[|l|p|]\n\
-\NC ? \NC \NC \NR\n\
-\NC ? \NC \NC \NR\n\
-\NC ? \NC \NC \NR\n\
-\stoptabulate\n
-
-ctx.template.structure.TABLE.context=\
-\bTABLE\n\
-\bTR \bTD ? \eTD \bTD \eTD \eTR\n\
-\bTR \bTD ? \eTD \bTD \eTD \eTR\n\
-\bTR \bTD ? \eTD \bTD \eTD \eTR\n\
-\eTABLE\n
-
-ctx.template.graphics.usemp.context=\
-\defineoverlay[?][\useMPgraphic{}]\n\n\
-\startuseMPgraphic{}\n\n\
-\stopuseMPgraphic\n
-
-ctx.template.graphics.reusemp.context=\
-\defineoverlay[?][\reuseMPgraphic{}]\n\n\
-\startreusableMPgraphic{}\n\n\
-\stopreusableMPgraphic\n
-
-ctx.template.fonts.typeface.context=\
-\definetypeface[mainface][rm][serif][?][default][features=default]\n\
-\definetypeface[mainface][ss][sans] [?][default][features=default]\n\
-\definetypeface[mainface][tt][mono] [?][default][features=default]\n\
-\definetypeface[mainface][mm][math] [?][default][features=default]\n\
-\n\
-\setupbodyfont[mainface,10pt]\n
+command.25.$(file.patterns.context)=insert_template
diff --git a/context/data/scite/context/scite-ctx-example.properties b/context/data/scite/context/scite-ctx-example.properties
index 78b2f2859..58c0acc34 100644
--- a/context/data/scite/context/scite-ctx-example.properties
+++ b/context/data/scite/context/scite-ctx-example.properties
@@ -1,23 +1 @@
-command.25.$(file.patterns.example)=insert_template $(ctx.template.list.example)
-
-ctx.template.list.example=\
- bold=font.bold.example|\
- emphasized=font.emphasized.example|\
- |\
- inline math=math.inline.example|\
- display math=math.display.example|\
- |\
- itemize=structure.itemize.example
-
-ctx.template.font.bold.example=<b>?</b>
-ctx.template.font.emphasized.example=<em>?</em>
-
-ctx.template.math.inline.example=<m>?</m>
-ctx.template.math.display.example=<math>?</math>
-
-ctx.template.structure.itemize.example=\
-<itemize>\n\
-<item>?</item>\n\
-<item>?</item>\n\
-<item>?</item>\n\
-</itemize>\n
+command.25.$(file.patterns.example)=insert_template
diff --git a/context/data/scite/context/scite-ctx-templates.lua b/context/data/scite/context/scite-ctx-templates.lua
new file mode 100644
index 000000000..72b981c81
--- /dev/null
+++ b/context/data/scite/context/scite-ctx-templates.lua
@@ -0,0 +1,31 @@
+-- this is just an example
+
+return {
+ xml = {
+ {
+ name = "bold",
+ nature = "inline",
+ template = "<b>?</b>",
+ },
+ {
+ name = "emphasized",
+ nature = "inline",
+ template = "<em>?</em>",
+ },
+ {
+ name = "inline",
+ nature = "inline",
+ template = "<m>?</m>",
+ },
+ {
+ name = "display",
+ nature = "display",
+ template = "<math>?</math>",
+ },
+ {
+ name = "itemize",
+ nature = "display",
+ template = "<itemize>\n <item>?</item>\n <item>?</item>\n <item>?</item>\n</itemize>",
+ },
+ },
+}
diff --git a/context/data/scite/context/scite-ctx.lua b/context/data/scite/context/scite-ctx.lua
index f2f33ecbb..126f6b8f3 100644
--- a/context/data/scite/context/scite-ctx.lua
+++ b/context/data/scite/context/scite-ctx.lua
@@ -72,7 +72,9 @@
props = props or { } -- setmetatable(props,{ __index = function(k,v) props[k] = "unknown" return "unknown" end } )
-local byte, lower, upper, gsub, sub, find, rep, match, gmatch, format, char = string.byte, string.lower, string.upper, string.gsub, string.sub, string.find, string.rep, string.match, string.gmatch, string.format, string.char
+local byte, char = string.byte, string.char
+local lower, upper, format = string.lower, string.upper, string.format
+local gsub, sub, find, rep, match, gmatch = string.gsub, string.sub, string.find, string.rep, string.match, string.gmatch
local sort, concat = table.sort, table.concat
-- helpers : utf
@@ -115,6 +117,17 @@ function io.exists(filename)
end
end
+local function resultof(command)
+ local handle = io.popen(command,"r") -- already has flush
+ if handle then
+ local result = handle:read("*all") or ""
+ handle:close()
+ return result
+ else
+ return ""
+ end
+end
+
function os.envvar(str)
local s = os.getenv(str)
if s ~= '' then
@@ -974,22 +987,28 @@ end
local menuactions = { }
local menufunctions = { }
+local menuentries = { }
function UserListShow(menutrigger, menulist)
- local menuentries = { }
- local list = grab(menulist,"[^%|]+")
- menuactions = { }
- for i=1, #list do
- if list[i] ~= '' then
- for key, val in gmatch(list[i],"%s*(.+)=(.+)%s*") do
- menuentries[#menuentries+1] = key
- menuactions[key] = val
+ if type(menulist) == "string" then
+ menuentries = { }
+ menuactions = { }
+ for item in gmatch(menulist,"[^%|]+") do
+ if item ~= "" then
+ -- why not just a split
+ for key, value in gmatch(item,"%s*(.+)=(.+)%s*") do
+ menuentries[#menuentries+1] = key
+ menuactions[key] = value
+ end
end
end
+ else
+ menuentries = menulist
+ menuactions = false
end
local menustring = concat(menuentries,'|')
if menustring == "" then
- report("there are no templates defined for this file type")
+ report("there are no (further) options defined for this file type")
else
editor.AutoCSeparator = byte('|')
editor:UserListShow(menutrigger,menustring)
@@ -998,8 +1017,8 @@ function UserListShow(menutrigger, menulist)
end
function OnUserListSelection(trigger,choice)
- if menufunctions[trigger] and menuactions[choice] then
- return menufunctions[trigger](menuactions[choice])
+ if menufunctions[trigger] then
+ return menufunctions[trigger](menuactions and menuactions[choice] or choice)
else
return false
end
@@ -1025,131 +1044,135 @@ menufunctions[12] = process_menu
-- templates
-local templatetrigger = 13
+-- <?context-directive job ctxtemplate demotemplate.lua ?>
-local ctx_template_paths = { "./ctx-templates", "../ctx-templates", "../../ctx-templates" }
-local ctx_auto_templates = false
-local ctx_template_list = ""
+local templatetrigger = 13
-local ctx_path_list = { }
-local ctx_path_done = { }
-local ctx_path_name = { }
+local ctx_template_file = "scite-ctx-templates.lua"
+local ctx_template_list = { }
+local ctx_template_menu = { }
function ctx_list_loaded(path)
return ctx_path_list[path] and #ctx_path_list[path] > 0
end
+local function loadtable(name)
+ local f = io.open(name,"rb")
+ if f then
+ f:close()
+ return dofile(name)
+ end
+end
+
+local patterns = {
+ xml = "<%?context%-directive job ctxtemplate (.-) %?>"
+}
+
+local function loadtemplate(name)
+ local temp = gsub(name,"\\","/")
+ local okay = loadtable(temp)
+ if okay then
+ print("template loaded: " .. name)
+ end
+ return okay
+end
+
+local function loadtemplatefrompaths(path,name)
+ return loadtemplate(path .. "/" .. name) or
+ loadtemplate(path .. "/../" .. name) or
+ loadtemplate(path .. "/../../" .. name)
+end
+
function insert_template(templatelist)
- if props["ctx.template.scan"] == "yes" then
- local path = props["FileDir"]
- local rescan = props["ctx.template.rescan"] == "yes"
- local suffix = props["ctx.template.suffix." .. props["FileExt"]] -- alas, no suffix expansion here
- local current = path .. "+" .. props["FileExt"]
- if rescan then
- print("re-scanning enabled")
- end
- ctx_template_list = ""
- if not ctx_path_done[path] or rescan then
- local pattern = "*.*"
- for i, pathname in ipairs(ctx_template_paths) do
- print("scanning " .. gsub(path,"\\","/") .. "/" .. pathname)
- ctx_path_name[path] = pathname
- ctx_path_list[path] = get_dir_list(pathname .. "/" .. pattern)
- if ctx_list_loaded(path) then
- print("finished locating template files")
+ local path = props["FileDir"]
+ local suffix = props["FileExt"]
+ local list = ctx_template_list[path]
+ if list == nil then
+ local pattern = patterns[suffix]
+ local okay = false
+ if pattern then
+ for i=0,9 do
+ local line = editor:GetLine(i) or ""
+ local name = match(line,pattern)
+ if name then
+ okay = loadtemplatefrompaths(path,name)
+ if not okay then
+ name = resultof("mtxrun --find-file " .. name)
+ if name then
+ name = gsub(name,"\n","")
+ okay = loadtemplate(name)
+ end
+ end
break
end
end
- if ctx_list_loaded(path) then
- print(#ctx_path_list[path] .. " template files found")
- else
- print("no template files found")
- end
end
- if ctx_list_loaded(path) then
- ctx_template_list = ""
- local pattern = "%." .. suffix .. "$"
- local n = 0
- for j, filename in ipairs(ctx_path_list[path]) do
- if find(filename,pattern) then
- n = n + 1
- local menuname = gsub(filename,"%..-$","")
- if ctx_template_list ~= "" then
- ctx_template_list = ctx_template_list .. "|"
- end
- ctx_template_list = ctx_template_list .. menuname .. "=" .. ctx_path_name[path] .. "/" .. filename
- end
- end
- if not ctx_path_done[path] then
- print(n .. " suitable template files found")
- end
+ if not okay then
+ okay = loadtemplatefrompaths(path,ctx_template_file)
end
- ctx_path_done[path] = true
- if ctx_template_list == "" then
- ctx_auto_templates = false
- else
- ctx_auto_templates = true
- templatelist = ctx_template_list
+ if not okay then
+ okay = loadtemplate(props["SciteDefaultHome"] .. "/context/" .. ctx_template_file)
end
- else
- ctx_auto_templates = false
- end
- if templatelist ~= "" then
- UserListShow(templatetrigger, templatelist)
- end
-end
-
--- ctx.template.[whatever].[filetype]
--- ctx.template.[whatever].data.[filetype]
--- ctx.template.[whatever].file.[filetype]
--- ctx.template.[whatever].list.[filetype]
-
-function process_template_one(action)
- local text = nil
- if ctx_auto_templates then
- local f = io.open(action,"r")
- if f then
- text = gsub(f:read("*all"),"\n$","")
- f:close()
+ if okay then
+ list = okay
else
- print("unable to auto load template file " .. text)
- text = nil
+ list = false
+ print("no template file found")
end
+ ctx_template_list[path] = list
end
- if not text or text == "" then
- text = props["ctx.template." .. action .. ".file"]
- if not text or text == "" then
- text = props["ctx.template." .. action .. ".data"]
- if not text or text == "" then
- text = props["ctx.template." .. action]
- end
- else
- local f = io.open(text,"r")
- if f then
- text = gsub(f:read("*all"),"\n$","")
- f:close()
- else
- print("unable to load template file " .. text)
- text = nil
+ ctx_template_menu = { }
+ if list then
+ local okay = list[suffix]
+ if okay then
+ local menu = { }
+ for i=1,#okay do
+ local o = okay[i]
+ local n = o.name
+ menu[#menu+1] = n
+ ctx_template_menu[n] = o
end
+ UserListShow(templatetrigger, menu, true)
end
end
- if text then
- text = gsub(text,"\\n","\n")
- local pos = find(text,"%?")
- text = gsub(text,"%?","")
- editor:insert(editor.CurrentPos,text)
- if pos then
- editor.CurrentPos = editor.CurrentPos + pos - 1
- editor.SelectionStart = editor.CurrentPos
- editor.SelectionEnd = editor.CurrentPos
- editor:GotoPos(editor.CurrentPos)
+end
+
+function inject_template(action)
+ if ctx_template_menu then
+ local a = ctx_template_menu[action]
+ if a then
+ local template = a.template
+ local nature = a.nature
+ if template then
+ local margin = props['SelectionStartColumn'] - 1
+ -- template = gsub(template,"\\n","\n")
+ template = gsub(template,"%?%?","_____")
+ local pos = find(template,"%?")
+ template = gsub(template,"%?","")
+ template = gsub(template,"_____","?")
+ if nature == "display" then
+ local spaces = rep(" ",margin)
+ if not find(template,"\n$") then
+ template = template .. "\n"
+ end
+ template = gsub(template,"\n",function(s)
+ return "\n" .. spaces
+ end)
+ pos = pos + margin -- todo: check for first line
+ end
+ editor:insert(editor.CurrentPos,template)
+ if pos then
+ editor.CurrentPos = editor.CurrentPos + pos - 1
+ editor.SelectionStart = editor.CurrentPos
+ editor.SelectionEnd = editor.CurrentPos
+ editor:GotoPos(editor.CurrentPos)
+ end
+ end
end
end
end
-menufunctions[13] = process_template_one
-menufunctions[14] = process_template_two
+menufunctions[13] = inject_template
-- command.name.26.*=Open Logfile
-- command.subsystem.26.*=3
diff --git a/doc/context/documents/general/manuals/interaction.pdf b/doc/context/documents/general/manuals/interaction.pdf
index 8198e8b92..6bfcc99cc 100644
--- a/doc/context/documents/general/manuals/interaction.pdf
+++ b/doc/context/documents/general/manuals/interaction.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf
index aa527b862..d1c49f8b1 100644
--- a/doc/context/documents/general/qrcs/setup-cs.pdf
+++ b/doc/context/documents/general/qrcs/setup-cs.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf
index ea5fc1ed7..aa6cee0e1 100644
--- a/doc/context/documents/general/qrcs/setup-de.pdf
+++ b/doc/context/documents/general/qrcs/setup-de.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf
index f373195d9..d8dc51e14 100644
--- a/doc/context/documents/general/qrcs/setup-en.pdf
+++ b/doc/context/documents/general/qrcs/setup-en.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf
index 9ce8b8717..5b4822110 100644
--- a/doc/context/documents/general/qrcs/setup-fr.pdf
+++ b/doc/context/documents/general/qrcs/setup-fr.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf
index 9bca93711..5e7251c8c 100644
--- a/doc/context/documents/general/qrcs/setup-it.pdf
+++ b/doc/context/documents/general/qrcs/setup-it.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf
index d6be2f850..9e9c44e8d 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-de.pdf b/doc/context/documents/general/qrcs/setup-mapping-de.pdf
index b4fb3686f..7727c6c80 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-de.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-de.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/doc/context/documents/general/qrcs/setup-mapping-en.pdf
index c6324683a..b78b69945 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-en.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-en.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf
index 4782d388e..afd504957 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/doc/context/documents/general/qrcs/setup-mapping-it.pdf
index 25ca636c0..b530df9c3 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-it.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-it.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf
index 1b70533ac..1d448a5af 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf
index dc4c994be..f565c5543 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf
index 39bcb233c..304a63658 100644
--- a/doc/context/documents/general/qrcs/setup-nl.pdf
+++ b/doc/context/documents/general/qrcs/setup-nl.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf
index 69a744975..39ecb74ad 100644
--- a/doc/context/documents/general/qrcs/setup-ro.pdf
+++ b/doc/context/documents/general/qrcs/setup-ro.pdf
Binary files differ
diff --git a/doc/context/scripts/mkiv/mtx-pdf.html b/doc/context/scripts/mkiv/mtx-pdf.html
new file mode 100644
index 000000000..e724148ca
--- /dev/null
+++ b/doc/context/scripts/mkiv/mtx-pdf.html
@@ -0,0 +1,52 @@
+<?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/><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..8da8b5ea3
--- /dev/null
+++ b/doc/context/scripts/mkiv/mtx-pdf.man
@@ -0,0 +1,36 @@
+.TH "mtx-pdf" "1" "01-01-2018" "version 0.10" "ConTeXt PDF Helpers"
+.SH NAME
+.B mtx-pdf
+.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)
+.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..9b3d8f8fe
--- /dev/null
+++ b/doc/context/scripts/mkiv/mtx-pdf.xml
@@ -0,0 +1,23 @@
+<?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>
+ </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>
+ </subcategory>
+ </category>
+ </flags>
+</application>
diff --git a/doc/context/sources/general/manuals/interaction/interaction-javascript.tex b/doc/context/sources/general/manuals/interaction/interaction-javascript.tex
index 57ce54fb1..64e784464 100644
--- a/doc/context/sources/general/manuals/interaction/interaction-javascript.tex
+++ b/doc/context/sources/general/manuals/interaction/interaction-javascript.tex
@@ -88,6 +88,49 @@ However, the more functionality ended up in the program, the least interesting
a recent \CONTEXT\ meeting, so who knows \unknown For now we're stuck with
\JAVASCRIPT.
+An example of \JAVASCRIPT\ usage is the following, where we load a video and add
+some controls. Beware that this kind of functionality is very viewer dependent
+and therefore also very unstable over time. Even worse, if you look at the loaded
+\JAVASCRIPT\ file you will notice a dependency on soon obsolete (in \ACROBAT\ at
+least) shockwave support. First we load a library that will predefine a video
+graphic: and then create an instance:
+
+\starttyping
+\useJSscripts[vplayer]
+
+\setupinteraction
+ [state=start]
+
+\externalfigure
+ [shockwave]
+ [frame=on,
+ width=480pt,
+ height=270pt,
+ file=test.mp4,
+ label=foo]
+\stoptyping
+
+The controls are defined with:
+
+\starttyping
+\goto{START} [JS(StartShockwave{foo})]
+\goto{REWIND}[JS(RewindShockwave{foo})]
+\goto{PAUSE} [JS(PauseShockwave{foo})]
+\goto{STOP} [JS(StopShockwave{foo})]
+\stoptyping
+
+or, as we have some defined reference shortcuts:
+
+\starttyping
+\goto{START} [StartShockwave{foo}]
+\goto{REWIND}[RewindShockwave{foo}]
+\goto{PAUSE} [PauseShockwave{foo}]
+\goto{STOP} [StopShockwave{foo}]
+\stoptyping
+
+It's actually not that hard to add all kind of functionality if only we could be
+sure of stable support and continuity.
+
\stopchapter
\stopcomponent
diff --git a/scripts/context/lua/mtx-pdf.lua b/scripts/context/lua/mtx-pdf.lua
index ad115637b..2e73fa841 100644
--- a/scripts/context/lua/mtx-pdf.lua
+++ b/scripts/context/lua/mtx-pdf.lua
@@ -55,6 +55,8 @@ end
scripts = scripts or { }
scripts.pdf = scripts.pdf or { }
+local details = environment.argument("detail") or environment.argument("details")
+
local function loadpdffile(filename)
if not filename or filename == "" then
report("no filename given")
@@ -73,35 +75,87 @@ end
function scripts.pdf.info(filename)
local pdffile = loadpdffile(filename)
if pdffile then
- local catalog = pdffile.Catalog
- local info = pdffile.Info
- local pages = pdffile.pages
- local nofpages = pdffile.nofpages
+ local catalog = pdffile.Catalog
+ local info = pdffile.Info
+ local pages = pdffile.pages
+ local nofpages = pdffile.nofpages
- report("filename > %s",filename)
- report("pdf version > %s",catalog.Version)
- report("major version > %s",pdffile.majorversion or "?")
- report("minor version > %s",pdffile.minorversion or "?")
- report("number of pages > %s",nofpages)
- report("title > %s",info.Title)
- report("creator > %s",info.Creator)
- report("producer > %s",info.Producer)
- report("creation date > %s",info.CreationDate)
- report("modification date > %s",info.ModDate)
+ local unset = "<unset>"
- local width, height, start
- for i=1, nofpages do
- local page = pages[i]
- local bbox = page.CropBox or page.MediaBox or { 0, 0, 0, 0 }
- local w, h = bbox[4]-bbox[2],bbox[3]-bbox[1]
- if w ~= width or h ~= height then
- if start then
- report("cropbox > pages: %s-%s, width: %s, height: %s",start,i-1,width,height)
+ report("%-17s > %s","filename", filename)
+ report("%-17s > %s","pdf version", catalog.Version or unset)
+ report("%-17s > %s","major version", pdffile.majorversion or unset)
+ report("%-17s > %s","minor version", pdffile.minorversion or unset)
+ report("%-17s > %s","number of pages", nofpages or 0)
+ report("%-17s > %s","title", info.Title or unset)
+ report("%-17s > %s","creator", info.Creator or unset)
+ report("%-17s > %s","producer", info.Producer or unset)
+ report("%-17s > %s","creation date", info.CreationDate or unset)
+ report("%-17s > %s","modification date", info.ModDate or unset)
+
+ local function somebox(what)
+ local box = string.lower(what)
+ local width, height, start
+ for i=1, nofpages do
+ local page = pages[i]
+ local bbox = page[what] or page.MediaBox or { 0, 0, 0, 0 }
+ local w, h = bbox[4]-bbox[2],bbox[3]-bbox[1]
+ if w ~= width or h ~= height then
+ if start then
+ report("%-17s > pages: %s-%s, width: %s, height: %s",box,start,i-1,width,height)
+ end
+ width, height, start = w, h, i
end
- width, height, start = w, h, i
end
+ report("%-17s > pages: %s-%s, width: %s, height: %s",box,start,nofpages,width,height)
+ end
+
+ if details then
+ somebox("MediaBox")
+ somebox("ArtBox")
+ somebox("BleedBox")
+ somebox("CropBox")
+ somebox("TrimBox")
+ else
+ somebox("CropBox")
end
- report("cropbox > pages: %s-%s, width: %s, height: %s",start,nofpages,width,height)
+
+ -- if details then
+ local annotations = 0
+ for i=1, nofpages do
+ local page = pages[i]
+ local a = page.Annots
+ if a then
+ annotations = annotations + #a
+ end
+ end
+ if annotations > 0 then
+ report("%-17s > %s", "annotations",annotations)
+ end
+ -- end
+
+ -- if details then
+ local d = pdffile.destinations
+ local k = d and sortedkeys(d)
+ if k and #k > 0 then
+ report("%-17s > %s", "destinations",#k)
+ end
+ local d = pdffile.javascripts
+ local k = d and sortedkeys(d)
+ if k and #k > 0 then
+ report("%-17s > %s", "javascripts",#k)
+ end
+ local d = pdffile.widgets
+ if d and #d > 0 then
+ report("%-17s > %s", "widgets",#d)
+ end
+ local d = pdffile.embeddedfiles
+ local k = d and sortedkeys(d)
+ if k and #k > 0 then
+ report("%-17s > %s", "embeddedfiles",#k)
+ end
+ -- end
+
end
end
@@ -206,13 +260,18 @@ function scripts.pdf.fonts(filename)
local codes = { }
local chars = { }
local freqs = { }
+ local names = { }
if counts then
codes = sortedkeys(counts)
for i=1,#codes do
local k = codes[i]
- local c = utfchar(k)
- chars[i] = c
- freqs[i] = format("U+%05X %s %s",k,counts[k] > 1 and "+" or " ", c)
+ if k > 32 then
+ local c = utfchar(k)
+ chars[i] = c
+ freqs[i] = format("U+%05X %s %s",k,counts[k] > 1 and "+" or " ", c)
+ else
+ freqs[i] = format("U+%05X %s --",k,counts[k] > 1 and "+" or " ")
+ end
end
if basefont and unicode then
local b = gsub(basefont,"^.*%+","")
@@ -225,26 +284,40 @@ function scripts.pdf.fonts(filename)
codes[i] = format("U+%05X",codes[i])
end
end
+ local d = encoding and encoding.Differences
+ if d then
+ for i=1,#d do
+ local di = d[i]
+ if type(di) == "string" then
+ names[#names+1] = di
+ end
+ end
+ end
found[k] = {
basefont = basefont or "no basefont",
- encoding = encoding or "no encoding",
+ encoding = (d and "custom n=" .. #d) or "no encoding",
subtype = subtype or "no subtype",
- unicode = tounicode and "unicode" or "no unicode",
+ unicode = tounicode and "unicode" or "no vector",
chars = chars,
codes = codes,
freqs = freqs,
+ names = names,
}
end
- if environment.argument("detail") or environment.argument("details") then
+ if details then
for k, v in sortedhash(found) do
report("id : %s", k)
report("basefont : %s", v.basefont)
- report("encoding : %s", v.encoding)
+ report("encoding : % t", v.names)
report("subtype : %s", v.subtype)
report("unicode : %s", v.unicode)
- report("characters : % t", v.chars)
- report("codepoints : % t", v.codes)
+ if #v.chars > 0 then
+ report("characters : % t", v.chars)
+ end
+ if #v.codes > 0 then
+ report("codepoints : % t", v.codes)
+ end
report("")
end
for k, v in sortedhash(common) do
@@ -253,9 +326,16 @@ function scripts.pdf.fonts(filename)
report("")
end
else
- local results = { { "id", "basefont", "encoding", "subtype", "unicode", "characters" } }
+ local haschar = false
+ for k, v in sortedhash(found) do
+ if #v.chars > 0 then
+ haschar = true
+ break
+ end
+ end
+ local results = { { "id", "basefont", "encoding", "subtype", "unicode", haschar and "characters" or nil } }
for k, v in sortedhash(found) do
- results[#results+1] = { k, v.basefont, v.encoding, v.subtype, v.unicode, concat(v.chars," ") }
+ results[#results+1] = { k, v.basefont, v.encoding, v.subtype, v.unicode, haschar and concat(v.chars," ") or nil }
end
utilities.formatters.formatcolumns(results)
report(results[1])
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index bde079a86..60ca9a337 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -12424,7 +12424,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 32361, stripped down to: 22577
+-- original size: 32613, stripped down to: 22577
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -24622,8 +24622,8 @@ end -- of closure
-- used libraries : 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 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 util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 984267
--- stripped bytes : 347979
+-- original bytes : 984519
+-- stripped bytes : 348231
-- end library merge
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index bde079a86..60ca9a337 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -12424,7 +12424,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 32361, stripped down to: 22577
+-- original size: 32613, stripped down to: 22577
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -24622,8 +24622,8 @@ end -- of closure
-- used libraries : 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 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 util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 984267
--- stripped bytes : 347979
+-- original bytes : 984519
+-- stripped bytes : 348231
-- end library merge
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index bde079a86..60ca9a337 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -12424,7 +12424,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 32361, stripped down to: 22577
+-- original size: 32613, stripped down to: 22577
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -24622,8 +24622,8 @@ end -- of closure
-- used libraries : 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 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 util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 984267
--- stripped bytes : 347979
+-- original bytes : 984519
+-- stripped bytes : 348231
-- end library merge
diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua
index bde079a86..60ca9a337 100644
--- a/scripts/context/stubs/win64/mtxrun.lua
+++ b/scripts/context/stubs/win64/mtxrun.lua
@@ -12424,7 +12424,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["trac-log"] = package.loaded["trac-log"] or true
--- original size: 32361, stripped down to: 22577
+-- original size: 32613, stripped down to: 22577
if not modules then modules={} end modules ['trac-log']={
version=1.001,
@@ -24622,8 +24622,8 @@ end -- of closure
-- used libraries : 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 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 util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 984267
--- stripped bytes : 347979
+-- original bytes : 984519
+-- stripped bytes : 348231
-- end library merge
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index 269f053f9..439cdf147 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{2018.10.03 16:02}
+\newcontextversion{2018.10.08 17:44}
%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 5fa5ed7d2..88a4cac8c 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{2018.10.03 16:02}
+\edef\contextversion{2018.10.08 17:44}
%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 6e30e12ad..0958b3464 100644
--- a/tex/context/base/mkii/mult-de.mkii
+++ b/tex/context/base/mkii/mult-de.mkii
@@ -1241,6 +1241,7 @@
\setinterfaceconstant{textstyle}{textstil}
\setinterfaceconstant{textwidth}{textbreite}
\setinterfaceconstant{threshold}{threshold}
+\setinterfaceconstant{time}{time}
\setinterfaceconstant{title}{titel}
\setinterfaceconstant{titlecolor}{titelfarbe}
\setinterfaceconstant{titlecommand}{titlecommand}
diff --git a/tex/context/base/mkii/mult-en.mkii b/tex/context/base/mkii/mult-en.mkii
index a9fffa0ea..bbe977f64 100644
--- a/tex/context/base/mkii/mult-en.mkii
+++ b/tex/context/base/mkii/mult-en.mkii
@@ -1241,6 +1241,7 @@
\setinterfaceconstant{textstyle}{textstyle}
\setinterfaceconstant{textwidth}{textwidth}
\setinterfaceconstant{threshold}{threshold}
+\setinterfaceconstant{time}{time}
\setinterfaceconstant{title}{title}
\setinterfaceconstant{titlecolor}{titlecolor}
\setinterfaceconstant{titlecommand}{titlecommand}
diff --git a/tex/context/base/mkiv/back-exp.lua b/tex/context/base/mkiv/back-exp.lua
index 10aca0a46..04f376d96 100644
--- a/tex/context/base/mkiv/back-exp.lua
+++ b/tex/context/base/mkiv/back-exp.lua
@@ -2950,6 +2950,7 @@ local collectresults do -- too many locals otherwise
local p
local localparagraph
local maybewrong
+ local pid
for n, id, subtype in nextnode, head do
if trace_detail then
showdetail(n,id,subtype)
@@ -3180,6 +3181,8 @@ end
if not keephyphens then
nofcurrentcontent = nofcurrentcontent - 1
end
+ elseif pid == disc_code then
+ -- go on .. tricky: we should mark the glyhs as coming from a disc
elseif not somespace[r] then
local a = getattr(n,a_tagged) or pat
if a == last then
@@ -3288,7 +3291,8 @@ end
elseif id == localpar_code then
localparagraph = getattr(n,a_taggedpar)
end
- p = n
+ p = n
+ pid = id
end
if maybewrong then
showmaybe(maybewrong)
diff --git a/tex/context/base/mkiv/back-swf.mkiv b/tex/context/base/mkiv/back-swf.mkiv
index 0a53a8fd2..20a94266a 100644
--- a/tex/context/base/mkiv/back-swf.mkiv
+++ b/tex/context/base/mkiv/back-swf.mkiv
@@ -11,6 +11,9 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D The question is: should I still document this in interaction.tex or just
+%D assume it's obsolete technology \unknown
+
%D This is only a placeholder that demonstrates the usage of swf resources.
%D There is no need to include this file into the format. The module was
%D tested by Luigi and Willi and based on their suggestions the functionality
@@ -58,6 +61,8 @@
%D [file=test.mp4,
%D label=foo]
%D
+%D \useJSscripts[vplayer] % or \useJSscripts[videoplayer]
+%D
%D \goto{START} [JS(StartShockwave{foo})]
%D \goto{REWIND}[JS(RewindShockwave{foo})]
%D \goto{PAUSE} [JS(PauseShockwave{foo})]
@@ -84,100 +89,8 @@
\unprotect
-\startluaparameterset[shockwave:display]
- toolbar = true,
- -- preview = "somefile",
- open = "click",
- close = "focus",
-\stopluaparameterset
-
-% using vplayer9.swf from ctan:
-
-\useexternalfigure
- [shockwave]
- [vplayer9.swf]
-% [arguments=\luaparameterset{shockwave:arguments}{src="\externalfigureparameter\v!file",source="\externalfigureparameter\v!file"},
- [\c!arguments=\luaparameterset{shockwave:arguments}{source="\externalfigureparameter\v!file",autoPlay=true},
- \c!resources=\luaparameterset{shockwave:resources}{files={"\externalfigureparameter\v!file"}},
- \c!display=shockwave:display]
-
-\startJSpreamble shockwave used now
- function StartShockwave(label) {
- var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
- if (rm.activated) {
- // ok
- } else {
- rm.activated = true ;
- }
- rm.callAS("rewind") ;
- rm.callAS("playPause") ;
- }
- function StopShockwave(label) {
- var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
- if (rm.activated) {
- rm.callAS("pause") ;
- rm.callAS("rewind") ;
- }
- }
- function RewindShockwave(label) {
- var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
- if (rm.activated) {
- rm.callAS("rewind") ;
- }
- }
- function PauseShockwave(label) {
- var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
- if (rm.activated) {
- rm.callAS("playPause") ;
- }
- }
-\stopJSpreamble
-
-% using videoplayer.swf from adobe or strobemediaplayback.swf from sourceforge:
-
-%\useexternalfigure
-% [shockwave]
-% [videoplayer.swf]
-% [\c!arguments=\luaparameterset{shockwave:arguments}{source="\externalfigureparameter\v!file"},
-% \c!resources=\luaparameterset{shockwave:resources}{files={"\externalfigureparameter\v!file"}},
-% \c!display=shockwave:display]
-
-\startJSpreamble shockwave used now
- function StartShockwave(label) {
- var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
- if (rm.activated) {
- rm.callAS("multimedia_play") ;
- } else {
- rm.activated = true ;
- }
- }
- function StopShockwave(label) {
- var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
- if (rm.activated) {
- rm.callAS("multimedia_pause") ;
- rm.callAS("multimedia_rewind") ;
- }
- }
- function RewindShockwave(label) {
- var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
- if (rm.activated) {
- rm.callAS("multimedia_rewind") ;
- }
- }
- function PauseShockwave(label) {
- var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
- if (rm.activated) {
- rm.callAS("multimedia_pause") ;
- }
- }
-\stopJSpreamble
-
-% \useexternalfigure
-% [shockwave]
-% [strobemediaplayback.swf]
-% [arguments=\luaparameterset{shockwave:arguments}{src="\externalfigureparameter\v!file"},
-% resources=\luaparameterset{shockwave:resources}{files={"\externalfigureparameter\v!file"}},
-% display=shockwave:display]
+%D The code has moved to the (explicitly loaded) \JAVASCRIPT\ modules. See there
+%D for more info.
\protect \endinput
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 3e3ab3bde..c3c035160 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2018.10.03 16:02}
+\newcontextversion{2018.10.08 17:44}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
@@ -30,6 +30,8 @@
\let\w\mathword
\to \everymathematics
+\let\assumelongusagecs\relax
+
% done
\protect \endinput
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 5a944df23..9b166fb03 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -42,7 +42,7 @@
%D has to match \type {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2018.10.03 16:02}
+\edef\contextversion{2018.10.08 17:44}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/font-cff.lua b/tex/context/base/mkiv/font-cff.lua
index ecd49fa3a..2c7d61521 100644
--- a/tex/context/base/mkiv/font-cff.lua
+++ b/tex/context/base/mkiv/font-cff.lua
@@ -28,7 +28,7 @@ if not modules then modules = { } end modules ['font-cff'] = {
local next, type, tonumber = next, type, tonumber
local byte, char, gmatch = string.byte, string.char, string.gmatch
-local concat, remove = table.concat, table.remove
+local concat, remove, unpack = table.concat, table.remove, table.unpack
local floor, abs, round, ceil, min, max = math.floor, math.abs, math.round, math.ceil, math.min, math.max
local P, C, R, S, C, Cs, Ct = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.C, lpeg.Cs, lpeg.Ct
local lpegmatch = lpeg.match
diff --git a/tex/context/base/mkiv/font-one.lua b/tex/context/base/mkiv/font-one.lua
index 85b9d406e..48bf117fe 100644
--- a/tex/context/base/mkiv/font-one.lua
+++ b/tex/context/base/mkiv/font-one.lua
@@ -106,6 +106,7 @@ function afm.load(filename)
afmenhancers.apply(data,filename)
-- otfreaders.addunicodetable(data) -- only when not done yet
fonts.mappings.addtounicode(data,filename)
+ otfreaders.stripredundant(data)
-- otfreaders.extend(data)
otfreaders.pack(data)
data.size = size
diff --git a/tex/context/base/mkiv/font-oup.lua b/tex/context/base/mkiv/font-oup.lua
index 012b007d5..14df60822 100644
--- a/tex/context/base/mkiv/font-oup.lua
+++ b/tex/context/base/mkiv/font-oup.lua
@@ -715,7 +715,7 @@ local function checklookups(fontdata,missing,nofmissing)
end
end
if next(done) then
- report_unicode("not unicoded: % t",sortedkeys(done))
+ report_unicodes("not unicoded: % t",sortedkeys(done))
end
end
end
@@ -916,12 +916,53 @@ local function unifyglyphs(fontdata,usenames)
return indices, names
end
-local p_bogusname = (
- (P("uni") + P("UNI") + P("Uni") + P("U") + P("u")) * S("Xx")^0 * R("09","AF")^1
- + (P("identity") + P("Identity") + P("IDENTITY")) * R("09","AF")^1
- + (P("index") + P("Index") + P("INDEX")) * R("09")^1
-) * (P(-1) + P("."))
+local p_crappyname do
+
+ local p_hex = R("af","AF","09")
+ local p_digit = R("09")
+ local p_done = S("._-")^0 + P(-1)
+ local p_alpha = R("az","AZ")
+ local p_ALPHA = R("AZ")
+
+ p_crappyname = (
+ -- (P("uni") + P("UNI") + P("Uni") + P("U") + P("u"))
+ lpeg.utfchartabletopattern({ "uni", "u" },true)
+ * S("Xx_")^0
+ * p_hex^1
+ -- + (P("identity") + P("Identity") + P("IDENTITY") + P("glyph") + P("jamo"))
+ + lpeg.utfchartabletopattern({ "identity", "glyph", "jamo" },true)
+ * p_hex^1
+ -- + (P("index") + P("Index") + P("INDEX")+ P("afii"))
+ + lpeg.utfchartabletopattern({ "index", "afii" }, true)
+ * p_digit^1
+ -- also happens l
+ + p_digit
+ * p_hex^3
+ + p_alpha
+ * p_digit^1
+ -- sort of special
+ + P("aj")
+ * p_digit^1
+ + P("eh_")
+ * (p_digit^1 + p_ALPHA * p_digit^1)
+ + (1-P("_"))^1
+ * P("_uni")
+ * p_hex^1
+ + P("_")
+ * P(1)^1
+ ) * p_done
+end
+
+-- In context we only keep glyph names because of tracing and access by name
+-- so weird names make no sense.
+
+local forcekeep = false -- only for testing something
+
+directives.register("otf.keepnames",function(v)
+ report_cleanup("keeping weird glyph names, expect larger files and more memory usage")
+ forcekeep = v
+end)
local function stripredundant(fontdata)
local descriptions = fontdata.descriptions
@@ -939,7 +980,7 @@ local function stripredundant(fontdata)
else
for unicode, d in next, descriptions do
local name = d.name
- if name and lpegmatch(p_bogusname,name) then
+ if name and lpegmatch(p_crappyname,name) then
d.name = nil
n = n + 1
end
@@ -960,6 +1001,8 @@ local function stripredundant(fontdata)
end
end
+readers.stripredundant = stripredundant
+
function readers.getcomponents(fontdata) -- handy for resolving ligatures when names are missing
local resources = fontdata.resources
if resources then
diff --git a/tex/context/base/mkiv/grph-inc.mkiv b/tex/context/base/mkiv/grph-inc.mkiv
index 62ac39864..371725271 100644
--- a/tex/context/base/mkiv/grph-inc.mkiv
+++ b/tex/context/base/mkiv/grph-inc.mkiv
@@ -204,7 +204,7 @@
{\grph_include_use_indeed{#1}{#2}{#3}{#4}}}}}
\def\grph_include_use_indeed#1#2#3#4%
- {\setvalue{\??externalfigureinstance#1}{\grph_include_setup{#2}{#3}{#4}}%
+ {\dodoglobal\setvalue{\??externalfigureinstance#1}{\grph_include_setup{#2}{#3}{#4}}%
\grph_include_analyze_collection[#2][#4]}
% inclusion
diff --git a/tex/context/base/mkiv/java-imp-exa.mkiv b/tex/context/base/mkiv/java-imp-example.mkiv
index 584ee1351..82d5b0cb0 100644
--- a/tex/context/base/mkiv/java-imp-exa.mkiv
+++ b/tex/context/base/mkiv/java-imp-example.mkiv
@@ -1,5 +1,5 @@
%D \module
-%D [ file=java-exa,
+%D [ file=java-imp-example, % was: java-exa
%D version=2002.??.??,
%D title=\CONTEXT\ JavaScript Macros,
%D subtitle=Example Support,
@@ -11,6 +11,9 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D This code is just kept as an example of dealign with forms and submitting data to
+%D a server. We used this to create stepwise growing student test forms and such.
+
% XFDF versus HTML
% localhost versus remote versus set
diff --git a/tex/context/base/mkiv/java-imp-fld.mkiv b/tex/context/base/mkiv/java-imp-fields.mkiv
index 559ab01b3..5801c3216 100644
--- a/tex/context/base/mkiv/java-imp-fld.mkiv
+++ b/tex/context/base/mkiv/java-imp-fields.mkiv
@@ -1,5 +1,5 @@
%D \module
-%D [ file=java-fld,
+%D [ file=java-imp-fields, % was java-fld
%D version=1998.05.20,
%D title=\CONTEXT\ JavaScript Macros,
%D subtitle=Field Support,
@@ -26,9 +26,9 @@
%D Probably a \UNICODE\ issue. Beware, in \MKIV\ we have a
%D different escaping of \type {\\}.
%D
-%D Watch out: cf. the latest pdf specification we've changed
-%D On into Yes. Also, we've changed the test for the on value
-%D into !Off as we dón't know what value it gets in the reader.
+%D Watch out: cf. the latest pdf specification we've changed On into Yes. Also,
+%D we've changed the test for the on value into !Off as we dón't know what value it
+%D gets in the reader.
% Is this still okay? We can have unicode now, can't we? Anyway it's kind of
% messy and unneeded in these unicode times.
diff --git a/tex/context/base/mkiv/java-imp-rhh.mkiv b/tex/context/base/mkiv/java-imp-highlight.mkiv
index 5f057f550..b55628f4b 100644
--- a/tex/context/base/mkiv/java-imp-rhh.mkiv
+++ b/tex/context/base/mkiv/java-imp-highlight.mkiv
@@ -1,5 +1,5 @@
%D \module
-%D [ file=java-rhh,
+%D [ file=java-imp-highlightm, % was: java-rhh
%D version=2010.02.01,
%D title=\CONTEXT\ JavaScript Macros,
%D subtitle=Runtime Highlight Hack,
diff --git a/tex/context/base/mkiv/java-imp-fil.mkiv b/tex/context/base/mkiv/java-imp-print.mkiv
index 808950f28..3d5325ff0 100644
--- a/tex/context/base/mkiv/java-imp-fil.mkiv
+++ b/tex/context/base/mkiv/java-imp-print.mkiv
@@ -1,5 +1,5 @@
%D \module
-%D [ file=java-fil,
+%D [ file=java-imp-print, % was: java-fil
%D version=1998.06.01,
%D title=\CONTEXT\ JavaScript Macros,
%D subtitle=Filing and Printing,
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\startJSpreamble Auxiliary used now
+\startJSpreamble auxiliary used now
function DocumentFileName() {
var Paths = this.path.split("/") ;
diff --git a/tex/context/base/mkiv/java-imp-stp.mkiv b/tex/context/base/mkiv/java-imp-steps.mkiv
index 8ac5d58b8..3990e4d7a 100644
--- a/tex/context/base/mkiv/java-imp-stp.mkiv
+++ b/tex/context/base/mkiv/java-imp-steps.mkiv
@@ -1,5 +1,5 @@
%D \module
-%D [ file=java-stp,
+%D [ file=java-imp-steps, % was: java-stp
%D version=2004.03.15,
%D title=\CONTEXT\ JavaScript Macros,
%D subtitle=Stepping,
diff --git a/tex/context/base/mkiv/java-imp-videoplayer.mkiv b/tex/context/base/mkiv/java-imp-videoplayer.mkiv
new file mode 100644
index 000000000..beda499a7
--- /dev/null
+++ b/tex/context/base/mkiv/java-imp-videoplayer.mkiv
@@ -0,0 +1,82 @@
+%D \module
+%D [ file=java-imp-videoplayer,
+%D version=2009.12.31,
+%D title=\CONTEXT\ JavaScript Macros,
+%D subtitle=Shockwave 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 As part of the interaction manual writing this code was moved here. It's
+%D kind of obsolete as shockwave is obsolete.
+
+% using videoplayer.swf from adobe or strobemediaplayback.swf from sourceforge:
+
+\startluaparameterset[shockwave:display]
+ toolbar = true,
+ -- preview = "somefile",
+ open = "click",
+ close = "focus",
+\stopluaparameterset
+
+\startJSpreamble shockwave used now
+
+ function StartShockwave(label) {
+ var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
+ if (rm.activated) {
+ rm.callAS("multimedia_play") ;
+ } else {
+ rm.activated = true ;
+ }
+ }
+
+ function StopShockwave(label) {
+ var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
+ if (rm.activated) {
+ rm.callAS("multimedia_pause") ;
+ rm.callAS("multimedia_rewind") ;
+ }
+ }
+
+ function RewindShockwave(label) {
+ var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
+ if (rm.activated) {
+ rm.callAS("multimedia_rewind") ;
+ }
+ }
+
+ function PauseShockwave(label) {
+ var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
+ if (rm.activated) {
+ rm.callAS("multimedia_pause") ;
+ }
+ }
+
+\stopJSpreamble
+
+\definereference[StartShockwave] [JS(StartShockwave)]
+\definereference[StopShockwave] [JS(StopShockwave)]
+\definereference[RewindShockwave][JS(RewindShockwave)]
+\definereference[PauseShockwave] [JS(PauseShockwave)]
+
+\unprotect
+
+\doglobal \useexternalfigure
+ [shockwave]
+ [videoplayer.swf]
+ [\c!arguments=\luaparameterset{shockwave:arguments}{source="\externalfigureparameter\v!file"},
+ \c!resources=\luaparameterset{shockwave:resources}{files={"\externalfigureparameter\v!file"}},
+ \c!display=shockwave:display]
+
+% \doglobal \useexternalfigure
+% [shockwave]
+% [strobemediaplayback.swf]
+% [arguments=\luaparameterset{shockwave:arguments}{src="\externalfigureparameter\v!file"},
+% resources=\luaparameterset{shockwave:resources}{files={"\externalfigureparameter\v!file"}},
+% display=shockwave:display]
+
+\protect \endinput
diff --git a/tex/context/base/mkiv/java-imp-vplayer.mkiv b/tex/context/base/mkiv/java-imp-vplayer.mkiv
new file mode 100644
index 000000000..4ed08cad6
--- /dev/null
+++ b/tex/context/base/mkiv/java-imp-vplayer.mkiv
@@ -0,0 +1,105 @@
+%D \module
+%D [ file=java-imp-vplayer,
+%D version=2009.12.31,
+%D title=\CONTEXT\ JavaScript Macros,
+%D subtitle=Shockwave 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 As part of the interaction manual writing this code was moved here. It's
+%D kind of obsolete as shockwave is obsolete. Anywaym, here's how it works.
+%D One can actually set all kind of properties but let's not waste time on
+%D that. Maybe some day \PDF\ will have proper native video support.
+%D
+%D \starttyping
+%D \starttext
+%D
+%D \useJSscripts[vplayer]
+%D
+%D \setupinteraction
+%D [state=start]
+%D
+%D \externalfigure
+%D [shockwave]
+%D [frame=on,
+%D width=480pt,
+%D height=270pt,
+%D %file=mathematics.mp4, % Hollie McNish, Martin Pyper & Jules Buckley (Metropole Orchestra)
+%D file=bathtub.mp4, % Jacob Collier & Becca Stevens
+%D label=foo]
+%D
+%D \goto{START} [JS(StartShockwave{foo})]
+%D \goto{REWIND}[JS(RewindShockwave{foo})]
+%D \goto{PAUSE} [JS(PauseShockwave{foo})]
+%D \goto{STOP} [JS(StopShockwave{foo})]
+%D
+%D \stoptext
+%D \stoptyping
+
+% using vplayer9.swf from ctan:
+
+\startluaparameterset[shockwave:display]
+ toolbar = true,
+ -- preview = "somefile",
+ open = "click",
+ close = "focus",
+\stopluaparameterset
+
+\startJSpreamble shockwave used now
+
+ function StartShockwave(label) {
+ var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
+ if (rm.activated) {
+ // ok
+ } else {
+ rm.activated = true ;
+ }
+ rm.callAS("rewind") ;
+ rm.callAS("playPause") ;
+ }
+
+ function StopShockwave(label) {
+ var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
+ if (rm.activated) {
+ rm.callAS("pause") ;
+ rm.callAS("rewind") ;
+ }
+ }
+
+ function RewindShockwave(label) {
+ var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
+ if (rm.activated) {
+ rm.callAS("rewind") ;
+ }
+ }
+
+ function PauseShockwave(label) {
+ var rm = this.getAnnotsRichMedia(this.pageNum,label)[0] ;
+ if (rm.activated) {
+ rm.callAS("playPause") ;
+ }
+ }
+
+\stopJSpreamble
+
+\definereference[StartShockwave] [JS(StartShockwave)]
+\definereference[StopShockwave] [JS(StopShockwave)]
+\definereference[RewindShockwave][JS(RewindShockwave)]
+\definereference[PauseShockwave] [JS(PauseShockwave)]
+
+\unprotect
+
+\doglobal \useexternalfigure
+ [shockwave]
+ [vplayer9.swf]
+ %[arguments=\luaparameterset{shockwave:arguments}{src="\externalfigureparameter\v!file",source="\externalfigureparameter\v!file"},
+ [\c!arguments=\luaparameterset{shockwave:arguments}{source="\externalfigureparameter\v!file",autoPlay=true},
+ \c!resources=\luaparameterset{shockwave:resources}{files={"\externalfigureparameter\v!file"}},
+ \c!display=shockwave:display]
+
+\protect \endinput
diff --git a/tex/context/base/mkiv/java-ini.mkiv b/tex/context/base/mkiv/java-ini.mkiv
index 1a131d9da..95c9c5220 100644
--- a/tex/context/base/mkiv/java-ini.mkiv
+++ b/tex/context/base/mkiv/java-ini.mkiv
@@ -38,7 +38,6 @@
%D \goto{calculate total}[Sum(1.5,2.3)]
%D \stoptyping
-
%D \macros
%D {startJScode}
%D
@@ -162,4 +161,12 @@
\def\java_use_preamble[#1]%
{\clf_usejavascriptpreamble{#1}}% so this one comes later
+%D Here:
+
+\definefilesynonym[java-imp-fld.mkiv] [java-imp-fields.mkiv]
+\definefilesynonym[java-imp-stp.mkiv] [java-imp-steps.mkiv]
+\definefilesynonym[java-imp-fil.mkiv] [java-imp-print.mkiv]
+\definefilesynonym[java-imp-rhh.mkiv] [java-imp-highlight.mkiv]
+\definefilesynonym[java-imp-exa.mkiv] [java-imp-example.mkiv]
+
\protect \endinput
diff --git a/tex/context/base/mkiv/lang-dis.lua b/tex/context/base/mkiv/lang-dis.lua
index 1e46cbd36..a45e87e9c 100644
--- a/tex/context/base/mkiv/lang-dis.lua
+++ b/tex/context/base/mkiv/lang-dis.lua
@@ -181,7 +181,7 @@ function languages.nofflattened()
return wiped -- handy for testing
end
--- experiment
+-- experiment: for now not in not in export mode!
local flatten = languages.flatten
local getlist = nodes.getlist
@@ -196,6 +196,7 @@ function nodes.handlers.flatten(head,where)
end
directives.register("hyphenator.flatten",function(v)
+ -- use with care
setaction("processors","nodes.handlers.flatten",v)
setaction("contributers","nodes.handlers.flattenline",v)
end)
diff --git a/tex/context/base/mkiv/lang-mis.mkiv b/tex/context/base/mkiv/lang-mis.mkiv
index f2c837f54..3ec29a782 100644
--- a/tex/context/base/mkiv/lang-mis.mkiv
+++ b/tex/context/base/mkiv/lang-mis.mkiv
@@ -145,7 +145,11 @@
%D modules these can be tuned by a setup command. Watch the (maybe) better looking
%D compound hyphen.
-\ifx\compoundhyphen \undefined \unexpanded\def\compoundhyphen {\hbox{-\kern-.25ex-}} \fi
+% hm why ex
+
+\ifx\compoundhyphen \undefined
+ \unexpanded\def\compoundhyphen {\hbox{-\kern-.10775\emwidth-}} % .25\exheight
+\fi
%D The last two variables are needed for subsentences |<|like this one|>| which we
%D did not yet mention. We want to enable breaking but at the same time don't want
diff --git a/tex/context/base/mkiv/lpdf-pde.lua b/tex/context/base/mkiv/lpdf-pde.lua
index 819143a3b..d7aa9f40c 100644
--- a/tex/context/base/mkiv/lpdf-pde.lua
+++ b/tex/context/base/mkiv/lpdf-pde.lua
@@ -52,7 +52,13 @@ local setmetatableindex = table.setmetatableindex
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
local P, C, S, R, Ct, Cc, V, Carg, Cs, Cf, Cg = lpeg.P, lpeg.C, lpeg.S, lpeg.R, lpeg.Ct, lpeg.Cc, lpeg.V, lpeg.Carg, lpeg.Cs, lpeg.Cf, lpeg.Cg
-if not lpdf then require("lpdf-aux") end
+if not lpdf then
+ require("lpdf-aux")
+end
+
+if not (number and number.dimenfactors) then
+ require("util-dim")
+end
local epdf = pdfe
lpdf = lpdf or { }
@@ -343,12 +349,12 @@ end
function resolvers.javascripts(document)
local Names = document.Catalog.Names
- return getnames(document,Names and Names.JS)
+ return getnames(document,Names and Names.JavaScript)
end
function resolvers.widgets(document)
- local Names = document.Catalog.Names
- return getnames(document,Names and Names.AcroForm)
+ local Names = document.Catalog.AcroForm
+ return Names and Names.Fields
end
function resolvers.embeddedfiles(document)
diff --git a/tex/context/base/mkiv/lpdf-swf.lua b/tex/context/base/mkiv/lpdf-swf.lua
index 0ac107f8b..7d76efc73 100644
--- a/tex/context/base/mkiv/lpdf-swf.lua
+++ b/tex/context/base/mkiv/lpdf-swf.lua
@@ -65,7 +65,10 @@ local function insertswf(spec)
local preview = checkedkey(display,"preview","string")
local toolbar = checkedkey(display,"toolbar","boolean")
- local embeddedreference = codeinjections.embedfile { file = filename }
+ local embeddedreference = codeinjections.embedfile {
+ file = filename,
+ compress = false,
+ }
local flash = pdfdictionary {
Subtype = pdfconstant("RichMediaConfiguration"),
@@ -122,6 +125,7 @@ local function insertswf(spec)
file = fullname,
usedname = usedname,
keepdir = true,
+ compress = false,
}
names[#names+1] = pdfstring(filename)
names[#names+1] = embeddedreference
diff --git a/tex/context/base/mkiv/lpdf-wid.lua b/tex/context/base/mkiv/lpdf-wid.lua
index 5793fc723..a929ed2ce 100644
--- a/tex/context/base/mkiv/lpdf-wid.lua
+++ b/tex/context/base/mkiv/lpdf-wid.lua
@@ -267,9 +267,13 @@ function codeinjections.embedfile(specification)
local keepdir = specification.keepdir -- can change
local usedname = specification.usedname
local filetype = specification.filetype
+ local compress = specification.compress
if filename == "" then
filename = nil
end
+ if compress == nil then
+ compress = true
+ end
if data then
local r = filestreams[hash]
if r == false then
@@ -324,7 +328,7 @@ function codeinjections.embedfile(specification)
specification.data = true -- signal that still data but already flushed
else
local foundname = specification.foundname or filename
- f = pdfflushstreamfileobject(foundname,a)
+ f = pdfflushstreamfileobject(foundname,a,compress)
end
local d = pdfdictionary {
Type = pdfconstant("Filespec"),
@@ -663,6 +667,7 @@ local function insertrendering(specification)
descriptor.EF = codeinjections.embedfile {
file = filename,
mimetype = mimetype, -- yes or no
+ compress = false,
}
end
local clip = pdfdictionary {
diff --git a/tex/context/base/mkiv/math-ini.lua b/tex/context/base/mkiv/math-ini.lua
index 5491078f3..66c08a76a 100644
--- a/tex/context/base/mkiv/math-ini.lua
+++ b/tex/context/base/mkiv/math-ini.lua
@@ -39,13 +39,6 @@ local mathematics = mathematics
mathematics.extrabase = fonts.privateoffsets.mathextrabase -- here we push some virtuals
mathematics.privatebase = fonts.privateoffsets.mathbase -- here we push the ex
-fonts.privateoffsets = {
- textbase = 0xF0000, -- used for hidden (opentype features)
- textextrabase = 0xFD000, -- used for visible by name
- mathextrabase = 0xFE000, -- used for visible by code
- mathbase = 0xFF000, -- used for hidden (virtual math)
-}
-
local unsetvalue = attributes.unsetvalue
local allocate = utilities.storage.allocate
local chardata = characters.data
diff --git a/tex/context/base/mkiv/pack-mrl.mkiv b/tex/context/base/mkiv/pack-mrl.mkiv
index 85aa3ad04..bef790536 100644
--- a/tex/context/base/mkiv/pack-mrl.mkiv
+++ b/tex/context/base/mkiv/pack-mrl.mkiv
@@ -39,7 +39,7 @@
\installsimplecommandhandler \??blackrules {blackrules}
\unexpanded\def\blackrule
- {\hbox\bgroup
+ {\hpack\bgroup
\doifelsenextoptionalcs\pack_black_rule_pickup\pack_black_rule_indeed}
\def\pack_black_rule_pickup[#1]%
@@ -99,7 +99,7 @@
%D would probably have taken more tokens.
\unexpanded\def\blackrules % probably never used
- {\hbox\bgroup
+ {\hpack\bgroup
\doifelsenextoptionalcs\pack_black_rules_pickup\pack_black_rules_indeed}
\def\pack_black_rules_pickup[#1]%
@@ -121,23 +121,25 @@
\fi
\fi
\useblackrulesstyleandcolor\c!style\c!color
- \edef\brule
- {\ifcsname\??blackruletype\directblackrulesparameter\c!type\endcsname
- \lastnamedcs
- \else
- \vrule
- \fi}%
- \dorecurse\scratchcounter % a typical case of where we can use a simple loop
- {\brule
- \s!width \scratchwidth
- \s!height\scratchheight
- \s!depth \scratchdepth
- \ifzeropt\scratchdistance\else
- \hskip\scratchdistance
- \fi}%
+ % a typical case of where we can use a simple loop or even a leaders
+ \dorecurse\scratchcounter\pack_black_rules_step
\unskip
\egroup}
+\def\pack_black_rules_step
+ {\ifcsname\??blackruletype\directblackrulesparameter\c!type\endcsname
+ \lastnamedcs
+ \else
+ \vrule
+ \fi
+ \s!width \scratchwidth
+ \s!height\scratchheight
+ \s!depth \scratchdepth
+ \relax
+ \ifzeropt\scratchdistance\else
+ \hskip\scratchdistance
+ \fi}
+
\installcorenamespace{blackruletype}
\setvalue{\??blackruletype mp}%
@@ -578,14 +580,14 @@
{\page[\v!preference] % interferes
\directtextrulesparameter\c!before\relax
\blank[\v!samepage,\v!nowhite]%
- \pack_textrule_with_text{#1}%
+ \pack_textrule_with_text_yes{#1}%
\blank[\v!samepage,\v!nowhite]%
\directtextrulesparameter\c!inbetween\relax
\endgraf}
\setvalue{\??textrulealternatives\v!bottom}#1%
{\blank[\v!samepage,\v!nowhite]%
- \pack_textrule_following{#1}%
+ \pack_textrule_following_yes{#1}%
\blank[\v!samepage,\v!nowhite]%
\directtextrulesparameter\c!after\relax
\page[\v!preference]}
@@ -593,14 +595,15 @@
\setvalue{\??textrulealternatives\v!middle}#1%
{\blank[\v!samepage,\v!nowhite]%
\directtextrulesparameter\c!inbetween\relax
- \pack_textrule_following{#1}%
+ \pack_textrule_following_yes{#1}%
\blank[\v!samepage,\v!nowhite]%
\directtextrulesparameter\c!inbetween\relax
\page[\v!preference]}
-\def\pack_textrule_with_text#1%
- {\bgroup
- \setbox\scratchbox\hbox to \availablehsize
+\def\pack_textrule_with_text_yes#1%
+ {\noindent % this will force side floats to be calculated
+ \bgroup
+ \setbox\scratchbox\hpack to \availablehsize
{\scratchwidth \directtextrulesparameter\c!rulethickness\relax
\scratchheight\dimexpr .5\exheight+.5\scratchwidth\relax
\scratchdepth \dimexpr-.5\exheight+.5\scratchwidth\relax
@@ -611,19 +614,41 @@
#1%
\hskip\leftmargindistance}}
{\color[\directtextrulesparameter\c!rulecolor]
- {\vrule\s!height\scratchheight\s!depth\scratchdepth\s!width\directtextrulesparameter\c!width}%
+ {\vrule
+ \s!height\scratchheight
+ \s!depth \scratchdepth
+ \s!width \directtextrulesparameter\c!width}%
\hbox spread 2\dimexpr\directtextrulesparameter\c!distance\relax
{\hss
\usetextrulesstyleandcolor\c!style\c!color
\strut#1%
\hss}}}%
\color[\directtextrulesparameter\c!rulecolor]
- {\leaders\hrule\s!height\scratchheight\s!depth\scratchdepth\hfill}}%
+ {\leaders\hrule
+ \s!height\scratchheight
+ \s!depth \scratchdepth
+ \hfill}}%
\ht\scratchbox\strutht
\dp\scratchbox\strutdp
- \noindent\box\scratchbox
+ \box\scratchbox
+ %\carryoverpar
\egroup}
+\def\pack_textrule_with_text_nop#1%
+ {\ifhmode
+ \endgraf
+ \fi
+ \doifelse{\directtextrulesparameter\c!depthcorrection}\v!on
+ \pack_textrule_correct_depth_yes
+ \pack_textrule_correct_depth_nop
+ \nointerlineskip
+ \noindent\vpack % was \dontleavehmode
+ {\color[\directtextrulesparameter\c!rulecolor]
+ {\hrule
+ \s!depth \directtextrulesparameter\c!rulethickness
+ \s!height\zeropoint
+ \s!width \availablehsize}}}
+
\def\pack_textrule_correct_depth_yes
{\vskip\dimexpr
\strutdp +.5\exheight
@@ -643,15 +668,9 @@
\def\pack_textrule_following#1%
{\doifelsenothing{#1}
- {\ifhmode
- \endgraf
- \fi
- \doifelse{\directtextrulesparameter\c!depthcorrection}\v!on\pack_textrule_correct_depth_yes\pack_textrule_correct_depth_nop
- \nointerlineskip
- \noindent\vbox % was \dontleavehmode
- {\color[\directtextrulesparameter\c!rulecolor]
- {\hrule\s!depth\directtextrulesparameter\c!rulethickness\s!height\zeropoint\s!width\availablehsize}}}
- {\pack_textrule_with_text{#1}}%
+ \pack_textrule_with_text_nop
+ \pack_textrule_with_text_yes
+ {#1}%
\ifvmode
\prevdepth\zeropoint
\fi}
diff --git a/tex/context/base/mkiv/page-sid.mkiv b/tex/context/base/mkiv/page-sid.mkiv
index 812196e6f..303b77af2 100644
--- a/tex/context/base/mkiv/page-sid.mkiv
+++ b/tex/context/base/mkiv/page-sid.mkiv
@@ -81,6 +81,9 @@
\newdimen \d_page_sides_progression
+\newcount \c_page_sides_m_of_lines
+\newconditional \c_page_sides_delayed
+
\newif \iftracesidefloats % public (might change)
%D Defaults:
@@ -764,7 +767,7 @@
\prevdepth\strutdp}
%\ignoreparskip}
-\def\page_sides_handle_float#1% grid (4) is rather experimental
+\def\page_sides_handle_float#1%
{\page_sides_initialize_checker
\page_sides_check_horizontal_skips
\page_sides_check_vertical_skips
@@ -776,8 +779,11 @@
\page_sides_apply_vertical_shift
\page_sides_analyse_space
\ifconditional\c_page_floats_room
+ \global\setfalse\c_page_sides_delayed
% we're ok
\else
+ \global\settrue\c_page_sides_delayed
+ \global\c_page_sides_m_of_lines\c_page_sides_n_of_lines
\ifcase\c_page_sides_page_method
\page_otr_fill_and_eject_page
\or
@@ -785,11 +791,13 @@
\else
\page_otr_fill_and_eject_page
\fi
+ \global\c_page_sides_n_of_lines\c_page_sides_m_of_lines
\page_sides_analyse_space
%\page_sides_inject_before
\page_sides_inject_dummy_lines
\fi
\page_sides_place_float
+ \global\setfalse\c_page_sides_delayed
\page_sides_check_floats_reset
\page_sides_wrapup}
@@ -797,8 +805,7 @@
{% we need to do this aftergroup
\aftergroup\par
\aftergroup\ignoreparskip
- \aftergroup\ignorespaces
- }
+ \aftergroup\ignorespaces}
\def\page_sides_check_floats_indeed
{\page_sides_analyse_progress
@@ -857,6 +864,10 @@
\unexpanded\def\page_sides_check_floats_set
{\edef\p_sidethreshold{\floatparameter\c!sidethreshold}%
+ \ifconditional\c_page_sides_delayed
+ % For Alan's hanging right float that moved to the next page.
+ \d_page_sides_progress\zeropoint
+ \fi
\ifx\p_sidethreshold\v!old
\d_page_sides_progression\dimexpr\d_page_sides_progress+\strutht-\roundingeps\relax
\c_page_sides_n_of_hang\d_page_sides_progression
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 7d9a44566..31155292e 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index 5a886244b..b1227d969 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/strc-ref.lua b/tex/context/base/mkiv/strc-ref.lua
index 0acfab7f7..8b0c5467e 100644
--- a/tex/context/base/mkiv/strc-ref.lua
+++ b/tex/context/base/mkiv/strc-ref.lua
@@ -1496,7 +1496,7 @@ local function identify_inner(set,var,prefix,collected,derived)
end
end
-- we now ignore the split prefix and treat the whole inner as a potential
- -- referenice into the global list
+ -- reference into the global list
local i = collected[prefix]
if i then
i = i[inner]
@@ -1552,6 +1552,17 @@ local function identify_outer(set,var,i)
end
return v
end
+-- weird too (we really need to check how this table is build
+ local v = identify_inner(set,var,var.outer,external)
+ if v then
+ v.kind = "outer with inner"
+ set.external = true
+ if trace_identifying then
+ report_identify_outer(set,v,i,"2c")
+ end
+ return v
+ end
+--
-- somewhat rubish: we use outer as first step in the externals table so it makes no
-- sense to have it as prefix so the next could be an option
local external = external[""]
@@ -2556,10 +2567,19 @@ local function referencepagestate(position,detail,spread)
if not actions then
return 0
else
- if not actions.pagestate then
+ local pagestate = actions.pagestate
+ for i=1,#actions do
+ local a = actions[i]
+ if a.outer then
+ pagestate = 0
+ actions.pagestate = pagestate
+ break
+ end
+ end
+ if not pagestate then
references.analyze(actions,position,spread) -- delayed unless explicitly asked for
+ pagestate = actions.pagestate
end
- local pagestate = actions.pagestate
if detail then
return pagestate
elseif pagestate == 4 then
diff --git a/tex/context/base/mkiv/symb-imp-fontawesome.mkiv b/tex/context/base/mkiv/symb-imp-fontawesome.mkiv
index cae2e506b..13a8fc678 100644
--- a/tex/context/base/mkiv/symb-imp-fontawesome.mkiv
+++ b/tex/context/base/mkiv/symb-imp-fontawesome.mkiv
@@ -749,8 +749,27 @@
\stopsymbolset
+
+\definefontsynonym [FontAwesomeBrands] [file:fontawesome5brandsregular400.otf]
+\definefontsynonym [FontAwesomeRegular] [file:fontawesome5freeregular400.otf]
+\definefontsynonym [FontAwesomeSolid] [file:fontawesome5freesolid900.otf]
+
+\startsymbolset [fontawesome-brands] [font=FontAwesomeBrands]
+ % Font Awesome Brands
+\stopsymbolset
+
+\startsymbolset [fontawesome-regular] [font=FontAwesomeRegular]
+ % Font Awesome Regular
+\stopsymbolset
+
+\startsymbolset [fontawesome-solid] [font=FontAwesomeSolid]
+ % Font Awesome Solid
+\stopsymbolset
+
\continueifinputfile{symb-imp-fontawesome.mkiv}
+\usemodule[article-basic]
+
\starttext
% \usesymbols[fontawesome]
@@ -760,6 +779,18 @@
% \symbol[fontawesome][angle right]
% \symbol[fontawesome][angle_right]
- \showsymbolset[fontawesome]
+ % \showsymbolset[fontawesome]
+
+ \startnamedsection [title] [title={Font Awesome Brands}]
+ \showsymbolset [fontawesome-brands]
+ \stopnamedsection
+
+ \startnamedsection [title] [title={Font Awesome Regular}]
+ \showsymbolset [fontawesome-regular]
+ \stopnamedsection
+
+ \startnamedsection [title] [title={Font Awesome Solid}]
+ \showsymbolset [fontawesome-solid]
+ \stopnamedsection
\stoptext
diff --git a/tex/context/base/mkiv/tabl-ntb.mkiv b/tex/context/base/mkiv/tabl-ntb.mkiv
index 54eca6cd3..ca3d78800 100644
--- a/tex/context/base/mkiv/tabl-ntb.mkiv
+++ b/tex/context/base/mkiv/tabl-ntb.mkiv
@@ -1161,13 +1161,11 @@
\def\tabl_ntb_row_stop_boxed
{% \noindent % no, else double leftskip in narrower
- \normalexpanded
- {\t_tabl_ntb
- {\the\t_tabl_ntb
- % no need for init
- \tabl_ntb_row_align_start
- \the\t_tabl_ntb_row
- \tabl_ntb_row_align_stop}}}
+ \etoksapp\t_tabl_ntb
+ {% no need for init
+ \tabl_ntb_row_align_start
+ \the\t_tabl_ntb_row
+ \tabl_ntb_row_align_stop}}
\def\tabl_ntb_row_stop_split
{\ifcsname\??naturaltableset\m_tabl_tbl_level:\c!y++\the\c_tabl_ntb_current_row\endcsname
@@ -1177,13 +1175,11 @@
\fi}
\def\tabl_ntb_row_stop_split_nop
- {\normalexpanded
- {\t_tabl_ntb
- {\the\t_tabl_ntb
- \tabl_ntb_row_align_reset
- \tabl_ntb_row_align_start
- \the\t_tabl_ntb_row
- \tabl_ntb_row_align_stop}}}
+ {\etoksapp\t_tabl_ntb
+ {\tabl_ntb_row_align_reset
+ \tabl_ntb_row_align_start
+ \the\t_tabl_ntb_row
+ \tabl_ntb_row_align_stop}}
\def\tabl_ntb_row_stop_split_yes
{\begingroup
@@ -1192,13 +1188,11 @@
\xdef\m_tabl_ntb_after_split {\naturaltablelocalparameter\c!after}% to be checked
\xdef\m_tabl_ntb_same_page {\naturaltablelocalparameter\c!samepage}%
\endgroup
- \normalexpanded
- {\t_tabl_ntb
- {\the\t_tabl_ntb
- \tabl_ntb_row_align_set{\m_tabl_ntb_before_split}{\m_tabl_ntb_after_split}{\m_tabl_ntb_same_page}%
- \tabl_ntb_row_align_start
- \the\t_tabl_ntb_row
- \tabl_ntb_row_align_stop}}}
+ \etoksapp\t_tabl_ntb
+ {\tabl_ntb_row_align_set{\m_tabl_ntb_before_split}{\m_tabl_ntb_after_split}{\m_tabl_ntb_same_page}%
+ \tabl_ntb_row_align_start
+ \the\t_tabl_ntb_row
+ \tabl_ntb_row_align_stop}}
\unexpanded\def\tabl_ntb_row_align_set#1#2#3%
{\xdef\m_tabl_ntb_before_split{#1}%
@@ -1225,12 +1219,10 @@
\tabl_ntb_prelocate_error
\fi}%
\def\tabl_ntb_row_stop
- {\normalexpanded
- {\t_tabl_ntb
- {\the\t_tabl_ntb
- \tabl_ntb_row_align_start
- \the\csname\??naturaltabletok\the\c_tabl_ntb_row\endcsname
- \tabl_ntb_row_align_stop}}}%
+ {\etoksapp\t_tabl_ntb
+ {\tabl_ntb_row_align_start
+ \the\csname\??naturaltabletok\the\c_tabl_ntb_row\endcsname
+ \tabl_ntb_row_align_stop}}%
\global\c_tabl_prelocated_rows#1\relax}
\def\tabl_ntb_prelocate_okay
@@ -1344,37 +1336,23 @@
{\global\advance\c_tabl_ntb_col\plusone
\kern\d_tabl_ntb_columndistance}
-% \setvalue{\??naturaltablecell\the\c_tabl_ntb_none}#1#2%
-% {\scratchcounter\tabl_ntb_get_col{#1}{#2}\relax
-% \ifnum\scratchcounter>\zerocount
-% \normalexpanded
-% {\t_tabl_ntb_row
-% {\the\t_tabl_ntb_row
-% \tabl_ntb_span{\the\scratchcounter}%
-% \tabl_ntb_plus}}%
-% \fi}
-
\setvalue{\??naturaltablecell\the\c_tabl_ntb_none}#1#2%
{\scratchcounter\tabl_ntb_get_col{#1}{#2}\relax
\ifnum\scratchcounter>\zerocount
- \normalexpanded
- {\t_tabl_ntb_row
- {\the\t_tabl_ntb_row
- \tabl_ntb_span{\the\scratchcounter}}}%
+ \etoksapp\t_tabl_ntb_row
+ {\tabl_ntb_span{\the\scratchcounter}}%
\fi}
\setvalue{\??naturaltablecell\the\c_tabl_ntb_cell}#1#2%
{\toksapp\t_tabl_ntb_row{\tabl_ntb_pass #1 #2 }% space delimited -> less tokens
\scratchcounter\tabl_ntb_get_col{#1}{#2}\relax
\ifnum\scratchcounter>\zerocount
- \normalexpanded
- {\t_tabl_ntb_row
- {\the\t_tabl_ntb_row
- \ifnum\scratchcounter=\plusone
- \tabl_ntb_plus
- \else
- \tabl_ntb_skip{\the\scratchcounter}%
- \fi}}%
+ \etoksapp\t_tabl_ntb_row
+ {\ifnum\scratchcounter=\plusone
+ \tabl_ntb_plus
+ \else
+ \tabl_ntb_skip{\the\scratchcounter}%
+ \fi}%
\fi}
\unexpanded\def\tabl_ntb_cell#1#2%
diff --git a/tex/context/base/mkiv/trac-log.lua b/tex/context/base/mkiv/trac-log.lua
index 297d053ab..83b81c9b0 100644
--- a/tex/context/base/mkiv/trac-log.lua
+++ b/tex/context/base/mkiv/trac-log.lua
@@ -405,6 +405,15 @@ if runningtex then
setlogfile = ignore
settimedlog = ignore
+ -- settimedlog = function()
+ -- local localtime = os.localtime
+ -- local writeline = write_nl
+ -- write_nl = function(f,...)
+ -- writeline(f,localtime() .. " | " .. concat { ... })
+ -- end
+ -- settimedlog = ignore
+ -- end
+
else
local report_yes, subreport_yes, status_yes
diff --git a/tex/context/base/mkiv/util-sql-imp-sqlite.lua b/tex/context/base/mkiv/util-sql-imp-sqlite.lua
index 04d5ced3a..cf4a3a8b0 100644
--- a/tex/context/base/mkiv/util-sql-imp-sqlite.lua
+++ b/tex/context/base/mkiv/util-sql-imp-sqlite.lua
@@ -132,7 +132,6 @@ setmetatable(cache, {
local f_preamble = formatters[ [[
ATTACH `%s` AS `%s` ;
PRAGMA `%s`.synchronous = normal ;
-PRAGMA journal_mode = truncate ;
]] ]
local function execute(specification)
@@ -211,17 +210,19 @@ local function execute(specification)
else
local column = { }
callback = function(data,nofcolumns,values,fields)
- for i=0,nofcolumns-1 do
+ for i=1,nofcolumns do
local field
if keysdone then
- field = keys[i+1]
+ field = keys[i]
else
-- field = get_list_item(fields,i)
- field = ffi_tostring(fields[i])
+ field = ffi_tostring(fields[i-1])
keys[i+1] = field
end
- -- column[field] = get_list_item(values,i)
- column[field] = ffi_tostring(values[i])
+ if field then
+ -- column[field] = get_list_item(values,i)
+ column[field] = ffi_tostring(values[i-1])
+ end
end
nofrows = nofrows + 1
keysdone = true
diff --git a/tex/context/fonts/mkiv/type-imp-plex.mkiv b/tex/context/fonts/mkiv/type-imp-plex.mkiv
index 99b099474..44334bcbd 100644
--- a/tex/context/fonts/mkiv/type-imp-plex.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-plex.mkiv
@@ -14,10 +14,12 @@
% Taco will make a special (more verbose) one for the ConTeXt journal! That setup will also have
% adapted interline spacing matching the larger ascenders.
-% [IBMPlexMono|IBMPlexSans|IBMPlexSerif|IBMPlexSansCondensed]-[Thin|Light|Text||Medium|SemiBold|Bold|Extra].otf
-% [IBMPlexMono|IBMPlexSans|IBMPlexSerif|IBMPlexSansCondensed]-[Thin|Light|Text||Medium|SemiBold|Bold|Extra]Italic.otf
+% thin, extralight, light, regular, text, medium, semibold, bold
-% [IBMPlexSans][Hebrew]-[Thin|Light|Text||Medium|SemiBold|Bold|].otf
+% [IBMPlexMono|IBMPlexSans|IBMPlexSerif|IBMPlexSansCondensed]-[Thin|ExtraLight|Light||Text|Medium|SemiBold|Bold].otf
+% [IBMPlexMono|IBMPlexSans|IBMPlexSerif|IBMPlexSansCondensed]-[Thin|ExtraLight|Light||Text|Medium|SemiBold|Bold]Italic.otf
+
+% [IBMPlexSans][Hebrew]-[Thin|Light||Text|Medium|SemiBold|Bold|].otf
\loadtypescriptfile[bookman]
@@ -27,59 +29,69 @@
\definetypescriptprefix [n:plexsans] [IBMPlexSans]
\definetypescriptprefix [n:plexmono] [IBMPlexMono]
- \definetypescriptprefix [n:plexserifnarrow] [IBMPlexSerif]
- \definetypescriptprefix [n:plexsansnarrow] [IBMPlexSansCondensed]
- \definetypescriptprefix [n:plexmonnarrow] [IBMPlexMono]
+ \definetypescriptprefix [n:narrowplexserif] [IBMPlexSerif]
+ \definetypescriptprefix [n:narrowplexsans] [IBMPlexSansCondensed]
+ \definetypescriptprefix [n:narrowplexmono] [IBMPlexMono]
\definetypescriptprefix [f:plexserif] [\s!default]
\definetypescriptprefix [f:plexsans] [\s!default]
\definetypescriptprefix [f:plexmono] [\s!none]
- \definetypescriptprefix [f:plexserifnarrow] [\s!default]
- \definetypescriptprefix [f:plexsansnarrow] [\s!default]
- \definetypescriptprefix [f:plexmononarrow] [\s!none]
+ \definetypescriptprefix [f:narrowplexserif] [\s!default]
+ \definetypescriptprefix [f:narrowplexsans] [\s!default]
+ \definetypescriptprefix [f:narrowplexmono] [\s!none]
- % [THIN|light|TEXT||medium|semibold|bold|extra]
+ % thin
- \starttypescript [\s!sans,\s!serif,\s!mono] [plex-thin,plex-hairline] [\s!name]
+ \starttypescript [\s!sans,\s!serif,\s!mono] [plex-thin] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-thin] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-thinitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-text] [\s!features=\typescriptprefix{f:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-text] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-light] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-light] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\stoptypescript
- % [thin|LIGHT|text||medium|semibold|bold|extra]
+ % extralight
+
+ \starttypescript [\s!sans,\s!serif,\s!mono] [plex-extralight] [\s!name]
+ \setups[\s!font:\s!fallback:\typescriptone]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-extralight] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-extralightitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-regular] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-italic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \stoptypescript
+
+ % light
\starttypescript [\s!sans,\s!serif,\s!mono] [plex-light] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-light] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-lightitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-regular] [\s!features=\typescriptprefix{f:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-italic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-text] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-textitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\stoptypescript
- % [thin|light|TEXT||MEDIUM|semibold|bold|extra]
+ % regular
- \starttypescript [\s!sans,\s!serif,\s!mono] [plex-text] [\s!name]
+ \starttypescript [\s!sans,\s!serif,\s!mono] [plex] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
- \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-text] [\s!features=\typescriptprefix{f:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-textitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-regular] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-italic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-medium] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-mediumitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\stoptypescript
- % [thin|light|text||medium|SEMIBOLD|bold|extra]
+ % text
- \starttypescript [\s!sans,\s!serif,\s!mono] [plex] [\s!name]
+ \starttypescript [\s!sans,\s!serif,\s!mono] [plex-text] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
- \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-regular] [\s!features=\typescriptprefix{f:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-italic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-text] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-textitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibold] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\stoptypescript
- % [thin|light|text||MEDIUM|semibold|BOLD|extra]
+ % medium
\starttypescript [\s!sans,\s!serif,\s!mono] [plex-medium] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
@@ -89,9 +101,9 @@
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-bolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\stoptypescript
- % [thin|light|text||medium|SEMIBOLD|bold|EXTRA]
+ % semibold
- \starttypescript [\s!sans,\s!serif,\s!mono] [plex-semibold,plex-dark,plex-black] [\s!name]
+ \starttypescript [\s!sans,\s!serif,\s!mono] [plex-semibold] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibold] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
@@ -99,7 +111,19 @@
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-extraitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\stoptypescript
- \starttypescript[plex,plex-thin,plex-hairline,plex-light,plex-text,plex-medium,plex-semibold,plex-dark,plex-black]
+ % bold
+
+ \starttypescript [\s!sans,\s!serif,\s!mono] [plex-bold] [\s!name]
+ \setups[\s!font:\s!fallback:\typescriptone]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-bold] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-bolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-bold] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-bolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \stoptypescript
+
+ % done
+
+ \starttypescript[plex,plex-thin,plex-extralight,plex-light,plex,plex-text,plex-medium,plex-semibold,plex-bold]
\definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default]
\definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default]
\definetypeface [\typescriptone] [\s!tt] [\s!mono] [\typescriptone] [\s!default]
@@ -108,38 +132,107 @@
% Here's Taco's variant as used in the ConTeXt Group Journal.
- \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex-thin,ibmplexnarrow-thin] [\s!name]
+ \definefontfeature[plexwidened][extend=\luaexpr{1/0.85}] % An odd floating point number to correct monospace.
+
+ \definetypescriptprefix [f:scplexserif] [\s!default,plexwidened]
+ \definetypescriptprefix [f:scplexsans] [\s!default,plexwidened]
+ \definetypescriptprefix [f:scplexmono] [plexwidened]
+
+ \definetypescriptprefix [f:scnarrowplexserif] [\s!default,plexwidened]
+ \definetypescriptprefix [f:scnarrowplexsans] [\s!default,plexwidened]
+ \definetypescriptprefix [f:scnarrowplexmono] [plexwidened]
+
+ \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex-thin] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-thin] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-thinitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-text] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-textitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Widened] [\s!file:\typescriptprefix{n:plex\typescriptone}-thin] [\s!features=\typescriptprefix{f:scplex\typescriptone}]
+ \definefontfallback[Fake\typescriptprefix{\typescriptone}Caps] [\typescriptprefix{\typescriptone}Widened] [0x0000-0xFFFF] [\s!rscale=0.85,method=uppercase]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Caps] [\s!file:\typescriptprefix{n:plex\typescriptone}-thin] [\s!fallbacks=Fake\typescriptprefix{\typescriptone}Caps]
\stoptypescript
- \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex-extralight,ibmplexnarrow-extralight] [\s!name]
+ \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex-extralight] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-extralight] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-extralightitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-medium] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-mediumitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Widened] [\s!file:\typescriptprefix{n:plex\typescriptone}-extralight] [\s!features=\typescriptprefix{f:scplex\typescriptone}]
+ \definefontfallback[Fake\typescriptprefix{\typescriptone}Caps] [\typescriptprefix{\typescriptone}Widened] [0x0000-0xFFFF] [\s!rscale=0.85,method=uppercase]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Caps] [\s!file:\typescriptprefix{n:plex\typescriptone}-extralight] [\s!fallbacks=Fake\typescriptprefix{\typescriptone}Caps]
\stoptypescript
- \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex-light,ibmplexnarrow-light] [\s!name]
+ \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex-light] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-light] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-lightitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibold] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Widened] [\s!file:\typescriptprefix{n:plex\typescriptone}-light] [\s!features=\typescriptprefix{f:scplex\typescriptone}]
+ \definefontfallback[Fake\typescriptprefix{\typescriptone}Caps] [\typescriptprefix{\typescriptone}Widened] [0x0000-0xFFFF] [\s!rscale=0.85,method=uppercase]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Caps] [\s!file:\typescriptprefix{n:plex\typescriptone}-light] [\s!fallbacks=Fake\typescriptprefix{\typescriptone}Caps]
\stoptypescript
- \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex,ibmplexnarrow-light] [\s!name]
+ \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex] [\s!name]
\setups[\s!font:\s!fallback:\typescriptone]
\definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-regular] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:plex\typescriptone}-italic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-bold] [\s!features=\typescriptprefix{f:plex\typescriptone}]
\definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-bolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Widened] [\s!file:\typescriptprefix{n:plex\typescriptone}-regular] [\s!features=\typescriptprefix{f:scplex\typescriptone}]
+ \definefontfallback[Fake\typescriptprefix{\typescriptone}Caps] [\typescriptprefix{\typescriptone}Widened] [0x0000-0xFFFF] [\s!rscale=0.85,method=uppercase]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Caps] [\s!file:\typescriptprefix{n:plex\typescriptone}-regular] [\s!fallbacks=Fake\typescriptprefix{\typescriptone}Caps]
+ \stoptypescript
+
+ % narrow
+
+ \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplexnarrow-thin] [\s!name]
+ \setups[\s!font:\s!fallback:\typescriptone]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-thin] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-thinitalic] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-text] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-textitalic] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Widened] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-thin] [\s!features=\typescriptprefix{f:scnarrowplex\typescriptone}]
+ \definefontfallback[Fake\typescriptprefix{\typescriptone}Caps] [\typescriptprefix{\typescriptone}Widened] [0x0000-0xFFFF] [\s!rscale=0.85,method=uppercase]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Caps] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-thin] [\s!fallbacks=Fake\typescriptprefix{\typescriptone}Caps]
+ \stoptypescript
+
+ \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplexnarrow-extralight] [\s!name]
+ \setups[\s!font:\s!fallback:\typescriptone]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-extralight] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-extralightitalic] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-medium] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-mediumitalic] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Widened] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-extralight] [\s!features=\typescriptprefix{f:scnarrowplex\typescriptone}]
+ \definefontfallback[Fake\typescriptprefix{\typescriptone}Caps] [\typescriptprefix{\typescriptone}Widened] [0x0000-0xFFFF] [\s!rscale=0.85,method=uppercase]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Caps] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-extralight] [\s!fallbacks=Fake\typescriptprefix{\typescriptone}Caps]
+ \stoptypescript
+
+ \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplexnarrow-light] [\s!name]
+ \setups[\s!font:\s!fallback:\typescriptone]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-light] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-lightitalic] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-semibold] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-semibolditalic] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Widened] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-light] [\s!features=\typescriptprefix{f:scnarrowplex\typescriptone}]
+ \definefontfallback[Fake\typescriptprefix{\typescriptone}Caps] [\typescriptprefix{\typescriptone}Widened] [0x0000-0xFFFF] [\s!rscale=0.85,method=uppercase]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Caps] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-light] [\s!fallbacks=Fake\typescriptprefix{\typescriptone}Caps]
\stoptypescript
+ \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplexnarrow] [\s!name]
+ \setups[\s!font:\s!fallback:\typescriptone]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-regular] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-italic] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-bold] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-bolditalic] [\s!features=\typescriptprefix{f:narrowplex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Widened] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-regular] [\s!features=\typescriptprefix{f:scnarrowplex\typescriptone}]
+ \definefontfallback[Fake\typescriptprefix{\typescriptone}Caps] [\typescriptprefix{\typescriptone}Widened] [0x0000-0xFFFF] [\s!rscale=0.85,method=uppercase]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Caps] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-regular] [\s!fallbacks=Fake\typescriptprefix{\typescriptone}Caps]
+ \stoptypescript
+
+
% For now, as some day plex will have cjk, hebrew, devanagari and arabic. The abstraction is not needed but
% this way we can add more id needed without much code.
@@ -152,28 +245,28 @@
\definefontfallback [SansHebrewFallbackBold] [SansHebrewBold] [0x0590-0x05ff] [check=yes,force=no]
\starttypescript [\s!sans] [ibmplex-thin] [\s!name]
- \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-extralight]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-thin]
[\s!features=\typescriptprefix{f:plex\typescriptone},
\s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-medium]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-text]
[\s!features=\typescriptprefix{f:plex\typescriptone},
\s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-extralight]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-thin]
[\s!features=hebrew]
- \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-medium]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-text]
[\s!features=hebrew]
\stoptypescript
\starttypescript [\s!sans] [ibmplex-extralight] [\s!name]
- \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-thin]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:plex\typescriptone}-extralight]
[\s!features=\typescriptprefix{f:plex\typescriptone},
\s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-text]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone}-medium]
[\s!features=\typescriptprefix{f:plex\typescriptone},
\s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
- \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-thin]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-extralight]
[\s!features=hebrew]
- \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-text]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-medium]
[\s!features=hebrew]
\stoptypescript
@@ -203,6 +296,60 @@
[\s!features=hebrew]
\stoptypescript
+ % narrow
+
+ \starttypescript [\s!sans] [ibmplexnarrow-thin] [\s!name]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-thin]
+ [\s!features=\typescriptprefix{f:narrowplex\typescriptone},
+ \s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-text]
+ [\s!features=\typescriptprefix{f:narrowplex\typescriptone},
+ \s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew] [\s!file:\typescriptprefix{n:narrowplex\typescriptone-hebrew}-thin]
+ [\s!features=hebrew]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:narrowplex\typescriptone-hebrew}-text]
+ [\s!features=hebrew]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [ibmplexnarrow-extralight] [\s!name]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-extralight]
+ [\s!features=\typescriptprefix{f:narrowplex\typescriptone},
+ \s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-medium]
+ [\s!features=\typescriptprefix{f:narrowplex\typescriptone},
+ \s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew] [\s!file:\typescriptprefix{n:narrowplex\typescriptone-hebrew}-extralight]
+ [\s!features=hebrew]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:narrowplex\typescriptone-hebrew}-medium]
+ [\s!features=hebrew]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [ibmplexnarrow-light] [\s!name]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-light]
+ [\s!features=\typescriptprefix{f:narrowplex\typescriptone},
+ \s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-semibold]
+ [\s!features=\typescriptprefix{f:narrowplex\typescriptone},
+ \s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew] [\s!file:\typescriptprefix{n:narrowplex\typescriptone-hebrew}-light]
+ [\s!features=hebrew]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:narrowplex\typescriptone-hebrew}-semibold]
+ [\s!features=hebrew]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [ibmplexnarrow] [\s!name]
+ \definefontsynonym [\typescriptprefix{\typescriptone}] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-regular]
+ [\s!features=\typescriptprefix{f:narrowplex\typescriptone},
+ \s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold] [\s!file:\typescriptprefix{n:narrowplex\typescriptone}-bold]
+ [\s!features=\typescriptprefix{f:narrowplex\typescriptone},
+ \s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew] [\s!file:\typescriptprefix{n:narrowplex\typescriptone-hebrew}-regular]
+ [\s!features=hebrew]
+ \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:narrowplex\typescriptone-hebrew}-bold]
+ [\s!features=hebrew]
+ \stoptypescript
+
% The main definition, inspired by discussion at the 2018 ConTeXt meeting after a talk by Taco. Here
% we default to sans serif. Taco: take your choice of math!
diff --git a/tex/context/interface/mkii/keys-de.xml b/tex/context/interface/mkii/keys-de.xml
index e5db3a6f4..78dcbcde6 100644
--- a/tex/context/interface/mkii/keys-de.xml
+++ b/tex/context/interface/mkii/keys-de.xml
@@ -1247,6 +1247,7 @@
<cd:constant name='textstyle' value='textstil'/>
<cd:constant name='textwidth' value='textbreite'/>
<cd:constant name='threshold' value='threshold'/>
+ <cd:constant name='time' value='time'/>
<cd:constant name='title' value='titel'/>
<cd:constant name='titlecolor' value='titelfarbe'/>
<cd:constant name='titlecommand' value='titlecommand'/>
diff --git a/tex/context/interface/mkii/keys-en.xml b/tex/context/interface/mkii/keys-en.xml
index e948cda23..a0a302d34 100644
--- a/tex/context/interface/mkii/keys-en.xml
+++ b/tex/context/interface/mkii/keys-en.xml
@@ -1247,6 +1247,7 @@
<cd:constant name='textstyle' value='textstyle'/>
<cd:constant name='textwidth' value='textwidth'/>
<cd:constant name='threshold' value='threshold'/>
+ <cd:constant name='time' value='time'/>
<cd:constant name='title' value='title'/>
<cd:constant name='titlecolor' value='titlecolor'/>
<cd:constant name='titlecommand' value='titlecommand'/>
diff --git a/tex/context/interface/mkiv/context-en.xml b/tex/context/interface/mkiv/context-en.xml
index 508e2fc7c..d0e93c410 100644
--- a/tex/context/interface/mkiv/context-en.xml
+++ b/tex/context/interface/mkiv/context-en.xml
@@ -10233,10 +10233,10 @@
<cd:constant type="cd:dimension"/>
</cd:parameter>
<cd:parameter name="ntop">
- <cd:constant type="cd:dimension"/>
+ <cd:constant type="cd:number"/>
</cd:parameter>
<cd:parameter name="nbottom">
- <cd:constant type="cd:dimension"/>
+ <cd:constant type="cd:number"/>
</cd:parameter>
<cd:parameter name="step">
<cd:constant type="small"/>
diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf
index f373195d9..d8dc51e14 100644
--- a/tex/context/interface/mkiv/i-context.pdf
+++ b/tex/context/interface/mkiv/i-context.pdf
Binary files differ
diff --git a/tex/context/interface/mkiv/i-floats.xml b/tex/context/interface/mkiv/i-floats.xml
index 2b25adf49..4b26b9e95 100644
--- a/tex/context/interface/mkiv/i-floats.xml
+++ b/tex/context/interface/mkiv/i-floats.xml
@@ -186,10 +186,10 @@
<cd:constant type="cd:dimension"/>
</cd:parameter>
<cd:parameter name="ntop">
- <cd:constant type="cd:dimension"/>
+ <cd:constant type="cd:number"/>
</cd:parameter>
<cd:parameter name="nbottom">
- <cd:constant type="cd:dimension"/>
+ <cd:constant type="cd:number"/>
</cd:parameter>
<cd:parameter name="step">
<cd:constant type="small"/>
diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf
index 3dcf09ed4..fac1c6288 100644
--- a/tex/context/interface/mkiv/i-readme.pdf
+++ b/tex/context/interface/mkiv/i-readme.pdf
Binary files differ
diff --git a/tex/context/modules/mkiv/m-matrix.mkiv b/tex/context/modules/mkiv/m-matrix.mkiv
index 9cac69672..4a0bd712d 100644
--- a/tex/context/modules/mkiv/m-matrix.mkiv
+++ b/tex/context/modules/mkiv/m-matrix.mkiv
@@ -23,6 +23,8 @@
\startluacode
+local tonumber, type = tonumber, type
+
local settings_to_hash = utilities.parsers.settings_to_hash
local formatters = string.formatters
local copy = table.copy
@@ -114,7 +116,7 @@ function matrix.typeset(m,options)
if type(m[1]) ~= "table" then
m = { copy(m) }
end
- for i=1, #m do
+ for i=1,#m do
local mi = m[i]
for j=1,#mi do
context.NC()
@@ -164,9 +166,11 @@ function matrix.swapcolumns(t, i, j)
return t
end
-matrix.swapC = matrix.swapcolumns
-matrix.swapR = matrix.swaprows
-matrix.swap = matrix.swaprows
+matrix.swapC = matrix.swapcolumns
+matrix.swapR = matrix.swaprows
+matrix.swapcolumns = matrix.swapcolumns
+matrix.swaprows = matrix.swaprows
+matrix.swap = matrix.swaprows
-- replace i-th row with factor * (i-th row)
@@ -299,7 +303,7 @@ local function determinant(m)
end
return s*d
else
- return "error: not a square matrix" -- not context(..)
+ return "error: not a square matrix"
end
end
@@ -371,7 +375,7 @@ matrix.rowEchelon = rowechelon
-- make matrices until its determinant is not 0
-function matrix.make(m,n,low,high) -- m and n swapped
+local function make(m,n,low,high) -- m and n swapped
if not n then
n = 10
end
@@ -401,6 +405,9 @@ function matrix.make(m,n,low,high) -- m and n swapped
end
end
+matrix.make = make
+matrix.makeR = matrix.make
+
-- extract submatrix by using
local function submatrix(t,i,j)
@@ -420,10 +427,11 @@ local function submatrix(t,i,j)
end
matrix.submatrix = submatrix
+matrix.subMatrix = submatrix
-- calculating determinant using Laplace Expansion
-function matrix.laplace(t) -- not sure if this is the most effient but
+local function laplace(t) -- not sure if this is the most effient but
local factors = { 1 } -- it's not used for number crunching anyway
local data = copy(t)
local det = 0
@@ -461,6 +469,8 @@ function matrix.laplace(t) -- not sure if this is the most effient but
return det
end
+matrix.laplace = laplace
+
-- solve the linear equation m X = c
local function solve(m,c)
@@ -518,6 +528,74 @@ end
matrix.inverse = inverse
+-- create zero and identity matrix
+
+local function makeM(k,v)
+ local tt = { }
+ for i=1,k do
+ local temp = { }
+ for j=1,k do
+ temp[j] = 0
+ end
+ tt[i] = temp
+ end
+ if v and v > 0 then
+ for i=1,k do
+ tt[i][i] = 1
+ end
+ end
+ return tt
+end
+
+matrix.makeM = makeM
+matrix.makeidentity = makeM
+matrix.makezero = makeM
+
+-- append the rows of the second matrix to the bottom of the first matrix
+
+local function joinrows(t1, t2)
+ local nt1 = #t1
+ local nt2 = #t2
+ if (nt1*nt2 > 0) and (#t1[1] ~= #t2[1]) then
+ return "error: different number of columns"
+ else
+ for i=1,nt2 do
+ t1[nt1+i] = t2[i]
+ end
+ return t1
+ end
+end
+
+matrix.joinrows = joinrows
+matrix.joinRows = joinrows
+
+-- append the columns of the second matrix to the right of the first matrix
+
+local function joincolumns(t1, t2)
+ local nt1 = #t1
+ local nt2 = #t2
+ if nt1 == 0 then
+ return t2
+ end
+ if nt2 == 0 then
+ return t1
+ end
+ if nt1 ~= nt2 then
+ return "error: different number of rows"
+ end
+ nt3 = #t2[1]
+ for i=1,nt1 do
+ local temp = t2[i]
+ for j= 1, nt3 do
+ insert(t1[i],temp[j])
+ end
+ end
+ return t1
+end
+
+matrix.joincolumns = joincolumns
+matrix.joinColumns = joincolumns
+
\stopluacode
\stopmodule
@@ -570,6 +648,7 @@ document.DemoMatrixC = {
\startbuffer
\ctxmodulematrix{typeset(moduledata.matrix.symbolic("a", "m", "n"))}
+$\qquad\qquad$
\ctxmodulematrix{typeset(moduledata.matrix.symbolic("a", "m", "n", 4, 8))}
\stopbuffer
@@ -581,9 +660,10 @@ document.DemoMatrixC = {
\startbuffer
\startluacode
- moduledata.matrix.typeset(moduledata.matrix.make(4,3, 0,5))
+ moduledata.matrix.typeset(moduledata.matrix.makeR(4,3, 0,5))
context.qquad()
- moduledata.matrix.typeset(moduledata.matrix.make(5,5,-1,5))
+ context("\\qquad")
+ moduledata.matrix.typeset(moduledata.matrix.makeR(5,5,-1,5))
\stopluacode
\stopbuffer
@@ -591,7 +671,7 @@ document.DemoMatrixC = {
\stopsubject
-\startsubject[title={Swap two rows (2 and 4)}]
+\startsubject[title={Swap two rows (ex: 2 and 4)}]
\startbuffer
\startluacode
@@ -605,13 +685,13 @@ document.DemoMatrixC = {
\stopsubject
-\startsubject[title={Swap two columns (2 and 4)}]
+\startsubject[title={Swap two columns (ex: 1 and 3)}]
\startbuffer
\startluacode
moduledata.matrix.typeset(document.DemoMatrixA)
context("$\\qquad \\Rightarrow \\qquad$")
- moduledata.matrix.typeset(moduledata.matrix.swapcolumns(document.DemoMatrixA,2, 4))
+ moduledata.matrix.typeset(moduledata.matrix.swapcolumns(document.DemoMatrixA,1, 3))
\stopluacode
\stopbuffer
@@ -726,7 +806,7 @@ context(moduledata.matrix.inner({ 1, 2, 3 }, { 3, 1, 2, 4 }))
}
moduledata.matrix.typeset(m, {fences="bars"})
context("$\\qquad = \\qquad$")
- moduledata.matrix.determinant(m)
+ context(moduledata.matrix.determinant(m))
\stopluacode
\stopbuffer
@@ -864,4 +944,51 @@ context(moduledata.matrix.inner({ 1, 2, 3 }, { 3, 1, 2, 4 }))
\stopsubject
+\startsubject[title={make matrices(zero, identiry, random}]
+
+\startbuffer
+\startluacode
+ moduledata.matrix.typeset(moduledata.matrix.makeM(3, 0))
+ context.qquad()
+ moduledata.matrix.typeset(moduledata.matrix.makeM(3, 1))
+ context.qquad()
+ moduledata.matrix.typeset(moduledata.matrix.makeR(4,3))
+\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
+
+\stopsubject
+
+\startsubject[title={join rows, join columns}]
+
+\startbuffer
+\startluacode
+ local mat1 = moduledata.matrix.makeR(3, 4)
+ local mat2 = moduledata.matrix.makeR(4, 3)
+
+ context("Appending as columns: ")
+ context.blank()
+ moduledata.matrix.typeset(mat1)
+ context("$\\&$")
+ moduledata.matrix.typeset(mat1)
+ context("\\quad $\\Rightarrow$ \\quad")
+ moduledata.matrix.joinColumns(mat1, mat1)
+ moduledata.matrix.typeset(mat1)
+ context.blank()
+ context("Appending as rows: ")
+ context.blank()
+ moduledata.matrix.typeset(mat2)
+ context("$\\&$")
+ moduledata.matrix.typeset(mat2)
+ context("\\quad $\\Rightarrow$ \\quad")
+ moduledata.matrix.joinRows(mat2, mat2)
+ moduledata.matrix.typeset(mat2)
+\stopluacode
+\stopbuffer
+
+\getbuffer[demo]
+
+\stopsubject
+
\stoptext
diff --git a/tex/context/modules/mkiv/s-fonts-system.lua b/tex/context/modules/mkiv/s-fonts-system.lua
index b91b3e75d..e05eef0fa 100644
--- a/tex/context/modules/mkiv/s-fonts-system.lua
+++ b/tex/context/modules/mkiv/s-fonts-system.lua
@@ -30,11 +30,15 @@ if not modules then modules = { } end modules ['s-fonts-system'] = {
moduledata.fonts = moduledata.fonts or { }
moduledata.fonts.system = moduledata.fonts.system or { }
-local lower = string.lower
-
local context = context
local NC, NR, HL = context.NC, context.NR, context.HL
-local bold = context.bold
+local ctx_bold = context.bold
+local ctx_verbatim = context.verbatim
+local lpegmatch = lpeg.match
+local sortedhash = table.sortedhash
+local formatters = string.formatters
+local concat = table.concat
+local lower = string.lower
local function allfiles(specification)
local pattern = lower(specification.pattern or "")
@@ -54,12 +58,12 @@ function moduledata.fonts.system.showinstalled(specification)
if files then
context.starttabulate { "|Tl|Tl|Tl|Tl|Tl|Tl|" }
HL()
- NC() bold("filename")
- NC() bold("fontname")
- NC() bold("subfamily")
- NC() bold("variant")
- NC() bold("weight")
- NC() bold("width")
+ NC() ctx_bold("filename")
+ NC() ctx_bold("fontname")
+ NC() ctx_bold("subfamily")
+ NC() ctx_bold("variant")
+ NC() ctx_bold("weight")
+ NC() ctx_bold("width")
NC() NR()
HL()
for filename, data in table.sortedpairs(files) do
@@ -80,25 +84,121 @@ function moduledata.fonts.system.cacheinstalled(specification)
local files = allfiles(specification)
if files then
local threshold = tonumber(specification.threshold)
+ local suffixes = specification.suffixes
+ if suffixes then
+ suffixes = utilities.parsers.settings_to_set(suffixes)
+ else
+ suffixes = { otf = true, ttf = true }
+ end
for filename, data in table.sortedpairs(files) do
if string.find(filename," ") then
-- skip this one
- else
- local s = file.suffix(filename)
- if s == "otf" or s == "ttf" then
- local fullname = resolvers.findfile(filename)
- context.start()
- context.type(fullname)
- context.par()
- if threshold and file.size(fullname) > threshold then
- logs.report("fonts","ignoring : %s",fullname)
- else
- logs.report("fonts","caching : %s",fullname)
- context.definedfont { filename }
+ elseif suffixes[file.suffix(filename)] then
+ local fullname = resolvers.findfile(filename)
+ context.start()
+ context.type(fullname)
+ context.par()
+ if threshold and file.size(fullname) > threshold then
+ logs.report("fonts","ignoring : %s",fullname)
+ else
+ logs.report("fonts","caching : %s",fullname)
+ context.definedfont { filename }
+ end
+ context.stop()
+ end
+ end
+ end
+end
+
+local splitter = lpeg.splitat(lpeg.S("._"),true)
+
+local method = 3
+
+function moduledata.fonts.system.showinstalledglyphnames(specification)
+ specification = interfaces.checkedspecification(specification)
+ local paths = caches.getreadablepaths()
+ local files = { }
+ local names = table.setmetatableindex("table")
+ local f_u = formatters["%04X"]
+ for i=1,#paths do
+ local list = dir.glob(paths[i].."/fonts/o*/**.tmc")
+ for i=1,#list do
+ files[list[i]] = true
+ end
+ end
+ for filename in table.sortedhash(files) do
+ logs.report("system","fontfile: %s",file.nameonly(filename))
+ local data = table.load(filename)
+ if data then
+ if method == 1 then
+ local unicodes = data.resources.unicodes
+ if unicodes then
+ for n, u in sortedhash(unicodes) do
+ if u >= 0xF0000 or (u >= 0xE000 and u <= 0xF8FF) then
+ -- skip
+ else
+ local f = lpegmatch(splitter,n) or n
+ if #f > 0 then
+ local t = names[f]
+ t[u] = (t[u] or 0) + 1
+ end
+ end
+ end
+ end
+ elseif method == 2 then
+ local unicodes = data.resources.unicodes
+ if unicodes then
+ for n, u in sortedhash(unicodes) do
+ if u >= 0xF0000 or (u >= 0xE000 and u <= 0xF8FF) then
+ -- skip
+ else
+ local t = names[n]
+ t[u] = (t[u] or 0) + 1
+ end
end
- context.stop()
end
+ elseif method == 3 then
+ local descriptions = data.descriptions
+ if descriptions then
+ for u, d in sortedhash(descriptions) do
+ local n = d.name
+ local u = d.unicode
+ if n and u then
+ if type(u) == "table" then
+ local t = { }
+ for i=1,#u do
+ t[i] = f_u(u[i])
+ end
+ u = concat(t," ")
+ end
+ local t = names[n]
+ t[u] = (t[u] or 0) + 1
+ end
+ end
+ end
+ else
+ -- nothing
end
end
end
+ if next(names) then
+ context.starttabulate { "|l|pl|" }
+ local f_u = formatters["%04X~(%i)"]
+ local f_s = formatters["%s~(%i)"]
+ for k, v in sortedhash(names) do
+ local t = { }
+ for k, v in sortedhash(v) do
+ if type(k) == "string" then
+ t[#t+1] = f_s(k,v)
+ else
+ t[#t+1] = f_u(k,v)
+ end
+ end
+ NC() ctx_verbatim(k)
+ NC() context("% t",t)
+ NC() NR()
+ end
+ context.stoptabulate()
+ end
+ table.save("s-fonts-system-glyph-names.lua",names)
end
diff --git a/tex/context/modules/mkiv/s-fonts-system.mkiv b/tex/context/modules/mkiv/s-fonts-system.mkiv
index a9d33d27e..5613701d9 100644
--- a/tex/context/modules/mkiv/s-fonts-system.mkiv
+++ b/tex/context/modules/mkiv/s-fonts-system.mkiv
@@ -24,8 +24,9 @@
\registerctxluafile{s-fonts-system}{}
-\installmodulecommandluasingle \showinstalledfonts {moduledata.fonts.system.showinstalled}
-\installmodulecommandluasingle \cacheinstalledfonts {moduledata.fonts.system.cacheinstalled}
+\installmodulecommandluasingle \showinstalledfonts {moduledata.fonts.system.showinstalled}
+\installmodulecommandluasingle \cacheinstalledfonts {moduledata.fonts.system.cacheinstalled}
+\installmodulecommandluasingle \showinstalledglyphnames {moduledata.fonts.system.showinstalledglyphnames}
\stopmodule
@@ -36,6 +37,12 @@
\starttext
% \showinstalledfonts
- \cacheinstalledfonts[threshold=4000000]
+
+% \enabletrackers[otf.keepnames]
+
+% \cacheinstalledfonts[threshold=4000000,suffixes={otf,ttf,afm,pfb}]
+% \cacheinstalledfonts[threshold=2000000,suffixes={otf,ttf,afm,pfb}]
+
+ \showinstalledglyphnames
\stoptext
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index adc2c6202..90f8f4f00 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 : 10/03/18 16:02:19
+-- merge date : 10/08/18 17:44:41
do -- begin closure to overcome local limits and interference
@@ -14218,7 +14218,7 @@ if not modules then modules={} end modules ['font-cff']={
}
local next,type,tonumber=next,type,tonumber
local byte,char,gmatch=string.byte,string.char,string.gmatch
-local concat,remove=table.concat,table.remove
+local concat,remove,unpack=table.concat,table.remove,table.unpack
local floor,abs,round,ceil,min,max=math.floor,math.abs,math.round,math.ceil,math.min,math.max
local P,C,R,S,C,Cs,Ct=lpeg.P,lpeg.C,lpeg.R,lpeg.S,lpeg.C,lpeg.Cs,lpeg.Ct
local lpegmatch=lpeg.match
@@ -20851,7 +20851,7 @@ local function checklookups(fontdata,missing,nofmissing)
end
end
if next(done) then
- report_unicode("not unicoded: % t",sortedkeys(done))
+ report_unicodes("not unicoded: % t",sortedkeys(done))
end
end
end
@@ -21040,9 +21040,25 @@ local function unifyglyphs(fontdata,usenames)
fontdata.hashmethod=hashmethod
return indices,names
end
-local p_bogusname=(
- (P("uni")+P("UNI")+P("Uni")+P("U")+P("u"))*S("Xx")^0*R("09","AF")^1+(P("identity")+P("Identity")+P("IDENTITY"))*R("09","AF")^1+(P("index")+P("Index")+P("INDEX"))*R("09")^1
-)*(P(-1)+P("."))
+local p_crappyname do
+ local p_hex=R("af","AF","09")
+ local p_digit=R("09")
+ local p_done=S("._-")^0+P(-1)
+ local p_alpha=R("az","AZ")
+ local p_ALPHA=R("AZ")
+ p_crappyname=(
+ lpeg.utfchartabletopattern({ "uni","u" },true)*S("Xx_")^0*p_hex^1
++lpeg.utfchartabletopattern({ "identity","glyph","jamo" },true)*p_hex^1
++lpeg.utfchartabletopattern({ "index","afii" },true)*p_digit^1
++p_digit*p_hex^3+p_alpha*p_digit^1
++P("aj")*p_digit^1+P("eh_")*(p_digit^1+p_ALPHA*p_digit^1)+(1-P("_"))^1*P("_uni")*p_hex^1+P("_")*P(1)^1
+ )*p_done
+end
+local forcekeep=false
+directives.register("otf.keepnames",function(v)
+ report_cleanup("keeping weird glyph names, expect larger files and more memory usage")
+ forcekeep=v
+end)
local function stripredundant(fontdata)
local descriptions=fontdata.descriptions
if descriptions then
@@ -21058,7 +21074,7 @@ local function stripredundant(fontdata)
else
for unicode,d in next,descriptions do
local name=d.name
- if name and lpegmatch(p_bogusname,name) then
+ if name and lpegmatch(p_crappyname,name) then
d.name=nil
n=n+1
end
@@ -21078,6 +21094,7 @@ local function stripredundant(fontdata)
end
end
end
+readers.stripredundant=stripredundant
function readers.getcomponents(fontdata)
local resources=fontdata.resources
if resources then
@@ -32882,6 +32899,7 @@ function afm.load(filename)
if data then
afmenhancers.apply(data,filename)
fonts.mappings.addtounicode(data,filename)
+ otfreaders.stripredundant(data)
otfreaders.pack(data)
data.size=size
data.time=time