I have gone through many topics related to this issue. It seems like Open type font is supported for Swing, but isn't supported for Graphics2D in Java7. It still allow me to create new font based on a .otf
file but it doesn't generate text when I try to write it to an image.
Font font = Font.createFont(Font.TRUETYPE_FONT, new File("font.otf"));
Has anyone faced the same? Please share your solution.
UPDATE
As said in this link, Open Type Font is supported but I can't find any toppic show how to use this font in practice.
For those who faced the same problem. I found out that my current Java version (1.7.0_151) couldn't handle OTF file.
I upgrade to JDK 7 b97 (or older), then the problem is gone.