-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
6
-
x86
-
windows_2003
FULL PRODUCT VERSION :
jsdk 6.02
ADDITIONAL OS VERSION INFORMATION :
windows 2003
A DESCRIPTION OF THE PROBLEM :
use Font.createFont(int type, File fontFile) to create a type 1 Font.
it couldn't generate the glyph with the give font file.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run under windows
__________ source code ___________
Font javaFont=Font.createFont(Font.TYPE1_FONT,new File("cour.pfa"));
javaFont=javaFont.deriveFont(Font.BOLD,20);
BufferedImage bi=new BufferedImage(600, 400, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = (Graphics2D) bi.getGraphics();
g2.setColor(Color.WHITE);
g2.setFont(javaFont);
g2.drawString("test string", 100,100);
ImageIO.write(bi, "png", new File("new.png"));
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
a PNG image with white text -- test string on it
ACTUAL -
a blank PNG image with nothing on it
ERROR MESSAGES/STACK TRACES THAT OCCUR :
no error message
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
__________ source code ___________
Font javaFont=Font.createFont(Font.TYPE1_FONT,new File("cour.pfa"));
javaFont=javaFont.deriveFont(Font.BOLD,20);
BufferedImage bi=new BufferedImage(600, 400, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = (Graphics2D) bi.getGraphics();
g2.setColor(Color.WHITE);
g2.setFont(javaFont);
g2.drawString("test string", 100,100);
ImageIO.write(bi, "png", new File("new.png"));
the cour.pfa:
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Couldn't find a workaround. it looks like the createFont is platform dependent.
currently, we have to try to convert Type 1 Font to true type and tolerate the information lost
jsdk 6.02
ADDITIONAL OS VERSION INFORMATION :
windows 2003
A DESCRIPTION OF THE PROBLEM :
use Font.createFont(int type, File fontFile) to create a type 1 Font.
it couldn't generate the glyph with the give font file.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run under windows
__________ source code ___________
Font javaFont=Font.createFont(Font.TYPE1_FONT,new File("cour.pfa"));
javaFont=javaFont.deriveFont(Font.BOLD,20);
BufferedImage bi=new BufferedImage(600, 400, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = (Graphics2D) bi.getGraphics();
g2.setColor(Color.WHITE);
g2.setFont(javaFont);
g2.drawString("test string", 100,100);
ImageIO.write(bi, "png", new File("new.png"));
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
a PNG image with white text -- test string on it
ACTUAL -
a blank PNG image with nothing on it
ERROR MESSAGES/STACK TRACES THAT OCCUR :
no error message
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
__________ source code ___________
Font javaFont=Font.createFont(Font.TYPE1_FONT,new File("cour.pfa"));
javaFont=javaFont.deriveFont(Font.BOLD,20);
BufferedImage bi=new BufferedImage(600, 400, BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = (Graphics2D) bi.getGraphics();
g2.setColor(Color.WHITE);
g2.setFont(javaFont);
g2.drawString("test string", 100,100);
ImageIO.write(bi, "png", new File("new.png"));
the cour.pfa:
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Couldn't find a workaround. it looks like the createFont is platform dependent.
currently, we have to try to convert Type 1 Font to true type and tolerate the information lost
- relates to
-
JDK-6720240 IOB exception when getting font metrics of hershey font
-
- Closed
-
-
JDK-6573783 Add heuristics to ignore malformed bitmap tables
-
- Closed
-