[Logo]
Forums Register Login
Font differs from Windows and Linux ?
Hi, i just want to ask, are fonts different from windows and linux in applet. I use a standard courier font.

For example, if i make an applet with courier font texts in linux, and make the texts wrap themselves, they will run ok in linux. But if i run the compiled applet in windows, the wrapped text somewhow got truncated.

But if i compile the applet in windows, it will look ok in linux and windows.

I've tried replacing my courier fonts in my /usr/java/jdk/jre/lib/fonts/cour*.ttf with the cour*.ttf from c:\windows\fonts with no effects .. Applets compiled and run ok in linux doesnt work in windows. They must be compiled in windows to run ok in both.

Why is that ?

Does the compilation use the fonts in the jdk lib or the system fonts ?

I'm so confused T_T

Please help
As far as I know this has absolutely nothing to do with the font.

Are you using Swing or AWT (or Other)? You did not mention how you draw text on the applet...

Remember, the AWT uses native components (inputboxes, dropdown lists, labels etc.) So if you're just using the AWT, you have two different operating systems trying to draw the same text using their OWN implementations. Which MIGHT be the source of your problems...
WHere the class files are compiled will not affect how fonts are displayed; you must be mistaken. But where they are executed will, indeed, affect their appearance because fonts are different on the different machines. How font files are located can be a black art on Linux, so I'm not surprised that replacing the ones in the Java lib directory had no effect. In general, you need to design AWT applications to be tolerant of font differences across platforms.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 19, 2017 17:47:55.