ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* lost position information with metafun registers
@ 2005-05-18 20:44 Richard Hirsch
  2005-05-19 10:50 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Hirsch @ 2005-05-18 20:44 UTC (permalink / raw)


Dear ConTeXt users (and developers),

I am very fond of the presentation capabilites of ConTeXt, especially in
connection with the Metafun macros. A big hand for the ConTeXt team!

Now I want to link some checkboxes to a MPgraphic (a fieldstack
actually) and I thought, that the best approach would be via the layer
mechanism described in section 5.4 of the Metafun manual.

I got the background picture and the checkboxes, but unfortunately the
checkboxes were not in the intended positions (saved in register macros)
but rather in the top left corner of the image.

The same happened when I tried to reproduce the example from the Metafun
manual: The texts show up in the top left corner of the boundig box of
the circle.

\setupcolors    [state=start]
\setuppapersize [S6][S6]

\definelayer    [test]

\startuseMPgraphic{oeps}
  path p ; p := fullcircle scaled 6cm ;
  fill p withcolor .8white ;
  draw p withpen pencircle scaled 1mm withcolor .625red ;
  register ("somepos-1",0cm,0cm,center currentpicture) ;
  register ("somepos-2",3cm,1cm,(-1cm,-1cm)) ;
  register ("somepos-3",2cm,0cm,(-2cm,2cm)) ;
\stopuseMPgraphic

\setMPlayer [test] [somepos-1] [location=c]
  {Does it work all right?}

\setMPlayer [test] [somepos-2]
  {\framed
    [width=\MPlayerwidth,height=\MPlayerheight,
     background=color,backgroundcolor=white]
    {It Works!}}

\starttext
  \getMPlayer [test]{\useMPgraphic{oeps}}
\stoptext

Does somebody have an idea what might go wrong? Do I miss an important
setting or activation? (I am using ConTeXt  ver: 2005.01.31  fmt:
2005.4.26  int: english  mes: english in connection with tetex 3.0-13 on
a linux box.)
Or might this rather be a problem with the acrobat reader (version 7.0
on linux but also version 5 on windows)?

I also tried to get some debug information via activating testmode 
(1. running texexec with the --mode=test option and 
 2. with  \getMPlayer [test]
[state=start,option=test]{\useMPgraphic{oeps}} in the document.) But I
can not find the position information in the logfiles.

Any help would be greatly appreciated.

Best regards,

  Richard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: lost position information with metafun registers
  2005-05-18 20:44 lost position information with metafun registers Richard Hirsch
@ 2005-05-19 10:50 ` Hans Hagen
  2005-05-19 19:52   ` Richard Hirsch
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2005-05-19 10:50 UTC (permalink / raw)


Richard Hirsch wrote:

> Does somebody have an idea what might go wrong? Do I miss an important
> setting or activation? (I am using ConTeXt  ver: 2005.01.31  fmt:
> 2005.4.26  int: english  mes: english in connection with tetex 3.0-13 on
> a linux box.)
> Or might this rather be a problem with the acrobat reader (version 7.0
> on linux but also version 5 on windows)?

that one gav eme a headache; i finally figured out that it's due to the fact 
that positions are not yet loaded (so, if you move \starttext to the top of your 
file, things would have worked ok)

here is a patch for page-lyr.tex:

\def\dosetMPlayer[#1][#2][#3]%
   {\checkpositions % added
    \edef\MPlayerwidth {\MPw{#2}}%
    \edef\MPlayerheight{\MPh{#2}}%
    \setlayer[#1][\c!x=\MPx{#2},\c!y=\MPy{#2},\c!position=\v!no,#3]}

alternatively you can add \checkpositions tothe top of your file

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: lost position information with metafun registers
  2005-05-19 10:50 ` Hans Hagen
@ 2005-05-19 19:52   ` Richard Hirsch
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Hirsch @ 2005-05-19 19:52 UTC (permalink / raw)
  Cc: mailing list for ConTeXt users

On Thu, 2005-05-19 at 12:50 +0200, Hans Hagen wrote:

> that one gav eme a headache; i finally figured out that it's due to the fact 
> that positions are not yet loaded (so, if you move \starttext to the top of your 
> file, things would have worked ok)
> 
> here is a patch for page-lyr.tex:
> 
> \def\dosetMPlayer[#1][#2][#3]%
>    {\checkpositions % added
>     \edef\MPlayerwidth {\MPw{#2}}%
>     \edef\MPlayerheight{\MPh{#2}}%
>     \setlayer[#1][\c!x=\MPx{#2},\c!y=\MPy{#2},\c!position=\v!no,#3]}
> 
> alternatively you can add \checkpositions tothe top of your file
> 
> Hans

AWESOME, 

everything works alright with the patch!

Thank you very much for your help!

Richard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-05-19 19:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-18 20:44 lost position information with metafun registers Richard Hirsch
2005-05-19 10:50 ` Hans Hagen
2005-05-19 19:52   ` Richard Hirsch

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).