The root cause: getTextSize(), although documented as returning the text size in pixels, sometimes returns it in dp instead.
Currently, a heuristic is used:
First, the size is treated as dp. Then the height of the text line is estimated. If it is higher than the view's height, the size is treated as px. This is a bad measure for views with wrapped text that don't have text line baselines provided. So a limit on the size in dp is used to prevent it from becoming too large.
The root cause:
getTextSize()
, although documented as returning the text size in pixels, sometimes returns it indp
instead.Currently, a heuristic is used:
First, the size is treated as
dp
. Then the height of the text line is estimated. If it is higher than the view's height, the size is treated aspx
. This is a bad measure for views with wrapped text that don't have text line baselines provided. So a limit on the size indp
is used to prevent it from becoming too large.Report the bug.