[NTG-context] Text with background (overlay with a line by MP)

Procházka Lukáš LPr at pontex.cz
Sat Mar 19 21:35:03 CET 2011


Hello,

I'm trying to create an overlay - text with a line drawn bellow.

The following code:

---

\defineoverlay[Label][\useMPgraphic{Label}]

\startuniqueMPgraphic{Label}
   path p; p := (0,0) -- (OverlayWidth,0);
   draw p yshifted -1cm withpen pencircle scaled 1mm withcolor .667red;
\stopuniqueMPgraphic

\def\Text#1{\inframed[background=Label,frame=off]{#1}}

\starttext
   AAA
   \Text{BBB}
   CCC
\stoptext

---

results in a horizontal line going exactly through the middle of the text.

And I'd like to draw it bellow; thus "yshifted -1cm".

How to do it?

Best regards,

Lukas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t-TxMP.mkiv
Type: application/octet-stream
Size: 325 bytes
Desc: not available
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20110319/8a4c96cb/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t-TxMP.pdf
Type: application/pdf
Size: 5378 bytes
Desc: not available
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20110319/8a4c96cb/attachment.pdf>


More information about the ntg-context mailing list