-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.3.0
-
None
-
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();
}
}
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();
}
}
- duplicates
-
JDK-4248579 Javatest File Dialog not displaying underscore "_" character in filenames
-
- Closed
-