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

Mismatch between the drawing width and font metrics

XMLWordPrintable

    • 2d
    • b08
    • x86
    • windows_xp
    • Verified

      Depending on the character strings that should be drawn for printing, the following symptoms occurs:
      1. mismatch between the drawing width and font metrics value.
      2. output as image.

      java.awt.Graphics2D#drawString(String, float, float)
      1. If the parameter String contains one or more of the special symbols(after-
      mentioned), the drawing result is different.
      2. the expected result of the character strings should be a text. But if the parameter String contains one or more of the special symbols, the result is an image. This symptom can be confirmed by outputing the character strings using a printer driver which have the PDF output function.

      3. If the parameter String does not contain the special symbols, a mismatch occurs between the width drawn and the width obtained by java.awt.FontMetrics#
      getStringBounds(String, Graphics2D) or java.awt.FontMetrics#stringWidth(String). In this case, the output of the character strings is a text, not an image. The mismatch of the width is especially prominent in the japanese part of the character strings.

      Special symbols:
      the special symbols are the following:

      ,.?!)]}?????([{?-^?@;:?#$%&=?|`+*<>_

      the UNICODE code point of these symbols is U+FFxx.

            prr Philip Race
            psreekumsunw Priya Sreekumar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: