Linux, Unicode, and Armenian Language support

Have you installed Linux and not sure how to type in Armenian? Are you not happy with the available Unicode fonts or keyboard layouts for the Armenian language? Then read on...

Sunday, September 24, 2006

New Armenian Keyboard Layouts posted to FreeDesktop.org
I'm happy to report that the new keyboard layouts for Armenian have been incorporated into FreeDesktop.org. (Thank you Sergey Udaltsov who committed the changes to the XKeyboard Configuration component.) What does this mean? With XKeyboard Config being the de facto central repository for Linux keyboard layouts, you should expect to see the new Armenian keyboard layouts in a future release of your Linux distro soon!

You can view the new configuration file for the Armenian keyboard layouts by clicking here (Select the "am" file)

And here is the original bug I filed within FreeDesktop.org to get these changes in: https://bugs.freedesktop.org/show_bug.cgi?id=8404

cheers

Wednesday, September 20, 2006

Installing the new Armenian Keyboard layouts for GNU/Linux
In a previous post, I described the 3 new keyboard layouts I created for the Armenian language. This post describes how to install these on your system. (I tested this on SUSE Linux 10.1 with X.org version 6.9 running GNOME 2.12.2.)

You will need access to the root user to be able to perform the following steps.

1. Open a terminal and change to the root user by typing: su root

2. Depending on your system, cd to /etc/X11/xkb/ or /usr/X11R6/lib/X11/xkb/ (on my system, the latter is a symbolic link to the first)

3. Backup your existing Armenia layout configuration by running: mv symbols/am symbols/am.bak

4. Using your browser, download the new am configuration file from here and save it to symbols/am. Alternatively, cd to the symbols directory and run wget http://webpages.charter.net/aourishian818/am

5. Provide the appropriate permissions on the file by running: chmod 644 symbols/am

6. Now we need to let X (the graphics system) know about the new layouts. In newer versions of X, this is done by editting the \.xml file under /etc/X11/xkb/rules/, where \ is the name of your X implementation. Mine is X.org, so I'll edit xorg.xml. (On my system, both xfree86.xml and xorg.xml are symbolic pointers to the same file, base.xml). Search for the string "Armenia" in this file. This should appear in a <description> tag which is a grandchild of a <layout>. Delete this <layout> tag that describes the Armenia layout and substitute it with the XML snippet located here. Save and close the file.

5. Restart X by typing Ctl + Alt + Backspace, then run startx at the command prompt.

6. You can now configure the Keyboard Indication (see my previous post) with the new keyboard layouts.

Enjoy, and leave me any comments if you have trouble with the above.

I plan to get this into the necessary projects (most likely X.org and XFree86) so that your next Linux distro will contain a robust Armenian language support.

New Armenian keyboard layouts for GNU/Linux

I wasn't satisfied with the keyboard layout for the Armenian language that came by default in my X Windows setup for SUSE Linux 10.1. I only got a single layout, Phonetics, which was close to the Eastern Armenian layout on Windows XP, but not quite that.

I wanted the same 2 options that I got in Windows XP: Eastern Armenian and Western Armenian layouts.

After a night of tinkering, I created three new layouts, Armenian (eastern), Armenian (western), and Armenian (easter, WinXP).

1. Armenian (eastern)
This layout is the same as the Eastern Armenian layout that comes with Windows XP, with the following exceptions:

a. The mappings for 'g' and 'c' have been reversed. I suspect this was a bug in the Windows XP Eastern Armenian layout, because 'g' more closely matches the Armenian letter գ (pronounced 'gim' in Eastern Armenian) than does 'c', and because 'c' more closely matches the Armenian letter ք (pronounced 'keh' in Eastern Armenian.

b. Keycode AE01 (the number 1) which maps to a colon in the XP layout has been mapped to the Unicode Armenian_full_stop.

c. The capital AE07 (the ampersand, &) which maps to "ken" in the XP layout hase been mapped to the Unicode Armenian ligature ew


2. Armenian (western)
This layout is the same as the Western Armenian layout that comes with Windows XP, with the following exceptions:

a. Keycode AE01 (the number 1) which maps to a colon in the XP layout has been mapped to the Unicode Armenian_full_stop, ։.

b. The Shift + AE07 (the ampersand, &) which maps to "ken" in the XP layout hase been mapped to the Unicode Armenian ligature ew, և.


3. Armenian (eastern, WinXP)
I included this layout for those who still want to use the original Eastern Armenian layout from Windows XP, which includes the bug described above. Therefore, this layout is the same as the Eastern Armenian layout that comes with Windows XP, with the following exceptions:

a. Keycode AE01 (the number 1) which maps to a colon in the XP layout has been mapped to the Unicode Armenian_full_stop, ։.

b. The capital AE07 (the ampersand, &) which maps to "ken" in the XP layout hase been mapped to the Unicode Armenian ligature ew, և.

Stay tuned for the next article on how to install these new keyboard layouts on your system.

Setting up SUSE Linux 10.1 to access a Windows XP (NTFS) partition
Having followed the instructions below, you should be able to have full access (read, write, edit, create files) to your Windows XP partition formatted with NTFS.
  1. Ensure that the FUSE kernel module is automatically loaded

  2. Put the below line into /etc/fstab

    /dev/hda1 /mnt/windows ntfs-3g defaults 0 0
  3. Reboot to test.

  • Optionally, Add Shortcut on the desktop to your Windows partition by executing the following on a command line:

ln -s /mnt/windows/ ~/Desktop/Windows

  • Optionally, Add a bookmark in Nautilus for /mnt/windows using Nautilus's bookmark feature

Installing Unicode fonts into GNU/Linux

I wasn't satisfied with the default fonts that came with my SUSE Linux 10.1 distribution. In particular, I wanted the Sylfaen font which is my preferred font for the Armenian language.

This article will explain how to install fonts from your Windows XP system (assuming you have a purchased copy) into your X Window system under SUSE Linux 10.1 (I am running X.org version 6.9). You may have to switch to the root user, by doing a "su root" or running commands via "sudo".
  1. If you have mounted your hard disk partition containing Windows XP, you can skip this step (see this post if you'd like to learn how). Otherwise, proceed to save the following fonts from your C:\WINDOWS\Fonts directory to CD, floppy disk, or USB (you can choose more or less):

      arial.ttf, sylfaen.ttf, tahoma.ttf, tahomabd.ttf, times.ttf, verdana.ttf

  2. Copy the fonts to the /usr/X11R6/lib/X11/fonts/local directory.
  3. Run SuSEConfig from a terminal.

GNU/Linux: Typing in Armenian using GNOME

The following instructions should work for any GNU/Linux distribution running GNOME (my version is 2.12.2); I'm running SUSE Linux 10.1 and GNOME is the default desktop for this distro.)

1) Add the Keyboard Indicator applet to your Panel:
  1. Right-click on a whitespace in your panel (the panel is the rectangular space on the bottom of your screen, holding the Start Menu, Applications, etc.)
  2. Select "Add to Panel" --> "Keyboard Indicator" --> "Add"
  3. You should now see a new applet with the current keyboard layout being used (mine says USA)

2) Configure the Keyboard Indicator Applet:
  1. Right click the new Keyboard Indicator applet --> Select "Open Keyboard Preferences" --> "Layouts" tab --> "Add" button --> Expand the "Armenia" node
  2. You now see all the keyboards installed in your X Window system. Mine only came with one out-of-box layout for Armenian: "Phonetic". Select that for now and click "OK". (In an upcoming post, I'll show you how to add new layouts for the Armenian language. For now, let's continue.)
  3. Optionally, if you want to configure how you will toggle layouts (e.g. between US English and Armenian), click the Layout Options tab. Expand the "Group Shift/Lock behavior" and select your preferences. (Since I like to switch layouts with the Alt + Shift command, I only selected the "Alt+Shift changes group" checkbox.)
  4. Click Close once you're done
3) Using the Keyboard Indicator Applet:
  1. The Keyboard Indicator applet is now configured. You can switch between keyboard layouts by simply left-clicking on the Keyboard Indicator applet, or by using the keyboard sequence you specified in step 2.3. Mine now says "USA". I click once, and it switches to "Arm".
  2. Open your favorite text editor or word processor and start typing in Armenian (along with any other language in the *same* document).

Caveats:
  • Make sure to save your files in UTF-8 formatting, because the Armenian characters are in Unicode format, and saving files containing them in anything other than a Unicode file formate (such as UTF-8) will lead to loss of data.
  • If you're seeing rectangular characters when you type in Armenian, make sure you first select a font that has defined Unicode characters in the Armenian language range. (My preference is the Sylfaen font which comes with Windows XP. In an upcoming entry, I'll describe how to add this font to your Linux/X Window system.)