ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hongwen Qiu <qiuhongwen@gmail.com>
To: ntg-context@ntg.nl
Subject: Re: 3. Re: \MPpos, pxy, initialize_box(), oh my! (Hongwen Qiu)
Date: Sat, 05 Jun 2010 19:12:28 +0800	[thread overview]
Message-ID: <4C0A311C.6010808@gmail.com> (raw)
In-Reply-To: <4C09BCD5.9050400@pg.canterbury.ac.nz>


[-- Attachment #1.1: Type: text/plain, Size: 2131 bytes --]

? 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

[-- Attachment #1.2: Type: text/html, Size: 3297 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2010-06-05 11:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1424.1275676267.4277.ntg-context@ntg.nl>
2010-06-05  2:56 ` Adam Fuller
2010-06-05 11:12   ` Hongwen Qiu [this message]
2010-06-05 17:30 ` Wrong spacing before and after commas in math(?) Warrence
     [not found] <mailman.1444.1275741285.4277.ntg-context@ntg.nl>
2010-06-06 14:23 ` 3. Re: \MPpos, pxy, initialize_box(), oh, my! (Hongwen Qiu) Adam Fuller
2010-06-06 14:25   ` Taco Hoekwater

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C0A311C.6010808@gmail.com \
    --to=qiuhongwen@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).