ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Meer, H. van der" <H.vanderMeer@uva.nl>
To: NTG ConTeXt <ntg-context@ntg.nl>
Subject: textext sync problem?
Date: Wed, 28 Aug 2013 17:40:23 +0000	[thread overview]
Message-ID: <465819E1-5E48-488E-8586-6ECC76F8546F@uva.nl> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 1732 bytes --]

I am using textext to draw text from inside a metapost program. The drawoptions macro is used by metapost to set drawing options such as color. As I understand, the textext call is handled by the tex-side of the metapost-context system, initiated of course from the metapost side. My impression is that this occurs asynchronously, judging by the problem I encountered.

On the metapost side I have:

drawoptions(withcolor blue);
pic := textext(labeltext);
drawoptions();
% the pic is output later

[cid:3EBB8ADD-F7B8-4DE1-8990-9EB0E0F45EF6@fritz.box]

Deleting the reset implied by the second drawoptions does honor the coloring:
drawoptions(withcolor blue);
pic := textext(labeltext);

[cid:8813D244-4326-4F4A-8520-3C704619954C@fritz.box]

I am inclined to conclude that the calling environment containing the drawoptions setting is not captured the moment the textext call is placed, but somewhat later. Because so it can be explained why the latter has the blue color but the former does not (drawoptions has already been reset before it is taken into account).

The following code variation seems to corroborate this conclusion:
drawoptions(withcolor blue);
pic := textext(labeltext);
drawoptions(withcolor darkgreen);

[cid:415E4344-B8AA-492B-B320-D57D405462EB@fritz.box]

If the conclusion is correct, I have a serious problem, because it then becomes impossible to predictably change the drawoptions used by textext. The result then might be dependent on timing conditions in the system. In my opinion, calling textext should capture all relevant data at the precise moment of the call in metapost.

I might be wrong, of course, but otherwise I am in need of a repair.

Hans van der Meer




[-- Attachment #1.1.2: Type: text/html, Size: 2648 bytes --]

[-- Attachment #1.2: blue.jpg --]
[-- Type: image/jpg, Size: 2847 bytes --]

[-- Attachment #1.3: green.jpg --]
[-- Type: image/jpg, Size: 2470 bytes --]

[-- Attachment #2: notblue.tiff --]
[-- Type: image/tiff, Size: 2340 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 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:[~2013-08-28 17:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28 17:40 Meer, H. van der [this message]
2013-08-28 19:20 ` Aditya Mahajan
2013-08-28 20:12   ` Meer, H. van der
2013-08-28 21:08     ` Aditya Mahajan
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=465819E1-5E48-488E-8586-6ECC76F8546F@uva.nl \
    --to=h.vandermeer@uva.nl \
    --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).