Fontspacing under Linux is wrong / different to Windows

Hello everybody!

Our applet looks fine under Windows, but not under Linux.

The reason is the different spacing of the fonts in Linux.

Our tries to load the fonts via inputStream/Font. createFont and to derive the jre-font are without effect. Finally we copied the Windows-jre-font to the Java-jre-fonts. The spacing was wrong!

The spacing under Linux is a little big greater than Windows. We checked it with System.out.println(">>>"+g.getFontMetrics(myParent.getFontText()).stringWidth("Seise"));.

What's wrong - is there a bug in Linux (Suse 7.2/KDE2.0 and 6.1/KDE1.0) or the jre1.3 ?

Anybody can help us - please?

Looking forward to get help from a java-guru!

Regards

Stoegi ;-)

P.S.: The LookAndFeel() of our Applet is "javax.swing.plaf.metal.MetalLookAndFeel"

[855 byte] By [Stoegi] at [2007-9-26 4:45:46]
# 1
Hi There:I got this problems too, can anyone pls help ? : ). Don't know why, the fontspacing on Windows is differenct to fontspacing in Linux. Linux fonspacing is slightly more.cheers,selena
selena_su at 2007-6-29 18:34:36 > top of Java-index,Archived Forums,Java Programming...
# 2

Although I don't know why this is the case, I would say it's the kind of cross-platform issue you should expect. In point of fact (without knowing how you specified a font) I wouldn't even count on having the same font. I guess the only thing to do is compensate by measuring the font width before drawing it, or using some kind of flexible layout manager (obviously one of these might not be practical).

Even on the Windows platform, font widths can change under some VMs depending on the type of anti-ailiasing applied by the OS.

asquithea at 2007-6-29 18:34:36 > top of Java-index,Archived Forums,Java Programming...