The problem is that while $width(This is a test,Verdana,-10) returns 87 pixels, this is actually 2 pixels bigger than the physical width of the font, and the way mIRC prints text using /drawtext (which is really what $width is made to be used with) that means a pixel either side of the text. Here's a picture showing what I mean:

Using the commands:
/drawrect @moo 7 1 200 200 87 30
/drawtext @moo 12 Verdana -10 200 200 This is a test

Both the rectangle and the text started from the exact same coordinate, yet the text fits perfectly inside the rectangle's borders because mIRC's /drawtext starts the actual text one pixel right of that and takes into account one pixel on the other side. This is probably why the width doesn't seem to add up in other applications - because you're aligning the edge of the text to the left and coming up 2 pixels short on what you expect.

As for the reason why Fixedsys has the same width using -10 and 10 it's because Fixedsys isn't a TrueType font and only has one size, no matter what size parameter you give $width with Fixedsys it will always give the same length for the text because it can only be displayed at that one size.


Spelling mistakes, grammatical errors, and stupid comments are intentional.