Function refreshTextDimensions