JDK-8090917 : Add drawGlyphVector type support to prism graphics
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: fx2.0,8
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2011-02-15
  • Updated: 2018-09-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Duplicate :  
Duplicate :  
Relates :  
Description
The Prism-J2D fallback pipeline uses java.awt.Graphics.drawString(..)
Using greyscale AA+FM mode this can pretty closely emulate the present FX 2.0 rendering
and works even for some modes like justification and tabs since Prism graphics breaks up the
rendering for these cases into separate drawString calls
But as we add support for additional attributes beyond font and style, specifically ligatures,
kerning, superscripts, or rendering behaviours such as sub-pixel positioning, it may become
increasingly difficult to ensure that glyphs are similarly positioned in both cases. This can affect layout since
all measurement is done on the prism side. We can mitigate this by adding code to set these
as attributes on the Java 2D font. but this relies on them behaving  equivalently. It might be
best to simply let prism tell 2D exactly where to draw each glyph.  Also strokes and effects applied to glyph
images may not align. And for fallback and logical fonts we likely already have substantial differences.
What is needed is apparently a drawGlyphVector type of API where prism assigns the AA modes
and precise glyph positions of each glyph, and 2D just does the blitting where its told.
This alone doesn't help the fallback/logical composite font differences. That will need a way to
extract the physical font used for each glyph run and break it up into multiple drawGlyphVector calls.

Although this is phrased in a way that suggests a new API on prism graphics, it may be that
ends up as some utilities used only in prism-j2d but provided as part of the core prism test
engine to extract the information needed by prism-j2d.

There may be additional complications or requirements but these are the ones that come to mind.
Comments
Note, the fix for RT-17411 does add the capability in prism graphics to draw a glyph list.
14-08-2012

Tabulation support in HTML based on glyph advances (RT-14662).
10-08-2011

Text copied from RT-12661 "An extension in Graphics interface for glyph-base text drawing." which duplicates this request, so I don't lose this part of the requirement : The problem is that Webkit (and our FX port - webnode) has BIDI string machinery and CSS support for letters/words spacing in shared code. The final Webkit callback for rendering is coming in format of glyph array and array of advances: WCGraphicsPrismContext.drawString(WCFont f, int[] glyphs, float[] advanceDXY, // ar(advanceDXY) = 2 * ar(glyphs): dx and dy for each glyph. float x, float y); To reach up the correct implementation we need an extension in Graphics interface for glyph-base text drawing with signature: Graphics.drawGlyphs( FontStrike fs, int[] glyphCodes, // glyph codes (can be ligature) float[] advancesX, // dx offsets for next glyph float[] advancesY,// dy offsets for next glyph in baseline float x, float y); ar(glyphCodes) = ar(advancesX) = ar(advancesY)
07-06-2011

Change issue type to feature.
17-03-2011