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

Sol2.6, Underscore char '_' not rendered w/ serif font & ANTIALIAS_OFF

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.3.0
    • client-libs
    • None
    • 2d
    • sparc
    • solaris_2.6

      The underscore character isn't rendered with the serif font and ANTIALIAS_OFF. The problem appears on Solaris 2.6 : jdk1.2.2 and jdk1.3. Looks okay on win32 & on Sol with jdk1.2.


      import java.awt.*;

      public class UnderScore extends Panel {

          public UnderScore() {
              setBackground(Color.white);
          }
          
          public void paint(Graphics g) {
              Dimension d = getSize();
              Graphics2D g2 = (Graphics2D) g;
              g2.clearRect(0, 0, d.width, d.height);
              g2.setColor(Color.black);
              g2.setFont(new Font("serif", Font.PLAIN, 24));

              String text = "serif.bold.24";
              g2.drawString(text + "ANTIALIAS_OFF", 5, (int) (d.height*0.3));

              g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
              g2.drawString(text + "ANTIALIAS_ON", 5, (int) (d.height*0.6));
          }
              
          public static void main(String args[]) {
              Frame f = new Frame("UnderScore isn't rendered");
              f.add("Center", new UnderScore());
              f.pack();
              f.setSize(500, 300);
              f.show();
          }
      }

            pkejriwasunw Parry Kejriwal (Inactive)
            blichtensunw Brian Lichtenwalter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: