How to customize Malayalam fonts in Linux

Now a days GNU/Linux distributions like Ubuntu, Debian, Fedora etc comes with pre-configured fonts for Malayalam. For Sans-serif family, it is Meera and  for serif, it is Rachana. If you like to change these fonts, there is no easy way to do with configuration tools in Gnome or KDE. They provide a general font selector for the whole desktop, but not for a given language.

The advantage of setting these preference at system level is, you don’t need to choose this fonts at application level then. For example, you don’t need to set them for firefox, chrome etc. All will follow the system preferences. We will use fontconfig for this

First, create a file named ~/.config/fontconfig/conf.d/50-my-malayalam.conf. If the folders for this file does not exist, just create them. To this file, add the following content.

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Malayalam (ml) -->
<match target="font">
        <test name="lang" compare="contains">
                <string>ml</string>
        </test>
        <alias>
                <family>sans-serif</family>
                <prefer>
                        <family>Manjari</family>
                </prefer>
        </alias>
</match>

<match target="font">
        <test name="lang" compare="contains">
                <string>ml</string>
        </test>
        <alias>
                <family>serif</family>
                <prefer>
                        <family>Rachana</family>
                </prefer>
        </alias>
</match>

<!-- Malayalam (ml) ends -->

</fontconfig>

Save the file and you are done. You can check if the default font for Malayalam changed or not using the following command

$ LANG=ml_IN fc-match

It should list Manjari. The above code we added to the file is not complicated. You can see that we are setting the sans-serif font preference for ml(Malayalam) language as Manjari. Also serif font preference as Rachana. You are free to change the fonts to whatever you prefer.

Note that you may want to close and open your applications to get this preference applied.

You may choose one of the fonts available at smc.org.in/fonts, download and install and use the above configuration with it.

How to type Malayalam using Keyman 10 and Mozhi

This is a quick tutorial on installing Mozhi input method in Windows 10.

Mozhi is a transliteration based keyboard  for Malayalam. You can type malayaalam to get മലയാളം for example. We will use Keyman tool as the input tool. Keyman input tool is an opensource input mechanism now developed by SIL. It supports lot of languages and Mozhi malayalam is one of that.

Step 1: Download Keyman desktop with Mozhi Malayalam keyboard

Go to https://keyman.com/keyboards/mozhi_malayalam. There you will see the following options to download. Select the first one as shown below. Download the installer to your computer. It is a file about 20MB.

Keyman 10 Desktop download page.

Step 2: Installation

Double click the downloaded file to start installation. The installer will be like this:

Keyman 10 Desktop installer

Click on the Install Keyman Desktop button. You will see the below screen.

Keyman 10 Desktop welcome page.

 

Press the “Start keyman” button. The installation will start and keyboard will start.

Step 3: Choose Mozhi input method

You will see a small icon at the bottom of your screen, near time is displayed.

Click on that to choose Mozhi.

Keyboard selection

Once you chose Mozhi, you can type in Manglish anywhere and you will see malayalam. To learn typing click on the “Keyboard Usage” as shown above.

Step 4: Start typing in Malayalam

You can directly type Malayalam in any application without copy paste. Just like English, start typing. Make sure to use a good Malayalam font. You can get them from https://smc.org.in/fonts/

Using Mozhi in LibreOffice. Notice the font used is Manjari.What I typed is “ippOL enikk malayaalam ezhuthaanaRiyaam”

 

Kindle supports custom fonts

I am pleasantly surprised to see that Amazon Kindle now supports installing custom fonts. A big step towards supporting non-latin content in their devices. I can now read Malayalam ebooks in my kindle with my favorite fonts.

Content rendered in Manjari font. Note that I installed Bold, Regular, Thin variants so that Kindle can pick up the right one

This feature is introduced in Kindle 5.9.6.1 version released in June 2018. Once updated to that version, all you need is to connect the device using the USB cable to your computer. Copy your fonts to the fonts folder there. Remove the usb cable. You will see the fonts listed in font selector.

Kindle had added Malayalam rendering support back in 2016, but the default font provided was one of the worst Malayalam fonts. It had wrong glyphs for certain conjuncts and font had minimal glyphs.

I tried some of the SMC Malayalam fonts in the new version of Kindle. Screenshots given below

Custom fonts selection screen. These fonts were copied to the device
Select a font other than the default one
Content in Rachana.
Make sure to check the version. 5.9.6.1 is the latest version and it supports custom fonts

HOWTO: Wacom Bamboo CTH301K in Debian

This is a short documentation on getting Wacom Bamboo CTH301K working in Debian. I use Debian Sid with Linux kernel 3.16 at the time of writing this. But this should work with latest Ubuntu(14.04 or 14.10) and new kernels.

Wacom Bamboo CTH301K is an entry level touch pad with stylus – you can use it as a mouse, or drawing pad with stylus. It has multitouch features like pinch zoom and all. I got all working.

Eventhough wacom has drivers for their many models in linux kernel, this particular model with device id: 056a:0318 does not have a driver in kernel. When you connect it, you will see it is listed in the lsusb output as
Bus 003 Device 016: ID 056a:0318 Wacom Co., Ltd

But touch or stylus wont work because of missing driver. First step to get stylus working is adding usbhid.quirks=0x056a:0x0318:0x40000000 to the grub boot cmdline. For this, edit /etc/default/grub. Append the above string to GRUB_CMDLINE_LINUX_DEFAULT. In my system it looked like as follows:

GRUB_CMDLINE_LINUX_DEFAULT="quiet init=/bin/systemd usbhid.quirks=0x056a:0x0318:0x40000000"

You need to save this file and run update-grub command to get this updated in grub. There are alternate ways to pass this string to modprob, but this method make sure it works always in every system restart. Once done, you will see the stylus getting detected and working. Touch will not work still-This is because the default wacom driver picked up does not know about this device.

To get touch working, open /usr/share/X11/xorg.conf.d/50-wacom.conf and add MatchIsTablet "on" to the first section of that file. In my machine it looked like

Section "InputClass"
        Identifier "Wacom USB device class"
        MatchUSBID "056a:*"
        MatchIsTablet "on"
        MatchDevicePath "/dev/input/event*"
        Driver "wacom"
EndSection

With this the “evdev” driver will be managing the device’s touch part. Restart your X – like restrarting KDM or GDM. Or just restart the machine.

You will see stylus and touch working now. You may need to use xsetwacom command to adjust the preferences, but you can find documentation of that elsewhere.

The above method also works with wireless model, just replace the device id 0x056a:0x0318 with 0x056a:0x0319

 Update

  • 24/04/2015: Bamboo Pad pen support accepted into Linus’ repository on the “master” branch (commit 61e9e7e). Expected release: Linux 4.0.
  • Bamboo Pad touch support accepted into Jiri’s HID repository on the “for-4.1/wacom” branch (commit 8c97a76). Expected release: Linux 4.1.