ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* textext sync problem?
@ 2013-08-28 17:40 Meer, H. van der
  2013-08-28 19:20 ` Aditya Mahajan
  0 siblings, 1 reply; 5+ messages in thread
From: Meer, H. van der @ 2013-08-28 17:40 UTC (permalink / raw)
  To: NTG ConTeXt


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

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

end of thread, other threads:[~2013-08-28 21:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-28 17:40 textext sync problem? 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
2013-08-28 21:11     ` Hans Hagen

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