Help with my Sinhala Keyboard

I designed a Sinhala phonetic keyboard for Windows computers using the Keyman Developer. In the process I encountered a problem which I will describe below. I hope somebody who met a similar problem in his/her own design would kindly advise me.

I have to first explain a little about how Sinhala is written. Sinhala alphabet has a set of consonants. To these consonants various small appendages (diacritics) are added to get different vowel sounds of that consonant. For example, take the consonant for the sound “k”. The Sinhala letter is really for the sound “ka”. To make the letter to take other vowel sounds diacritics are added to that letter, thus making the sounds “ki”, “ku”, “ke”, “ko” etc respectively. I think this feature is found in many Asian languages.

My problem is that there are three diacritics which have not been included in the Unicode for Sinhala. Therefore I cannot include them in my Keyman keyboard. The Sinhala fonts I am using include these diacritics, but as I find no feature in the Keyman Developer that allows me to add any diacritic or character not in the Unicode.

I am using the version 11 of the Keyman Developer and the font systems “Iskola Potha” or “Abhaya Libre”.

I would be grateful to someone for advising me, as without those diacritic signs, my keyboard is not complete.

1 Like

Can you give a link to one of the fonts and a screenshot of the missing diacritics? I would be very surprised if Sinhala is missing characters in Unicode unless this is for a smaller language group.

Thank you Lorna, for the email. My reply is as follows:

  1. Link to Abhaya Libre font. I am sorry that I cannot include a link. I attempted several times to give the link, but each time it is blocked by the SIL server. They do not permit new users to post links in posts. I have to trouble you to find the Abhaya Libre font in Github. Sorry for the extra inconvenience.

  2. Two of the missing diacritics are given in the attached screenshot. Third one is not that important and can be ignored for the present. The first diacritic is more or less a semicircle placed below the consonant. For all the consonants it retains this relative position. The second diacritic is a complex shape placed after the consonant.

I hope the information provided meets the data you requested. Please let me know if any more information is required.

As to your observation, the missing diacritics belong to the main Sinhala alphabet, not a regional or a minority one. It is surprising that the committee that coordinated the inclusion of Sinhala to Unicode opted to omit these two. As a result now we are compelled to use workarounds that look crude and uneducated.

Thank you for offering to help me.

Best regards

P.C. Senaratne

diacritics.png

1 Like

Ok, I’m not real familiar with the Sinhala script, but I did look at another keyboard and at Unicode. To get what you are looking for your keyboard would need to output the following for those two examples:

U+0D9A U+0DCa U+200D U+0DBB
U+0D9A U+0DCa U+200D U+0DBA

ක්‍ර
ක්‍ය

In Unicode they chose not to encode all the potential glyphs. They encode the main characters. U+0DCA is your virama and U+200D is a ZERO WIDTH JOINER, so with both of those you could get the output you are looking for.

1 Like

Thank you for your response. I will try it and let you know if it doesn’t work.

Best regards

1 Like

Since my last message, I have acted upon your advice and the keyboard works fine, with all the glyphs in place. Thanks for your help.

I tried to compile the keyboard so that I can check it on another computer, other than the PC on which it was developed. This, I wanted to check for any bugs in a different computer. I went through all the steps given in the help tutorial for compilation. The keyboard compiled to a small “.kps” file and a bigger “.kpm” file. Tried to install in another computer, but it does not recognise it as an installable file, Did I miss something? Or is there some other method of installation? Can you please help me on this?

A screen shot of the files list is shown below.

image

With best regards.

I’m sorry we’ve been so slow in responding. The .kmp file is what should be distributed. It is only installable though if people first install Keyman Desktop from here: https://keyman.com/downloads/

After installing Keyman Desktop (and possibly rebooting), THEN they can double-click on the .kmp file and it should install the keyboard. The .kps file is not a compiler, it is part of the source that you used in creating the .kmp.

1 Like

Thank you for your kind advice.

With kind regards.

1 Like

Pl to down loard kyemak typing softwere

Hi Chandrasiri. Welcome to the community. Can you tell me which Sinhala keyboard you are referring to?

These two keyboards are based on Windows layouts:
https://keyman.com/keyboards/basic_kbdsw09
https://keyman.com/keyboards/basic_kbdsn1

We have another keyboard here: Garp Sinhala 7.2.0 keyboard
All of these keyboards can be downloaded and then installed from these links. They also all have help files that you can access from those pages. I hope one of these will be helpful to you.

If you don’t actually want a Sinhala keyboard, but are just looking to download Keyman, you can go here: https://keyman.com/
Click on “Products” and then choose which application you would like to use.

If you want to develop a keyboard, you can go here: Keyman Downloads and go to the bottom and choose “Keyman Developer”.

Sorry to be returning after a long lapse. Completed the Sinhala keyboard long time back, but lost everything when my laptop was stolen. I almost completed the keyboard once again with the help of an early listing, but cannot recall how I implemented two things.

First, I cannot remember how the lost keyboard implemented the seven ligatures. Tried various methods but was unsuccessful.

Second, there is a glyph called “Repaya” - something looks like an ampersand, but smaller - that is placed atop a consonant to signify a preceding ‘R’ sound. That also I had implemented, but cannot recall how.

If it is helpful I can send illustrations and other details please.

Best regards
prabhath

@prabhath First of all, I am very sorry to hear about your computer troubles and losing your work on the keyboard! I know that is awful to lose all that work. Unfortunately, without a backup or someone who also has your source files, I cannot help you to recover your work. This is one reason we really like people to put their keyboards in the Keyman repository so that the keyboard is always available even with computer loss.

For the “Repaya”, I think this little sign above is what your are referring to?
image

I did find this page: Ambiguities in parsing Sinhala named sequences (repaya, Yansaya and Rakararnasaya) · Issue #6 · akuru/sinhala-unicode-technical · GitHub
and it says “Repaya” is created with these codepoints:
SINHALA CONSONANT SIGN REPAYA; 0DBB 0DCA 200D

I hope this helps.

Also, we do have some Sinhala keyboards already which you might find useful. For the first two, you can look at the code for the keyboard and it may help you recreate what you need.

https://keyman.com/keyboards/basic_kbdsw09
https://keyman.com/keyboards/basic_kbdsn1
https://keyman.com/keyboards/garpsinhala
https://keyman.com/keyboards/helabasauni
https://keyman.com/keyboards/sipon%20phonetic%20sinhala

@Lorna

Thank you for the prompt reply. I will try your suggestions.
Merry Christmas!

Best regards

Hi Lorna,

First let me wish you all at the SIL a very happy 2024!

The suggested code works for the glyph REPAYA. Thank you for that.

However the keyboards sent by you seem not to have implemented any ligatures. I went through the codes available during the holiday period and my search failed to find anything.

I was able to implement seven ligatures in my lost keyboard. I am showing some examples below:

U+0DAD

U+0DC0

The ligature is - ත්‍ව

U+0DB1

U+0DAF

The ligature is - න්‍ද

I experimented with the ZWJ and the Sinhala "Hal" glyph (U+0DCA) in various permutations but could not achieve the ligatures. I would be glad for some advice please.

Best regards.

Happy 2024 to you also!

I think it depends on the font whether there are ligatures, doesn’t it? If you want to achieve the codepoints in the ligatures you mention above you can use the basic_kbdsn1 keyboard and type:

The ligature is - ත්‍ව (:a\j)

The ligature is - න්‍ද (ka\o)

Since I’m not very familiar with Sinhala, I cannot suggest a good font. Also, if you are wanting to just type one key to access the ligatures you will probably have to tackle creating your own keyboard once again, but in general I think at least the first two keyboards I listed above have all the individual keystrokes.

I’m very sorry about that!

@Lorna Thank you for the reply. I think I have not made myself clear. Please permit me to be more specific.

  1. I have implemented a working version of my lost keyboard once again. I used a hardcopy of an early version of the keyboard to build upon and implemented the logic I used for the lost version from memory. Now I am almost there except for the ligatures. If I get that small bit my keyboard will be complete.

  2. Sinhala typewriter keyboard has a traditional layout named Wijesekara keyboard. The keyboards suggested by you follow that layout. I designed my keyboard phonetically similar to the QWERTY keyboard. That permits us, non career typists to migrate easily from English to Sinhala typing. There are many phonetic keyboards for Sinhala, but many suffer from various inadequacies. That is what compelled me to develop one.

Even without the ligatures I can share my keyboard with others at the present status of development. Yet I like to do the ligatures since I did it once.

Hope I get advice on the ligatures please.

Regards
Prabhath Senaratne

I assume you just need to write rules to output the codepoints that are used to form the ligature. Are you having trouble writing the rules or am I misunderstanding the issue?

This rule with mean the ligature is output if you type RALT+L:

+ [RALT K_L] > U+0DAD U+0DCA U+200D U+0DC0

Or you can use a contextual rule so it processes previous keystrokes which output U+0DAD:

U+0DAD + [RALT K_L] > U+0DAD U+0DCA U+200D U+0DC0

Since am not familiar with your keyboard I don’t know what approach you would favor. The reference guide should prove helpful: Keyman Keyboard Language Reference. Especially look at context.

@Lorna

Thank you for the reply. You have understood my problem. I am looking for the rule that would produce ligatures. Following is an example of one of my attempts for a particular ligature.

U+0D9A + [LALT K_Z] > U+0D9A U+0DCA U+2000 U+0DC2

It is very similar in pattern to to what you suggested. However the test output is as follows:

ක් Instead it shall output the following: ක්‍ෂ

(That ligature was produced by my previous keyboard.)

Rest of the rules also also produce similar discrete characters. For some reason the ZWJ is not having the desired effect. Do you have any suggestions please?

I have the ‘kmp’ file for my previous keyboard. Is it possible to extract the code out of that please?
Best regards.

PC Senaratne

Yes, this is possible. A .kmp file is a zip file, so if you rename it, you’ll be able to use an unzip tool to extract the files from it. One of the files will be a .kmx file, and you can use kmdecomp (command line tool, included with Keyman Developer) to ‘decompile’ it to a .kmn. It won’t be identical to the original source, but will be functionally equivalent.

Your rule uses U+2000 and not U+200d. See if that fixes the issue. Otherwise, yes. We can help you decompile your previous keyboard. You can upload the kmp to Google drive or dropbox and dm me the link if you wish.