[NTG-context] sometxt vs textext behaving different

Hans van der Meer hansm at science.uva.nl
Sun Jul 16 18:41:44 CEST 2006

Metapost problem: It seems that sometxt and textext behave different.
This is my macro:

% Label with text and centerposition
vardef theLabel@#(expr labeltext, pos) =
	save pic; picture pic;
	if picture labeltext:
		pic := labeltext;
		if labeltext = "":
			pic := nullpicture;
			% 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");
	% calculate labelshift from suffix
	save shift; pair shift;
	shift = ((penX/2 + labeloffset) * xpart laboff@#,
				(penY/2 + labeloffset) * ypart laboff@#)
				- (labxf@# * lrcorner pic + labyf@# * ulcorner pic
				+ (1 - labxf@# - labyf@#) * llcorner pic);

	% deliver picture shifted in position
	pic shifted (pos + shift)

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ntg.nl/pipermail/ntg-context/attachments/20060716/c3d8933c/attachment.html 

More information about the ntg-context mailing list