truncate: fixing loop for IE10

In IE, size measurements will be zero if measuring only spaces. We need to start
measuring from the first non-whitespace character.