Some problems I find in the awt font module on Linux system.
林kurn
linkuntju at gmail.com
Thu Oct 12 08:43:21 UTC 2023
1. The JDK configuration is not synchronized with fontconfig configuration.
The JDK configuration is updated only if the fontconfig's font cache
directory has been updated, the condition for updating the font cache
directory is the font changing. So, when we add some new configuration in
the fontconfig, JDK configuration can't update synchronously.
2. There is no fallback font when swing components use physical fonts. For
example, when a JTextField use "jTextField.setFont(new Font("Ubuntu Mono",
Font.PLAIN, 20))" (On an Ubuntu system, has "Ubuntu Mono" font), all the
CJK character will show as a tofu in this JTextField, because. Almost every
font does not contain all possible inputs, adding a fallback font may help
those us don't just use English.
3. JDK use fontconfig and generate a common set of configurations for all
the java programs. It brings a fatal problem: if we add some fontconfig
configuration for program A, we run program A and JDK generates its
configuration, then all other programs will use the configuration for A.
4. A suggestion: use fontconfig to get substitute fonts for physical fonts
which JDK not found. Now, when a JTextField use "jTextField.setFont(new
Font("My Font", Font.PLAIN, 20))" (On an Ubuntu system, no "My Font" font),
the JDK will use default logical font. Get some substitute fonts via
fontconfig may be more flexible, more configurable.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20231012/4e8e50a2/attachment.htm>
More information about the jdk-dev
mailing list