Replaced deprecated sizeWithFont with sizeWithAttributes