To display Assamese Unicode character in Java program follow the following steps-
1. check your JRE Home
2. change directory to C:\Program Files\Java\jdk1.6.0_10\jre\lib (according to default java directory)
generally within each installed JDK version there is a JRE directory. Go to that directory.
another JRE directory is generally in C:\Program Files\JRE.. no need to modify this directory
3. wherever the JRE, go to that, which one is within JDK
4. there you find the following files
../JRE/lib/fontconfig.OS.Version.properties
../JRE/lib/fontconfig.OS.Version.bfc
../JRE/lib/fontconfig.OS.properties
../JRE/lib/fontconfig.OS.bfc
../JRE/lib/fontconfig.Version.properties
../JRE/lib/fontconfig.Version.bfc
../JRE/lib/fontconfig.properties
../JRE/lib/fontconfig.bfc
There may be some less number of file, no problem, 3 will get minimum 3 files among the above listed files with extension .src
5. copy fontconfig.properties.src and past it in the same directory
6. rename the newly pasted file as fontconfig.properties
7. open it with notepade++ (or any other editor) and add the following 3 lines
##Added a line at the top of the 'Component Font Mappings':
allfonts.bengali=Vrinda
##Modifed the UTF-8 Search Sequence line to include Bengali:
sequence.allfonts.UTF-8.hi=alphabetic/1252,devanagari,bengali,dingbats,symbol
##Added a line at the top of the 'Font File Names':
filename.Vrinda=VRINDA.TTF
##if after including the above 3 line also the system is not working then add the following line in 'search sequence' area
sequence.allfonts=alphabetic/default,bengali,dingbats,symbol
####now execute the java programm. It will work
check the simple following program
import javax.swing.JOptionPane;
public class asm
{
public static void main (String [] args)
{
String asm = "\u09ae\u0987 \u0985\u09b8\u09aE\u09c0\u09df\u09be \u09b6\u09ac\u09cd\u09a6";
JOptionPane.showMessageDialog(null, asm);
}
}
If useful please leave a comment
1. check your JRE Home
2. change directory to C:\Program Files\Java\jdk1.6.0_10\jre\lib (according to default java directory)
generally within each installed JDK version there is a JRE directory. Go to that directory.
another JRE directory is generally in C:\Program Files\JRE.. no need to modify this directory
3. wherever the JRE, go to that, which one is within JDK
4. there you find the following files
../JRE/lib/fontconfig.OS.Version.properties
../JRE/lib/fontconfig.OS.Version.bfc
../JRE/lib/fontconfig.OS.properties
../JRE/lib/fontconfig.OS.bfc
../JRE/lib/fontconfig.Version.properties
../JRE/lib/fontconfig.Version.bfc
../JRE/lib/fontconfig.properties
../JRE/lib/fontconfig.bfc
There may be some less number of file, no problem, 3 will get minimum 3 files among the above listed files with extension .src
5. copy fontconfig.properties.src and past it in the same directory
6. rename the newly pasted file as fontconfig.properties
7. open it with notepade++ (or any other editor) and add the following 3 lines
##Added a line at the top of the 'Component Font Mappings':
allfonts.bengali=Vrinda
##Modifed the UTF-8 Search Sequence line to include Bengali:
sequence.allfonts.UTF-8.hi=alphabetic/1252,devanagari,bengali,dingbats,symbol
##Added a line at the top of the 'Font File Names':
filename.Vrinda=VRINDA.TTF
##if after including the above 3 line also the system is not working then add the following line in 'search sequence' area
sequence.allfonts=alphabetic/default,bengali,dingbats,symbol
####now execute the java programm. It will work
check the simple following program
import javax.swing.JOptionPane;
public class asm
{
public static void main (String [] args)
{
String asm = "\u09ae\u0987 \u0985\u09b8\u09aE\u09c0\u09df\u09be \u09b6\u09ac\u09cd\u09a6";
JOptionPane.showMessageDialog(null, asm);
}
}
If useful please leave a comment
Hi i tried it, but is not displaying the assamese font.Some blocks come in place of it. And again, i like to know using which i can convert the Assamese font to Unicode as you did in String asm here. Anyway thanks a lot
ReplyDelete