roytang.net Posts Photos Archives About

Comment by Thorbjørn Ravn Andersen on Displaying Chinese text in an Applet via stackoverflow.com

This indicated that the font does not support Chinese characters (which you probably guessed).

You might find the java.awt.Font.canDisplayUpto() method interesting.

http://www.j2ee.me/javase/6/docs/api/java/awt/Font.html#canDisplayUpTo(java.lang.String)

"Indicates whether or not this Font can display a specified String. For strings with Unicode encoding, it is important to know if a particular font can display the string. This method returns an offset into the String str which is the first character this Font cannot display without using the missing glyph code. If the Font can display all characters, -1 is returned."

via stackoverflow.com