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

Solaris X11 rasteriser not used for characters in first string displayed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 6
    • client-libs
    • None
    • 2d
    • mustang
    • sparc
    • solaris_8

      On Solaris some CJK fonts do not contain embedded bitmaps and rely on PCF
      bitmaps. JDK relies on the Xserver to rasterise these PCF fonts if they are
      available to X11. The test to see if they are available for a font is
      performed the first time a strike is created for that font.

      Unfortunately this will likely happen after the first call to map chars to
      glyphs but this mapping process assumes the test has already been performed.
      It needs this information to map from the glyph id in the TrueTypeFont back
      to the unicode codepoint, so that any access to the native font that later
      occurs using the glyph code can be mapped back to unicode from which a
      character converter can re-convert it for use by the native rasteriser

      The consequence of this is the characters in the very first string that is
      displayed appear to have no mapping into the native encoding, so skip the
      native rasterisation.

      This can lead to very small inconsistencies and degradation in the appearance
      of those select few characters when displayed using that font.

      Login to a JA locale on Solaris 8 and run this program on JDK 1.5 (Tiger)
      It will show a difference from the same program on JDK 1.4.

      import java.awt.*;

      public class FontTest extends Component {

          public FontTest() { }
          public void paint(Graphics g) {
      g.setColor(Color.black);
      Font f = new Font("Dialog", Font.PLAIN, 12);
      g.setFont(f);
      g.drawString("\uff081p\uff09\u96e3\u3057\u3044\u6f22\u5b57\uff1a\u901a\u5e38\u3000\u4f7f\u7528\u4e0d\u53ef\u3000\u9078\u629e\u6e08\u307f\u3000test", 20, 20);

          }

          public static void main(String[] args) {
      Frame frame = new Frame();
      frame.add("Center", new FontTest());
      frame.setSize(400, 160);
              frame.setVisible(true);
          }

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: