Some of the leads I got when I first brought up this
subject pointed me in the direction of a problem with the
Mac 1.4 JVM rendering fonts that had been
AffineTransform-ed. I can now confirm that with a simple
"one-class wonder." The source code below effectively
duplicates the rendering problem of the emulator:
package Test30MR05;
import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
public class Test30MR05 extends JPanel {
protected Image bufferImage;
protected Graphics bgr; // back
graphics
protected Font font;
protected Font tallFont;
public Test30MR05() {
Dimension size = new Dimension(500,500);
setPreferredSize(size);
setMinimumSize(size);
setMaximumSize(size);
setBackground(Color.blue);
font = new Font("Serif", Font.PLAIN, 16);
tallFont =
font.deriveFont(AffineTransform.getScaleInstance(1.0,
1.6));
}
public void setup(){
bufferImage = createImage(500,500);
bgr = bufferImage.getGraphics();
bgr.setColor(Color.red);
bgr.fillRect(0,0,500,500);
bgr.setColor(Color.white);
bgr.drawLine(250,0,250,500);
bgr.drawLine(0,250,500,250);
bgr.setFont(font);
bgr.drawString("I like spam. This is
normal.",251,249);
bgr.drawLine(0,300,500,300);
bgr.setFont(tallFont);
bgr.drawString("I like spam. This is taller.", 251,
299);
}
public void paint(Graphics g) {
if (bufferImage != null)
g.drawImage(bufferImage, 0, 0, null);
}
public static void main(String[] args) {
Test30MR05 foo = new Test30MR05();
JFrame frame = new JFrame();
frame.getContentPane().add(foo);
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
foo.setup();
frame.setVisible(true);
}
}
Later today, I hope to have a ZIP file with the above, in
source, class, and jar, with WinDoze and MacOS-X screen
shots, on my web site. Anybody here know about the Affine
bug, or any workarounds for it?
--
JHHL
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.