Improved title size calculations