Hi,
I tried the "Dcaron" example from the MetaPost manual (page 50) and it
works nicely when called with "mpost".
% Dcaron.mp
fontmapfile"=lm-ec.map";
beginfig(56);
picture q;
path p;
interim ahlength:=12bp;
interim ahangle:=25;
q:= glyph "Dcaron" of "ec-lmr10" scaled .2;
for item within q:
p:= pathpart item;
drawarrow p withcolor(.6,.9,.6) withpen pencircle scaled 1.5;
for j=0 upto length p:
pickup pencircle scaled .7;
draw (point j of p -- precontrol j of p)
dashed evenly withcolor blue;
draw (point j of p -- postcontrol j of p)
dashed evenly withcolor blue;
pickup pencircle scaled 3;
draw precontrol j of p withcolor red;
draw postcontrol j of p withcolor red;
pickup pencircle scaled 2;
draw point j of p withcolor black;
endfor
endfor
endfig;
% -------
But how can I get the glyph path(s) with luatex (mplib)?
Minimal example (glyph.mkiv) and console output are attached (log is
empty). Looks like I can't use 'fontmapfile' and without it the glyphs
are not found.
Peter
mtx-context | run 1: luatex
--fmt="R:/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
--jobname="glyph"
--lua="R:/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
--no-parse-first-line --c:currentrun=1 --c:fulljobname="./glyph.mkiv"
--c:input="./glyph.mkiv" --c:kindofrun=1 --c:maxnofruns=8 "cont-yes.mkiv"
This is LuaTeX, Version beta-0.77.0-2013122323 (rev 4694)
\write18 enabled.
(R:/tex/texmf-context/tex/context/base/cont-yes.mkiv
ConTeXt ver: 2013.12.24 17:52 MKIV beta fmt: 2013.12.25 int: english/english
system > 'cont-new.mkiv' loaded
(R:/tex/texmf-context/tex/context/base/cont-new.mkiv)
system > files > jobname 'glyph', input './glyph.mkiv', result 'glyph'
fonts > latin modern fonts are not preloaded
languages > language 'en' is active
(d:/mydocs/TeX/dokumente/D3/glyph.mkiv{R:/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fonts > preloading latin modern fonts (second stage)
fonts > typescripts > unknown library 'loc'
{R:/tex/texmf/fonts/map/dvips/lm/lm-math.map}{R:/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
fonts > 'fallback modern rm 12pt' is loaded
metapost > initializing instance 'metafun' using format 'metafun'
metapost > loading 'metafun' as
'R:/tex/texmf-context/metapost/context/base/metafun.mpiv' using method 'default'
metapost > initializing number mode 'scaled'
metapost > error:
Warning: cannot open font map file mpost.map
{lm-ec.map
Out of memory!
metapost > error: no-term
no-error
nil
backend > xmp > using file
'R:/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
pages > flushing realpage 1, userpage 1
) )<R:/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf>
mkiv lua stats > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats > used cache path:
R:/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats > resource resolver: loadtime 0.000 seconds, 0 scans with
scantime 0.000 seconds, 0 shared scans, 29 found files, scanned paths: <none>
mkiv lua stats > stored bytecode data: 338 modules (0.094 sec), 69 tables
(0.000 sec), 407 chunks (0.094 sec)
mkiv lua stats > cleaned up reserved nodes: 42 nodes, 9 lists of 442
mkiv lua stats > node memory usage: 2 glue, 2 penalty, 9 attribute, 28
glue_spec, 3 attribute_list
mkiv lua stats > node list callback tasks: 6 unique task lists, 5 instances
(re)created, 40 calls
mkiv lua stats > used backend: pdf (backend for directly generating pdf output)
mkiv lua stats > loaded patterns: en::2, load time: 0.000
mkiv lua stats > jobdata time: 0.000 seconds saving, 0.000 seconds loading
mkiv lua stats > callbacks: 141 direct, 196 indirect, 337 total
mkiv lua stats > result saved in file: glyph.pdf, compresslevel 3,
objectcompreslevel 3
mkiv lua stats > loaded fonts: 2 files: latinmodern-math.otf,
lmroman12-regular.otf
mkiv lua stats > fonts load time: 0.094 seconds for 4 fonts, 2 shared in
backend, 2 common vectors, 0 common hashes
mkiv lua stats > used platform: win64, type: windows, binary subtree:
texmf-win64
mkiv lua stats > luatex banner: this is luatex, version beta-0.77.0 (tex live
2013/w32tex) (rev 4694)
mkiv lua stats > control sequences: 38342 of 65536 + 100000
mkiv lua stats > current memory usage: 49 MB (ctx: 49 MB)
mkiv lua stats > runtime: 0.250 seconds, 1 processed pages, 1 shipped pages,
4.000 pages/second
mtx-context | run 1: luatex
--fmt="R:/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
--jobname="glyph"
--lua="R:/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
--no-parse-first-line --c:currentrun=2 --c:fulljobname="./glyph.mkiv"
--c:input="./glyph.mkiv" --c:kindofrun=2 --c:maxnofruns=8 "cont-yes.mkiv"
This is LuaTeX, Version beta-0.77.0-2013122323 (rev 4694)
\write18 enabled.
(R:/tex/texmf-context/tex/context/base/cont-yes.mkiv
ConTeXt ver: 2013.12.24 17:52 MKIV beta fmt: 2013.12.25 int: english/english
system > 'cont-new.mkiv' loaded
(R:/tex/texmf-context/tex/context/base/cont-new.mkiv)
system > files > jobname 'glyph', input './glyph.mkiv', result 'glyph'
fonts > latin modern fonts are not preloaded
languages > language 'en' is active
(d:/mydocs/TeX/dokumente/D3/glyph.mkiv{R:/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fonts > preloading latin modern fonts (second stage)
fonts > typescripts > unknown library 'loc'
{R:/tex/texmf/fonts/map/dvips/lm/lm-math.map}{R:/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
fonts > 'fallback modern rm 12pt' is loaded
metapost > initializing instance 'metafun' using format 'metafun'
metapost > loading 'metafun' as
'R:/tex/texmf-context/metapost/context/base/metafun.mpiv' using method 'default'
metapost > initializing number mode 'scaled'
mtx-context | fatal error: return code: -1073741819
\startMPinclusions
fontmapfile "=lm-ec.map";
\stopMPinclusions
\startuniqueMPgraphic{Dcaron}
path p[];
picture q;
q:= glyph "Dcaron" of "ec-lmr10" scaled .2;
i:= 1;
for item within q:
p[i] := pathpart item;
i:= i+1;
endfor
draw_arrow_path(p1);
draw_arrow_path(p2);
draw_arrow_path(p3);
passarrayvariable("Dcaron",p,1,3,1);
setbounds currentpicture to boundingbox q;
\stopuniqueMPgraphic
\starttext
\ctxlua{metapost.showlog = true}
\uniqueMPgraphic{Dcaron}
\ctxlua{inspect(metapost.variables[Dcaron])}
\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________