If you surround the font-name in quotes, mIRC fails to see it as a fontname that may contain multiple spaces, and reverts to the font set in the options dialog:
;This returns the width correctly
echo -a Without Quotes: $width(I am testing,Dejavu Sans Mono,50)
;This does not
echo -a With Quotes: $width(I am testing,"Dejavu Sans Mono",50)
Echos the following:
Without Quotes: 360
With Quotes: 259
Code to test on your own:
alias widthtest {
var %f = $window($active).font
var %s = $window($active).fontsize
echo -a Without quotes(Correct): $width(#,%f,%s)
echo -a With Quotes(Incorrect): $width(#,$qt(%f),%s)
}