On 8/28/2013 10:12 PM, 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.
even then, as aditya mentioned, a minimal example is needed as now i had to made one myself anyhow, textext is not a real picture in the sense that it only carries around dimensions and the text string dealing with color is already somewhat complex and the 'current' color of the picture is taken into account, so with "draw somepic withcolor red" the color gets applied to all picture components and drawoptions are also applied (part of the draw definition) i made a patch that also carries some extra color info but i'm not sure how robust it is (i also did some further optimization) btw, we do have a 'named properties' feature in metafun: \startMPpage property p[] ; p1 = properties(withcolor blue) ; p2 = properties(withcolor red) ; % fill fullcircle scaled 2cm withproperties p1 ; picture pic ; pic := textext("one") ; draw pic withproperties p1 ; draw pic shifted (1cm,0) withproperties p2 ; drawoptions(withcolor red); pic := textext("one") shifted (1cm,0) ; drawoptions(); draw pic ; drawoptions(withcolor green); draw textext("one") shifted (2cm,0) ; drawoptions(); \stopMPpage Hans (in flu-mode so more bugs than usual) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------