-
Bug
-
Resolution: Fixed
-
P4
-
1.4.0
-
hopper
-
x86
-
windows_98, windows_nt
Name: bsC130419 Date: 05/31/2001
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
After doing a rotate or shear transformation (either by calling
g2d.transform(AffineTransform) or g2d.rotate(double) or by
Font.deriveFont(AffineTransform) ), the Chinese characters become distorted.
Here is a sample program:
import java.io.*;
import java.awt.*;
import java.awt.font.*;
import java.awt.geom.*;
import javax.swing.*;
public class Test {
public static void main(String [] args) throws Exception {
Font font = new Font("??????", Font.PLAIN, 20);
font = font.deriveFont(40.0f);
JFrame frame = new JFrame();
JPanel panel = new TestPanel(font, new String("\u660e\u9ad4"));
frame.getContentPane().add(panel);
frame.setDefaultCloseOperation(3);
frame.setSize(new Dimension(640, 480));
frame.setVisible(true);
}
}
class TestPanel extends JPanel {
private Font font;
private String str;
public TestPanel(Font font, String str) {
super();
AffineTransform t = new AffineTransform();
t.rotate(0.785);
font = font.deriveFont(t);
this.font = font;
this.str = str;
}
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D)g;
GlyphVector v =
font.createGlyphVector(g2d.getFontRenderContext(), str);
g2d.setFont(font);
g2d.drawGlyphVector(v, 100, 100);
}
}
The drawing is correct in JDK 1.3.0, JDK 1.3.0_01 and JDK 1.3.1
(Review ID: 125274)
======================================================================
- duplicates
-
JDK-4495474 Font2DTest demo doing the rotate or shear, the text is very poor in tch winnt4.0
-
- Closed
-