The font module does not work well with fontconfig on Linux.

林kurn linkuntju at gmail.com
Fri Jan 5 05:13:29 UTC 2024


Here are the problems I found, and here is a patch that may fix them.

1. The font manager uses the default logical font as the fallback font.
On Linux systems, we can use fontconfig to get a matching list of fonts.
So, I added a new fallback method, FONTCONFIGURATION_FALLBACK, and
implemented it for Linux systems using fontconfig.

2. The FileFont object have no fallback ability when rendering.
I make the FileFont class implement the FontSubstitution interface and
reuse the fallback method on first.
This enhances text display on Linux systems that frequently use FileFont
objects, reduce the inability to display characters in multiple languages
when using physical fonts.

I know my patch still requires improvement, and I haven't adapted it for
Windows and Mac. But I hope this will lead to further discussion,
eventually we can improve these problems.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20240105/aa36bf95/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Implements-the-FONTCONFIGURATION_FALLBACK-on-Linux.patch
Type: text/x-patch
Size: 8946 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20240105/aa36bf95/0003-Implements-the-FONTCONFIGURATION_FALLBACK-on-Linux-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Optimizes-how-information-is-retrieved-from-fontconf.patch
Type: text/x-patch
Size: 10989 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20240105/aa36bf95/0001-Optimizes-how-information-is-retrieved-from-fontconf-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Enables-glyphs-fallback-for-FileFont.patch
Type: text/x-patch
Size: 2260 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20240105/aa36bf95/0004-Enables-glyphs-fallback-for-FileFont-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Adds-a-new-fallback-form-FONTCONFIGURATION_FALLBACK.patch
Type: text/x-patch
Size: 2837 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20240105/aa36bf95/0002-Adds-a-new-fallback-form-FONTCONFIGURATION_FALLBACK-0001.patch>


More information about the jdk-dev mailing list