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
Forgot to tell why I need the glyph paths... I implemented multi path support in drops yesterday and now I want to test it with some glyphs. Currently I use Inkscape (export the glyph path as PDF) and pdftoedit to finally get a MP path. Time consuming and the result still needs a manual clean-up. Here is my current test example. Needless to say, that the path blew up my code in the first run (a too low threshold value) :-D http://www.wuala.com/indiego/public/ConTeXt/pathtest.pdf Am 19.02.2014 13:25, schrieb Peter Rolf:
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
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / 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 ___________________________________________________________________________________
On 2/19/2014 7:41 PM, Peter Rolf wrote:
Forgot to tell why I need the glyph paths... I implemented multi path support in drops yesterday and now I want to test it with some glyphs. Currently I use Inkscape (export the glyph path as PDF) and pdftoedit to finally get a MP path. Time consuming and the result still needs a manual clean-up.
% macros=mkvi \definefont[RatherBig][Mono at 60pt] \defineeffect [justone] [alternative=outer,rulethickness=1pt] \defineeffect [justtwo] [alternative=inner] \starttexdefinition example #font#line#text \hbox { \framed [offset=\dimexpr#line/2\relax,strut=no,frame=off] { \definedfont[#font] \defineeffect[bg][alternative=outer,rulethickness=#line] \defineeffect[fg][alternative=inner] \hsmash{\red \effect[bg]{#text}} \hbox {\blue\effect[fg]{#text}} } } \stoptexdefinition \starttext {\effect[justone]{\RatherBig BIG}} {\effect[justtwo]{\RatherBig BIG}} \example{Mono at 60pt}{5pt}{BIG} \example{Mono at 80pt}{10pt}{BIG} \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am 20.02.2014 09:58, schrieb Hans Hagen:
On 2/19/2014 7:41 PM, Peter Rolf wrote:
Forgot to tell why I need the glyph paths... I implemented multi path support in drops yesterday and now I want to test it with some glyphs. Currently I use Inkscape (export the glyph path as PDF) and pdftoedit to finally get a MP path. Time consuming and the result still needs a manual clean-up.
% macros=mkvi
\definefont[RatherBig][Mono at 60pt]
\defineeffect [justone] [alternative=outer,rulethickness=1pt] \defineeffect [justtwo] [alternative=inner]
\starttexdefinition example #font#line#text \hbox { \framed [offset=\dimexpr#line/2\relax,strut=no,frame=off] { \definedfont[#font] \defineeffect[bg][alternative=outer,rulethickness=#line] \defineeffect[fg][alternative=inner] \hsmash{\red \effect[bg]{#text}} \hbox {\blue\effect[fg]{#text}} } } \stoptexdefinition
\starttext
{\effect[justone]{\RatherBig BIG}}
{\effect[justtwo]{\RatherBig BIG}}
\example{Mono at 60pt}{5pt}{BIG}
\example{Mono at 80pt}{10pt}{BIG}
\stoptext
Thanks for this nice example (I wasn't aware of this). But this doesn't really help me with my problem. I guess my example had too much irritating eye candy, so I made another one :-) http://www.wuala.com/indiego/public/ConTeXt/pathtest2.pdf The problem is, that I need direct access to the glyphs path(s), as I must calculate the offset paths for the sub shadows (umbra/penumbra). Inkscape has a similar function called "inset/outset path", if I remember right. In the example I used a negative offset for the umbra shadow (udistance) and a positive for the penumbra shadow (pdistance). The original path is drawn as 'arrowpath'. The path creating algorithm (based on the Tiller-Hanson alg.) works quite good so far, but still needs a lot of tweaking. And glyphs have a wide range of shapes, so they are nearly ideal for testing purposes. Anyhow, it can't be helped, if 'glyph' is not working. I'll test some ConTeXt generated PDF glyphs (MPpage) then and see if I can optimize the manual path creation a little bit. Best wishes, Peter
participants (2)
-
Hans Hagen
-
Peter Rolf