SINHALA and J2ME

Java programming topics
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

SINHALA and J2ME

Post by Rksk » Wed Mar 24, 2010 12:00 pm

How to create j2me application with ability to type in sinhala letters?

like THILINA DICTIONARY , THIBASme SMS
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: SINHALA and J2ME

Post by Neo » Wed Mar 24, 2010 12:44 pm

See How to use a different font in J2ME if you want to change to a font that the phone supports. As we know that Sinhala isn't usually installed with phones, this is not easily possible.

You'll have to move to embedded way of displaying fonts. If I clarify a bit, you can do the necessary graphics for your own customised fonts and save that as an image file along with your other graphic images. After that you could use those customised fonts where ever you want in the app. For ex: first of all you have to create a PNG image strip with all the characters say 1234..... ABCD....abcd... and so on in your desired style.

You can use setClip() to set the clipping position on the strip (PNG image with fonts) and then draw the image using drawImage();. Note that PNG can have colourless pixels so it overlays nicely to the background.

See Mobile Bit Font Creator that might help you straight away.

Hope that helps!
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: SINHALA and J2ME

Post by Rksk » Wed Mar 24, 2010 6:28 pm

See this image! open with paint.

I found this in THILINA DICTIONARY.

But in THIBASme SMS it draws all the charactors sinhala, tamil also english.
font.png
font.png (4.44 KiB) Viewed 9120 times
Last edited by Neo on Wed Mar 24, 2010 6:31 pm, edited 1 time in total.
Reason: Placed image on post with "Place inline"
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: SINHALA and J2ME

Post by Neo » Wed Mar 24, 2010 6:33 pm

I think there should be several images of this kind :?:
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: SINHALA and J2ME

Post by Rksk » Wed Mar 24, 2010 6:55 pm

See this!


ThibasME sms source.zip
(32.32 KiB) Downloaded 607 times
Last edited by Rksk on Wed Mar 24, 2010 7:19 pm, edited 1 time in total.
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: SINHALA and J2ME

Post by Neo » Wed Mar 24, 2010 7:08 pm

Looks like a pixel map to me ?
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: SINHALA and J2ME

Post by Rksk » Wed Mar 24, 2010 7:16 pm

What is a pixel map?
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: SINHALA and J2ME

Post by Neo » Wed Mar 24, 2010 7:22 pm

I will give you a little example...

000010000
000101000
000111000
001000100
010000010

Can you see letter A is there? 0's represent blank area and 1's represent letter foreground.
Now you can represent this as an array as follows.
array_A = {0,0,0,0,1,0,0,0,0, 0,0,0,1,0,1,0,0,0, ...............

When you add several fonts to a single array like this, it is usually referred as a simple pixel map.
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: SINHALA and J2ME

Post by Rksk » Tue Mar 30, 2010 6:39 pm

Pls give an example on setclip() with the above posted PNG or another.

Neo wrote:See How to use a different font in J2ME if you want to change to a font that the phone supports. As we know that Sinhala isn't usually installed with phones, this is not easily possible.

You'll have to move to embedded way of displaying fonts. If I clarify a bit, you can do the necessary graphics for your own customised fonts and save that as an image file along with your other graphic images. After that you could use those customised fonts where ever you want in the app. For ex: first of all you have to create a PNG image strip with all the characters say 1234..... ABCD....abcd... and so on in your desired style.

You can use setClip() to set the clipping position on the strip (PNG image with fonts) and then draw the image using drawImage();. Note that PNG can have colourless pixels so it overlays nicely to the background.

See Mobile Bit Font Creator that might help you straight away.
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: SINHALA and J2ME

Post by Neo » Tue Mar 30, 2010 8:26 pm

See http://devlinslab.blogspot.com/2007/11/ ... -part.html
This is a great article that demonstrate exactly the same thing you want.
Post Reply

Return to “Java Programming”