While working on https://bugs.openjdk.org/browse/JDK-8314482 accidentally came across a subtle bug in the code that computes the next tab position. The probability of hitting the bug is rather low as it only happens with certain fonts(s?) and specific size(s?).
The bug can be reproduced in the monkey tester using TextArea and InaiMathi font of size 24, which produces the float value of tabAdvance 57.6.
The offending line in PrismTextLayout:1249
```
float tabStop = ((int)(lineWidth / tabAdvance) +1) * tabAdvance;
```
this formula fails to advance the tabStop when lineWidth (the current position) is 172.79999
lineWidth=172.79999 next=172.79999
(please see the screenshots with font sizes 16 (ok) and 24 (fail))
The bug can be reproduced in the monkey tester using TextArea and InaiMathi font of size 24, which produces the float value of tabAdvance 57.6.
The offending line in PrismTextLayout:1249
```
float tabStop = ((int)(lineWidth / tabAdvance) +1) * tabAdvance;
```
this formula fails to advance the tabStop when lineWidth (the current position) is 172.79999
lineWidth=172.79999 next=172.79999
(please see the screenshots with font sizes 16 (ok) and 24 (fail))
- relates to
-
JDK-8314482 TextFlow: TabStopPolicy
-
- In Progress
-