-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0, 1.3.0
-
beta
-
x86, sparc
-
solaris_7, solaris_8
import java.awt.*;
public class PrintText {
static public void main(String[] args) {
Frame f = new Frame("test");
f.pack();
PrintJob pj = f.getToolkit().getPrintJob(f, "print1", null);
if (pj != null) {
String s = "abcdefghijklmnopqrstuvwxyzABCEFGHIJKLMNOPQRSTUVWXYZ1234567890";
int yoffset = 50;
Graphics g = pj.getGraphics();
g.setFont(new Font("Serif",Font.PLAIN,14));
g.drawString("Serif: " +s,10,yoffset);
yoffset+=100;
g.setFont(new Font("SansSerif",Font.PLAIN,14));
g.drawString("SansSerif: "+s,10,yoffset);
yoffset+=100;
g.setFont(new Font("Dialog",Font.PLAIN,14));
g.drawString("Dialog: "+s,10,yoffset);
yoffset+=100;
g.setFont(new Font("DialogInput",Font.PLAIN,14));
g.drawString("DialogInput: "+ s,10,yoffset);
yoffset+=100;
g.setFont(new Font("MonoSpaced",Font.PLAIN,14));
g.drawString("MonoSpaced: "+ s,10,yoffset);
yoffset+=100;
g.setFont(new Font("Courier",Font.PLAIN,14));
g.drawString("Courier: "+s,10,yoffset);
yoffset+=100;
g.dispose();
pj.end();
}
}
}
Using the 1.1(AWT) printing API on Java 2 (1.2, 1.2,2) on Solaris, text
in component labels and text drawn using Graphics.drawString always appears
as "Courier" even though the font is set to "Serif" or "SanSerif".
Test case below ..
public class PrintText {
static public void main(String[] args) {
Frame f = new Frame("test");
f.pack();
PrintJob pj = f.getToolkit().getPrintJob(f, "print1", null);
if (pj != null) {
String s = "abcdefghijklmnopqrstuvwxyzABCEFGHIJKLMNOPQRSTUVWXYZ1234567890";
int yoffset = 50;
Graphics g = pj.getGraphics();
g.setFont(new Font("Serif",Font.PLAIN,14));
g.drawString("Serif: " +s,10,yoffset);
yoffset+=100;
g.setFont(new Font("SansSerif",Font.PLAIN,14));
g.drawString("SansSerif: "+s,10,yoffset);
yoffset+=100;
g.setFont(new Font("Dialog",Font.PLAIN,14));
g.drawString("Dialog: "+s,10,yoffset);
yoffset+=100;
g.setFont(new Font("DialogInput",Font.PLAIN,14));
g.drawString("DialogInput: "+ s,10,yoffset);
yoffset+=100;
g.setFont(new Font("MonoSpaced",Font.PLAIN,14));
g.drawString("MonoSpaced: "+ s,10,yoffset);
yoffset+=100;
g.setFont(new Font("Courier",Font.PLAIN,14));
g.drawString("Courier: "+s,10,yoffset);
yoffset+=100;
g.dispose();
pj.end();
}
}
}
Using the 1.1(AWT) printing API on Java 2 (1.2, 1.2,2) on Solaris, text
in component labels and text drawn using Graphics.drawString always appears
as "Courier" even though the font is set to "Serif" or "SanSerif".
Test case below ..