Unity Issue Tracker - MeasureTextSize returns incorrect size when the used string value is only spaces
Fixed
UUM-48220
MeasureTextSize returns incorrect size when the used string value is only spaces
Unity: Text (TextCore)
Fixed
6.0.X
Won't Fix
2023.3.X
2023.2.X
2023.1.X
2022.3.X
2021.3.X
Add pre and pre-wrap to USS WhiteSpace property
Adding the ZWSP Unicode (\u200B) at the end of the string will ensure MeasureTextSize returns the same result as UITK layout system.
In 2023.3+, more White Space properties have been added to control line endings.
Adding the ZWSP Unicode (\u200B) at the end of the string will ensure MeasureTextSize returns the same result as UITK layout system.
In 2023.3+, more White Space properties have been added to control line endings.
How to reproduce:
1. Open the “IN-51217_repro“ project
2. Open the “SampleScene“
3. Enter the Play Mode
4. Observe the Console
Expected result: Measured size is (0,0)
Actual result: Measured size is different