Adding method to calculate text size