Thursday, June 17, 2010

TAMIL UNICODE


The unicode for Tamil is in the range 0B80 - 0BFF . Each individual tamil letter is represented by a 16 bit code.

Example:

Code for letter க is 0B95
Code for letter கா is 0B95 0BBE
The image above shows the code for various tamil letters. Thus the respective combination of the tamil letters can be used to generate appropriate tamil words. Remember always that the consonants should appear first.( That is for the letter கா , the code for க should appear first).

Using Tamil Unicode In Java:

Java code to display a tamil string in a Applet:

import java.awt.*;
import java.io.*;
import javax.swing.*;
public class test1 extends JApplet
{

public void init()
{
String rt="\u0B87\u0BB2\u0BCD\u0BB2\u0BC8";
Container cp=getContentPane();
cp.setLayout(new FlowLayout());
JLabel b=new JLabel();
b.setFont(new Font("Latha",Font.PLAIN,12));
b.setText(rt);
cp.add(b);
}

}


Displaying Tamil Font In Java:

If the tamil font is not properly displayed in Java , you have to add a fallback folder


1) Create a folder called "fallback".

2) Copy the font file latha.ttf(or the font which you are using) into the fallback folder.

3) Move the fallback folder into two locations

/jdk/jre/fonts/
/jre/fonts

The first jre folder is inside the jdk folder. This is used to display tamil font in frames and windows.
The second jre folder occurs along with the jdk folder. This is used to display tamil font in applets.

Important Tip Regarding using Different Languages In java:

It is adviced to use Swings compared to Awt for applications involving different languages.



7 comments:

  1. Good work...Tamil language are found in inscriptions dating from the 5th century BCE. The written Tamil language is believed to have developed from the Brahmi script. Tamil script evolved in shape and style over the years, finally gaining stabilization with the introduction of printing in the 16th century.

    ReplyDelete
  2. மிக்க நன்றி வெகுநாளாய்த் தேடிக் கொண்டிருந்தேன்.ஜேலேபிளில் தமிழ் அச்சுப்பதி்க்க காத்திருந்தேன் நன்றி நண்பரே
    லெ.சங்கரநாராயணன்

    pspl.sankar@gmail.com

    ReplyDelete
  3. மிக்க நன்றி நண்பரே ... எங்கு தேடியும் இதற்கான விடை கிடைக்கவில்லை . இப்பொழுது எனக்கு உங்களால் இதட்கான விடை கிடைத்து விட்டது.

    ReplyDelete