-
Bug
-
Resolution: Fixed
-
P4
-
11, 12, 13
-
Ubuntu18.04
-
b24
-
generic
-
linux
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8225948 | 14 | Toshio Nakamura | P4 | Resolved | Fixed | team |
When Google Noto fonts[1] were installed and listed by fontconfig library on Linux, CompositeFont couldn't contain it.
The entry of Noto font could be replaced by another font which depends on an environment.
Under our Ubuntu18.04 zLinux,
"Noto Sans CJK JP Regular" was listed at the top of Japanese, but was replaced by
"BPG Ingiri GPL&GNU".
Then, we cannot show Japanese in the system.
Under another our Ubuntu18.04 x86_64,
"Noto Sans CJK JP Regular" was replaced by
"Noto Serif CJK KR Light".
Then, we saw unexpected glyphs. JP(Japanese) and KR(Korean) use similar but different glyphs.
This problem is only for CompositeFont. Specific Font by filename can show expectedly.
Evaluation:
src/java.desktop/share/classes/sun/font/CompositeFont.java:doDeferredInitialisation() (l. 296)
validates the target font by comparing names.
The current code stored FamilyName to faceNames variable, then compared it with FullName (getFontName()).
If they were different, the target font was treated as invalid.
So, faceNames should be created by FullName.
Noto fonts have different values between a preferred family name and a full name. And, this is the reason the problem was found with Noto fonts.
The cached font list is stored under ~/.java/fonts directory. We should delete it before testing.
[1] https://www.google.com/get/noto/
Attached screenshots and a log file:
Noto-problem.jpg - In the case that Noto font is the only Japanese font.
Noto-fixed.jpg - With the proposed fix.
fc-match.log - The result of fc-match command in above environment.
The entry of Noto font could be replaced by another font which depends on an environment.
Under our Ubuntu18.04 zLinux,
"Noto Sans CJK JP Regular" was listed at the top of Japanese, but was replaced by
"BPG Ingiri GPL&GNU".
Then, we cannot show Japanese in the system.
Under another our Ubuntu18.04 x86_64,
"Noto Sans CJK JP Regular" was replaced by
"Noto Serif CJK KR Light".
Then, we saw unexpected glyphs. JP(Japanese) and KR(Korean) use similar but different glyphs.
This problem is only for CompositeFont. Specific Font by filename can show expectedly.
Evaluation:
src/java.desktop/share/classes/sun/font/CompositeFont.java:doDeferredInitialisation() (l. 296)
validates the target font by comparing names.
The current code stored FamilyName to faceNames variable, then compared it with FullName (getFontName()).
If they were different, the target font was treated as invalid.
So, faceNames should be created by FullName.
Noto fonts have different values between a preferred family name and a full name. And, this is the reason the problem was found with Noto fonts.
The cached font list is stored under ~/.java/fonts directory. We should delete it before testing.
[1] https://www.google.com/get/noto/
Attached screenshots and a log file:
Noto-problem.jpg - In the case that Noto font is the only Japanese font.
Noto-fixed.jpg - With the proposed fix.
fc-match.log - The result of fc-match command in above environment.
- backported by
-
JDK-8225948 Noto fonts for East Asian countries cannot belong to CompositeFont
- Resolved
- relates to
-
JDK-8264703 Numbers and latin letters rendering in different fonts
- Open
- links to
-
Review openjdk/jdk11u-dev/2586