-
Bug
-
Resolution: Fixed
-
P3
-
11, 12, 13
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8226117 | 14 | Philip Race | P3 | Resolved | Fixed | team |
JDK-8231332 | 11.0.6-oracle | Philip Race | P3 | Resolved | Fixed | b01 |
JDK-8230316 | 11.0.6 | Philip Race | P3 | Resolved | Fixed | b01 |
JDK-8230315 | openjdk8u232 | Philip Race | P3 | Resolved | Fixed | b05 |
We use swing and windows-look-and-feel. In jdk-8 and jdk-11 the default fonts are the same (Tahoma for buttons and Segoe for menus). The font-rendering for Tahoma changed in jdk-11 and gets ugly. For example 'it' has a big space between 'i' and 't'.
Furthermore the spacing between lines changed. For example in the menu the spacing between the menu items raised.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The example code can reproduce it.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Same rendering as with jdk-8.
ACTUAL -
The font rendering of Tahoma is ugly. For example the spacing of letters (e.g. "it") got wrong.
Line spacing is too big e.g. in the menu.
---------- BEGIN SOURCE ----------
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.KeyStroke;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
public class TestRenderer {
public static void main(String[] args)
throws ClassNotFoundException, InstantiationException, IllegalAccessException,
UnsupportedLookAndFeelException {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
JFrame f = new JFrame();
JButton b1 = new JButton("Mitarbeiterdisposition");
//b1.setFont(UIManager.getDefaults().getFont("Button.font"));
b1.setBounds(130, 100, 100, 40);//x axis, y axis, width, height
f.add(b1);
f.setSize(400, 500);
f.setLayout(null);
f.setVisible(true);
JMenuBar menuBar;
JMenu menu;
JMenuItem menuItem;
//Create the menu bar.
menuBar = new JMenuBar();
//Build the first menu.
menu = new JMenu("A Menu");
menu.setMnemonic(KeyEvent.VK_A);
menu.getAccessibleContext().setAccessibleDescription("The only menu in this program that has menu items");
menuBar.add(menu);
//a group of JMenuItems
menuItem = new JMenuItem("A text-only menu item", KeyEvent.VK_T);
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_1, ActionEvent.ALT_MASK));
menuItem.getAccessibleContext().setAccessibleDescription("This doesn't really do anything");
menu.add(menuItem);
//a group of JMenuItems
menuItem = new JMenuItem("A text-only menu item", KeyEvent.VK_T);
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_1, ActionEvent.ALT_MASK));
menuItem.getAccessibleContext().setAccessibleDescription("This doesn't really do anything");
menu.add(menuItem);
//a group of JMenuItems
menuItem = new JMenuItem("A text-only menu item", KeyEvent.VK_T);
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_1, ActionEvent.ALT_MASK));
menuItem.getAccessibleContext().setAccessibleDescription("This doesn't really do anything");
menu.add(menuItem);
f.setJMenuBar(menuBar);
}
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8226117 Font rendering and glyph spacing changed from jdk-8 to jdk-11
- Resolved
-
JDK-8230315 Font rendering and glyph spacing changed from jdk-8 to jdk-11
- Resolved
-
JDK-8230316 Font rendering and glyph spacing changed from jdk-8 to jdk-11
- Resolved
-
JDK-8231332 Font rendering and glyph spacing changed from jdk-8 to jdk-11
- Resolved
- duplicates
-
JDK-8214429 Preferred width of a Component is incorrect when using a custom Font
- Closed
-
JDK-8214538 Swing text rendering issue, letters either with spaces or stuck together
- Closed
-
JDK-8228763 Improper kerning adding extra whitespace in some text
- Closed
- relates to
-
JDK-8210447 Incorrect font rendering under Windows LAF
- Closed
-
JDK-8228763 Improper kerning adding extra whitespace in some text
- Closed