-
Bug
-
Resolution: Unresolved
-
P4
-
17, 21, 25, 26
-
None
-
In Review
-
windows
This issue cannot be reproduced on a clean machine and requires several prerequisites.
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)
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)
- 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
-
Review(master) openjdk/jdk/27551