[metapost] Metafun doesn' fill arrow heads anymore

Franck Pastor franck.pastor at mac.com
Sat Dec 30 22:38:18 CET 2017


> 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}


More information about the metapost mailing list