Kip Warner schrieb am 27.05.2024 um 19:23:
On Mon, 2024-05-27 at 05:43 -0400, seyal zavira wrote:
if you don't want to use metapost you can also use svg for background
for example:
\startuniqueMPgraphic{centered_svg}
draw lmt_svg [
filename = "badge.svg",
width = OverlayWidth,
y = OverlayHeight/2, ] ;
\stopuniqueMPgraphic
\defineoverlay
[svgback]
[\useMPgraphic{centered_svg}]
\defineframed[Sback][location=low,background=svgback,frame=off,offset=8pt]
\starttext
this is a sample \Sback{1} text
\stoptext
Hello Seyal,
This does work but it's a bit annoying that I have to create an SVG of
just a circle and store it somewhere. I'm fine with using MetaPost,
especially if it makes this easier, but I just don't know how.
You can use the \framed solution and modify it to use a metapost graphic
as background, it also easy to replace the circle with a hexagon etc.
\startuseMPgraphic{textcircle}
draw fullcircle
xscaled OverlayWidth
yscaled OverlayWidth
withcolor OverlayLineColor ;
\stopuseMPgraphic
\defineoverlay[textcircle][\useMPgraphic{textcircle}]
\defineframed
[textcircled]
[ width=1.5em,
height=1.5em,
frame=off,
background=textcircle,
location=low,
offset=none]
\starttext
\dostepwiserecurse{0}{9}{1}{#1 = \textcircled{#1}\blank}
\stoptext
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________