Anyhow, I've worked out that characters are 5 pixels wide, times the scale. The only character I've found to be less than 5 pixels is the exclamation mark, which is 2 pixels wide.
Anyhow, here's the code i've come up with: (CHAR_HEIGHT is just there so I don't forget the value
function GetTextWidth(textObject)
local CHAR_WIDTH = 5
local CHAR_HEIGHT = 8
local EXCLAMATION_WIDTH = 2
local text = textObject.getText()
local scale = textObject.getScale()
local width = 0
for i = 1, #str do
if text:sub(i,i) == "!" then
width = width + CHAR_WIDTH * scale
end
end
return width
end


