added function to calculate a character's width