Hans,
Can you change the definition of setinstalledframeddimensions in
pack-fen.mkiv to:
\def\setinstalledframedimensions
{\edef\overlaywidth {\the\frameddimenwd\space}%
\edef\overlayheight{\the\dimexpr\frameddimenht+\frameddimendp\relax\space}%
\edef\overlaydepth {\the\frameddimendp\space}%
\edef\overlaycolor {\framedparameter\c!backgroundcolor}%
\edef\overlaylinecolor{\framedparameter\c!framecolor}%
\edef\overlaylinewidth{\the\ruledlinewidth}}
and include the attached file as part of meta-imp-fen.mkiv?
This is based on an example by Marcin on TeX.se:
http://tex.stackexchange.com/questions/34482/contest-show-off-your-skillz-in-tex-friends-tex-sx-birthday/35211#35211
Thanks,
Aditya\unprotect
% Hooked fences: lefthook, righthook, tophook, and bottomhook.
% The parameter \type{radius} determine the radius of the hook.
% The parameter \type{hook} determines the length of the hook.
\startMPextensions
vardef BasicHook (expr size, radius, hook) =
((0,0) --- (size - radius, 0){right} .. {up}(size, radius) --- (size,
hook))
enddef;
\stopMPextensions
\startuseMPgraphic{bottom_right_hook}
save radius, hook ;
radius := \the\dimexpr\framedparameter\c!frameradius\relax;
hook := \the\dimexpr\framedparameter{hook}\relax;
draw BasicHook(OverlayWidth, radius, hook)
withpen pencircle scaled OverlayLineWidth
withcolor OverlayLineColor;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\startuseMPgraphic{bottom_left_hook}
save radius, hook ;
radius := \the\dimexpr\framedparameter\c!frameradius\relax;
hook := \the\dimexpr\framedparameter{hook}\relax;
draw BasicHook(OverlayWidth, radius, hook)
reflectedabout ((0.5OverlayWidth, 0), (0.5OverlayWidth, OverlayHeight))
withpen pencircle scaled OverlayLineWidth
withcolor OverlayLineColor;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\startuseMPgraphic{top_right_hook}
save radius, hook ;
radius := \the\dimexpr\framedparameter\c!frameradius\relax;
hook := \the\dimexpr\framedparameter{hook}\relax;
draw BasicHook(OverlayWidth, radius, hook)
reflectedabout ((0,0),(OverlayWidth,0))
shifted (0,OverlayHeight)
withpen pencircle scaled OverlayLineWidth
withcolor OverlayLineColor;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\startuseMPgraphic{left_top_hook}
save radius, hook ;
radius := \the\dimexpr\framedparameter\c!frameradius\relax;
hook := \the\dimexpr\framedparameter{hook}\relax;
draw BasicHook(OverlayWidth, radius, hook)
reflectedabout ((0.5OverlayWidth, 0), (0.5OverlayWidth, OverlayHeight))
reflectedabout ((0,0),(OverlayWidth,0))
shifted (0,OverlayHeight)
withpen pencircle scaled OverlayLineWidth
withcolor OverlayLineColor;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\startuseMPgraphic{left_bottom_hook}
save radius, hook ;
radius := \the\dimexpr\framedparameter\c!frameradius\relax;
hook := \the\dimexpr\framedparameter{hook}\relax;
draw BasicHook(OverlayHeight, radius, hook)
rotated -90
shifted (0,OverlayHeight)
withpen pencircle scaled OverlayLineWidth
withcolor OverlayLineColor;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\startuseMPgraphic{left_top_hook}
save radius, hook ;
radius := \the\dimexpr\framedparameter\c!frameradius\relax;
hook := \the\dimexpr\framedparameter{hook}\relax;
draw BasicHook(OverlayHeight, radius, hook)
reflectedabout ((0,0),(OverlayWidth,0))
rotated 90
withpen pencircle scaled OverlayLineWidth
withcolor OverlayLineColor;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\startuseMPgraphic{right_top_hook}
save radius, hook ;
radius := \the\dimexpr\framedparameter\c!frameradius\relax;
hook := \the\dimexpr\framedparameter{hook}\relax;
draw BasicHook(OverlayHeight, radius, hook)
rotated 90
shifted (OverlayWidth,0)
withpen pencircle scaled OverlayLineWidth
withcolor OverlayLineColor;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\startuseMPgraphic{right_bottom_hook}
save radius, hook ;
radius := \the\dimexpr\framedparameter\c!frameradius\relax;
hook := \the\dimexpr\framedparameter{hook}\relax;
draw BasicHook(OverlayHeight, radius, hook)
reflectedabout ((0,0),(OverlayWidth,0))
rotated -90
shifted (OverlayWidth,OverlayHeight)
withpen pencircle scaled OverlayLineWidth
withcolor OverlayLineColor;
setbounds currentpicture to OverlayBox;
\stopuseMPgraphic
\installtopframerenderer{righthook}{\useMPgraphic{top_right_hook}}
\installtopframerenderer {lefthook}{\useMPgraphic{top_left_hook}}
\installbottomframerenderer {righthook}{\useMPgraphic{bottom_right_hook}}
\installbottomframerenderer {lefthook}{\useMPgraphic{bottom_left_hook}}