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

% Label with text and centerposition
vardef [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

Reply via email to