JDK-8127584 : WebView does not support rendering surrogate pair charcter
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: fx2.0.2,fx2.1
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2012-01-16
  • Updated: 2015-06-17
  • Resolved: 2012-09-17
Related Reports
Blocks :  
Blocks :  
Duplicate :  
Description
With javafx.scene.web.WebView, when the letter is the surrogate pair character (ex: CJK Unified Ideographs Extension B), the program could not render that.

for example:
U+4E00 (CJK Unified Ideographs)
<span style="font-family:SimSun-ExtB;">&#x4e00;</span>
... OK on usual browser
... OK on WebView
U+20000 (CJK Unified Ideographs Extension B) == D840+DC00
<span style="font-family:SimSun-ExtB;">&#x20000;</span>
... OK on usual browser
... NotGood on WebView
<span style="font-family:SimSun-ExtB;">&#xd840;&#xdc00;</span>
... OK on usual browser
... two ? glyphs on WebView

When NotGood, NullPointerException has occurred:
java.lang.NullPointerException
	at com.sun.t2k.T2KFontFactory.getFontResourceByFileName(T2KFontFactory.java:482)
	at com.sun.t2k.T2KFontFactory.getFontResource(T2KFontFactory.java:420)
	at com.sun.t2k.FallbackResource.getSlotResource(FallbackResource.java:168)
	at com.sun.t2k.T2KCompositeFontResource.getSlotResource(T2KCompositeFontResource.java:50)
	at com.sun.t2k.CompositeGlyphMapper.getSlotMapper(CompositeGlyphMapper.java:52)
	at com.sun.t2k.CompositeGlyphMapper.convertToGlyph(CompositeGlyphMapper.java:73)
	at com.sun.t2k.CompositeGlyphMapper.getGlyphCode(CompositeGlyphMapper.java:129)
	at com.sun.t2k.CharToGlyphMapper.charToGlyph(CharToGlyphMapper.java:116)
	at com.sun.t2k.CompositeStrike.getCharAdvance(CompositeStrike.java:183)
	at com.sun.webpane.sg.prism.WCFontImpl.getGlyphWidth(WCFontImpl.java:140)
	at com.sun.webpane.webkit.Timer.twkFireTimerEvent(Native Method)
	at com.sun.webpane.webkit.Timer.fireTimerEvent(Timer.java:66)
	at com.sun.webpane.webkit.Timer.notifyTick(Timer.java:47)
	at javafx.scene.web.WebEngine$PulseTimer$2.pulse(WebEngine.java:586)
	at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:292)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:385)
	at com.sun.javafx.tk.quantum.QuantumToolkit$8.run(QuantumToolkit.java:311)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
	at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:62)
	at java.lang.Thread.run(Unknown Source)

Comments
Fixed as part of RT-24327
17-09-2012

1. Surrogate pairs are not supported by Java Unicode. "Java originally used UCS-2, and added UTF-16 supplementary character support in J2SE 5.0. However, non-BMP characters require the individual surrogate halves to be entered individually, for example: "\uD834\uDD1E" for U+1D11E." (http://en.wikipedia.org/wiki/UTF-16) 2. The complex &#xD840;&#xDC00; char rendering is a problem not only for us, but in FF 9.0.1 too. 3. There are two solutions: 1] Wait for Java surrogate pairs support. 2] Switch to ICU support. 4. An exception is a duplicate for RT-17480. 5. To implement it right, we need to have RT-11239 fixed.
23-01-2012

Alexey, is this our bug, or fonts bug, or a combination of the two?
23-01-2012