Description
In jdk 17, after selecting a string, the characters are displayed on top of the background color, and there is no gap between the characters and the top of the background color. However, in jdk8, there is a gap between the characters and the top of the background color. The problem this brings is that when the characters I use are Chinese, I will find that the selected characters exceed the background color range.
Steps to Reproduce
Specific steps to reproduce the behavior:
Use jdk8 to run the demo program, and then enter Chinese in the editor;
Use jdk17 to run the demo program, and then enter the same content as in the first step in the editor;
Observe the gap between the top of the characters and the selected background color when selecting content in the editor in the two scenarios;
Expected behavior
In both scenarios, the distance between the top of the selected character and the background color area is the same
Actual behavior
In the two scenarios, the gap between the top of the selected character and the selected background color is different. The gap is very small under jdk17, which will cause the selected character to exceed the background color area when the selected content is Chinese.
Screenshots
jdk 17:
jdk8:
Java version
jdk8 & jdk17
Additional context
Add any other context about the problem here.
@highgozhangyc - can you reproduce this with the newly-released RSTA 3.5.0 or newer? I don't see the text's baseline being so high in my tests, e.g. on Java 17 on Windows with the default RSTA settings:
Description In jdk 17, after selecting a string, the characters are displayed on top of the background color, and there is no gap between the characters and the top of the background color. However, in jdk8, there is a gap between the characters and the top of the background color. The problem this brings is that when the characters I use are Chinese, I will find that the selected characters exceed the background color range.
Steps to Reproduce Specific steps to reproduce the behavior:
Expected behavior In both scenarios, the distance between the top of the selected character and the background color area is the same
Actual behavior In the two scenarios, the gap between the top of the selected character and the selected background color is different. The gap is very small under jdk17, which will cause the selected character to exceed the background color area when the selected content is Chinese.
Screenshots jdk 17:
jdk8:
Java version jdk8 & jdk17
Additional context Add any other context about the problem here.