-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: 17, 21, 25, 26
-
Component/s: client-libs
-
b23
-
windows
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
|---|---|---|---|---|---|---|
| JDK-8372577 | 25.0.3 | Sergey Nazarkin | P4 | Resolved | Fixed | master |
| JDK-8373013 | 21.0.11 | Sergey Nazarkin | P4 | Resolved | Fixed | master |
| JDK-8373014 | 17.0.19 | Sergey Nazarkin | P4 | Resolved | Fixed | master |
1. JP should be the default local on the Windows machine.
2. The EUDC font should be installed (created with eudcedit.exe).
3. The fallback font is present at <jdk>/lib/fonts.
The Japanese locale (https://github.com/openjdk/jdk/blob/63688d894e2157bb091be3aa62946f7e5830f384/src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsEnv.cpp#L244) and the EUDC font (which is not present by default) execute a branch in the CompositeFont constructor that contains a bug (https://github.com/openjdk/jdk/blob/63688d894e2157bb091be3aa62946f7e5830f384/src/java.desktop/share/classes/sun/font/CompositeFont.java#L118) involving deferred font initialisation. The initialisation loop should install false only for the EUDC font instantiated a few lines above.
The reason the NPE is not shown without the fallback fonts is the guard at CompositeFont.getSlotFont (https://github.com/openjdk/jdk/blob/63688d894e2157bb091be3aa62946f7e5830f384/src/java.desktop/share/classes/sun/font/CompositeFont.java#L383). I'm not very familiar with the font subsystem, but those fonts are installed without component names (https://github.com/openjdk/jdk/blob/63688d894e2157bb091be3aa62946f7e5830f384/src/java.desktop/share/classes/sun/awt/FontConfiguration.java#L1055). So that findFont2D returns null, resulting in a NPE.
2 09:58:13.032625001 GUI_COMMON:://CommonGuiUtils setText: caught exception :REAL_EXCEPTION:: Cannot invoke "sun.font.PhysicalFont.getMapper()" because the return value of "sun.font.CompositeFont.getSlotFont(int)" is null
2 java.lang.NullPointerException: Cannot invoke "sun.font.PhysicalFont.getMapper()" because the return value of "sun.font.CompositeFont.getSlotFont(int)" is null
2 at java.desktop/sun.font.CompositeGlyphMapper.getSlotMapper(Unknown Source)
2 at java.desktop/sun.font.CompositeGlyphMapper.convertToGlyph(Unknown Source)
2 at java.desktop/sun.font.CompositeGlyphMapper.charToGlyph(Unknown Source)
2 at java.desktop/sun.font.FontRunIterator.next(Unknown Source)
2 at java.desktop/sun.font.GlyphLayout.layout(Unknown Source)
2 at java.desktop/sun.font.ExtendedTextSourceLabel.createGV(Unknown Source)
2 at java.desktop/sun.font.ExtendedTextSourceLabel.getGV(Unknown Source)
2 at java.desktop/sun.font.ExtendedTextSourceLabel.createCharinfo(Unknown Source)
2 at java.desktop/sun.font.ExtendedTextSourceLabel.getCharinfo(Unknown Source)
2 at java.desktop/sun.font.ExtendedTextSourceLabel.getLineBreakIndex(Unknown Source)
2 at java.desktop/java.awt.font.TextMeasurer.calcLineBreak(Unknown Source)
2 at java.desktop/java.awt.font.TextMeasurer.getLineBreakIndex(Unknown Source)
2 at java.desktop/java.awt.font.LineBreakMeasurer.nextOffset(Unknown Source)
2 at java.desktop/java.awt.font.LineBreakMeasurer.nextLayout(Unknown Source)
2 at java.desktop/javax.swing.text.TextLayoutStrategy.sync(Unknown Source)
- backported by
-
JDK-8372577 NPE during text drawing on machine with JP locale
-
- Resolved
-
-
JDK-8373013 NPE during text drawing on machine with JP locale
-
- Resolved
-
-
JDK-8373014 NPE during text drawing on machine with JP locale
-
- Resolved
-
- relates to
-
JDK-8170913 Java "1.8.0_112" on Windows 10 displays different characters for EUDCs from ones created in eudcedit.exe.
-
- Resolved
-
- links to
-
Commit(master)
openjdk/jdk17u-dev/e853a440
-
Commit(master)
openjdk/jdk21u-dev/70ba5d4b
-
Commit(master)
openjdk/jdk25u/5e639f4f
-
Commit(master)
openjdk/jdk/4520983e
-
Review(master)
openjdk/jdk17u-dev/4159
-
Review(master)
openjdk/jdk21u-dev/2448
-
Review(master)
openjdk/jdk/27551