Re: [NTG-context] 3. Re: \MPpos, pxy, initialize_box(), oh, my! (Hongwen Qiu)

2010-06-06 Thread Adam Fuller

hmm, that's interesting.  the source of the metafun manual is a logical place 
to look... hadn't thought of that, but where can i find it?  i searched the 
source browser for metafun and metafun.tex to no avail.  the challenge of 
learning a new system like context is like cooking out of someone else's 
kitchen: everything you need is probably there somewhere, it's just a matter of 
knowing where to look.

yes, i'd like to know how this family of macros---\fpos, \tpos, mpos:box and 
mpos:par and friends, etc.---work, and what information you can get from them.  
the only mention of these on this mailing list seems to be that bunch of 
messages you forwarded, which was back in 2008.  if i can get a bit of a 
kickstart toward figuring them out, i'd be compelled to put the basics in the 
wiki.

assuming mpos:box and mpos:par were some sort of built-in MPgraphics, i 
compiled the following short context document, where mpos:box and mpos:par had 
no effect :(

\setupMPvariables[mpos:box][linecolor=darkred]
\setupMPvariables[mpos:par][linecolor=darkred]

\startpositionoverlay{testing_paragraph_outline}
\setMPpositiongraphic{pos1}{mpos:box}{self=pos1}
\setMPpositiongraphic{pos1}{mpos:par}{self=pos1}
\stoppositionoverlay

\defineoverlay[mylayer][\positionoverlay{testing_paragraph_outline}]
\setupbackgrounds[page][background=mylayer]

\starttext
\fpos{pos1}Something special.\tpos{pos1}
\stoptext


On 6/06/2010 12:34 a.m., ntg-context-requ...@ntg.nl wrote:

Date: Sat, 05 Jun 2010 19:12:28 +0800
From: Hongwen Qiuqiuhong...@gmail.com
To:ntg-context@ntg.nl
Subject: Re: [NTG-context] 3. Re: \MPpos, pxy, initialize_box(), oh
my! (Hongwen Qiu)
Message-ID:4c0a311c.6010...@gmail.com
Content-Type: text/plain; charset=iso-8859-1; Format=flowed

? 2010?06?05? 10:56, Adam Fuller ??:

  my initial post had a mistake:  i meant to refer to the/Metafun/
  manual, not the Metapost manual.  that probably didn't help.

Actually, I know that you mean the/Metafun/  manual.

  i guess what i should have said is, i know that pxy can give me the
  bounding/box/  (the rectangle with the maximum horizontal and vertical
  extents of its contents, be they set in horizontal or vertical mode),
  but can it give me the subset of that, the bounding/path/, if you
  will, when the contents are text which flows over several lines.  the
  bounding/path/  may not be rectangular, although it will be something
  like the union of the bounding boxes of the text's individual lines.

So now, I understand what mean.

  i think if you look at the correct reference, the difference of the
  effects is clear.  i think the challenge is that you don't know where
  the line breaks will occur until you typeset it.   --adam

And the source code from the manual may help you:

\setupMPvariables[mpos:box][linecolor=darkred]
\setupMPvariables[mpos:par][linecolor=darkred]

\startpositionoverlay{backgraphics}
\setMPpositiongraphic{A-3}{mpos:box}{self=A-3}
\setMPpositiongraphic{A-4}{mpos:box}{self=A-4}
\setMPpositiongraphic{b:A-5}{mpos:par}{self=A-5}
\setMPpositiongraphic{b:A-6}{mpos:par}{self=A-6}
\stoppositionoverlay

\fpos {A-5} Because the text must be laid on top of
the graphic, the graphic must precede the first word in the
typeset stream or it must be positioned on a separate layer.
In the latter case it can be calculated directly after the
paragraph is typeset, but in the former case a second pass
is needed. \tpos {A-5}

Given the above code, I think you can get some information about the
horizontal and vertical pos of texts from \fpos and \tpos. And the
mpos:par is defined in anch-pgr.mkii and anch-pgr.mkiv. But I haven't
dig into the code which implement mpos:par. Hope you can find useful
information there.

And hope the following message I just searched out will help you too:

http://archive.contextgarden.net/message/20080107.024554.314d9fee.ca.html
-- next part --
An HTML attachment was scrubbed...
URL:http://www.ntg.nl/pipermail/ntg-context/attachments/20100605/66da92a8/attachment-0001.html

attachment: adam_fuller.vcf___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] 3. Re: \MPpos, pxy, initialize_box(), oh, my! (Hongwen Qiu)

2010-06-06 Thread Taco Hoekwater

Adam Fuller wrote:
hmm, that's interesting.  the source of the metafun manual is a logical 
place to look... hadn't thought of that, but where can i find it?  


http://context.aanhet.net/svn/manuals/metafun/

Best wishes,
Taco
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] 3. Re: \MPpos, pxy, initialize_box(), oh my! (Hongwen Qiu)

2010-06-05 Thread Hongwen Qiu

? 2010?06?05? 10:56, Adam Fuller ??:
my initial post had a mistake:  i meant to refer to the /Metafun/ 
manual, not the Metapost manual.  that probably didn't help.

Actually, I know that you mean the /Metafun/ manual.
i guess what i should have said is, i know that pxy can give me the 
bounding /box/ (the rectangle with the maximum horizontal and vertical 
extents of its contents, be they set in horizontal or vertical mode), 
but can it give me the subset of that, the bounding /path/, if you 
will, when the contents are text which flows over several lines.  the 
bounding /path/ may not be rectangular, although it will be something 
like the union of the bounding boxes of the text's individual lines.

So now, I understand what mean.
i think if you look at the correct reference, the difference of the 
effects is clear.  i think the challenge is that you don't know where 
the line breaks will occur until you typeset it.   --adam 

And the source code from the manual may help you:

\setupMPvariables[mpos:box][linecolor=darkred]
\setupMPvariables[mpos:par][linecolor=darkred]

\startpositionoverlay{backgraphics}
  \setMPpositiongraphic{A-3}{mpos:box}{self=A-3}
  \setMPpositiongraphic{A-4}{mpos:box}{self=A-4}
  \setMPpositiongraphic{b:A-5}{mpos:par}{self=A-5}
  \setMPpositiongraphic{b:A-6}{mpos:par}{self=A-6}
\stoppositionoverlay

\fpos {A-5} Because the text must be laid on top of
the graphic, the graphic must precede the first word in the
typeset stream or it must be positioned on a separate layer.
In the latter case it can be calculated directly after the
paragraph is typeset, but in the former case a second pass
is needed. \tpos {A-5}

Given the above code, I think you can get some information about the 
horizontal and vertical pos of texts from \fpos and \tpos. And the 
mpos:par is defined in anch-pgr.mkii and anch-pgr.mkiv. But I haven't 
dig into the code which implement mpos:par. Hope you can find useful 
information there.


And hope the following message I just searched out will help you too:

http://archive.contextgarden.net/message/20080107.024554.314d9fee.ca.html
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] 3. Re: \MPpos, pxy, initialize_box(), oh my! (Hongwen Qiu)

2010-06-04 Thread Adam Fuller



On 5/06/2010 6:31 a.m., ntg-context-requ...@ntg.nl wrote:

3. Re: \MPpos, pxy, initialize_box(), oh my! (Hongwen Qiu)


hi hongwen,
thanks for taking an interest.

my initial post had a mistake:  i meant to refer to the /Metafun/ manual, not 
the Metapost manual.  that probably didn't help.

i guess what i should have said is, i know that pxy can give me the bounding 
/box/ (the rectangle with the maximum horizontal and vertical extents of its 
contents, be they set in horizontal or vertical mode), but can it give me the 
subset of that, the bounding /path/, if you will, when the contents are text 
which flows over several lines.  the bounding /path/ may not be rectangular, 
although it will be something like the union of the bounding boxes of the 
text's individual lines.

i think if you look at the correct reference, the difference of the effects is 
clear.  i think the challenge is that you don't know where the line breaks will 
occur until you typeset it.   --adam
attachment: adam_fuller.vcf___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___