Question

My release script produces images of the version number to save me the trouble of manually going into the MoinMoin wiki software and changing it by hand for each release. Unfortunately, since the fonts look a little different on each platform's JVM, the result is ugly.

I solved the the font inconsistency by using Lucide Sans (comes with every Java system). (Loading Fonts from TTF files is another option.) The result is much better, producing the exact same image on Mac/Windows (http://img718.imageshack.us/img718/9089/winq.png), but a slightly different one on OpenJDK (http://img441.imageshack.us/img441/4247/openjdk.png).

I believe this is caused by OpenJDK having a different font rendering system (as opposed to different fonts). Is there any way I can get all three of my target platforms (Sun Windows, Mac, OpenJDK Linux) to produce images of text that look identical?

[Update: ugly link is no longer ugly since am correcting things by hand until I can find an automatic solution]

Was it helpful?

Solution

OpenJDK uses the font rendering library of the system, so you might not even get the same font rendering on different linux distributions or versions.

Additionally, you can't even assume that Lucida Sans is available, because OpenJDK doesn't install it, it is only in Sun's JDK.

The only solution would be to deploy your own custom OpenJDK to Windows and Mac platforms and making sure it still uses Freetype instead of the platform's font rendering library. But that's not workable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top