[metapost] Metafun doesn' fill arrow heads anymore

Hans Hagen pragma at wxs.nl
Sun Dec 31 12:10:03 CET 2017


On 12/30/2017 10:38 PM, Franck Pastor wrote:
> 
>> Le 30 déc. 2017 à 21:14, Franck Pastor <franck.pastor at mac.com> a écrit :
>>
>> Happy New Year to all the MetaPost users!
>>
>> I’ve just experienced a problem discovered by Ulrike Fisher in
>>
>> https://tex.stackexchange.com/q/408215/25768?sem=2
>>
>> when the Metafun format of MetaPost is in use in the most recent TeX Live distributions (2016-2017), the arrow heads are not filled at all, they remain empty.
>>
>> Try the example (in the LuaLaTeX) given by Ulrike to see this behaviour:
>>
>> \documentclass{article}
>> \usepackage{luamplib}
>> \begin{document}
>>
>> \begin{mplibcode}
>>
>> beginfig(1);
>> drawarrow (0,0)--(10,10);
>> endfig;
>>
>> \end{mplibcode}
>>
>> \mplibsetformat{metafun}
>> \begin{mplibcode}
>>
>> beginfig(1);
>> drawarrow (0,0)--(10,10);
>> endfig;
>> \end{mplibcode}
>>
>> \end{document}
>>
>> The first arrow head is normally filled, the second is not. Is it a bug, or simply the new default way Metafun draws an arrowhead?
> 
> This bug seems to be related to the fillup macro of Metafun. It seems it doesn’t work as it should, at least outside of ConTeXt. See what Ulrike Fischer’s update in her TeX Stackexchange subject I mentioned above:
> 
> https://tex.stackexchange.com/questions/408215/metafun-why-is-the-arrow-tip-not-filled
> 
> \documentclass{article}
> \usepackage{luamplib}
> \begin{document}
> \begin{mplibcode}
> beginfig(1);
> drawarrow (0,0)--(10,10);
> endfig;
> \end{mplibcode}
> 
> \mplibsetformat{metafun}
> \begin{mplibcode}
> beginfig(1);
> drawarrow (0,0)--(10,10);
> endfig;
> \end{mplibcode}
> 
> \begin{mplibcode}
> def mfun_draw_arrow_path text t =
> if autoarrows : set_ahlength(t); fi
>      draw arrowpath mfun_arrow_path t ;
>      fill arrowhead mfun_arrow_path t ;
> %changed fillup to fill
>   endgroup ;
> enddef ;
> beginfig(1);
> drawarrow (0,0)--(10,10);
> endfig;
> \end{mplibcode}
> 
> \end{document}
i have added some code to the luatex-mplib.lua module and it works in 
plain now so when i post a new context beta someone has to make sure 
it's also used in latex

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the metapost mailing list