%D \module %D [ file=meta-imp-local-fences, %D version=2012.05.23, %D title=\METAPOST\ Graphics, %D subtitle=Fences, %D author=Aditya Mahajan, %D date=\currentdate, %D copyright={Aditya Mahajan}] %C %D This module allows one to set the thickness and color of each side of a %D frame. \unprotect \def\insall_local_fence_handler#1#2% {\startuniqueMPgraphic {#1_local_fence} draw #1boundary OverlayBox withpen pensquare scaled (\the\dimexpr\framedparameter{#2\c!rulethickness}\relax) withcolor \MPcolor{\framedparameter{#2\c!framecolor}} ; setbounds currentpicture to OverlayBox ; \stopuniqueMPgraphic \setupframed[#2\c!rulethickness=\c!rulethickness, #2\c!framecolor=\c!framecolor] \getvalue{install#1framerenderer}\v!local {\uniqueMPgraphic{#1_local_fence}}} \insall_local_fence_handler {top} \v!top \insall_local_fence_handler {bottom} \v!bottom \insall_local_fence_handler {left} \v!left \insall_local_fence_handler {right} \v!right \protect \continueifinputfile{meta-imp-local-fences.mkiv} % Typo in pack-fen.mkiv \unprotected \let\setinstalledframedimensions\pack_framed_overlay_initialize_indeed \defineframed [colorful] [ toprulethickness=1pt, topframecolor=red, bottomrulethickness=2pt, bottomframecolor=blue, leftrulethickness=3pt, leftframecolor=green, rightrulethickness=4pt, rightframecolor=yellow, frame=off, topframe=local, bottomframe=local, rightframe=local, leftframe=local, ] \colorful{Hello world} \stoptext