Showing posts with label ខ្មែរយូនីកូដ. Show all posts
Showing posts with label ខ្មែរយូនីកូដ. Show all posts

Tuesday, November 27, 2018

Khmer Unicode Problems in newer Linux distros

TL;DR

Type the following command into Terminal:

im-config -n xim

Log out and log back in for the changes to take effect.


The Full Version

I noticed recently that the problems with Khmer vowels appear again in new versions of Linux distros, including the popular Ubuntu and its derivatives like elementaryOS which I’m currently using. The vowels in question are:

Shift + A ាំ (Srak Arm)
Shift + Semicolon (;) ោះ (Srak Orss)
Shift + V េះ (Srak Ess)
Comma (,) ុំ (Srak Om)
Shift + Comma (,) ុះ (Srak Oss)

The problem is that, instead of outputting the intended vowels, square block or nothing at all is outputted.

A widely-shared workaround to resolve this problem is to add entries for these vowels in /usr/share/X11/locale/$LANG/Compose:

#
# Khmer digraphs
#
<U17ff> : "ាំ"
<U17fe> : "ោះ"
<U17fd> : "េះ"
<U17fc> : "ុំ"
<U17fb> : "ុះ"

NOTE: At the time of writing it seems that most distros already include these bindings.

Plus, you need to fallback to the legacy input method xim, which respects the aforementioned Compose file, by adding the following line in /etc/environment:

GTK_IM_MODULE=xim

All is well and good, right? Unfortunately, no. As of late, most Linux distros are shipped with the popular ibus as the default input method, and the current version of ibus (1.5.17) does not support multi-character Compose key output (the 5 Khmer vowels are multi-character), so the previous method no longer works even with GTK_IM_MODULE=xim in the /etc/environment file.

A solution to this is to force the default input method of the system to xim:

im-config -n xim

I found out that just using this command will make the Khmer Unicode compose key bindings work again in GTK applications without any need to modify the /etc/environment file.

Wait, only GTK applications? Yes, QT applications still don’t seem to work correctly with multi-character Compose key output, at least not the applications I tested with:

  • VLC Media Player
  • VirtualBox
  • TeamViewer
  • WPS Office
Strangely, even forcing QT_IM_MODULE=xim doesn’t help either.

Please keep in mind that xim is very old and will most likely be completely removed in the future as other input methods are more stable. That being said, until ibus gains support for multi-character Compose key output, xim is still a valid band-aid to this annoying problem. In the meantime, you can also take a look at other input methods like uim which has better legacy support with xim and multi-character Compose key output. I tested uim and it seems to work out of the box with the 5 Khmer vowels. The only problem is that it’s not included by default in most distros, so you have to install it manually.

Hopefully this will make your Linux adventure with Khmer Unicode better, and if you have a different method to make Khmer Unicode support works better on Linux, please let me know.

Wednesday, February 4, 2015

Changing default Khmer system fonts on Windows 8.1

Khmer UI was first introduced in Windows Vista and has served since then as the default Khmer fonts for the Windows User Interface.

Khmer UI

Due to the its difficult legibility, the team behind Khmer Unicode (NiDA) introduced Khmer fonts fixer for Windows Vista and Windows 7 (which should also work for Windows 8) in order to replace Khmer UI fonts with Khmer OS Sytem font.

However, in Windows 8, this method doesn't work anymore most likely due to Microsoft's deeper integration of system fonts. In fact, Microsoft has used another font which is actually a combination of three typefaces: Thai, Lao and Khmer. The result font file is called Leelawadee UI (which can be found in the Fonts folder in Windows).

Tuesday, January 27, 2015

Khmer Fonts for iOS 8

Starting from iOS 8, Apple has integrated Khmer language into its mobile operating system, most likely due to a huge amount of requests from Khmer people led by 4khmeriphone team which has been making Khmer Unicode keyboards and Khmer language available to iOS users since the third generation of iOS. I'm sure this brought joys to all Khmer people from every corner of the world.

And I, an iPhone user turned amateur themer/developer, has initially started making Khmer fonts for the jailbroken iOS 7 because I saw very few Khmer fonts on the iOS platform whereas English fonts for iOS were in the hundreds or maybe thousands. So I decided to make a change. So far, I've modified/made several Khmer fonts for iOS 7 and two Khmer fonts for iOS 7.1.x (since it's gotten harder to port Khmer fonts to iOS on this version due to Apple's change of how the system renders fonts). I hosted all these packages on my MyRepospace repository: http://cydia.myrepospace.com/fidele007

Les Symboles Nationaux (1) v2

(L'article ci-dessous est une révision de l'article publié en 2011) Chaque pays a ses symboles nationaux qui montrent la cult...