Implement early-exit optimization to avoid expensive width calculations when we can determine that all remaining content will definitely fit on the current line.
Implement early-exit optimization to avoid expensive width calculations when we can determine that all remaining content will definitely fit on the current line.