From 6f2d249bfb4ead58ed709e59c403df9457f51982 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 4 Oct 2019 18:59:44 +0200 Subject: 2019-10-04 17:52:00 --- .../documents/general/manuals/luametafun.pdf | Bin 1668894 -> 1697401 bytes doc/context/documents/general/qrcs/setup-cs.pdf | Bin 887618 -> 887638 bytes doc/context/documents/general/qrcs/setup-de.pdf | Bin 889147 -> 889570 bytes doc/context/documents/general/qrcs/setup-en.pdf | Bin 893298 -> 893187 bytes doc/context/documents/general/qrcs/setup-fr.pdf | Bin 885344 -> 885655 bytes doc/context/documents/general/qrcs/setup-it.pdf | Bin 891141 -> 891118 bytes .../documents/general/qrcs/setup-mapping-cs.pdf | Bin 383721 -> 383962 bytes .../documents/general/qrcs/setup-mapping-de.pdf | Bin 471542 -> 471698 bytes .../documents/general/qrcs/setup-mapping-en.pdf | Bin 380233 -> 380055 bytes .../documents/general/qrcs/setup-mapping-fr.pdf | Bin 383840 -> 383753 bytes .../documents/general/qrcs/setup-mapping-it.pdf | Bin 383132 -> 383179 bytes .../documents/general/qrcs/setup-mapping-nl.pdf | Bin 382077 -> 382085 bytes .../documents/general/qrcs/setup-mapping-ro.pdf | Bin 620285 -> 620612 bytes doc/context/documents/general/qrcs/setup-nl.pdf | Bin 880641 -> 880835 bytes doc/context/documents/general/qrcs/setup-ro.pdf | Bin 885453 -> 885539 bytes doc/context/scripts/mkiv/mtx-update.html | 66 ----- doc/context/scripts/mkiv/mtx-update.man | 81 ----- doc/context/scripts/mkiv/mtx-update.xml | 33 --- .../manuals/luametafun/luametafun-fonts.tex | 328 +++++++++++++++++++++ .../manuals/luametafun/luametafun-style.tex | 9 + .../general/manuals/luametafun/luametafun.tex | 1 + metapost/context/base/mpiv/mp-lmtx.mpxl | 19 ++ scripts/context/lua/mtx-install.lua | 2 +- scripts/context/lua/mtx-update.lua | 128 ++++++-- scripts/context/lua/mtxrun.lua | 27 +- scripts/context/stubs/mswin/mtxrun.lua | 27 +- scripts/context/stubs/unix/mtxrun | 27 +- scripts/context/stubs/win64/mtxrun.lua | 27 +- tex/context/base/mkii/cont-new.mkii | 2 +- tex/context/base/mkii/context.mkii | 2 +- tex/context/base/mkii/mult-de.mkii | 1 + tex/context/base/mkii/mult-nl.mkii | 1 + tex/context/base/mkii/mult-pe.mkii | 9 + tex/context/base/mkiv/colo-ini.lua | 2 - tex/context/base/mkiv/colo-ini.mkiv | 2 +- tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/context.mkxl | 2 +- tex/context/base/mkiv/font-ctx.lua | 69 ++++- tex/context/base/mkiv/font-ogr.lua | 192 +++++++++++- tex/context/base/mkiv/lpdf-emb.lua | 11 +- tex/context/base/mkiv/lxml-lpt.lua | 45 ++- tex/context/base/mkiv/lxml-tex.lua | 2 +- tex/context/base/mkiv/meta-imp-symbols.mkxl | 99 +++++++ tex/context/base/mkiv/meta-ini.mkxl | 2 + tex/context/base/mkiv/mlib-lmp.lua | 16 + tex/context/base/mkiv/mlib-lua.lua | 1 + tex/context/base/mkiv/mlib-run.lua | 8 +- tex/context/base/mkiv/status-files.pdf | Bin 26630 -> 26660 bytes tex/context/base/mkiv/status-lua.pdf | Bin 268646 -> 268380 bytes tex/context/fonts/mkiv/type-imp-cambria.mkiv | 2 +- tex/context/fonts/mkiv/type-imp-dejavu.mkiv | 4 +- tex/context/fonts/mkiv/type-imp-texgyre.mkiv | 8 +- tex/context/interface/mkii/keys-de.xml | 1 + tex/context/interface/mkii/keys-nl.xml | 1 + tex/context/interface/mkii/keys-pe.xml | 9 + tex/context/interface/mkiv/i-context.pdf | Bin 893298 -> 893187 bytes tex/context/interface/mkiv/i-readme.pdf | Bin 61165 -> 61165 bytes tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 59 files changed, 976 insertions(+), 296 deletions(-) delete mode 100644 doc/context/scripts/mkiv/mtx-update.html delete mode 100644 doc/context/scripts/mkiv/mtx-update.man delete mode 100644 doc/context/scripts/mkiv/mtx-update.xml create mode 100644 doc/context/sources/general/manuals/luametafun/luametafun-fonts.tex create mode 100644 tex/context/base/mkiv/meta-imp-symbols.mkxl diff --git a/doc/context/documents/general/manuals/luametafun.pdf b/doc/context/documents/general/manuals/luametafun.pdf index d0a19a3b5..188f1f21d 100644 Binary files a/doc/context/documents/general/manuals/luametafun.pdf and b/doc/context/documents/general/manuals/luametafun.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf index 33234564e..506dfc96a 100644 Binary files a/doc/context/documents/general/qrcs/setup-cs.pdf and b/doc/context/documents/general/qrcs/setup-cs.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf index 6b3768529..3265015ea 100644 Binary files a/doc/context/documents/general/qrcs/setup-de.pdf and b/doc/context/documents/general/qrcs/setup-de.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf index 8471d15b4..51102b6e7 100644 Binary files a/doc/context/documents/general/qrcs/setup-en.pdf and b/doc/context/documents/general/qrcs/setup-en.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf index 20aa6e88e..436f9f41d 100644 Binary files a/doc/context/documents/general/qrcs/setup-fr.pdf and b/doc/context/documents/general/qrcs/setup-fr.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf index f54ac45f8..09ba7f8cc 100644 Binary files a/doc/context/documents/general/qrcs/setup-it.pdf and b/doc/context/documents/general/qrcs/setup-it.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf index be096cfa0..c4f84e8e4 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf and b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-de.pdf b/doc/context/documents/general/qrcs/setup-mapping-de.pdf index 6af69e8e5..4a8cec63f 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-de.pdf and b/doc/context/documents/general/qrcs/setup-mapping-de.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/doc/context/documents/general/qrcs/setup-mapping-en.pdf index 0ca8447f9..439349327 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-en.pdf and b/doc/context/documents/general/qrcs/setup-mapping-en.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf index ece38b598..2ba16062a 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf and b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/doc/context/documents/general/qrcs/setup-mapping-it.pdf index 3d1e3f394..ecd479c4b 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-it.pdf and b/doc/context/documents/general/qrcs/setup-mapping-it.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf index a6b35b0df..0ddd7011d 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf and b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf index 3a9c33053..15edacd00 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf and b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf index 8b47f596c..d389a21cb 100644 Binary files a/doc/context/documents/general/qrcs/setup-nl.pdf and b/doc/context/documents/general/qrcs/setup-nl.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf index fd120f187..3ec2dc1db 100644 Binary files a/doc/context/documents/general/qrcs/setup-ro.pdf and b/doc/context/documents/general/qrcs/setup-ro.pdf differ diff --git a/doc/context/scripts/mkiv/mtx-update.html b/doc/context/scripts/mkiv/mtx-update.html deleted file mode 100644 index ed7363ca0..000000000 --- a/doc/context/scripts/mkiv/mtx-update.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - ConTeXt Minimals Updater 1.03 - - - - - -
-
ConTeXt Minimals Updater 1.03
-
-
-
-
wiki: http://contextgarden.net | mail: ntg-context@ntg.nl | website: http://www.pragma-ade.nl
-
-
-
- -
-
-

Command line options

- - - - - - - - - - - - - - - - - - - - - - -
flagvaluedescription
--platformstringplatform (windows, linux, linux-64, osx-intel, osx-ppc, linux-ppc)
--serverstringrepository url (rsync://contextgarden.net)
--modulestringrepository url (minimals)
--repositorystringspecify version (current, experimental)
--contextstringspecify version (current, latest, beta, yyyy.mm.dd)
--rsyncstringrsync binary (rsync)
--texrootstringinstallation directory (not guessed for the moment)
--enginestringtex engine (luatex, pdftex, xetex)
--modulesstringextra modules (can be list or 'all')
--fontsstringadditional fonts (can be list or 'all')
--goodiesstringextra binaries (like scite and texworks)
--forceinstead of a dryrun, do the real thing
--updateupdate minimal tree
--makealso make formats and generate file databases
--keepdon't delete unused or obsolete files
--stateupdate tree using saved state
--cygwinadapt drive specs to cygwin
--mingwassume mingw binaries being used
--silentless (or no) logging
-
-
-
- - diff --git a/doc/context/scripts/mkiv/mtx-update.man b/doc/context/scripts/mkiv/mtx-update.man deleted file mode 100644 index a4ecef639..000000000 --- a/doc/context/scripts/mkiv/mtx-update.man +++ /dev/null @@ -1,81 +0,0 @@ -.TH "mtx-update" "1" "01-01-2019" "version 1.03" "ConTeXt Minimals Updater" -.SH NAME - mtx-update - ConTeXt Minimals Updater -.SH SYNOPSIS -.B mtxrun --script update [ -.I OPTIONS ... -.B ] [ -.I FILENAMES -.B ] -.SH DESCRIPTION -.B ConTeXt Minimals Updater -.SH OPTIONS -.TP -.B --platform=string -platform (windows, linux, linux-64, osx-intel, osx-ppc, linux-ppc) -.TP -.B --server=string -repository url (rsync://contextgarden.net) -.TP -.B --module=string -repository url (minimals) -.TP -.B --repository=string -specify version (current, experimental) -.TP -.B --context=string -specify version (current, latest, beta, yyyy.mm.dd) -.TP -.B --rsync=string -rsync binary (rsync) -.TP -.B --texroot=string -installation directory (not guessed for the moment) -.TP -.B --engine=string -tex engine (luatex, pdftex, xetex) -.TP -.B --modules=string -extra modules (can be list or 'all') -.TP -.B --fonts=string -additional fonts (can be list or 'all') -.TP -.B --goodies=string -extra binaries (like scite and texworks) -.TP -.B --force -instead of a dryrun, do the real thing -.TP -.B --update -update minimal tree -.TP -.B --make -also make formats and generate file databases -.TP -.B --keep -don't delete unused or obsolete files -.TP -.B --state -update tree using saved state -.TP -.B --cygwin -adapt drive specs to cygwin -.TP -.B --mingw -assume mingw binaries being used -.TP -.B --silent -less (or no) logging -.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-update.xml b/doc/context/scripts/mkiv/mtx-update.xml deleted file mode 100644 index 818b994fd..000000000 --- a/doc/context/scripts/mkiv/mtx-update.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - mtx-update - ConTeXt Minimals Updater - 1.03 - - - - - platform (windows, linux, linux-64, osx-intel, osx-ppc, linux-ppc) - repository url (rsync://contextgarden.net) - repository url (minimals) - specify version (current, experimental) - specify version (current, latest, beta, yyyy.mm.dd) - rsync binary (rsync) - installation directory (not guessed for the moment) - tex engine (luatex, pdftex, xetex) - extra modules (can be list or 'all') - additional fonts (can be list or 'all') - extra binaries (like scite and texworks) - instead of a dryrun, do the real thing - update minimal tree - also make formats and generate file databases - don't delete unused or obsolete files - update tree using saved state - adapt drive specs to cygwin - assume mingw binaries being used - less (or no) logging - - - - diff --git a/doc/context/sources/general/manuals/luametafun/luametafun-fonts.tex b/doc/context/sources/general/manuals/luametafun/luametafun-fonts.tex new file mode 100644 index 000000000..27ea2fd00 --- /dev/null +++ b/doc/context/sources/general/manuals/luametafun/luametafun-fonts.tex @@ -0,0 +1,328 @@ +% language=us + +\environment luametafun-style + +\startcomponent luametafun-fonts + +\startchapter[title={Fonts}] + +Fonts are interesting phenomena but can also be quite hairy. Shapes can be +missing or not to your liking. There can be bugs too. Control over fonts has +always been on the agenda of \TEX\ macro packages, and \CONTEXT\ provides a lot +of control, especially in \MKIV. In \LMTX\ we add some more to that: we bring +back \METAFONT's but now in the \METAPOST\ way. A simple example shows how this +is (maybe I should say: will be) done. + +We define three simple shapes and do that (for now) in the \type {simplefun} +instance because that's what is used when generating the glyphs. + +\startbuffer +\startMPcalculation{simplefun} + vardef TestGlyphLB = + image ( + fill (unitsquare xscaled 10 yscaled 16 shifted (0,-3)) + withcolor "darkred" withtransparency (1,.5) + ; + ) + enddef ; + + vardef TestGlyphRB = + image ( + fill (unitcircle xscaled 15 yscaled 12 shifted (0,-2)) + withcolor "darkblue" withtransparency (1,.5) + ; + ) + enddef ; + + vardef TestGlyphFS = + image ( + fill (unittriangle xscaled 15 yscaled 12 shifted (0,-2)) + withcolor "darkgreen" withtransparency (1,.5) + ; + ) + enddef ; +\stopMPcalculation +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +This is not that spectacular, not is the following: + +\startbuffer +\startMPcalculation{simplefun} + lmt_registerglyphs [ + name = "test", + units = 10, % 1000 + ] ; + + lmt_registerglyph [ + category = "test", + unicode = 123, + code = "draw TestGlyphLB ;", + width = 10, % 1000 + height = 13, % 1300 + depth = 3 % 300 + ] ; + + lmt_registerglyph [ + category = "test", + unicode = 125, + code = "draw TestGlyphRB ;", + width = 15, + height = 10, + depth = 2 + ] ; + + lmt_registerglyph [ + category = "test", + unicode = "/", + code = "draw TestGlyphFS ;", + width = 15, + height = 10, + depth = 2 + ] ; + +\stopMPcalculation +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +We now define a font. We always use a font as starting point which has the +advantage that we always get something reasonable when we test. Of course you can +use this \type {mps} font feature with other fonts too. + +\startbuffer +\definefontfeature[metapost][metapost=test] % or: mps={category=test} + +\definefont[MyFontA][Serif*metapost @ 10bp] +\definefont[MyFontB][Serif*metapost @ 12bp] +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +These fonts can now be used: + +\startbuffer +\MyFontA \dorecurse{20}{\{ /#1/ \} }\par +\MyFontB \dorecurse{20}{\{ /#1/ \} }\par +\stopbuffer + +\typebuffer[option=TEX] + +We get some useless text but it demonstrates the idea: + +{\getbuffer} + +If you know a bit more about \CONTEXT\ you could think: so what, wasn't this +already possible? Sure, there are various ways to achieve similar effects, but +the method described here has a few advantages: it's relatively easy and we're +talking about real fonts here. This means that using the shapes for characters is +pretty efficient. + +A more realistic example is given next. It is a subset of what is available in +the \CONTEXT\ core. + +\startbuffer +\startMPcalculation{simplefun} + + pen SymbolPen ; SymbolPen := pencircle scaled 1/4 ; + + vardef SymbolBullet = + fill unitcircle scaled 3 shifted (1.5,1.5) withpen SymbolPen + enddef ; + vardef SymbolSquare = + draw unitsquare scaled (3-1/16) shifted (1.5,1.5) withpen SymbolPen + enddef ; + vardef SymbolBlackDiamond = + fillup unitdiamond scaled (3-1/16) shifted (1.5,1.5) withpen SymbolPen + enddef ; + vardef SymbolNotDef = + draw center unitcircle + scaled 3 + shifted (1.5,1.5) + withpen SymbolPen scaled 4 + enddef ; + + lmt_registerglyphs [ + name = "symbols", + units = 10, + usecolor = true, + width = 6, + height = 6, + depth = 0, + code = "SymbolNotDef ;", + ] ; + + lmt_registerglyph [ category = "symbols", unicode = "0x2022", + code = "SymbolBullet ;" + ] ; + lmt_registerglyph [ category = "symbols", unicode = "0x25A1", + code = "SymbolSquare ;" + ] ; + lmt_registerglyph [ category = "symbols", unicode = "0x25C6", + code = "SymbolBlackDiamond ;" + ] ; +\stopMPcalculation +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +We could use these symbols in for instance itemize symbols. You might notice the +potential difference in bullets: + +\startbuffer +\definefontfeature[metapost][metapost=symbols] + +\definefont[MyFont] [Serif*metapost sa 1] + +\startitemize[packed] + \startitem {\MyFont • □ ◆}\quad Regular rendering. \stopitem + \startitem {\MyFont\red • □ ◆}\quad Rendering with color. \stopitem + \startitem {\MyFont\blue\showglyphs • □ ◆}\quad Idem but with boundingboxes shown. \stopitem +\stopitemize +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +When blown up, these symbols look as follows: + +\startlinecorrection +\scale[width=\textwidth]{% + {\MyFont •□◆}% + {\MyFont\red •□◆}% + {\MyFont\blue\showglyphs •□◆}% +} +\stoplinecorrection + +You can use these tricks with basically any font, so also with math fonts. +However, at least for now, you need to define these before the font gets loaded. + +\startbuffer +\startMPcalculation{simplefun} + + pen KindergartenPen ; KindergartenPen := pencircle scaled 1 ; + + % 10 x 10 grid + + vardef KindergartenEqual = + draw image + ( + draw (2,6) -- (9,5) ; + draw (2,4) -- (8,3) ; + ) + shifted (0,-2) + withpen KindergartenPen + withcolor "KindergartenEqual" + enddef ; + vardef KindergartenPlus = + draw image + ( + draw (1,4) -- (9,5) ; + draw (4,1) -- (5,8) ; + ) + shifted (0,-2) + withpen KindergartenPen + withcolor "KindergartenPlus" + enddef ; + vardef KindergartenMinus = + draw image + ( + draw (1,5) -- (9,4) ; + ) + shifted (0,-2) + withpen KindergartenPen + withcolor "KindergartenMinus" + enddef ; + vardef KindergartenTimes = + draw image + ( + draw (2,1) -- (9,8) ; + draw (8,1) -- (2,8) ; + ) + shifted (0,-2) + withpen KindergartenPen + withcolor "KindergartenTimes" + enddef ; + vardef KindergartenDivided = + draw image + ( + draw (2,1) -- (8,9) ; + ) + shifted (0,-2) + withpen KindergartenPen + withcolor "KindergartenDivided" + enddef ; + + lmt_registerglyphs [ + name = "kindergarten", + units = 10, + % usecolor = true, + width = 10, + height = 8, + depth = 2, + ] ; + + lmt_registerglyph [ category = "kindergarten", unicode = "0x003D", + code = "KindergartenEqual" + ] ; + lmt_registerglyph [ category = "kindergarten", unicode = "0x002B", + code = "KindergartenPlus" + ] ; + lmt_registerglyph [ category = "kindergarten", unicode = "0x2212", + code = "KindergartenMinus" + ] ; + lmt_registerglyph [ category = "kindergarten", unicode = "0x00D7", + code = "KindergartenTimes" + ] ; + lmt_registerglyph [ category = "kindergarten", unicode = "0x002F", + code = "KindergartenDivided" + ] ; + +\stopMPcalculation +\stopbuffer + +\typebuffer[option=TEX] \getbuffer + +We also define the colors. If we leave \type {usecolor} to true, the text colors +will be taken. + +\startbuffer[definitions] +\definecolor[KindergartenEqual] [darkgreen] +\definecolor[KindergartenPlus] [darkred] +\definecolor[KindergartenMinus] [darkred] +\definecolor[KindergartenTimes] [darkblue] +\definecolor[KindergartenDivided][darkblue] + +\definefontfeature[mathextra][metapost=kindergarten] +\stopbuffer + +\typebuffer[definitions][option=TEX] \getbuffer[definitions] + +Here is an example: + +\starttyping +\switchtobodyfont[cambria] + +$ y = 2 \times x + a - b / 3 $ +\stoptyping + +Scaled up: + +\startlinecorrection + \switchtobodyfont[cambria] + \scale[width=\textwidth]{$ y = 2 \times x + a - b / 3 $} +\stoplinecorrection + +Of course this won't work out well (yet) with extensible yet, due to related +definitions for which we don't have an interface yet. There is one thing that you +need to keep in mind: the fonts are flushed when the document gets finalized so +you have to make sure that colors are defined at the level that they are still +valid at that time. So best put color definitions like the above in the document +style. + +This is an experimental interface anyway so we don't explain the parameters yet +as there might be more of them. + +\stopchapter + +\stopcomponent diff --git a/doc/context/sources/general/manuals/luametafun/luametafun-style.tex b/doc/context/sources/general/manuals/luametafun/luametafun-style.tex index df469d0c0..63eb7e375 100644 --- a/doc/context/sources/general/manuals/luametafun/luametafun-style.tex +++ b/doc/context/sources/general/manuals/luametafun/luametafun-style.tex @@ -52,4 +52,13 @@ [before=, after=] +% sectionblocks keep things local and we need these colors very late, +% when we flush fonts + +\definecolor[KindergartenEqual] [darkgreen] +\definecolor[KindergartenPlus] [darkred] +\definecolor[KindergartenMinus] [darkred] +\definecolor[KindergartenTimes] [darkblue] +\definecolor[KindergartenDivided][darkblue] + \stopenvironment diff --git a/doc/context/sources/general/manuals/luametafun/luametafun.tex b/doc/context/sources/general/manuals/luametafun/luametafun.tex index 6f5aff173..52b7a6800 100644 --- a/doc/context/sources/general/manuals/luametafun/luametafun.tex +++ b/doc/context/sources/general/manuals/luametafun/luametafun.tex @@ -26,6 +26,7 @@ \component luametafun-function \component luametafun-chart \component luametafun-svg + \component luametafun-fonts \component luametafun-interface \stopbodymatter diff --git a/metapost/context/base/mpiv/mp-lmtx.mpxl b/metapost/context/base/mpiv/mp-lmtx.mpxl index fe84872ea..3d24dfd75 100644 --- a/metapost/context/base/mpiv/mp-lmtx.mpxl +++ b/metapost/context/base/mpiv/mp-lmtx.mpxl @@ -2112,3 +2112,22 @@ vardef lmt_do_surface = popparameters ; ) enddef ; + +% I can make a variant that avoids the lmt_do ... and does an immediate function +% call instead. + +presetparameters "mpsglyphs" [ + name = "dummy", + units = 1000, +] ; + +presetparameters "mpsglyph" [ + category = "dummy", + unicode = 0, +] ; + +def lmt_registerglyphs = applyparameters "mpsglyphs" "lmt_do_registerglyphs" enddef ; +def lmt_registerglyph = applyparameters "mpsglyph" "lmt_do_registerglyph" enddef ; + +vardef lmt_do_registerglyphs = lua.mp.lmt_register_glyphs() ; enddef ; +vardef lmt_do_registerglyph = lua.mp.lmt_register_glyph () ; enddef ; diff --git a/scripts/context/lua/mtx-install.lua b/scripts/context/lua/mtx-install.lua index cf6ba4e98..5395ff6ee 100644 --- a/scripts/context/lua/mtx-install.lua +++ b/scripts/context/lua/mtx-install.lua @@ -402,7 +402,7 @@ function install.update() local osplatform = environment.arguments.platform or nil local platform = platforms[osplatform or os.platform or ""] - if platform == "unknown" and osplatform then + if (platform == "unknown" or platform == "" or not platform) and osplatform then -- catches openbsdN.M kind of specifications platform = osplatform elseif not osplatform then diff --git a/scripts/context/lua/mtx-update.lua b/scripts/context/lua/mtx-update.lua index d9deb1b36..a3297e804 100644 --- a/scripts/context/lua/mtx-update.lua +++ b/scripts/context/lua/mtx-update.lua @@ -164,19 +164,72 @@ update.goodies = { }, } -update.platforms = { +-- update.platforms = { +-- ["mswin"] = "mswin", +-- ["windows"] = "mswin", +-- ["win32"] = "mswin", +-- ["win"] = "mswin", +-- -- ["mswin"] = "win32", +-- -- ["windows"] = "win32", +-- -- ["win32"] = "win32", +-- -- ["win"] = "win32", +-- -- +-- -- ["mswin-64"] = "mswin-64", +-- -- ["windows-64"] = "mswin-64", +-- -- ["win64"] = "mswin-64", +-- ["mswin-64"] = "win64", +-- ["windows-64"] = "win64", +-- ["win64"] = "win64", +-- -- +-- ["linux"] = "linux", +-- ["linux-32"] = "linux", +-- ["linux32"] = "linux", +-- -- +-- ["linux-64"] = "linux-64", +-- ["linux64"] = "linux-64", +-- -- +-- ["linuxmusl-64"] = "linuxmusl-64", +-- -- +-- ["linux-armhf"] = "linux-armhf", +-- -- +-- ["freebsd"] = "freebsd", +-- -- +-- ["freebsd-amd64"] = "freebsd-amd64", +-- -- +-- ["kfreebsd"] = "kfreebsd-i386", +-- ["kfreebsd-i386"] = "kfreebsd-i386", +-- -- +-- ["kfreebsd-amd64"] = "kfreebsd-amd64", +-- -- +-- ["linux-ppc"] = "linux-ppc", +-- ["ppc"] = "linux-ppc", +-- -- +-- ["osx"] = "osx-intel", +-- ["macosx"] = "osx-intel", +-- ["osx-intel"] = "osx-intel", +-- ["osxintel"] = "osx-intel", +-- -- +-- ["osx-ppc"] = "osx-ppc", +-- ["osx-powerpc"] = "osx-ppc", +-- ["osxppc"] = "osx-ppc", +-- ["osxpowerpc"] = "osx-ppc", +-- -- +-- ["osx-64"] = "osx-64", +-- -- +-- ["solaris-intel"] = "solaris-intel", +-- -- +-- ["solaris-sparc"] = "solaris-sparc", +-- ["solaris"] = "solaris-sparc", +-- -- +-- ["unknown"] = "unknown", +-- } + +local platforms = { ["mswin"] = "mswin", ["windows"] = "mswin", ["win32"] = "mswin", ["win"] = "mswin", - -- ["mswin"] = "win32", - -- ["windows"] = "win32", - -- ["win32"] = "win32", - -- ["win"] = "win32", -- - -- ["mswin-64"] = "mswin-64", - -- ["windows-64"] = "mswin-64", - -- ["win64"] = "mswin-64", ["mswin-64"] = "win64", ["windows-64"] = "win64", ["win64"] = "win64", @@ -192,34 +245,39 @@ update.platforms = { -- ["linux-armhf"] = "linux-armhf", -- - ["freebsd"] = "freebsd", + ["openbsd"] = "openbsd6.5", + ["openbsd-i386"] = "openbsd6.5", + ["openbsd-amd64"] = "openbsd6.5-amd64", -- + ["freebsd"] = "freebsd", + ["freebsd-i386"] = "freebsd", ["freebsd-amd64"] = "freebsd-amd64", -- - ["kfreebsd"] = "kfreebsd-i386", - ["kfreebsd-i386"] = "kfreebsd-i386", - -- - ["kfreebsd-amd64"] = "kfreebsd-amd64", + -- ["kfreebsd"] = "kfreebsd-i386", + -- ["kfreebsd-i386"] = "kfreebsd-i386", + -- ["kfreebsd-amd64"] = "kfreebsd-amd64", -- - ["linux-ppc"] = "linux-ppc", - ["ppc"] = "linux-ppc", + -- ["linux-ppc"] = "linux-ppc", + -- ["ppc"] = "linux-ppc", -- - ["osx"] = "osx-intel", - ["macosx"] = "osx-intel", - ["osx-intel"] = "osx-intel", - ["osxintel"] = "osx-intel", + -- ["osx"] = "osx-intel", + -- ["macosx"] = "osx-intel", + -- ["osx-intel"] = "osx-intel", + -- ["osxintel"] = "osx-intel", -- - ["osx-ppc"] = "osx-ppc", - ["osx-powerpc"] = "osx-ppc", - ["osxppc"] = "osx-ppc", - ["osxpowerpc"] = "osx-ppc", + -- ["osx-ppc"] = "osx-ppc", + -- ["osx-powerpc"] = "osx-ppc", + -- ["osxppc"] = "osx-ppc", + -- ["osxpowerpc"] = "osx-ppc", -- + ["macosx"] = "osx-64", + ["osx"] = "osx-64", ["osx-64"] = "osx-64", -- - ["solaris-intel"] = "solaris-intel", + -- ["solaris-intel"] = "solaris-intel", -- - ["solaris-sparc"] = "solaris-sparc", - ["solaris"] = "solaris-sparc", + -- ["solaris-sparc"] = "solaris-sparc", + -- ["solaris"] = "solaris-sparc", -- ["unknown"] = "unknown", } @@ -652,15 +710,33 @@ if scripts.savestate then end end + -- old + local valid = update.platforms for r in gmatch(environment.argument("platform") or os.platform,"([^, ]+)") do if valid[r] then states.set("platforms." .. r, true) end end + -- new + +-- local osplatform = environment.arguments.platform or nil +-- local platform = platforms[osplatform or os.platform or ""] +-- +-- if (platform == "unknown" or platform == "" or not platform) and osplatform then +-- -- catches openbsdN.M kind of specifications +-- platform = osplatform +-- elseif not osplatform then +-- osplatform = platform +-- end +-- states.set("platforms." .. platform, true) end + + -- so far + local valid = table.tohash(update.texformats) for r in gmatch(environment.argument("formats") or "","([^, ]+)") do if valid[r] then states.set("formats." .. r, true) end end + -- local valid = table.tohash(update.mpformats) -- for r in gmatch(environment.argument("formats") or "","([^, ]+)") do -- if valid[r] then states.set("formats." .. r, true) end diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 95df13f9f..0fd5404d7 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -17843,7 +17843,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-lpt"] = package.loaded["lxml-lpt"] or true --- original size: 55145, stripped down to: 30992 +-- original size: 54626, stripped down to: 31255 if not modules then modules={} end modules ['lxml-lpt']={ version=1.001, @@ -18325,6 +18325,8 @@ local builtin={ lastindex="(#ll.__p__.dt or 1)", lastelement="(ll.__p__.en or 1)", last="#list", + list="list", + self="ll", rootposition="order", order="order", element="(ll.ei or 1)", @@ -18433,7 +18435,8 @@ local function register_selector(specification) end local function register_expression(expression) local converted=lpegmatch(converter,expression) - local runner=load(format(template_e,converted)) + local wrapped=format(template_e,converted) + local runner=load(wrapped) runner=(runner and runner()) or function() errorrunner_e(expression,converted) end return { kind="expression",expression=expression,converted=converted,evaluator=runner } end @@ -18805,6 +18808,20 @@ expressions.count=function(e,pattern) local collected=applylpath(e,pattern) return pattern and (collected and #collected) or 0 end +expressions.attribute=function(e,name,value) + if type(e)=="table" and name then + local a=e.at + if a then + local v=a[name] + if value then + return v==value + else + return v + end + end + end + return nil +end expressions.oneof=function(s,...) for i=1,select("#",...) do if s==select(i,...) then @@ -18851,7 +18868,7 @@ function expressions.contains(str,pattern) end return false end -function xml.expressions.idstring(str) +function expressions.idstring(str) return type(str)=="string" and gsub(str,"^#","") or "" end local function traverse(root,pattern,handle) @@ -25840,8 +25857,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1031236 --- stripped bytes : 408771 +-- original bytes : 1030717 +-- stripped bytes : 407989 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 95df13f9f..0fd5404d7 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -17843,7 +17843,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-lpt"] = package.loaded["lxml-lpt"] or true --- original size: 55145, stripped down to: 30992 +-- original size: 54626, stripped down to: 31255 if not modules then modules={} end modules ['lxml-lpt']={ version=1.001, @@ -18325,6 +18325,8 @@ local builtin={ lastindex="(#ll.__p__.dt or 1)", lastelement="(ll.__p__.en or 1)", last="#list", + list="list", + self="ll", rootposition="order", order="order", element="(ll.ei or 1)", @@ -18433,7 +18435,8 @@ local function register_selector(specification) end local function register_expression(expression) local converted=lpegmatch(converter,expression) - local runner=load(format(template_e,converted)) + local wrapped=format(template_e,converted) + local runner=load(wrapped) runner=(runner and runner()) or function() errorrunner_e(expression,converted) end return { kind="expression",expression=expression,converted=converted,evaluator=runner } end @@ -18805,6 +18808,20 @@ expressions.count=function(e,pattern) local collected=applylpath(e,pattern) return pattern and (collected and #collected) or 0 end +expressions.attribute=function(e,name,value) + if type(e)=="table" and name then + local a=e.at + if a then + local v=a[name] + if value then + return v==value + else + return v + end + end + end + return nil +end expressions.oneof=function(s,...) for i=1,select("#",...) do if s==select(i,...) then @@ -18851,7 +18868,7 @@ function expressions.contains(str,pattern) end return false end -function xml.expressions.idstring(str) +function expressions.idstring(str) return type(str)=="string" and gsub(str,"^#","") or "" end local function traverse(root,pattern,handle) @@ -25840,8 +25857,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1031236 --- stripped bytes : 408771 +-- original bytes : 1030717 +-- stripped bytes : 407989 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 95df13f9f..0fd5404d7 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -17843,7 +17843,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-lpt"] = package.loaded["lxml-lpt"] or true --- original size: 55145, stripped down to: 30992 +-- original size: 54626, stripped down to: 31255 if not modules then modules={} end modules ['lxml-lpt']={ version=1.001, @@ -18325,6 +18325,8 @@ local builtin={ lastindex="(#ll.__p__.dt or 1)", lastelement="(ll.__p__.en or 1)", last="#list", + list="list", + self="ll", rootposition="order", order="order", element="(ll.ei or 1)", @@ -18433,7 +18435,8 @@ local function register_selector(specification) end local function register_expression(expression) local converted=lpegmatch(converter,expression) - local runner=load(format(template_e,converted)) + local wrapped=format(template_e,converted) + local runner=load(wrapped) runner=(runner and runner()) or function() errorrunner_e(expression,converted) end return { kind="expression",expression=expression,converted=converted,evaluator=runner } end @@ -18805,6 +18808,20 @@ expressions.count=function(e,pattern) local collected=applylpath(e,pattern) return pattern and (collected and #collected) or 0 end +expressions.attribute=function(e,name,value) + if type(e)=="table" and name then + local a=e.at + if a then + local v=a[name] + if value then + return v==value + else + return v + end + end + end + return nil +end expressions.oneof=function(s,...) for i=1,select("#",...) do if s==select(i,...) then @@ -18851,7 +18868,7 @@ function expressions.contains(str,pattern) end return false end -function xml.expressions.idstring(str) +function expressions.idstring(str) return type(str)=="string" and gsub(str,"^#","") or "" end local function traverse(root,pattern,handle) @@ -25840,8 +25857,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1031236 --- stripped bytes : 408771 +-- original bytes : 1030717 +-- stripped bytes : 407989 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 95df13f9f..0fd5404d7 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -17843,7 +17843,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-lpt"] = package.loaded["lxml-lpt"] or true --- original size: 55145, stripped down to: 30992 +-- original size: 54626, stripped down to: 31255 if not modules then modules={} end modules ['lxml-lpt']={ version=1.001, @@ -18325,6 +18325,8 @@ local builtin={ lastindex="(#ll.__p__.dt or 1)", lastelement="(ll.__p__.en or 1)", last="#list", + list="list", + self="ll", rootposition="order", order="order", element="(ll.ei or 1)", @@ -18433,7 +18435,8 @@ local function register_selector(specification) end local function register_expression(expression) local converted=lpegmatch(converter,expression) - local runner=load(format(template_e,converted)) + local wrapped=format(template_e,converted) + local runner=load(wrapped) runner=(runner and runner()) or function() errorrunner_e(expression,converted) end return { kind="expression",expression=expression,converted=converted,evaluator=runner } end @@ -18805,6 +18808,20 @@ expressions.count=function(e,pattern) local collected=applylpath(e,pattern) return pattern and (collected and #collected) or 0 end +expressions.attribute=function(e,name,value) + if type(e)=="table" and name then + local a=e.at + if a then + local v=a[name] + if value then + return v==value + else + return v + end + end + end + return nil +end expressions.oneof=function(s,...) for i=1,select("#",...) do if s==select(i,...) then @@ -18851,7 +18868,7 @@ function expressions.contains(str,pattern) end return false end -function xml.expressions.idstring(str) +function expressions.idstring(str) return type(str)=="string" and gsub(str,"^#","") or "" end local function traverse(root,pattern,handle) @@ -25840,8 +25857,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1031236 --- stripped bytes : 408771 +-- original bytes : 1030717 +-- stripped bytes : 407989 -- end library merge diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 296525c5c..bed8b96fc 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2019.10.02 12:43} +\newcontextversion{2019.10.04 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 ed7ade881..b042613af 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2019.10.02 12:43} +\edef\contextversion{2019.10.04 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 a957e8f17..9632dc07e 100644 --- a/tex/context/base/mkii/mult-de.mkii +++ b/tex/context/base/mkii/mult-de.mkii @@ -234,6 +234,7 @@ \setinterfacevariable{hanging}{haengend} \setinterfacevariable{head}{kopf} \setinterfacevariable{header}{kopfzeile} +\setinterfacevariable{headintext}{headintext} \setinterfacevariable{height}{hoehe} \setinterfacevariable{helptext}{hilfetext} \setinterfacevariable{hencefore}{vorher} diff --git a/tex/context/base/mkii/mult-nl.mkii b/tex/context/base/mkii/mult-nl.mkii index aebf9a898..ce86f1edd 100644 --- a/tex/context/base/mkii/mult-nl.mkii +++ b/tex/context/base/mkii/mult-nl.mkii @@ -234,6 +234,7 @@ \setinterfacevariable{hanging}{hangend} \setinterfacevariable{head}{kop} \setinterfacevariable{header}{hoofd} +\setinterfacevariable{headintext}{kopintekst} \setinterfacevariable{height}{hoogte} \setinterfacevariable{helptext}{helptekst} \setinterfacevariable{hencefore}{hierboven} diff --git a/tex/context/base/mkii/mult-pe.mkii b/tex/context/base/mkii/mult-pe.mkii index d07d9dbdd..eb5c6d3b8 100644 --- a/tex/context/base/mkii/mult-pe.mkii +++ b/tex/context/base/mkii/mult-pe.mkii @@ -234,6 +234,7 @@ \setinterfacevariable{hanging}{آویزان} \setinterfacevariable{head}{سر} \setinterfacevariable{header}{سربرگ} +\setinterfacevariable{headintext}{headintext} \setinterfacevariable{height}{ارتفاع} \setinterfacevariable{helptext}{متن‌کمکی} \setinterfacevariable{hencefore}{hencefore} @@ -637,6 +638,7 @@ \setinterfaceconstant{aligntitle}{عنوان‌تنظیم} \setinterfaceconstant{alternative}{جایگزین} \setinterfaceconstant{anchor}{anchor} +\setinterfaceconstant{anchoring}{anchoring} \setinterfaceconstant{andtext}{andtext} \setinterfaceconstant{apa}{apa} \setinterfaceconstant{arguments}{arguments} @@ -866,6 +868,7 @@ \setinterfaceconstant{hfil}{پرکردن‌ارتفاع} \setinterfaceconstant{hidenumber}{hidenumber} \setinterfaceconstant{hoffset}{آفست‌ا} +\setinterfaceconstant{horizontal}{افقی} \setinterfaceconstant{horoffset}{آفست‌افق} \setinterfaceconstant{hyphen}{شکستن} \setinterfaceconstant{hyphens}{hyphens} @@ -966,9 +969,12 @@ \setinterfaceconstant{menu}{منو} \setinterfaceconstant{method}{روش} \setinterfaceconstant{middle}{میان} +\setinterfaceconstant{middlecolor}{middlecolor} \setinterfaceconstant{middlecommand}{middlecommand} \setinterfaceconstant{middlespeech}{سخنرانی‌میانی} +\setinterfaceconstant{middlestyle}{middlestyle} \setinterfaceconstant{middletext}{متن‌میانی} +\setinterfaceconstant{middlewidth}{middlewidth} \setinterfaceconstant{midsentence}{جمله‌میانی} \setinterfaceconstant{min}{کمترین} \setinterfaceconstant{mindepth}{کمترین‌عمق} @@ -1286,6 +1292,7 @@ \setinterfaceconstant{vcompact}{vcompact} \setinterfaceconstant{vector}{vector} \setinterfaceconstant{veroffset}{آفست‌عم} +\setinterfaceconstant{vertical}{عمودی} \setinterfaceconstant{vfactor}{vfactor} \setinterfaceconstant{vfil}{vfil} \setinterfaceconstant{viewerprefix}{viewerprefix} @@ -1296,6 +1303,7 @@ \setinterfaceconstant{white}{سفید} \setinterfaceconstant{width}{عرض} \setinterfaceconstant{words}{words} +\setinterfaceconstant{xanchor}{xanchor} \setinterfaceconstant{xfactor}{فاکتورایکس} \setinterfaceconstant{xhtml}{xhtml} \setinterfaceconstant{xmax}{xmax} @@ -1303,6 +1311,7 @@ \setinterfaceconstant{xoffset}{آفست‌ایکس} \setinterfaceconstant{xscale}{مقیاس‌ایکس} \setinterfaceconstant{xstep}{گام‌ایکس} +\setinterfaceconstant{yanchor}{yanchor} \setinterfaceconstant{yfactor}{فاکتوروای} \setinterfaceconstant{ymax}{ymax} \setinterfaceconstant{yoffset}{آفست‌وای} diff --git a/tex/context/base/mkiv/colo-ini.lua b/tex/context/base/mkiv/colo-ini.lua index d865668a5..cd2c19a75 100644 --- a/tex/context/base/mkiv/colo-ini.lua +++ b/tex/context/base/mkiv/colo-ini.lua @@ -571,7 +571,6 @@ colors.isblack = isblack -- if c and c > 1 then -- 1 is black -- local v = attributes.colors.values[c] - local function definespotcolor(name,parent,str,global) if parent == "" or find(parent,"=",1,true) then colors.registerspotcolor(name, parent) -- does that work? no attr @@ -830,7 +829,6 @@ colors.mpoptions = mpoptions -- mpprint(mpnamedcolor(str)) -- end - -- local function formatcolor(ca,separator) -- local cv = colorvalues[ca] -- if cv then diff --git a/tex/context/base/mkiv/colo-ini.mkiv b/tex/context/base/mkiv/colo-ini.mkiv index 7b649c174..fc456e824 100644 --- a/tex/context/base/mkiv/colo-ini.mkiv +++ b/tex/context/base/mkiv/colo-ini.mkiv @@ -859,7 +859,7 @@ % \let\colo_basics_synchronize\gobbleoneargument % used in mp interface % \let\colo_basics_inherit \gobbletwoarguments % used in mp interface -\def\colo_basics_allocate#1% +\def\colo_basics_allocate#1% todo: use a chardef instead {\expandafter\newcount\csname\??colornumber#1\endcsname \clf_synccolorcount{#1}\c_syst_last_allocated_count} diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 2236514eb..1b4a8b805 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2019.10.02 12:43} +\newcontextversion{2019.10.04 17:44} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 87efea55e..cc542ec68 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -45,7 +45,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2019.10.02 12:43} +\edef\contextversion{2019.10.04 17:44} \edef\contextkind {beta} %D Kind of special: diff --git a/tex/context/base/mkiv/context.mkxl b/tex/context/base/mkiv/context.mkxl index c3552f09f..6158184ee 100644 --- a/tex/context/base/mkiv/context.mkxl +++ b/tex/context/base/mkiv/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2019.10.02 12:43} +\edef\contextversion{2019.10.04 17:44} \edef\contextkind {beta} %D Kind of special: diff --git a/tex/context/base/mkiv/font-ctx.lua b/tex/context/base/mkiv/font-ctx.lua index 02cf6093c..0a492b119 100644 --- a/tex/context/base/mkiv/font-ctx.lua +++ b/tex/context/base/mkiv/font-ctx.lua @@ -179,7 +179,7 @@ do local hashes = { } local nofinstances = 0 - local instances = table.setmetatableindex(function(t,k) + local instances = setmetatableindex(function(t,k) nofinstances = nofinstances + 1 t[k] = nofinstances return nofinstances @@ -570,6 +570,21 @@ end -- \definefontfeature[demo][a={b,c}] -- \definefontfeature[demo][a={b=12,c={34,35}}] +local h = setmetatableindex(function(t,k) + local v = "," .. k .. "," + t[k] = v + return v +end) + +-- local function removefromhash(hash,key) +-- local pattern = h[key] +-- for k in next, hash do +-- if k ~= key and find(h[k],pattern) then -- if find(k,",") and ... +-- hash[k] = nil +-- end +-- end +-- end + local function presetcontext(name,parent,features) -- will go to con and shared if features == "" and find(parent,"=",1,true) then features = parent @@ -635,14 +650,23 @@ local function presetcontext(name,parent,features) -- will go to con and shared -- if v then t[k] = v end t[k] = v end - -- needed for dynamic features - -- maybe number should always be renewed as we can redefine features - local number = setups[name] and setups[name].number or 0 -- hm, numbers[name] + -- the number is needed for dynamic features; maybe number should always be + -- renewed as we can redefine features ... i need a test + local number = setups[name] and setups[name].number or 0 if number == 0 then number = #numbers + 1 numbers[number] = name end + -- t.number = number + -- there is the special case of combined features as we have in math but maybe + -- this has to change some day ... otherwise we mess up dynamics (ok, we could + -- impose a limit there: no combined features) + -- + -- done elsewhere (!) + -- + -- removefromhash(setups,name) -- can have changed (like foo,extramath) + -- setups[name] = t return number, t end @@ -913,14 +937,37 @@ end -- return fastcopy(setups[features] or (presetcontext(features,"","") and setups[features])) -- end +-- local function splitcontext(features) -- presetcontext creates dummy here +-- local sf = setups[features] +-- if not sf then +-- local n -- number +-- if find(features,",") then +-- -- let's assume a combination which is not yet defined but just specified (as in math) +-- n, sf = presetcontext(features,features,"") +-- else +-- -- we've run into an unknown feature and or a direct spec so we create a dummy +-- n, sf = presetcontext(features,"","") +-- end +-- end +-- return fastcopy(sf) +-- end + local function splitcontext(features) -- presetcontext creates dummy here - local sf = setups[features] - if not sf then - local n -- number - if find(features,",",a,true) then - -- let's assume a combination which is not yet defined but just specified (as in math) - n, sf = presetcontext(features,features,"") - else + local n, sf + if find(features,",") then + -- + -- from elsewhere (!) + -- + -- this will become: + -- + -- if find(features,"^reset," then + setups[features] = nil + -- end + -- let's assume a combination which is not yet defined but just specified (as in math) + n, sf = presetcontext(features,features,"") + else + sf = setups[features] + if not sf then -- we've run into an unknown feature and or a direct spec so we create a dummy n, sf = presetcontext(features,"","") end diff --git a/tex/context/base/mkiv/font-ogr.lua b/tex/context/base/mkiv/font-ogr.lua index a2e5d2e82..ed5bc709b 100644 --- a/tex/context/base/mkiv/font-ogr.lua +++ b/tex/context/base/mkiv/font-ogr.lua @@ -15,10 +15,12 @@ elseif CONTEXTLMTXMODE == 0 then return end -local tostring, tonumber, next = tostring, tonumber, next -local round, max, mod, div = math.round, math.round, math.mod, math.div -local concat, setmetatableindex = table.concat, table.setmetatableindex +local tostring, tonumber, next, type = tostring, tonumber, next, type +local round, max, mod, div = math.round, math.max, math.mod, math.div +local concat, setmetatableindex, sortedhash = table.concat, table.setmetatableindex, table.sortedhash +local utfbyte = utf.byte local formatters = string.formatters +local settings_to_hash_strict, settings_to_array = utilities.parsers.settings_to_hash_strict, utilities.parsers.settings_to_array local otf = fonts.handlers.otf local otfregister = otf.features.register @@ -51,8 +53,10 @@ do return droppedin end + -- todo: pass specification table instead + function dropins.provide(method,t_tfmdata,indexdata,...) - droppedin = dropins.nextid() + local droppedin = dropins.nextid() local t_characters = t_tfmdata.characters local t_descriptions = t_tfmdata.descriptions local t_properties = t_tfmdata.properties @@ -76,14 +80,13 @@ do return slot, droppedin, d_tfmdata, d_properties end - function dropins.clone(method,tfmdata,shapes,...) + function dropins.clone(method,tfmdata,shapes,...) -- by index if method and shapes then local characters = tfmdata.characters local descriptions = tfmdata.descriptions local droppedin, tfmdrop, dropchars, dropdescs, colrshapes local idx = 255 local slot = 0 - -- for k, v in next, characters do local index = v.index if index then @@ -93,7 +96,13 @@ do if shape then if idx >= 255 then idx = 1 - colrshapes = { filename = shapes.filename, fixdepth = shapes.fixdepth } -- not needed + colrshapes = { -- or use metatable + filename = shapes.filename, + fixdepth = shapes.fixdepth, + units = shapes.units, + usecolor = shapes.usecolor, + -- instance = shapes.instance, + } slot, droppedin, tfmdrop = dropins.provide(method,tfmdata,colrshapes) dropchars = tfmdrop.characters dropdescs = tfmdrop.descriptions @@ -101,10 +110,7 @@ do idx = idx + 1 end colrshapes[idx] = shape -- so not: description - -- --- local helpers = fonts.helpers --- local prependcommands = helpers.prependcommands --- print(v.commands) + -- todo: prepend v.commands = { { "slot", slot, idx } } -- hack to prevent that type 3 also gets 'use' flags .. todo local c = { commands = false, index = idx, dropin = tfmdata } @@ -122,6 +128,170 @@ do end end + function dropins.swap(method,tfmdata,shapes,...) -- by unicode + if method and shapes then + local characters = tfmdata.characters + local descriptions = tfmdata.descriptions + local droppedin, tfmdrop, dropchars, dropdescs, colrshapes + local idx = 255 + local slot = 0 + -- we can have a variant where shaped are by unicode and not by index + for k, v in next, characters do + local description = descriptions[k] + if description then + local shape = shapes[k] + if shape then + if idx >= 255 then + idx = 1 + colrshapes = { -- or use metatable + filename = shapes.filename, + fixdepth = shapes.fixdepth, + units = shapes.units, + usecolor = shapes.usecolor, + -- instance = shapes.instance, + } + slot, droppedin, tfmdrop = dropins.provide(method,tfmdata,colrshapes) + dropchars = tfmdrop.characters + dropdescs = tfmdrop.descriptions + else + idx = idx + 1 + end + colrshapes[idx] = shape -- so not: description + -- todo: prepend + v.commands = { { "slot", slot, idx } } + -- hack to prevent that type 3 also gets 'use' flags .. todo + local c = { commands = false, index = idx, dropin = tfmdata } + local d = { index = idx, dropin = tfmdata } + setmetatableindex(c,v) + setmetatableindex(d,description) + dropchars[idx] = c + dropdescs[idx] = d + end + end + end + else + -- error + end + end + +end + +do + + local dropins = fonts.dropins + + local shapes = setmetatableindex(function(t,k) + local v = { + glyphs = { }, + parameters = { + units = 1000 + }, + } + t[k] = v + return v + end) + + function dropins.registerglyphs(parameters) + local category = parameters.name + local target = shapes[category].parameters + for k, v in next, parameters do + if k ~= "glyphs" then + target[k] = v + end + end + end + + function dropins.registerglyph(parameters) + local category = parameters.category + local unicode = parameters.unicode + local unitype = type(unicode) + if unitype == "string" then + local uninumber = tonumber(unicode) + if uninumber then + unicode = round(uninumber) + else + unicode = utfbyte(unicode) + end + elseif unitype == "number" then + unicode = round(unicode) + end + parameters.unicode = unicode + -- print(category,unicode) + shapes[category].glyphs[unicode] = parameters + end + + local function initializemps(tfmdata,kind,value) + if value then + local spec = settings_to_hash_strict(value) + if not spec or not next(spec) then + spec = { category = value } + end + -- todo: multiple categories but then mayb also different + -- clones because of the units .. fot now we assume the same + -- units + local category = spec.category + if category and category ~= "" then + local categories = settings_to_array(category) + local usedshapes = nil + local index = 0 + for i=1,#categories do + local category = categories[i] + local mpsshapes = shapes[category] + if mpsshapes then + local properties = tfmdata.properties + local parameters = tfmdata.parameters + local characters = tfmdata.characters + local descriptions = tfmdata.descriptions + local mpsparameters = mpsshapes.parameters + local units = mpsparameters.units or 1000 + local defaultwidth = mpsparameters.width or 0 + local defaultheight = mpsparameters.height or 0 + local defaultdepth = mpsparameters.depth or 0 + local defaultcode = mpsparameters.code or "" + local scale = parameters.size / units + usedshapes = usedshapes or { + instance = "simplefun", + units = units, + usecolor = mpsparameters.usecolor, + } + -- todo: deal with extensibles and more properties + for unicode, shape in sortedhash(mpsshapes.glyphs) do + -- local oldc = characters[unicode] + -- if oldc then + index = index + 1 + local newc = { + index = index, -- into usedshapes + width = scale * (shape.width or defaultwidth), + height = scale * (shape.height or defaultheight), + depth = scale * (shape.depth or defaultdepth), + } + -- + characters [unicode] = newc + descriptions[unicode] = newc + -- + usedshapes[unicode] = shape.code or defaultcode + -- end + end + end + end + if usedshapes then + -- todo: different font when units and usecolor changes, maybe move into loop + -- above + dropins.swap("mps",tfmdata,usedshapes) + end + end + end + end + + otfregister { + name = "metapost", + description = "metapost glyphs", + manipulators = { + base = initializemps, + node = initializemps, + } + } + end -- This sits here for historcal reasons so for now we keep it here. diff --git a/tex/context/base/mkiv/lpdf-emb.lua b/tex/context/base/mkiv/lpdf-emb.lua index eace34ca1..28ff6ceaf 100644 --- a/tex/context/base/mkiv/lpdf-emb.lua +++ b/tex/context/base/mkiv/lpdf-emb.lua @@ -1532,6 +1532,7 @@ do local f_image = formatters["%.6N 0 d0 /%s Do"] local f_image_d = formatters["%.6N 0 d0 1 0 0 1 0 %.3N cm /%s Do"] local f_stream = formatters["%.6N 0 d0 %s"] + local f_stream_c = formatters["%.6N 0 0 0 0 0 d1 %s"] local f_stream_d = formatters["%.6N 0 d0 1 0 0 1 0 %.3N cm %s"] -- A type 3 font has at most 256 characters and Acrobat also wants a zero slot @@ -1617,17 +1618,21 @@ do local mpshapes = properties.indexdata[1] if mpshapes then local scale = 10 * details.parameters.size/details.parameters.designsize - local units = details.parameters.units + local units = mpshapes.units or details.parameters.units local factor = units * bpfactor / scale local fixdepth = mpshapes.fixdepth + local usecolor = mpshapes.usecolor + -- todo: each mp a table with properties (like using d0 / d1) local function mpstopdf(mp,data) local width = data.width if decompress then mp = decompress(mp) end - local pdf = metapost.simple("metafun",mp,true) -- can be sped up, minifun + local pdf = metapost.simple(mpshapes.instance,mp,true) -- can be sped up, minifun local width = width * factor - if fixdepth then + if usecolor then + return f_stream_c(width,pdf), width + elseif fixdepth then local depth = data.depth or 0 local height = data.height or 0 if depth ~= 0 or height ~= 0 then diff --git a/tex/context/base/mkiv/lxml-lpt.lua b/tex/context/base/mkiv/lxml-lpt.lua index 392c1a401..5bcdfbabc 100644 --- a/tex/context/base/mkiv/lxml-lpt.lua +++ b/tex/context/base/mkiv/lxml-lpt.lua @@ -614,27 +614,6 @@ local lp_doequal = P("=") / "==" local lp_or = P("|") / " or " local lp_and = P("&") / " and " --- local lp_builtin = ( --- P("text") / "(ll.dt[1] or '')" + -- fragile --- P("content") / "ll.dt" + --- P("name") / "((ll.ns~='' and ll.ns..':'..ll.tg) or ll.tg)" + --- P("tag") / "ll.tg" + --- P("position") / "l" + -- is element in finalizer --- P("firstindex") / "1" + --- P("lastindex") / "(#ll.__p__.dt or 1)" + --- P("firstelement") / "1" + --- P("lastelement") / "(ll.__p__.en or 1)" + --- P("first") / "1" + --- P("last") / "#list" + --- P("rootposition") / "order" + --- P("order") / "order" + --- P("element") / "(ll.ei or 1)" + --- P("index") / "(ll.ni or 1)" + --- P("match") / "(ll.mi or 1)" + --- P("namespace") / "ll.ns" + --- P("ns") / "ll.ns" --- ) * ((spaces * P("(") * spaces * P(")"))/"") - local builtin = { text = "(ll.dt[1] or '')", -- fragile content = "ll.dt", @@ -647,6 +626,8 @@ local builtin = { lastindex = "(#ll.__p__.dt or 1)", lastelement = "(ll.__p__.en or 1)", last = "#list", + list = "list", + self = "ll", rootposition = "order", order = "order", element = "(ll.ei or 1)", @@ -654,6 +635,7 @@ local builtin = { match = "(ll.mi or 1)", namespace = "ll.ns", ns = "ll.ns", + } local lp_builtin = lpeg.utfchartabletopattern(builtin)/builtin * ((spaces * P("(") * spaces * P(")"))/"") @@ -806,7 +788,9 @@ end local function register_expression(expression) local converted = lpegmatch(converter,expression) - local runner = load(format(template_e,converted)) + local wrapped = format(template_e,converted) + local runner = load(wrapped) + -- print(wrapped) runner = (runner and runner()) or function() errorrunner_e(expression,converted) end return { kind = "expression", expression = expression, converted = converted, evaluator = runner } end @@ -1306,6 +1290,21 @@ expressions.count = function(e,pattern) -- what if pattern == empty or nil return pattern and (collected and #collected) or 0 end +expressions.attribute = function(e,name,value) + if type(e) == "table" and name then + local a = e.at + if a then + local v = a[name] + if value then + return v == value + else + return v + end + end + end + return nil +end + -- external -- expressions.oneof = function(s,...) @@ -1371,7 +1370,7 @@ function expressions.contains(str,pattern) return false end -function xml.expressions.idstring(str) +function expressions.idstring(str) return type(str) == "string" and gsub(str,"^#","") or "" end diff --git a/tex/context/base/mkiv/lxml-tex.lua b/tex/context/base/mkiv/lxml-tex.lua index 6a9e3c2cc..9ab8cafc6 100644 --- a/tex/context/base/mkiv/lxml-tex.lua +++ b/tex/context/base/mkiv/lxml-tex.lua @@ -337,7 +337,7 @@ do noferrors = noferrors + 1 errors[filename] = errors[filename] + 1 end - errorhandler(filename) + errorhandler(message) -- (filename) end logs.registerfinalactions(function() diff --git a/tex/context/base/mkiv/meta-imp-symbols.mkxl b/tex/context/base/mkiv/meta-imp-symbols.mkxl new file mode 100644 index 000000000..7d4cb4005 --- /dev/null +++ b/tex/context/base/mkiv/meta-imp-symbols.mkxl @@ -0,0 +1,99 @@ +%D \module +%D [ file=meta-imp-symbols, +%D version=2019.10.01, +%D title=\METAPOST\ Graphics, +%D subtitle=Symbols, +%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 This is an (experimental) prelude to more. + +\startMPcalculation{simplefun} + + pen SymbolPen ; SymbolPen := pencircle scaled 1/4 ; + + vardef SymbolBullet = fill unitcircle scaled 3 shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x2022 • + vardef SymbolDash = draw (origin--right) scaled 3 shifted (1.5,3.0) withpen SymbolPen scaled 2 enddef ; % 0x2013 – + vardef SymbolTriangle = draw unittriangle scaled 3 shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x25B6 ⊳ + vardef SymbolCircle = fill unitcircle scaled 3 shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x2218 ∘ + vardef SymbolSquare = draw unitsquare scaled (3-1/16) shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x25A1 □ + vardef SymbolDiamond = draw unitdiamond scaled 3 shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x22C4 ⋄ + vardef SymbolBlackTriangle = fillup unittriangle scaled (3-1/16) shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x25B6 ▶ + vardef SymbolBlackSquare = fillup unitsquare scaled (3-1/16) shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x25A0 ■ + vardef SymbolBlackDiamond = fillup unitdiamond scaled (3-1/16) shifted (1.5,1.5) withpen SymbolPen enddef ; % 0x25C6 ◆ + + vardef SymbolNotDef = + draw center unitcircle + scaled 3 + shifted (1.5,1.5) + withpen SymbolPen scaled 4 + enddef ; + + vardef SymbolStar = % 0x22C6 % ⋆ + SymbolNotDef + enddef ; + + vardef SymbolCheckmark = % 0x2713 ✓ + SymbolNotDef + enddef ; + + vardef SymbolAsterisk = % 0x2217 ∗ + SymbolNotDef + enddef ; + + % We could set code directly to the meaning of the macro. + + lmt_registerglyphs [ + name = "symbols", + units = 10, + usecolor = true, + width = 6, + height = 6, + depth = 0, + code = "SymbolNotDef ;", + ] ; + + lmt_registerglyph [ category = "symbols", unicode = "0x2022", code = "SymbolBullet ;" ] ; + lmt_registerglyph [ category = "symbols", unicode = "0x2013", code = "SymbolDash ;" ] ; + lmt_registerglyph [ category = "symbols", unicode = "0x22C6" ] ; % , code = "SymbolStar ;" ] ; + lmt_registerglyph [ category = "symbols", unicode = "0x22B3", code = "SymbolTriangle ;" ] ; + lmt_registerglyph [ category = "symbols", unicode = "0x2218", code = "SymbolCircle ;" ] ; + lmt_registerglyph [ category = "symbols", unicode = "0x25A1", code = "SymbolSquare ;" ] ; + lmt_registerglyph [ category = "symbols", unicode = "0x22C4", code = "SymbolDiamond ;" ] ; + lmt_registerglyph [ category = "symbols", unicode = "0x2713" ] ; % , code = "SymbolCheckmark ;" ] ; + lmt_registerglyph [ category = "symbols", unicode = "0x2217" ] ; % , code = "SymbolAsterisk ;" ] ; + lmt_registerglyph [ category = "symbols", unicode = "0x25B6", code = "SymbolBlackTriangle ;" ] ; + lmt_registerglyph [ category = "symbols", unicode = "0x25A0", code = "SymbolBlackSquare ;" ] ; + lmt_registerglyph [ category = "symbols", unicode = "0x25C6", code = "SymbolBlackDiamond ;" ] ; + +\stopMPcalculation + +\continueifinputfile{meta-imp-symbols.mkxl} + +\usemodule[article-basic] \setupbodyfont[pagella] + +\starttext + +\definefontfeature[metasymbols][mps=symbols] + +\definefont[MyFont] [Serif*default,metasymbols sa 1] + +Some metasymbols: + +\startitem {\MyFont • □ ◆}\quad Regular rendering. \stopitem +\startitem {\MyFont\red • □ ◆}\quad Rendering with color. \stopitem +\startitem {\MyFont\blue\showglyphs • □ ◆}\quad Idem but with boundingboxes shown. \stopitem + +And some more: + +\startlines + • – ⋆ ⊳ ∘ □ ⋄ ✓ ∗ ▶ ■ ◆ + {\MyFont • – ⋆ ⊳ ∘ □ ⋄ ✓ ∗ ▶ ■ ◆} +\stoplines + +\stoptext diff --git a/tex/context/base/mkiv/meta-ini.mkxl b/tex/context/base/mkiv/meta-ini.mkxl index 745bd9268..e08aa560a 100644 --- a/tex/context/base/mkiv/meta-ini.mkxl +++ b/tex/context/base/mkiv/meta-ini.mkxl @@ -225,6 +225,8 @@ \defineMPinstance[binarypost] [\s!format=mpost,\c!method=\s!binary] \defineMPinstance[decimalpost][\s!format=mpost,\c!method=\s!decimal] +\defineMPinstance[simplefun] [\s!format=metafun,\c!method=\s!double] % maybe use minifun + %defineMPinstance[megapost] [\s!format=mpost,\c!method=\s!decimal] \newconditional\c_meta_include_initializations diff --git a/tex/context/base/mkiv/mlib-lmp.lua b/tex/context/base/mkiv/mlib-lmp.lua index dc130c2fd..e72ddd03c 100644 --- a/tex/context/base/mkiv/mlib-lmp.lua +++ b/tex/context/base/mkiv/mlib-lmp.lua @@ -154,3 +154,19 @@ function mp.lmt_svg_include() mpdirect(metacode) end end + +if CONTEXTLMTXMODE > 0 then + + local dropins = fonts.dropins + local registerglyphs = dropins.registerglyphs + local registerglyph = dropins.registerglyph + + function mp.lmt_register_glyph() + registerglyph(metapost.getparameterset("mpsglyph")) + end + + function mp.lmt_register_glyphs() + registerglyphs(metapost.getparameterset("mpsglyphs")) + end + +end diff --git a/tex/context/base/mkiv/mlib-lua.lua b/tex/context/base/mkiv/mlib-lua.lua index 29ef334f1..5af1ccb68 100644 --- a/tex/context/base/mkiv/mlib-lua.lua +++ b/tex/context/base/mkiv/mlib-lua.lua @@ -771,6 +771,7 @@ do metapost.registerscript("namedcolor",function() mpprint(mpnamedcolor(scanstring())) +-- test: return mpnamedcolor(scanstring()) end) end diff --git a/tex/context/base/mkiv/mlib-run.lua b/tex/context/base/mkiv/mlib-run.lua index bf7c8a796..e9d460472 100644 --- a/tex/context/base/mkiv/mlib-run.lua +++ b/tex/context/base/mkiv/mlib-run.lua @@ -518,6 +518,7 @@ function metapost.pushformat(specification,f,m) -- was: instance, name, method local usedinstance = instance .. ":" .. nofformats local mpx = mpxformats [usedinstance] local mpp = mpxpreambles[instance] or "" + -- report_metapost("push instance %a (%S)",usedinstance,mpx) if preamble then preamble = prepareddata(preamble) mpp = mpp .. "\n" .. preamble @@ -851,10 +852,11 @@ do end, } - function metapost.simple(format,code,useextensions) + function metapost.simple(instance,code,useextensions) + -- can we pickup the instance ? local mpx = metapost.pushformat { - instance = "simplefun", - format = "metafun", + instance = instance or "simplefun", + format = "metafun", -- or: minifun method = "double", } metapost.process { diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index e62e508a4..0d100562d 100644 Binary files a/tex/context/base/mkiv/status-files.pdf and b/tex/context/base/mkiv/status-files.pdf differ diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf index b84c61b2e..41c98c12c 100644 Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ diff --git a/tex/context/fonts/mkiv/type-imp-cambria.mkiv b/tex/context/fonts/mkiv/type-imp-cambria.mkiv index 06781a8d0..0ccb4409e 100644 --- a/tex/context/fonts/mkiv/type-imp-cambria.mkiv +++ b/tex/context/fonts/mkiv/type-imp-cambria.mkiv @@ -39,7 +39,7 @@ \stoptypescript % We load a goodies file that will apply a patch to the font. As a demonstration - % we apply the patch when caching as as when scaling which is why we also specify + % we apply the patch when caching and when scaling which is why we also specify % the goodies file with the name. \starttypescript [\s!math] [cambria,cambria-m,cambria-a] [\s!name] diff --git a/tex/context/fonts/mkiv/type-imp-dejavu.mkiv b/tex/context/fonts/mkiv/type-imp-dejavu.mkiv index 3af9d2d17..ee1e9f383 100644 --- a/tex/context/fonts/mkiv/type-imp-dejavu.mkiv +++ b/tex/context/fonts/mkiv/type-imp-dejavu.mkiv @@ -43,8 +43,8 @@ \starttypescript [\s!math][dejavu][\s!name] \loadfontgoodies[dejavu-math] - \definefontsynonym[\s!MathRoman] [file:texgyredejavu-math][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=dejavu-math] - \definefontsynonym[\s!MathRomanBold][file:texgyredejavu-math][\s!features={\s!math\mathsizesuffix,dejavu-math-bold,mathextra},\s!goodies=schola-math] + \definefontsynonym[\s!MathRoman] [\s!file:texgyredejavu-math][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=dejavu-math] + \definefontsynonym[\s!MathRomanBold][\s!file:texgyredejavu-math][\s!features={\s!math\mathsizesuffix,dejavu-math-bold,mathextra},\s!goodies=dejavu-math] \stoptypescript \starttypescript[dejavu] diff --git a/tex/context/fonts/mkiv/type-imp-texgyre.mkiv b/tex/context/fonts/mkiv/type-imp-texgyre.mkiv index 583da77c1..72d3b3588 100644 --- a/tex/context/fonts/mkiv/type-imp-texgyre.mkiv +++ b/tex/context/fonts/mkiv/type-imp-texgyre.mkiv @@ -248,7 +248,7 @@ % \loadfontgoodies[texgyre] % \definefontsynonym[\s!MathRoman][file:texgyre-termes-math-regular.otf][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=texgyre] \definefontsynonym[\s!MathRoman] [file:texgyretermes-math.otf][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=termes-math] - \definefontsynonym[\s!MathRomanBold][file:texgyretermes-math.otf][\s!features={\s!math\mathsizesuffix,termes-math-bold,mathextra},\s!goodies=schola-math] + \definefontsynonym[\s!MathRomanBold][file:texgyretermes-math.otf][\s!features={\s!math\mathsizesuffix,termes-math-bold,mathextra},\s!goodies=termes-math] \stoptypescript \stoptypescriptcollection @@ -277,7 +277,7 @@ % \loadfontgoodies[texgyre] % \definefontsynonym[\s!MathRoman][file:texgyre-pagella-math-regular.otf][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=texgyre] \definefontsynonym[\s!MathRoman] [file:texgyrepagella-math.otf][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=pagella-math] - \definefontsynonym[\s!MathRomanBold][file:texgyrepagella-math.otf][\s!features={\s!math\mathsizesuffix,pagella-math-bold,mathextra},\s!goodies=schola-math] + \definefontsynonym[\s!MathRomanBold][file:texgyrepagella-math.otf][\s!features={\s!math\mathsizesuffix,pagella-math-bold,mathextra},\s!goodies=pagella-math] \stoptypescript \stoptypescriptcollection @@ -290,7 +290,7 @@ % \loadfontgoodies[texgyre] % \definefontsynonym[\s!MathRoman][file:texgyre-bonum-math-regular.otf][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=texgyre] \definefontsynonym[\s!MathRoman] [file:texgyrebonum-math.otf][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=bonum-math] - \definefontsynonym[\s!MathRomanBold][file:texgyrebonum-math.otf][\s!features={\s!math\mathsizesuffix,bonum-math-bold,mathextra},\s!goodies=schola-math] + \definefontsynonym[\s!MathRomanBold][file:texgyrebonum-math.otf][\s!features={\s!math\mathsizesuffix,bonum-math-bold,mathextra},\s!goodies=bonum-math] \stoptypescript \stoptypescriptcollection @@ -305,5 +305,3 @@ \stoptypescript \stoptypescriptcollection - - diff --git a/tex/context/interface/mkii/keys-de.xml b/tex/context/interface/mkii/keys-de.xml index b9cd9cc05..5d1009959 100644 --- a/tex/context/interface/mkii/keys-de.xml +++ b/tex/context/interface/mkii/keys-de.xml @@ -237,6 +237,7 @@ + diff --git a/tex/context/interface/mkii/keys-nl.xml b/tex/context/interface/mkii/keys-nl.xml index 55e0ff335..cb6ebc68d 100644 --- a/tex/context/interface/mkii/keys-nl.xml +++ b/tex/context/interface/mkii/keys-nl.xml @@ -237,6 +237,7 @@ + diff --git a/tex/context/interface/mkii/keys-pe.xml b/tex/context/interface/mkii/keys-pe.xml index 86f8f49c9..2fcb76c9f 100644 --- a/tex/context/interface/mkii/keys-pe.xml +++ b/tex/context/interface/mkii/keys-pe.xml @@ -237,6 +237,7 @@ + @@ -643,6 +644,7 @@ + @@ -872,6 +874,7 @@ + @@ -972,9 +975,12 @@ + + + @@ -1292,6 +1298,7 @@ + @@ -1302,6 +1309,7 @@ + @@ -1309,6 +1317,7 @@ + diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf index 8471d15b4..51102b6e7 100644 Binary files a/tex/context/interface/mkiv/i-context.pdf and b/tex/context/interface/mkiv/i-context.pdf differ diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf index 87356b5f9..41e4b2392 100644 Binary files a/tex/context/interface/mkiv/i-readme.pdf and b/tex/context/interface/mkiv/i-readme.pdf differ diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 9e38b5e5c..9d036f3ec 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/02/19 12:43:06 +-- merge date : 10/04/19 17:44:12 do -- begin closure to overcome local limits and interference -- cgit v1.2.3