ජාවා වල සිංහල යුනිකෝධ් භාවිතා කරන්නේ කෙසේද ?

54 views
Skip to first unread message

W.H. Kalpa Pathum

unread,
Nov 6, 2007, 1:06:29 PM11/6/07
to Sinhala Unicode Group
ජාවා වැඩසටහනක අතුරුමුහුණතේදී සිංහල යුනිකෝධ් භාවිතා කරන්නේ කෙසේද ?
(Label, Frame වැනි Objects සඳහා)
--

------------------------------------
W.H.Kalpa Pathum
http://www.kalpapathum.blogspot.com
http://callkalpa.googlepages.com (Under construction)
------------------------------------

Prasan (ප්‍රසාන්)

unread,
Nov 7, 2007, 12:04:12 AM11/7/07
to සිංහල යුනිකෝඩ් සමූහය - Sinhala Unicode Group
පැතුම්ගේ ප්‍රශ්නයට තවත් ප්‍රශ්නයක් එක් කිරීමට හිතුවා. මම සපුමල්ගේ
http://sourceforge.net/projects/jsinhalization/ ප්‍රොජෙක්ට් එකට
සම්බන්ද ගොනු සියල්ලම ලබා ගත්තා. සමහරවිට පැතුම්ගේ ප්‍රශ්නයට ආරම්භක
පිලිතුර එතන ඇති.

සපුමල්, ඔබේ උපදෙස් මාලාවේ හැටියට jSinhalization.zip කියලා ගොනුවක්
sourceforge එකේ නැහැ. මට ලැබුනේ SinhalaLocale_v-0.2.1.jar,
SinhalaStandardIM_v-0.2.1.jar සහ SinhalaNotepad.jar ගොනු විතරයි. මම
ඔබේ SinhalaNotepad.jar run කල විට සිංහල සිංහල දිස්වන මුත් ඇතුල් කරන්න
නොහැකියි. ඒ සඳහා SinhalaLocale_v-0.2.1.jar ස්ථාපනය කර ගන්නේ කෙසේද?
පවිච්චි කරන ජාවා වර්ශන් එක අනුව JAR files නැවත බිල්ඩ් කිරීමක්
අවශ්‍යයද? ම භාවිතා කරන්නේ jdk-1.6 ෆෙඩෝරා වලදියි.

මම මීට අවුරුදු කිහිපයකට උඩදී උසස් පෙල භෞතික විද්‍යා virtual experiment
කිහිපයක් සිංහලෙන් නිර්මාණය කළා. එතෙන්දි භාවිතා කරේ unicode නෙමෙයි.
ටෙක්ස්ට් ෆීල්ඩ් වල ෆොන්ට් වෙනස් කිරීම තමයි සිදුකලේ. මේ සඳහා පාසල්
ගුරුවරුන්ගේ විශාල කැමැත්තක් තිබුනා. මේවා කොලඹ විශ්වවිද්‍යාලයේ භෞතික
විද්‍යා අධ්‍යයන අංශය මගින් දිවයින පුරා වපවත්වනු ලැබූ වැඩමුළු වලත්
භාවිතා වුනා. මුහුණ දුන්නු ලොකුම බාධකය තමයි එකම ටෙක්ස්ට් ෆීල්ඩ් එකක හෝ
ලේබල් එකක සිංහල සහ ඉංග්‍රීසි දෙකම පෙන්වීම.

පසුගිය දිනවල යුනිකේතය එක්ක ජාවාහි සිංහල සහාය සොයන්නට සිතුනා.සමූහයේ
පසුගිය කතාබස් බොහොමයක් පිරික්සුවා. එතෙන්දි තමයි සපුමල්ගේ ව්‍යාපෘතිය
ගැන දැන ගත්තේ. සපුමල් සිංහල ටෙක්ස්ට් එකක් ජාවා යෙදුමකට කම්පයිල්
කිරීමේදීම hard code කරනවානම් එසේ කිරීමටත් SinhalaLocale_v-0.2.1.jar
ස්ථාපනය කර යුතුද? මම සිංහල ටෙක්ස්ට් ස්ට්‍රින් එකක් ඇති ජාවා කේතයක්
compile කිරීමේදී පහත දැක්වෙන error එක javac compiler එක දිස්වනවා. මේකට
විසඳුමක් තිබේද?

Prasan (ප්‍රසාන්)

unread,
Nov 7, 2007, 12:57:35 AM11/7/07
to සිංහල යුනිකෝඩ් සමූහය - Sinhala Unicode Group
continuing from last post,

මම සිංහල ටෙක්ස්ට් ස්ට්‍රින් එකක් ඇති ජාවා කේතයක්
compile කිරීමේදී පහත දැක්වෙන error එක javac compiler එක දිස්වනවා. මේකට
විසඳුමක් තිබේද?

unmappable character for encoding UTF8

On Nov 7, 10:04 am, "Prasan (ප්‍රසාන්)" <prasanhe...@gmail.com> wrote:
> පැතුම්ගේ ප්‍රශ්නයට තවත් ප්‍රශ්නයක් එක් කිරීමට හිතුවා. මම සපුමල්ගේhttp://sourceforge.net/projects/jsinhalization/ප්‍රොජෙක්ට් එකට

> > W.H.Kalpa Pathumhttp://www.kalpapathum.blogspot.comhttp://callkalpa.googlepages.com(U...construction)
> > ------------------------------------

එරංග

unread,
Nov 7, 2007, 6:11:28 AM11/7/07
to සිංහල යුනිකෝඩ් සමූහය - Sinhala Unicode Group
Java සමග ලැබෙන native2acsii උත්සාහ කර බැලුවාද? Java කේත සහ message
bundles සඳහා එය භාවිත කල හැකියි. Swing සඳහා නම් sure නෑ!

> > > W.H.Kalpa Pathumhttp://www.kalpapathum.blogspot.comhttp://callkalpa.googlepages.com(U...)
> > > ------------------------------------

Prasan (ප්‍රසාන්)

unread,
Nov 7, 2007, 6:24:00 AM11/7/07
to සිංහල යුනිකෝඩ් සමූහය - Sinhala Unicode Group
මට හිතෙන හැටියට native2acsii තිබෙන්නේ Non-Latin හෝ Non-Unicode
කැරක්ටර්ස් යුනිකේතයට හැරවීමටයි. http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/native2ascii.html
බලන්න. අපිට තිබෙන ප්‍රශ්නය මීට වඩා වෙනස් බවයි මගේ හැඟීම.

සිංහල IM ජාවා වල ක්‍රියාත්මක නොවීමේ විශාලම පාඩුව තමයි බොහොමයක්ම ජාවා
IDE ජාවා වලින්ම ක්‍රියාත්මක වීම (NETBeans, IntelliJ IDEA, Ecclipse)
වගේ.

දසුන් සමීර

unread,
Nov 8, 2007, 1:32:08 AM11/8/07
to සිංහල යුනිකෝඩ් සමූහය - Sinhala Unicode Group
මා ජාවා ගැන එතරම් ‍ගැඹු‍රින් හදාරා නැතිමුත් මෙය උත්සහ කර බලන්න.
ඔබ කී SinhalaLocale_v-0.2.1.jar ගොනුව SinhalaLocale_v-0.2.1.zip ලෙස
ප්‍රතිනාමකරණය(rename) කරන්න. දැන් unzip කරන්න. ඉතිරි හරිය ඔබටම බලා ගත
හැකිය.

සපුමල් ජයරත්න

unread,
Nov 8, 2007, 3:42:57 AM11/8/07
to Sinhala...@googlegroups.com
Hello,

I beg your pardon for writing in English. I am writing in English because it seems I will not be able to get a machine with Sinhala in next couple of days.

Have you download the files from http://sourceforge.net/project/showfiles.php?group_id=132259

Just put the SinhalaLocale.jar and SinhalaStandardIM.jar in lib/ext in you Java virtual machine and you are done. Then you can write swing application or any other type of application and use Sinhala support.

For a sample swing application you can check the SinhalaNotepad.jar. Check its source code and you can learn how to develop Java software with Sinhala support.

If you need any other help contact me.

regards,
Sapumal

එරංග

unread,
Nov 8, 2007, 7:12:05 AM11/8/07
to සිංහල යුනිකෝඩ් සමූහය - Sinhala Unicode Group
නැහැ, native2acsii තිබෙන්නේ native-encoded කැරක්ටර්ස් Unicode-encoded
කැරක්ටර්ස් වලට පරිවර්තනය කිරීමයි.

උදා.
ජාවා -> \u0da2\u0dcf\u0dc0\u0dcf

මෙසේ web applications වල ඇති resource bundles මෙන්ම සිංහල ටෙක්ස්ට්
ස්ට්‍රින් එකක් ඇති ජාවා කේත ගොනුද native2acsii මගින් Unicode-encoded
කැරක්ටර්ස් බවට පත්කර භාවිතා කල හැකියි. ඉතින් native2acsii භාවිතයෙන්
සිංහල ටෙක්ස්ට් ස්ට්‍රින් එකක් ඇති ජාවා කේතයක් compile කර run කල
හැකියි. නමුත් එය swing applications වලට හරි යයිද දන්නේ නෑ.

-එරංග

Prasan (ප්‍රසාන්)

unread,
Nov 8, 2007, 10:40:43 PM11/8/07
to සිංහල යුනිකෝඩ් සමූහය - Sinhala Unicode Group
I'm sorry for writing in English. I'm out of the office for few days
and don't have access to a sinhala enabled computer. (Can we use a
sinhala VIEWING enabled firefox version in a PEN Drive? Like the U3
version of firefox. At least if u can view sinhala that'll be fine.)

Eranga U r correct. I wen't through the Java Internationalization
guideline and separated all sinhala resource strings from the source
codes. Now I don't have to use native2ascii.

I'll go through Sapumal's instructions and try again.

Prasan (ප්‍රසාන්)

unread,
Nov 13, 2007, 9:36:59 AM11/13/07
to සිංහල යුනිකෝඩ් සමූහය - Sinhala Unicode Group
සපුමල්ගේ උපදෙස් ඒ අයුරෙන්ම ක්‍රියාත්මක කළා. (භාවිතා කරන්නේ jdk1.6.03
ෆෙඩෝරා 7). සිංහල නෝට්පෑඩ් වල සිංහල පෙනෙන්නේ ප්‍රධාන මෙනුවේ පමනයි.
ටයිප් කරන දේ පේන්නේ නෑ. තිර පිටපත බලන්න.
http://groups.google.com/group/Sinhala-Unicode/web/Screenshot-Untitled+-+Sinhala+Note+Pad.png

පසුව මම ස්විංග් වලින් කුඩා ඇප්ප්ලිකේශන් එකක් ලිව්වා. (කරුණාකර ඇමුණුම
බලන්න.) එහිත් ඇප්ප්ලිකේශන් ටයිටල් බාර් එකේ සිංහල දිස්වන මුත් ටෙක්ස්ට්
ලේබල් එකක සිංහල දිස්වන්නේ නැහැ.

http://groups.google.com/group/Sinhala-Unicode/web/Screenshot-%E0%B6%86%E0%B6%BA%E0%B7%94%E0%B6%B6%E0%B7%9D%E0%B7%80%E0%B6%B1%E0%B7%8A+.png

මා ලියූ ප්‍රෝග්‍රැම් එකේ සෝස් කෝඩ් එක මෙතනින් ලබා ගන්න.

http://groups.google.com/group/Sinhala-Unicode/web/sinhala_unicode_java.zip

සපුමල් ජයරත්න

unread,
Nov 13, 2007, 11:37:47 AM11/13/07
to Sinhala...@googlegroups.com
compile කිරීමේදී පහත දැක්වෙන error එක javac compiler එක දිස්වනවා. මේකට
විසඳුමක් තිබේද?

unmappable character for encoding UTF8

Again, sorry for writing in English.

Please tell me the editor and OS you used. It depends whether the tool you are using supports Unicode and whether it saves the file in Unicode encoding. This works for me in plain shell and vi in OpenSUSE 10.3. See my results.

sapumal@linux:~/Foss/Jsinhalization> cat Test.java
class Test {
        public static void main(String args[]) {
                System.out.println("සපුමල් ජයරත්න");
        }
}
sapumal@linux:~/Foss/Jsinhalization> javac Test.java
sapumal@linux:~/Foss/Jsinhalization> java Test
සපුමල් ජයරත්න

Thanks,
Sapumal.

සපුමල් ජයරත්න

unread,
Nov 13, 2007, 11:40:01 AM11/13/07
to Sinhala...@googlegroups.com
On Nov 7, 2007 4:41 PM, එරංග <era...@gmail.com> wrote:
Java සමග ලැබෙන native2acsii උත්සාහ කර බැලුවාද? Java කේත සහ message
bundles සඳහා එය භාවිත කල හැකියි. Swing සඳහා නම් sure නෑ!

Yes, you can use native2ascii to make resource bundles and it works well for Swing as well. This is exactly the same method I used in SinhalaNotepad. See the code and the resource bundles.

Thanks,
Sapumal.

සපුමල් ජයරත්න

unread,
Nov 13, 2007, 11:45:34 AM11/13/07
to Sinhala...@googlegroups.com
On Nov 7, 2007 4:54 PM, Prasan (ප්රසාන්) <prasa...@gmail.com> wrote:
මට හිතෙන හැටියට native2acsii තිබෙන්නේ Non-Latin හෝ Non-Unicode
කැරක්ටර්ස් යුනිකේතයට හැරවීමටයි.  http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/native2ascii.html
බලන්න. අපිට තිබෙන ප්රශ්නය මීට වඩා වෙනස් බවයි මගේ හැඟීම.

No, native2ascii is for convert the text to ascii. For example if you have a Sinhala Unicode text file and if you run the native2ascii on it, you will get a file in ascii and the Unicode characters converted to something like /u####/u#### etc.
 
සිංහල IM ජාවා වල ක්රියාත්මක නොවීමේ විශාලම පාඩුව තමයි බොහොමයක්ම ජාවා
IDE ජාවා වලින්ම ක්රියාත්මක වීම (NETBeans, IntelliJ IDEA, Ecclipse)
වගේ.

You can install SinhalaLocale and Sinhala input method in the VM and then can use Sinhala in Eclipse and other IDEs.

Thanks,
Sapumal.

සපුමල් ජයරත්න

unread,
Nov 13, 2007, 11:57:53 AM11/13/07
to Sinhala...@googlegroups.com
You are correct. If you need to know how to use Sinhala you can only study the contents of SinhalaNotepad.jar. But if you need to learn how the Locale and Input method were implemented then you should see the contents of the SinhalaLocale.jar and SinhalaStandardIM.jar. Each file has the source code bundled in them.

Thanks,
Sapumal.

සපුමල් ජයරත්න

unread,
Nov 13, 2007, 12:00:39 PM11/13/07
to Sinhala...@googlegroups.com
On Nov 8, 2007 5:42 PM, එරංග <era...@gmail.com> wrote:
නැහැ, native2acsii තිබෙන්නේ native-encoded කැරක්ටර්ස් Unicode-encoded
කැරක්ටර්ස් වලට පරිවර්තනය කිරීමයි.

උදා.
ජාවා -> \u0da2\u0dcf\u0dc0\u0dcf

මෙසේ web applications වල ඇති resource bundles මෙන්ම සිංහල ටෙක්ස්ට්
ස්ට්රින් එකක් ඇති ජාවා කේත ගොනුද native2acsii මගින් Unicode-encoded
කැරක්ටර්ස් බවට පත්කර භාවිතා කල හැකියි. ඉතින් native2acsii භාවිතයෙන්
සිංහල ටෙක්ස්ට් ස්ට්රින් එකක් ඇති ජාවා කේතයක් compile කර run කල
හැකියි. නමුත් එය swing applications වලට හරි යයිද දන්නේ නෑ.

You are correct. This works for swing as well. Unzip the SinhalaNotepad.jar and check the files ending with *.properties. They are such resource bundles. Then menus in the Sinhala Notepad getting populated from those files.

Thanks,
Sapumal.

සපුමල් ජයරත්න

unread,
Nov 13, 2007, 12:27:25 PM11/13/07
to Sinhala...@googlegroups.com
On Nov 13, 2007 8:06 PM, Prasan (ප්රසාන්) <prasa...@gmail.com> wrote:
සපුමල්ගේ උපදෙස් ඒ අයුරෙන්ම ක්රියාත්මක කළා. (භාවිතා කරන්නේ jdk1.6.03
ෆෙඩෝරා 7). සිංහල නෝට්පෑඩ් වල සිංහල පෙනෙන්නේ ප්රධාන මෙනුවේ පමනයි.
ටයිප් කරන දේ පේන්නේ නෑ. තිර පිටපත බලන්න.
http://groups.google.com/group/Sinhala-Unicode/web/Screenshot-Untitled+-+Sinhala+Note+Pad.png

When I develop the Sinhala Notepad I resembles the exact functionality of the Windows Notepad. As you know Windows notepad does not allow you to have several fonts in the document. When you change the font all the text converted to the selected font.

So in your case the initial font which has already been set should be an English font. So using the menu you can set whatever font you like. So open the font dialog box and select a Sinhala font. Then you should be able to see the text in Sinhala.

I have developed improved version of this which resembles the functionality of the Windows Wordpad. I think it is not fully finished. I will check that.


පසුව මම ස්විංග් වලින් කුඩා ඇප්ප්ලිකේශන් එකක් ලිව්වා. (කරුණාකර ඇමුණුම
බලන්න.) එහිත් ඇප්ප්ලිකේශන් ටයිටල් බාර් එකේ සිංහල දිස්වන මුත් ටෙක්ස්ට්
ලේබල් එකක සිංහල දිස්වන්නේ නැහැ.

http://groups.google.com/group/Sinhala-Unicode/web/Screenshot-%E0%B6%86%E0%B6%BA%E0%B7%94%E0%B6%B6%E0%B7%9D%E0%B7%80%E0%B6%B1%E0%B7%8A+.png

මා ලියූ ප්රෝග්රැම් එකේ සෝස් කෝඩ් එක මෙතනින් ලබා ගන්න.

http://groups.google.com/group/Sinhala-Unicode/web/sinhala_unicode_java.zip

You need to set the font for your text boxes and text areas. Unzip the SinhalaNotepad.jar and see the file name Fonts.java . It is the font dialog. You can use the same class with your code.

Have you able to switch to the Sinhala input method and insert Sinhala text? In windows when you click the icon on the left side of the title bar you get a menu which has a menu item for selecting a input method. In Linux you need to use a hot key. See this link, http://javadesktop.org/articles/InputMethod/index.html

Let me know the progress.

This solution for adding Sinhala to Java platform is not completed as it lacks rendering support. When I develop these utilities Java is not open source. I could have implemented the rendering by editing the source available in that time but the license at that time did not allow to distributed the changes(as I remember). So I skiped that. Now as Java is open source you can do it and have complete Sinhala support in Java. If somebody is willing to spend time on that I am very glad to help.

Thanks,
Sapumal.

Prasan (ප්‍රසාන්)

unread,
Nov 13, 2007, 12:31:51 PM11/13/07
to සිංහල යුනිකෝඩ් සමූහය - Sinhala Unicode Group
> > unmappable character for encoding UTF8

ප්‍රශ්නය මතුවුනේ මම වින්ඩෝස් වලින් ලියූ ජාවා කේතයක් (යුනිකෝඩ් නොවේ)
යුනිකෝඩ් වලට හැරවීමේදීයි. අළුතින් ලියන ගොනු සඳහා මේ වෝනින් එක
දිස්වන්නේ නැහැ. කොහොමටත් native2ascii භාවිතයෙන් ප්‍රශ්නය මගහරවා ගත්තා.

> Please tell me the editor and OS you used. It depends whether the tool you
> are using supports Unicode and whether it saves the file in Unicode
> encoding.

මම භාවිතා කරන්නේ
SciTE Version 1.74 එඩිටර් එක
ෆෙඩොරා 7
jdk 1.6.03 (Sun)

scite යුනිකේත සහාය හොඳින් දක්වන බවයි පෙන්නේ. ඔබේ උදාහරණය හොඳින්
කම්පයිල් වෙනවා. නමුත් රන් කිරීමේදී නම් gnome terminal එකේ හරියට පෙන්නේ
නැහැ. හැබැයි ප්‍රෝග්‍රැම් එකේ අවුට්පුට් එක ටෙක්ස්ට් ෆයිල් එකකට රී-
ඩිරෙක්ට් කෙරූවිට හොඳින් පේනවා. තිර පිටපත බලන්න

http://groups.google.com/group/Sinhala-Unicode/web/java+compilation.png

කොහොම වුනත් ස්විංග් ඇප්ප්ලිකේශන් වල නම් ප්‍රශ්නයක් ඇති බවයි පේන්නේ.
පසුගිය පෝස්ට් එකේ ඇති තිර පිටපත් පිරික්සන්න.

ස්තුතියි

Tyronne Wickramaratne

unread,
Nov 13, 2007, 12:38:19 PM11/13/07
to Sinhala...@googlegroups.com
On Nov 13, 2007 11:01 PM, Prasan (ප්රසාන්) <prasa...@gmail.com> wrote:
> > unmappable character for encoding UTF8

ප්රශ්නය මතුවුනේ මම වින්ඩෝස් වලින් ලියූ ජාවා කේතයක් (යුනිකෝඩ් නොවේ)
යුනිකෝඩ් වලට හැරවීමේදීයි. අළුතින් ලියන ගොනු සඳහා මේ වෝනින් එක
දිස්වන්නේ නැහැ. කොහොමටත් native2ascii භාවිතයෙන් ප්රශ්නය මගහරවා ගත්තා.

> Please tell me the editor and OS you used. It depends whether the tool you
> are using supports Unicode and whether it saves the file in Unicode
> encoding.

මම භාවිතා කරන්නේ
SciTE Version 1.74 එඩිටර් එක
do you have any specific reason for not to use Eclipse ?

ෆෙඩොරා 7
jdk 1.6.03 (Sun)

scite යුනිකේත සහාය හොඳින් දක්වන බවයි පෙන්නේ. ඔබේ උදාහරණය හොඳින්
කම්පයිල් වෙනවා. නමුත් රන් කිරීමේදී නම් gnome terminal එකේ හරියට පෙන්නේ
yes.. that's a known issue, it's not getting rendered on gnome-terminal. 

නැහැ. හැබැයි ප්රෝග්රැම් එකේ අවුට්පුට් එක ටෙක්ස්ට් ෆයිල් එකකට රී-
ඩිරෙක්ට් කෙරූවිට හොඳින් පේනවා. තිර පිටපත බලන්න

http://groups.google.com/group/Sinhala-Unicode/web/java+compilation.png

කොහොම වුනත් ස්විංග් ඇප්ප්ලිකේශන් වල නම් ප්රශ්නයක් ඇති බවයි පේන්නේ.
පසුගිය පෝස්ට් එකේ ඇති තිර පිටපත් පිරික්සන්න.
i'm sorry, i haven't used locales in java... time is the key.. :(
ස්තුතියි

it's interesting to see that you guys are using java .. keep going .. :)


--
/usr/local/tyronne
http://labs.jboss.com/jbossmessaging/
ändern ist gewesen geändert worden

සපුමල් ජයරත්න

unread,
Nov 13, 2007, 12:39:39 PM11/13/07
to Sinhala...@googlegroups.com
scite යුනිකේත සහාය හොඳින් දක්වන බවයි පෙන්නේ. ඔබේ උදාහරණය හොඳින්
කම්පයිල් වෙනවා. නමුත් රන් කිරීමේදී නම් gnome terminal එකේ හරියට පෙන්නේ
නැහැ. හැබැයි ප්රෝග්රැම් එකේ අවුට්පුට් එක ටෙක්ස්ට් ෆයිල් එකකට රී-
ඩිරෙක්ට් කෙරූවිට හොඳින් පේනවා. තිර පිටපත බලන්න

http://groups.google.com/group/Sinhala-Unicode/web/java+compilation.png


Here, your Java application correctly output Sinhala Unicode. But in you Linux shell the Sinhala rendering is not working properly. This is same in my case. The terminal is not perform Sinhala rendering. But when I copy the output from the terminal and put into my mail it rendered the text correctly. So we need not to worry about this. See my other mails about swing.

Thanks,
Sapumal.

Prasan (ප්‍රසාන්)

unread,
Nov 13, 2007, 12:56:02 PM11/13/07
to සිංහල යුනිකෝඩ් සමූහය - Sinhala Unicode Group
සපුමල් ඔබේ දෙවන පිලිතුර පසුවයි දැක්කේ. සමාවෙන්න.

සිංහල ඉන්පුට් මෙතඩ් සහ අකුරු දෙකම වැඩ. තිර පිටපත බලන්න.

http://groups.google.com/group/Sinhala-Unicode/web/sinhala-notepad.png

මට දැන් තමයි තේරුනේ ජාවා වල ඉන්පුට් මෙතඩ් මෙහෙයුම් පද්ධතියේ ඉන්පුට්
මෙතඩ් වලින් ස්වායත්තයි කියලා. ඔබේ ඉන්පුට් මෙතඩ් එක විජේසේකරද? ( මට ඒක
පුරුදු නැහැ. තිරපිටපතේ වචනයක්වත් ලියා ගන්න බැරි වුනේ ඒ නිසයි)

එකම ටෙක්ස්ට් ඒරියා එකක භාෂා දෙකක් තිබීමට නොහැකිද? (because u have to
set the font for each text area?)

>Now as Java is
>open source you can do it and have complete Sinhala support in Java. If
>somebody is willing to spend time on that I am very glad to help.

මට මේ ගැන බොහෝ දේ ඉගෙන ගැනීමට ඇති මුත් උත්සාහ කිරීමට කැමතියි.

ස්තුතියි

සපුමල් ජයරත්න

unread,
Nov 13, 2007, 1:42:36 PM11/13/07
to Sinhala...@googlegroups.com
On Nov 13, 2007 11:26 PM, Prasan (ප්රසාන්) <prasa...@gmail.com> wrote:
සපුමල් ඔබේ දෙවන පිලිතුර පසුවයි දැක්කේ. සමාවෙන්න.

සිංහල ඉන්පුට් මෙතඩ් සහ අකුරු දෙකම වැඩ. තිර පිටපත බලන්න.

http://groups.google.com/group/Sinhala-Unicode/web/sinhala-notepad.png

Great.

මට දැන් තමයි තේරුනේ ජාවා වල ඉන්පුට් මෙතඩ් මෙහෙයුම් පද්ධතියේ ඉන්පුට්
මෙතඩ් වලින් ස්වායත්තයි කියලා. ඔබේ ඉන්පුට් මෙතඩ් එක විජේසේකරද? ( මට ඒක
පුරුදු නැහැ. තිරපිටපතේ වචනයක්වත් ලියා ගන්න බැරි වුනේ ඒ නිසයි)

Yes, Swing is very different from running other applications. You do not inherit operating system related settings. Usually if OS set to a particular locale it is also used by other programs as well. But Java programs run on the virtual machine. It is like a mini OS and you can set the locale, input method etc in VM. But there are some bridges where you can use system input methods. But I was unable to use any other Sinhala input method which get installed on host OS to type Sinhala on Swing components. That is why an pure Java implementation is useful.

The input is based on 'Sinhala Standard Keyboard' which documented in SLS 1134 standard. It is 99% Wijesekara, but has some differences.

එකම ටෙක්ස්ට් ඒරියා එකක භාෂා දෙකක් තිබීමට නොහැකිද? (because u have to
set the font for each text area?)

You can. But as you see I use single method to set the font of the entire text area. You can even write a word processor using the text area but then the programming gets really complected. I will check the Wordpad implementation and try to fix it and have a working version and check in to Sourceforge. Then you can get it and improve on that.

>Now as Java is
>open source you can do it and have complete Sinhala support in Java. If
>somebody is willing to spend time on that I am very glad to help.

මට මේ ගැන බොහෝ දේ ඉගෙන ගැනීමට ඇති මුත් උත්සාහ කිරීමට කැමතියි.

This is really great. The time is very crustal for me. But I can give all required guidelines to finish the task. Please create an Sourcefoge account and join the jsinhalization project and lets continue the rest there.

Thanks,
Sapumal.

Prasan (ප්‍රසාන්)

unread,
Nov 13, 2007, 9:12:36 PM11/13/07
to සිංහල යුනිකෝඩ් සමූහය - Sinhala Unicode Group

> But I was unable to use any other Sinhala input method which get
> installed on host OS to type Sinhala on Swing components. That is why an
> pure Java implementation is useful.

සිස්ටම් IM එක හොඳට වැඩ කරනවා. මට පලමුවෙන්ම ඒක සොයා ගැනීමට නොහැකි වුනේ
ෆොන්ට් ප්‍රශ්නය නිසයි. ෆොන්ට් එක මරු කල පසු ෆෙඩෝරා IM එක හොඳින් වැඩ.
හැබැයි ZWJ නම් වැඩ නැහැ. කරුනාකර තිර පිටපත බලන්න.

http://groups.google.com/group/Sinhala-Unicode/web/notepad-with-system-IM.png


> You can. But as you see I use single method to set the font of the entire
> text area. You can even write a word processor using the text area but then
> the programming gets really complected. I will check the Wordpad
> implementation and try to fix it and have a working version and check in to
> Sourceforge. Then you can get it and improve on that.

අපි වින්ඩෝස් නෝට්පෑඩ් හෝ ඕනෑම වින්ඩෝස් හෝ GTK ටෙක්ස්ට් ඒරියා එකක්
සැලකුවහොත් (ලේබ්ල් එකක් පවා) ෆොන්ට් සෙට් කිරීමකින් තොරව යුනිකේත සහාය
දක්වනවා නේද? ටෙක්ස්ට් ස්ට්‍රින් එකක එකිනෙකට වෙනස් භාෂාවන් කිහිපයක්
ඇතිවිට මෙහෙයුම් පද්ධතිය අවශ්‍ය ෆොන්ට් එක තෝරා ගන්නවනේ. ඒ
ක්‍රියාකාරීත්වය ජාවා වලත් ඇති කිරීමට පුලුවන් නම් හොඳයි.

> This is really great. The time is very crustal for me. But I can give all
> required guidelines to finish the task. Please create an Sourcefoge account
> and join the jsinhalization project and lets continue the rest there.

ස්තුතියි සපුමල් මම එසේ කරන්නම්. මේ පණිවිඩය සමූහයටම යැව්වේ මෙහෙයුම්
පද්ධතියේ IM එක ජාවා වලත් හොඳින් ක්‍රියා කල නිසයි. සමහර විට එය සමූහයට
අළුත් පණිවිඩයක් වීමටත් පුලුවන්.

නැවතත් ස්තුතියි

සපුමල් ජයරත්න

unread,
Nov 14, 2007, 1:29:07 AM11/14/07
to Sinhala...@googlegroups.com
ෆොන්ට් ප්රශ්නය නිසයි. ෆොන්ට් එක මරු කල පසු ෆෙඩෝරා IM එක හොඳින් වැඩ.
හැබැයි ZWJ නම් වැඩ නැහැ. කරුනාකර තිර පිටපත බලන්න.

http://groups.google.com/group/Sinhala-Unicode/web/notepad-with-system-IM.png

This is a good news. I haven't tested this in Linux. But I couldn't able to do this in a Windows machine where the Sinhala XP kit is installed. I will double check that. If we can type Sinhala on Swing components using a Sinhala input method installed on the OS, there is no need for a separate IM for Java VM. But it will help if you want to bundle your input method with you VM and bundle the VM with your product. Then irrespective of the Sinhala support in OS your product will work in Sinhala.


අපි වින්ඩෝස් නෝට්පෑඩ් හෝ ඕනෑම වින්ඩෝස් හෝ GTK ටෙක්ස්ට් ඒරියා එකක්
සැලකුවහොත් (ලේබ්ල් එකක් පවා) ෆොන්ට් සෙට් කිරීමකින් තොරව යුනිකේත සහාය
දක්වනවා නේද? ටෙක්ස්ට් ස්ට්රින් එකක එකිනෙකට වෙනස් භාෂාවන් කිහිපයක්
ඇතිවිට මෙහෙයුම් පද්ධතිය අවශ්ය ෆොන්ට් එක තෝරා ගන්නවනේ. ඒ
ක්රියාකාරීත්වය ජාවා වලත් ඇති කිරීමට පුලුවන් නම් හොඳයි.

There are several ways to do that. Any Swing component can display HTML. You can define the font in the HTML code. I haven't done it but I guess it should work. But I am sure that there is a different way where you create an object of a particular class and define text and everything related to text attribute and then assign that object to the Swing component. I don't remember the class names but you can find it in Java tutorials.

Thanks,
Sapumal.
Reply all
Reply to author
Forward
0 new messages