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



<<inline: blue.jpg>>

<<inline: green.jpg>>

<<attachment: notblue.tiff>>

___________________________________________________________________________________
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 via email to