J2ME and Unicode - Enabling the J2ME Emulator with Unicode
(Page 2 of 6 )
There is one more required step needed to properly display Unicode characters, that is to ensure the display itself can support Unicode; in this case the emulator screen. You will also need to obtain the appropriate fonts. For example, if you want to display Japanese characters you will need the MS Mincho font. After installing the font on your system you will now need to edit the properties file, which we will go over in next section. This can be very tedious if you decided that you wanted to support dozens of languages. You would have to install and edit dozens of property files. Of course, an easy solution to this is to obtain a font set that contains multiple language support; one of which is the Arial Unicode MS font. Unfortunately Microsoft no longer supplies this font free-of-charge. You will either have to purchase it or find an alternative Unicode font set.
Now with the new fonts installed go to home directory of the Sun Wireless ToolKit, and go into the directory wtkdevices. Now copy DefaultColorPhone and paste in the same directory renamed to UnicodePhone. Also, rename the properties file under the UnicodePhone directory to UnicodePhone.properties. Next, using any editor open the UnicdoePhone.properties file and find the font section. It should look similar to the following:
font.default=SansSerif-plain-10
font.softButton=SansSerif-plain-11
font.system.plain.small: SansSerif-plain-9
font.system.plain.medium: SansSerif-plain-11
font.system.plain.large: SansSerif-plain-14
font.system.bold.small: SansSerif-bold-9
font.system.bold.medium: SansSerif-bold-11
font.system.bold.large: SansSerif-bold-14
font.system.italic.small: SansSerif-italic-9
font.system.italic.medium: SansSerif-italic-11
font.system.italic.large: SansSerif-italic-14
font.system.bold.italic.small: SansSerif-bolditalic-9
font.system.bold.italic.medium: SansSerif-bolditalic-11
font.system.bold.italic.large: SansSerif-bolditalic-14
font.monospace.plain.small: Monospaced-plain-9
font.monospace.plain.medium: Monospaced-plain-11
font.monospace.plain.large: Monospaced-plain-14
font.monospace.bold.small: Monospaced-bold-9
font.monospace.bold.medium: Monospaced-bold-11
font.monospace.bold.large: Monospaced-bold-14
font.monospace.italic.small: Monospaced-italic-9
font.monospace.italic.medium: Monospaced-italic-11
font.monospace.italic.large: Monospaced-italic-14
.
.
Continued
Replace SansSerif and Monospaced with the following: Arial Unicode MS (assuming you are using the Arial Unicode MS font set). The file should now look similar to the following:
font.default=Arial Unicode MS-plain-10
font.softButton=Arial Unicode MS-plain-11
font.system.plain.small: Arial Unicode MS-plain-9
font.system.plain.medium: Arial Unicode MS-plain-11
font.system.plain.large: Arial Unicode MS-plain-14
font.system.bold.small: Arial Unicode MS-bold-9
font.system.bold.medium: Arial Unicode MS-bold-11
font.system.bold.large: Arial Unicode MS-bold-14
font.system.italic.small: Arial Unicode MS-italic-9
font.system.italic.medium: Arial Unicode MS-italic-11
font.system.italic.large: Arial Unicode MS-italic-14
font.system.bold.italic.small: Arial Unicode MS-bolditalic-9
font.system.bold.italic.medium: Arial Unicode MS-bolditalic-11
font.system.bold.italic.large: Arial Unicode MS-bolditalic-14
font.monospace.plain.small: Arial Unicode MS-plain-9
font.monospace.plain.medium: Arial Unicode MS-plain-11
font.monospace.plain.large: Arial Unicode MS-plain-14
font.monospace.bold.small: Arial Unicode MS-bold-9
font.monospace.bold.medium: Arial Unicode MS-bold-11
font.monospace.bold.large: Arial Unicode MS-bold-14
font.monospace.italic.small: Arial Unicode MS-italic-9
font.monospace.italic.medium: Arial Unicode MS-italic-11
font.monospace.italic.large: Arial Unicode MS-italic-14
font.monospace.bold.italic.small: Arial Unicode MS-bolditalic-9
font.monospace.bold.italic.medium: Arial Unicode MS-bolditalic-11
font.monospace.bold.italic.large: Arial Unicode MS-bolditalic-14
.
.
Continued
For more detailed installation instructions refer to Qusay H. Mahmoud’s excellent tutorial, which is indicated in the reference section of this article.
Next: Simple Unicode Test >>
More Java Articles
More By Jason Lam