ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: textext sync problem?
Date: Wed, 28 Aug 2013 17:08:13 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LNX.2.03.1308281704140.13886@hzvpu.rqh> (raw)
In-Reply-To: <8F9D20A5-00D1-4509-9F1C-8E5B0D1EB55B@uva.nl>

On Wed, 28 Aug 2013, Meer, H. van der wrote:

> Do I understand ypu correctly then that:
>
> (1) textext delivers a picture containing what it did typeset, regardless of the setting of drawop
> (2) drawoptions (withcolor red) then applies the color to that picture?
>
> But then there is a complication.
> On input textext("\tfb text") the above seems to apply, but submitting textext("\orange\tfb text") makes the text orange coloured in spit of the drawoptions setting. Thus textext seems to behave differently for getting an explicit color for its content or not.
>
> Before ripping the program for a minimal example I would like to first 
> have a clear understanding of the functioning of textext in relation to 
> metapost. It seems that as yet I do not have a clear enough picture of 
> that process.

The example below illustrates what is happening:

\starttext
\startMPcode
   newpicture p;

   drawoptions (withcolor red);
   p := image (addto currentpicture doublepath unitsquare scaled 1cm );
   drawoptions ();

   draw p;
\stopMPcode
\stoptext

drawoptions() are used only when you use draw or fill (look up their 
definition in mp-base.mpiv). textext does not use draw or fill. If you 
want drawoptions to be honored, you can do something as follows:

\starttext

\startMPcode
   newpicture p;

   drawoptions (withcolor red);
   p := image (draw textext("\tfd text"));
   drawoptions ();

   draw p;
\stopMPcode

\stoptext

Aditya
___________________________________________________________________________________
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:[~2013-08-28 21:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28 17:40 Meer, H. van der
2013-08-28 19:20 ` Aditya Mahajan
2013-08-28 20:12   ` Meer, H. van der
2013-08-28 21:08     ` Aditya Mahajan [this message]
2013-08-28 21:11     ` Hans Hagen

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=alpine.LNX.2.03.1308281704140.13886@hzvpu.rqh \
    --to=adityam@umich.edu \
    --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).