* [NTG-context] Does the return of "wdpart positionwhd" is the width of the box ?
@ 2025-02-01 21:15 garulfo
2025-02-01 21:18 ` [NTG-context] " garulfo
2025-02-01 21:52 ` Hans Hagen
0 siblings, 2 replies; 3+ messages in thread
From: garulfo @ 2025-02-01 21:15 UTC (permalink / raw)
To: ntg-context
Hi,
the metafun function positionwidth doesn't seems to be available, so I triy to use wdpart positionwhd.
But in the MVE, the green point is not at the expected position (on the right border of the frame).
%%%%%%%%%%%%%
\setupheadertexts[]
\setuppapersize[A8,landscape]
\setupbodyfont[40pt]
\startuseMPgraphic{MPMyPage}
StartPage ;
draw
positionbox("locA")
withpen pencircle scaled 5pt
withcolor transparent(1,0.5,blue);
pair ThePoint;
ThePoint := positionxy("locA");
draw ThePoint
withpen pencircle scaled 5pt
withcolor red ;
draw ThePoint
shifted (wdpart positionwhd("locA"),0)
withpen pencircle scaled 5pt
withcolor green ;
StopPage ;
\stopuseMPgraphic
\defineoverlay
[OLMyPage]
[\useMPgraphic{MPMyPage}]
\setupbackgrounds
[page]
[background={foreground,OLMyPage}]
\starttext
A
\framed
[region=locA,
offset=overlay,
frame=off]
{\TeX}.
\stoptext
%%%%%%%%%%%%%
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* [NTG-context] Re: Does the return of "wdpart positionwhd" is the width of the box ?
2025-02-01 21:15 [NTG-context] Does the return of "wdpart positionwhd" is the width of the box ? garulfo
@ 2025-02-01 21:18 ` garulfo
2025-02-01 21:52 ` Hans Hagen
1 sibling, 0 replies; 3+ messages in thread
From: garulfo @ 2025-02-01 21:18 UTC (permalink / raw)
To: ntg-context
This is working:
draw ThePoint
shifted (\MPw{locA},0)
withpen pencircle scaled 5pt
withcolor green ;
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* [NTG-context] Re: Does the return of "wdpart positionwhd" is the width of the box ?
2025-02-01 21:15 [NTG-context] Does the return of "wdpart positionwhd" is the width of the box ? garulfo
2025-02-01 21:18 ` [NTG-context] " garulfo
@ 2025-02-01 21:52 ` Hans Hagen
1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2025-02-01 21:52 UTC (permalink / raw)
To: garulfo, mailing list for ConTeXt users
On 2/1/2025 10:15 PM, garulfo@azules.eu wrote:
> Hi,
>
> the metafun function positionwidth doesn't seems to be available, so I triy to use wdpart positionwhd.
in anch-pos.lmt :
function jobpositions.whd(id)
local jpi = collected[id]
if jpi then
return jpi.w, jpi.h, jpi.d -- fix w
end
end
you need to remake the format
mabe it makes sense to have
positionwd positionht positiondp
some day but as this went unnoticed i bet there is not that much demand
for it
> But in the MVE, the green point is not at the expected position (on the right border of the frame).
>
> %%%%%%%%%%%%%
>
> \setupheadertexts[]
> \setuppapersize[A8,landscape]
> \setupbodyfont[40pt]
>
> \startuseMPgraphic{MPMyPage}
> StartPage ;
> draw
> positionbox("locA")
> withpen pencircle scaled 5pt
> withcolor transparent(1,0.5,blue);
>
> pair ThePoint;
> ThePoint := positionxy("locA");
>
> draw ThePoint
> withpen pencircle scaled 5pt
> withcolor red ;
>
> draw ThePoint
> shifted (wdpart positionwhd("locA"),0)
> withpen pencircle scaled 5pt
> withcolor green ;
>
> StopPage ;
> \stopuseMPgraphic
>
> \defineoverlay
> [OLMyPage]
> [\useMPgraphic{MPMyPage}]
>
> \setupbackgrounds
> [page]
> [background={foreground,OLMyPage}]
>
> \starttext
>
> A
> \framed
> [region=locA,
> offset=overlay,
> frame=off]
> {\TeX}.
>
> \stoptext
>
> %%%%%%%%%%%%%
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
--
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-01 21:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-01 21:15 [NTG-context] Does the return of "wdpart positionwhd" is the width of the box ? garulfo
2025-02-01 21:18 ` [NTG-context] " garulfo
2025-02-01 21:52 ` Hans Hagen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).