Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8090917

Add drawGlyphVector type support to prism graphics

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • fx2.0, 8
    • javafx
    • None

      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.

            prr Philip Race
            prr Philip Race
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Imported: