-
Bug
-
Resolution: Fixed
-
P3
-
8, 9
-
b150
MacOSX supports automatic font fallback for unicode code points
not supported by a specified font.
JDK has implementation support to have that work in JDK too.
However this is not working for unicode supplementaray characters represented by surrogate pairs as demonstrated
by this test:
import javax.swing.*;
import java.awt.*;
public class SurrogatesFallbackTest {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame();
JLabel label = new JLabel(new String(Character.toChars(0x1d400))); // MATHEMATICAL BOLD CAPITAL A
label.setFont(new Font("Menlo", Font.PLAIN, 36)); // expected to fallback to STIXGeneral
frame.add(label);
frame.pack();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
});
}
}
not supported by a specified font.
JDK has implementation support to have that work in JDK too.
However this is not working for unicode supplementaray characters represented by surrogate pairs as demonstrated
by this test:
import javax.swing.*;
import java.awt.*;
public class SurrogatesFallbackTest {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame();
JLabel label = new JLabel(new String(Character.toChars(0x1d400))); // MATHEMATICAL BOLD CAPITAL A
label.setFont(new Font("Menlo", Font.PLAIN, 36)); // expected to fallback to STIXGeneral
frame.add(label);
frame.pack();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
});
}
}