Fixed width calculation for text with linebreaks