You may now want to consider the following suggestions to
Since the font listing returns by
getFontList() of IE
VM are not sorted alphabetically, as compared to
getAvailableFontFamilyNames() in Java 1.3. Therefore, we
may want to sort the result on IE VM. If we do want the code to be
internationalized, we will need to make use of the
Another exercise is to use Java Reflection with the following API found in Java 1.3, where Font object is replicated with just a change of size or style or both.
public Font deriveFont(float size) public Font deriveFont(int style, float size) public Font deriveFont(AffineTransform trans) public Font deriveFont(int style, AffineTransform trans) public Font deriveFont(int style) public Font deriveFont(Map attributes)
The latest MS VM can be obtained from Microsoft's Java site.
References on I18N and Java
- IBM developerworks Internationalization theme page
- alphaWorks Technologies by IBM
- Unicode home page
In this article, we illustrated how to achieve the display of Asian characters in applets on IE by using Java Reflection. Otherwise, these texts would have appeared in "block" characters. We also illustrated how to obtain a listing of user system fonts depending on which version of VM you are using.
This technique has been implemented in our client-side Java-based product, Facado, which in addition to being internationalized, offers interactive and collaborative computing capabilities in the browser.
I welcome your feedback and exchange of ideas. Contact me via email.
I would like to thank Steve Anglin, Managing Editor of ONJava.com, for giving me this opportunity to share this information with you and NexusEdge Technologies Pte Ltd for providing the environment to develop leading-edge Java solutions.
I would like to thank my colleague, Thierry Bedos, for his valuable discussion on Java reflection and feedback on this article.
Jaric Sng is a Java GUI designer and developer with interest and expertise with Java Internationalization.
Return to ONJava.com.