views:

69

answers:

1

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 (), but a slightly different one on OpenJDK ().

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]

+1  A: 

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.

soc
What a mess, thanks for your feedback. I guess using the standard library just isn't the way to do what I need.I later noticed that using your own TTF file produces different renderings even between Mac and Windows.
Yuvi Masory
Maybe you could use a bitmap font? That should usually produce very similiar results.Or you could render the glyphs you need into images once and then just assemble them together in your application...
soc