Right, this is actually a little more complicated. $chr(9) is definitely zero length as returned by Windows APIs. However, some characters in custom @windows are processed slightly differently from normal windows, and this includes tab characters. $width() and $height() work independently of window type, since there is no window parameter. They currently default to the window type in which they are being called. If you call these from a custom @window, they will return the value you expect to match /drawtext. If you call them from any other window, they will return values for normal windows.
To make them match /drawtext, one solution would be to add a switch to $width() and $height() to make them use a custom @window type measurement.
Or, since they will usually be used with /drawtext, make them default to custom @window measurement. But this would break backward compatibility in measurement of text that includes tab characters in non-custom windows.
Last edited by Khaled; 17/03/20 10:56 AM.