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

Java 2D Printing is not checking for layout attributes on a font.

    XMLWordPrintable

Details

    • 2d
    • b67
    • generic
    • generic

    Description

      In JDK 6 all text attributes can be set on a font.
      In screen rendering (ie SunGraphic2D) this is detected a "layout"
      attribute and text layout is invoked to handle drawString in these cases.

      The printing implementation doesn't detect this and so unless
      TextLayout is used these won't be honoured.

      The exception to this one of the triggers for "raster printing" is
      see - eg if a transparent colour is set on the graphics then it
      works fine as the screen loops detect it.

      So the printing graphics implementations of drawString needs to test
      Font.hasLayoutAttributes() and then ensure the most appropriate handling.

      Eg 1.4/1.5 doesn't didn't handle FOREGROUND_COLOR even if directly
      using TextLayout. 1.6 does but prints it as a shape and doesn't
      delegate when the TL is indirectly invoked from drawString
      We should handle both these cases properly and ideally optimally.

      We don't necessarily need to back off to filled outlines
      for other layout attributes either.
      There exists code which can handle positioning glyphs
      used when TL was directly used. We should try to leverage
      it for the indirect case too.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: