The disadvantage of the method described above is that it counts characters while the "w" is wider then the "i". Therefor the warp won't occur at the same position in each line and the wider the line is (counted in characters), the bigger the difference can be.
Better is when you use the BoundingBox of the text and compare it to an actual pixel count, but I'm not sure this will work in scripting, It does however in the API and I've been using this for years now.
#XPression