Re: [NTG-context] sometxt vs textext behaving different

2006-07-17 Thread Taco Hoekwater


Hans van der Meer wrote:
 Metapost problem: It seems that sometxt and textext behave different.

Yes, they are different. sometxt only works for TeX-only labels.
If you need a MetaPost variable in the label, you have to use textext.

Greetings, Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] sometxt vs textext behaving different

2006-07-16 Thread Hans van der Meer
Metapost problem: It seems that sometxt and textext behave different.This is my macro:% Label with text and centerpositionvardef [EMAIL PROTECTED](expr labeltext, pos) = 	save pic; picture pic;	if picture labeltext:		pic := labeltext;	else:		if labeltext = "":			pic := nullpicture;		else:			% prevent wobbling of text boxes with uneven depth% TEXTEXT line:			pic := textext("\setbox0=\hbox{"labeltext"}\dp0=0pt\box0");			% since ConTeXt 14-7-2006 textext = sometxt% SOMETXT line:			%pic := sometxt("\setbox0=\hbox{"labeltext"}\dp0=0pt\box0");		fi	fi		% calculate labelshift from suffix	save shift; pair shift;	shift = ((penX/2 + labeloffset) * xpart [EMAIL PROTECTED],(penY/2 + labeloffset) * ypart [EMAIL PROTECTED])- ([EMAIL PROTECTED] * lrcorner pic + [EMAIL PROTECTED] * ulcorner pic+ (1 - [EMAIL PROTECTED] - [EMAIL PROTECTED]) * llcorner pic);	% deliver picture shifted in position	pic shifted (pos + shift)enddef;With textext enabled it just works as I intend.With sometxt enabled I get: unknown picture pic sometxt! Equation cannot be performed (unknown picture=numeric).to be read again                    (theLabel-...":pic:=nullpicture;else:pic:=sometxt(                                                  "\setbox0=\hbox{"(EXPR3)...l.211 Label("TEXTEXT", (w/2,h/2))                                  withcolor red;Thus while textext delivers a picture sometxt does not. This seems strange, because I understood that sometxt was meant as a dropin replacement for textext (except for MP loops, as Hans Hagen mentioned in a previous email).Is this correct or do I have to make more changes to switch over from textext to sometxt? Hans van der Meer ___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context