I have a servlet which generates an image. I want to load the font it uses from a TTF file, so that the servlet is not dependent on that font being available on that particular server.
I load the font using java.awt.Font.createFont(). When I test this on my local Glassfish on Mac OS X this works fine, but when I try it on Glassfish on a Linux server I get the following exception:
java.awt.FontFormatException: bad table, tag=1279872591
at sun.font.TrueTypeFont.init(TrueTypeFont.java:
at sun.font.TrueTypeFont.<init>(TrueTypeFont.java:162)
at sun.font.FontManager.createFont2D(FontManager.java:2264)
I was under the impression that the parsing of the TTF file was done entirely in Java, and therefore not platform specific. Is this assumption wrong? Or is there some other reason why this fails?