Integrated into JavaFX in JavaFX 8 releases since JavaFX 8 b192 and since JavaFX 11.
An initial issue https://github.com/javafxports/openjdk-jfx/issues/71 was submitted for this in the archived javafxport repository. Read details there. JavaFX was removed from the reference OpenJDK from Java 9 but some other distributors still include it in their own JDK. That why we reported this issue here.
Bug JDK-8147476, commit of the following :
FontJava.cpp :
Completes the implementation of the platformBoundsForGlyph(Glyph c) function in FontJava.cpp.
Previous implementation simply returned a (0,0,0,0) rectangle, which explains the bad rendering height of MathML elements.
This affects only MathML elements due to specific mathematic glyphs behavior : WebCore MathML rendering can't use the font ascents and descents which causes gap into assembled glyphs. So getAscent(), getDescent() ... font methods are not appropriate.
WebCore uses bearY and heights informations from the glyph bounding box.
MathMLRenderTest.java :
Adds a HeadLess proper unit test for this Bug JDK-8147476.
Tests the height of the first MathML mo token element in a quadratic formula.
WCFont.java :
Adds the abstract getGlyphBoundingBox() method.
WCFontPerfLogger.java :
Adds the getGlyphBoundingBox() method.
WCFontImpl.java :
Implements the getGlyphBoundingBox() method.
Uses and reorders (FontResource) getGlyphBoundingBox values to match perfectly with WebCore requirements.
All files :
Changes copyright date and removes white space tabulation.
With last small changes (comments https://github.com/javafxports/openjdk-jfx/issues/71) the rendering is far better than with my previous patch. Now WebView is not so far from Safari and FireFox versus MathML display. The remaining problems are due to the missing OpenMathData table support.
A quick solution would be :
to include a font file containing the right glyph alignment.
and modify the mathml.css file to force MathML renderer to use them first.
The purpose of this issue is bad rendering with MathML token elements.
This is referenced in Java Bug Database as
This is tracked in JBS as
Related Pull Request
Related Issues
Status
An initial issue https://github.com/javafxports/openjdk-jfx/issues/71 was submitted for this in the archived javafxport repository. Read details there. JavaFX was removed from the reference OpenJDK from Java 9 but some other distributors still include it in their own JDK. That why we reported this issue here.
Bug JDK-8147476, commit of the following :
FontJava.cpp :
platformBoundsForGlyph(Glyph c)
function inFontJava.cpp
.getAscent()
,getDescent()
... font methods are not appropriate.MathMLRenderTest.java :
WCFont.java :
WCFontPerfLogger.java :
WCFontImpl.java :
All files :
With last small changes (comments https://github.com/javafxports/openjdk-jfx/issues/71) the rendering is far better than with my previous patch. Now WebView is not so far from Safari and FireFox versus MathML display. The remaining problems are due to the missing OpenMathData table support. A quick solution would be :