-
Bug
-
Resolution: Fixed
-
P3
-
11
-
b17
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8204740 | 11.0.1 | Andrew Brygin | P3 | Resolved | Fixed | team |
JDK-8300274 | openjdk8u372 | Leslie Zhai | P3 | Resolved | Fixed | b01 |
With freetype, text rotated on 180 or 270 degrees is too narrow.
Attached test case and screen shoots demonstrate the problem.
The problem is caused by the rounding applied to the cases of vertical
and horizontal text, see freetypeScaler.c, lines 768 and 773:
http://hg.openjdk.java.net/jdk/client/file/80a5ff734fcd/src/java.desktop/share/native/libfontmanager/freetypeScaler.c#l768
http://hg.openjdk.java.net/jdk/client/file/80a5ff734fcd/src/java.desktop/share/native/libfontmanager/freetypeScaler.c#l773
The rounding routine is defined as ROUND(x) ((int) (x+0.5)) (see line 48),
and it gives incorrect results for negative arguments.
For example, say glyph advance is 8, and we render it without rotation, and with rotation on 180 degrees. In these cases, ROUND(8)=8, whereas ROUND(-8)=-7.
It is not clear, why do we need the rounding for vertical and horizontal text,
but if we do, then the rounding routine should handle negative arguments
in a more accurate manner.
The problem affects EA builds of JDK 11, and any openjdk builds.
Attached test case and screen shoots demonstrate the problem.
The problem is caused by the rounding applied to the cases of vertical
and horizontal text, see freetypeScaler.c, lines 768 and 773:
http://hg.openjdk.java.net/jdk/client/file/80a5ff734fcd/src/java.desktop/share/native/libfontmanager/freetypeScaler.c#l768
http://hg.openjdk.java.net/jdk/client/file/80a5ff734fcd/src/java.desktop/share/native/libfontmanager/freetypeScaler.c#l773
The rounding routine is defined as ROUND(x) ((int) (x+0.5)) (see line 48),
and it gives incorrect results for negative arguments.
For example, say glyph advance is 8, and we render it without rotation, and with rotation on 180 degrees. In these cases, ROUND(8)=8, whereas ROUND(-8)=-7.
It is not clear, why do we need the rounding for vertical and horizontal text,
but if we do, then the rounding routine should handle negative arguments
in a more accurate manner.
The problem affects EA builds of JDK 11, and any openjdk builds.
- backported by
-
JDK-8204740 [freetype] text rotated on 180 degrees is too narrow
- Resolved
-
JDK-8300274 [freetype] text rotated on 180 degrees is too narrow
- Resolved
- relates to
-
JDK-8219641 java/awt/font/Rotate/RotatedTextTest.java fails on Linux: Test failed for angle 15.0
- Open