Bangla in GNU/Linux HOWTO
Prev |  | Next

# 2. Users' Guide

This part is mainly for the user - it does not go into the intricacies of development procedures. However, developers planning to work in this field must also read it - so that they can setup the required develoment environment.

## 2.1. Setting up the locale for Bengali

The first job that you have to do is to setup the locale for Bangla. The formal description of specific set of cultural habits for some country, together with all associated translations targeted to the same native language, is called the "locale" for this language or country. This sub-section describes how to setup the `bn_BD` locale definition file, which is for Bangladeshi Bengali. However, the Indian Bengali definition file, i.e. `bn_IN`, can be used in the same manner.

| Remember that this sub-section is not intended to explain how to create a locale definition file, we will just explain how to use the locale defition file for Bangladeshi Bengali.

The `bn_BD` file should come with the latest glibc package. in case you have an older glibc, you can download this file from the download section of Bengalinux.org.

| Make sure you have some Unicode encoded Bengali fonts installed on your system. If you don't have one, check out fonts section.

Now issue the following command as root:

`bash$` `localedef -f UTF-8 -i bn_BD bn_BD.UTF-8`

This makes your system ready to be used with bn_BD locale definition.

Now make sure your X server is ready for Bengali locale. Check the following file `/usr/X11R6/lib/X11/locale/locale.dir`

It should have the following lines:

        en_US.UTF-8/XLC_LOCALE       bn_BD.UTF-8
        en_US.UTF-8/XLC_LOCALE:      bn_BD.UTF-8

Now your system is ready to use bn_BD.UTF-8 locale. For example, I use the following command to open up an xterm with my own crappy font:

`bash$` `LC_ALL=bn_BD.UTF-8 xterm -fn"-misc-Probhat-medium-r-normal--0-0-0-0-p-0-iso10646-1" -u8`

Remember, if you want to use Bengali in any application, you will have to start that application under an environment where the locale was set to bn_BD.UTF-8, otherwise it won't work.

## 2.2. Installing the Bengali Fonts

### 2.2.1. Installing using the rpm package

If you are a rpm [read: RedHat %#$!@] user, then the easiest way to install the fonts from FBFP is by using the rpm package. The rpm package can be downloaded from http://www.Bengalinux.org/downloads/freebanglafont-0.2-1.noarch.rpm or http://savannah.nongnu.org/files/?group=freebangfont. Just install the rpm package as you would do for any other rpm package with the command

`bash$` `rpm -ivh freebanglafont-0.2-1.noarch.rpm`

### 2.2.2. Installing using individual font file

If you cannot or do not want to use the rpm package, there is always the good old tgz packages. Remember that you should have root privilege when you execute the commands mentioned here.

Download the files you want to install from http://savannah.nongnu.org/files/?group=freebangfont.

| Remember that you will find several different tgz packages in FBFP. Each of them contain different font faces, i.e. they all look different from one another.

Once you have downloaded all the packages you want, extract all the `*.ttf` file(s). Basically run the following command on each `*.tgz` or `*.tar.gz` you have downloaded.

`bash$` `tar -zxvf your_font_package.tar.gz`

This will create a new directory that will contain different files that comes with the font package. We are only interested about the `*.ttf` files.

Create a new directory where you want to install these fonts. For the rest of this document, we will assume we are installing the fonts in `/usr/X11R6/lib/X11/fonts/bengali/`

Copy the `*.ttf` files we just extracted in to this directory, and execute the following commands:

`bash$` `cd /usr/X11R6/lib/X11/fonts/bengali`

`bash$` `ttmkfdir`

`bash$` `mkfontdir`

`bash$` `chkfontpath -q -a /usr/X11R6/lib/X11/fonts/bengali`

Now we will add the new directory to fontconfig configuration. Usually this configuration file is `/etc/fonts/fonts.conf`. Open this file with you choice of text editor and look for the part that looks somewhat like shown below

      <dir>/usr/X11R6/lib/X11/fonts/Type1</dir>
      <dir>/usr/share/fonts</dir>
      <dir>~/.fonts</dir>

Add the line

    <dir>/usr/X11R6/lib/X11/fonts/bengali</dir>

so that now it looks something like this:

      <dir>/usr/X11R6/lib/X11/fonts/Type1</dir>
      <dir>/usr/share/fonts</dir>
      <dir>/usr/X11R6/lib/X11/fonts/bengali</dir>
      <dir>~/.fonts</dir>

After you have saved the file, execute the following command:

`bash$` `fc-cache`

If you have GNOME print library ( libgnomeprint) installed, then execute the following commands:

`bash$` `cd /usr/X11R6/lib/X11/fonts/bengali`

`bash$` `libgnomeprint-2.0-font-install --dynamic`

That should be it! If you have any problem, please let us know at `<users@bengalinux.org>`

## 2.3. Setting up the Bengali keyboard

| The intention of this HOWTO is not to explain what is xkb symbol file, or how to create a new layout, etc. There are tons of places on the web where one can find a better and more in-depth HOWTO about XFree86 keyboard[layout/xkb/etc].

There is nothing special about setting up a Bengali Keyboard, just follow the steps described below. Remember everything you need in the following steps can be downloaded from the download section of Bengalinux.org, except the machine and the OS :-).

| Make sure you have some Unicode encoded Bengali fonts installed on your system. If you don't have one, check out fonts section.

Download the xkb symbol file `ben` and copy it to the directory where the other xkb symbol files are. Usually this would be `/usr/X11R6/lib/X11/xkb/symbols`

| BTW, usually only root can copy files into this directory.

You are now one command away from starting the keyboard. On my system I just type the following command:

`bash$` `setxkbmap -symbols "us(pc101)+ben+group(ctrl_shift_toggle)"`

On your system you are most likely to use a different value for `-symbols`option. Let me explain what they mean, then you can decide what should be the value for your system. My default keyboard layout for X is `us(pc101)`. If you don't know what is the default you use, check the `XF86Config` file As the Bengali keyboard layout is defined in the second group we can simply add everything from `ben` to our keyboard layout. Now you have setup your keyboard with `us(pc101)` as group one and `ben` as your second group. What does that mean? Well in simple words: with X you can have different layouts in different groups and you can switch between these different layouts. And that is exactly why we added "group(ctrl_shift_toggle)". This means we can switch between the two groups by pressing ctrl-shift buttons together. Matter of fact there are other options for the toggle switch. If your XFree86 is new enough, you will find a file named `group` in the same directory you copied `ben`. If your system does not have this file do not worry. You can use an option like "grp:shift_toggle" which will toggle by pressing both shift buttons. In which case your command becomes:

`bash$` `setxkbmap -symbols "us(pc101)+ben" -option "grp:shift_toggle"`

## 2.4. Some "special" Bengali only applications

### 2.4.1. Lekho

Lekho is a text editor for creating Bangla Unicode files without using any type of Unicode font.

| This section must not be taken as "The Complete Reference of Lekho". At best it can be regarded as a short introduction to the editor. The main purpose of this section is to make you aware of the presence of this wonderful editor. In any case, the primary source of information on Lekho is it's website or the documentation provided with the package distribution.

You may find Lekho helpful if you are

1. Too lazy/busy to install the necessary Locale, Opentype fonts and Keyboard.

2. Currently using a Gnome version prior to 2.0 .

3. Don't have gtk+ in your system at all.

4. Want to export as Latex for use with Bangtex macro package.

Some of the major features of Lekho are as follows

- Keyboard Layout- Phonetic (i.e. k=ka, kh=kha etc)

- Minimum Requirements- Qt 2.3

- Font Usage- Adarshalipi

- Save As- UTF-8, UTF-16, ISO-8859-1

- Export As- HTML, Bangtex

- Development Status- Beta

- Support- Through Mailing list

1. Download the latest tarball from Lekho's website at http://lekho.sourceforge.net (Rumours are that an RPM is on the pipeline. By the time you read this HOWTO, it may be already out. So please check it if you prefer RPMs). Now untar the tarball:

   `bash$` `tar xfz Lekho.tar.gz`

2. 'CD' to the Lekho source directory and then go through the traditional way of compilation+installation:

   `bash$` `./configure`

   `bash$` `make`

   `bash$` `make install`

3. At the very end of 'make install', the Adarshalipi fonts are copied to a seperate directory and the name of this directory is also printed. Now add that directory to your fontpath. There are several ways to do this depending on the XFree86 version you are using. Please consult Lekho's documentation for details.

Although Lekho is still in development stage, it has enough features to meet the requirements of most people IMHO.

Prev | Home | Next
Introduction |  | Developers' Guide