-
Bug
-
Resolution: Fixed
-
P4
-
9, 10
-
None
-
b20
-
windows_10
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8206845 | 12 | Steven Loomis | P4 | Resolved | Fixed | team |
JDK-8206622 | 11.0.1 | Steven Loomis | P4 | Resolved | Fixed | b01 |
If text contains a variation selector character, its base character is not rendered.
Reproducer:
-------- BEGIN SOURCE ----------
import javax.swing.*;
import java.awt.*;
import java.awt.font.*;
public class VariationSelectorTest {
// A font supporting Unicode variation selectors is required
private static final Font FONT = new Font("DejaVu Sans", Font.PLAIN, 12);
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.add(new MyComponent());
frame.setSize(200, 200);
frame.setVisible(true);
frame.setLocationRelativeTo(null);
});
}
private static class MyComponent extends JComponent {
@Override
protected void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
FontRenderContext frc = g2d.getFontRenderContext();
String text = "a";
GlyphVector gv = FONT.layoutGlyphVector(frc, text.toCharArray(), 0, text.length(), Font.LAYOUT_LEFT_TO_RIGHT);
g2d.drawGlyphVector(gv, 80, 50);
String text2 = "a\ufe00";
GlyphVector gv2 = FONT.layoutGlyphVector(frc, text2.toCharArray(), 0, text2.length(), Font.LAYOUT_LEFT_TO_RIGHT);
g2d.drawGlyphVector(gv2, 80, 100);
}
}
}
-------- END SOURCE ----------
Before running this sample application, 'DejaVu Sans' font (https://dejavu-fonts.github.io/) should be installed onto the system.
Expected result - two identical letters 'a' are rendered (variation sequence being used is not standard, so it should be rendered just like the base character alone).
Actual result - only one letter 'a' is rendered (base character case).
The application runs as expected on latest Java 8 version (1.8.0_144).
Reproducer:
-------- BEGIN SOURCE ----------
import javax.swing.*;
import java.awt.*;
import java.awt.font.*;
public class VariationSelectorTest {
// A font supporting Unicode variation selectors is required
private static final Font FONT = new Font("DejaVu Sans", Font.PLAIN, 12);
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.add(new MyComponent());
frame.setSize(200, 200);
frame.setVisible(true);
frame.setLocationRelativeTo(null);
});
}
private static class MyComponent extends JComponent {
@Override
protected void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
FontRenderContext frc = g2d.getFontRenderContext();
String text = "a";
GlyphVector gv = FONT.layoutGlyphVector(frc, text.toCharArray(), 0, text.length(), Font.LAYOUT_LEFT_TO_RIGHT);
g2d.drawGlyphVector(gv, 80, 50);
String text2 = "a\ufe00";
GlyphVector gv2 = FONT.layoutGlyphVector(frc, text2.toCharArray(), 0, text2.length(), Font.LAYOUT_LEFT_TO_RIGHT);
g2d.drawGlyphVector(gv2, 80, 100);
}
}
}
-------- END SOURCE ----------
Before running this sample application, 'DejaVu Sans' font (https://dejavu-fonts.github.io/) should be installed onto the system.
Expected result - two identical letters 'a' are rendered (variation sequence being used is not standard, so it should be rendered just like the base character alone).
Actual result - only one letter 'a' is rendered (base character case).
The application runs as expected on latest Java 8 version (1.8.0_144).
- backported by
-
JDK-8206622 Wrong rendering of variation sequences
-
- Resolved
-
-
JDK-8206845 Wrong rendering of variation sequences
-
- Resolved
-
- relates to
-
JDK-8088529 DRT test fast/text/unicode-variation-selector.html is not rendered properly
-
- Open
-
-
JDK-8207932 Wrong rendering of variation sequences
-
- Open
-