-
Bug
-
Resolution: Unresolved
-
P5
-
8, 11, 13
-
None
-
Windows 10 (version 1809, build 17763.914)
-
windows
To reproduce, run the program with the source code given below.
Expected result: two 'club suit' symbols are rendered in the program window (possibly having different styles).
Actual result: one 'club suit' symbol and one 'spade suit' symbol are rendered (see attached image).
--- Test program source code ---
import javax.swing.*;
import java.awt.*;
public class SegoeUiTest {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame();
frame.add(new MyComponent());
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setSize(200, 100);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
});
}
private static class MyComponent extends JComponent {
private static final String FONT_FAMILY = "Segoe UI Semibold";
private static final String CLUB_SUIT = "\u2663";
@Override
protected void paintComponent(Graphics g) {
((Graphics2D)g).setRenderingHint(
RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB
);
g.setFont(new Font(FONT_FAMILY, Font.PLAIN, 24));
g.drawString(CLUB_SUIT, 50, 40);
g.setFont(new Font(FONT_FAMILY, Font.BOLD | Font.ITALIC, 24));
g.drawString(CLUB_SUIT, 110, 40);
}
}
}
--------------------------------
Expected result: two 'club suit' symbols are rendered in the program window (possibly having different styles).
Actual result: one 'club suit' symbol and one 'spade suit' symbol are rendered (see attached image).
--- Test program source code ---
import javax.swing.*;
import java.awt.*;
public class SegoeUiTest {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame();
frame.add(new MyComponent());
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setSize(200, 100);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
});
}
private static class MyComponent extends JComponent {
private static final String FONT_FAMILY = "Segoe UI Semibold";
private static final String CLUB_SUIT = "\u2663";
@Override
protected void paintComponent(Graphics g) {
((Graphics2D)g).setRenderingHint(
RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB
);
g.setFont(new Font(FONT_FAMILY, Font.PLAIN, 24));
g.drawString(CLUB_SUIT, 50, 40);
g.setFont(new Font(FONT_FAMILY, Font.BOLD | Font.ITALIC, 24));
g.drawString(CLUB_SUIT, 110, 40);
}
}
}
--------------------------------