text width calculation fix (see issue #17)