July 24, 2007

Proper rendering of Indic fonts on Firefox

Filed under: FOSS, General, Tech — strike @ 4:57 pm

Official binary releases from the Mozilla Corporation by default do not render Indic fonts correctly. The reason is official binary release is not compiled with pango support. Pango is a font rendering engine with focus on l18n. The pango layout engine is basically designed in context with gtk+ widget toolkit. Pango works on multitude of platforms like Linux, MacOSX and M$.

Most of the Indic scripts fall under Complex Languages which require special rendering. To enable this under Firefox we need to recompile the source with just one extra option i.e. –enable-pango.

Marathi (Devnagari) fonts rendered by official binary release is shown in image below.

Indic font rendering official release

Marathi fonts rendered by custom built Firefox is shown in image below.

Indic font rendering on Pango enabled Firefox

You can clearly see the difference in font rendering.

Download and build Firefox

To compile Firefox, download firefox source from mozilla.org after selecting source directory under appropriate version (2.0.0.5 in this case). The source itself is 35 MB, after bunzipping it expands to whopping 345 MB.

tar xjf firefox-2.0.0.5-source.tar.bz2
cd mozilla

Next step is to create a configuration file. There is a utility for building configuration file (called mozconfig) from Mozilla located here, which makes life a little easy.

It is better to create mozconfig file which include existing build options. You can view the official binary release build option by typing about:buildconfig in address bar of official release Firefox. Below are build options used for binary release:

–enable-application=browser –enable-update-channel=release –enable-update-packaging –enable-official-branding –disable-debug ‘–enable-optimize=-Os -freorder-blocks -fno-reorder-functions -gstabs+’ –disable-tests –enable-default-toolkit=gtk2 –enable-xft –disable-freetype2 –enable-svg –enable-canvas –enable-static –disable-shared

As can be seen here official release Firefox is not compiled with pango support. As you can see, this build is going be static with just one extra option i.e. –enable-pango. The mozconfig file created for custom compilation looks like the one shown below:

# Options for client.mk.
mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/ff-opt-static

# Options for ‘configure’ (same as command-line options).
ac_add_options –enable-application=browser
ac_add_options –enable-update-channel=release
ac_add_options –enable-update-packaging
ac_add_options –enable-official-branding
ac_add_options –enable-pango
ac_add_options –disable-debug
ac_add_options ‘–enable-optimize=-Os -freorder-blocks -fno-reorder-functions -gstabs+’
ac_add_options –disable-tests
ac_add_options –enable-default-toolkit=gtk2
ac_add_options –enable-xft
ac_add_options –disable-freetype2
ac_add_options –enable-svg
ac_add_options –enable-canvas
ac_add_options –enable-static
ac_add_options –disable-shared

Please note that in above file I have used –enable-official-branding which makes use of all the trademarked logos while building. However, you should not use this if you are planning to distribute binary, unless you have obtained express permission from Mozilla. Read Mozilla Licensing Policies. As long as you are building it for yourself, you can use anything you want.

Assuming your Mozilla source is in mozilla directory, you can keep this file in this top level source directory with name .mozconfig as a convension. Actually you can keep this file anywhere and export a shell environment variable MOZCONFIG pointing to an absolute path to this file. But this is volatile.

I personally prefer to keep it in top level source directory and export path as a precautionary measure. Next is to issue make command.

export MOZCONFIG=/absolute/path/to/mozilla/.mozconfig
make -f client.mk build

While compilation process is on, you can get caffeinated enough so you can stay up for further tests. On my Celeron 1.7 GZ laptop with 768 MB memory it took freakin 2.5 hours to finish compilation. Most of the compilation is CPU hogging, with constant average CPU usage nearing 95%. This sent load average on my machine to a soaring 4 to 7. Most of the compilation time I had a table fan spinning in full swing facing my lappy as it started heating up like anything in first few minutes itself.

Only last step where it binds some big object files together and finally the firefox-bin binary is memory intensive. It took most of my available memory and all of the CPU bringing other tasks on lappy to a screeching halt.

Big Phat Warning: The official document states that it requires 1.5 GB disks pace for static and XULRunner builds, mine took 2.7 GB. So keep at least 3 GB of disks pace free on the partition where you are compiling Firefox. You WILL run into troubles if its your root partition with /tmp on it and is filled to the brim.
Initially I had just 2 GBs of disk space free on root partition. I thought it would work but did not consider the disk space used by /tmp and space used by sources. Obviously in first try it failed due to lack of disk space. Next I freed up some more space. After everything was compiled properly it took around 2.7 GB of disk space.

After the compilation is complete you can test the new build by running file /absolute/path/to/mozilla/ff-opt-static/dist/bin/firefox. Once you are satisfied with the new build, you can create a tar file which then you can copy on any location you want and run from there. This can be created by running command

make -C ff-opt-static/browser/installer

This would create file firefox-2.0.0.5.en-US.linux-i686.tar.gz in mozilla/ff-opt-static/dist/ directory. That completes building Firefox from source.

The memory footprint did not change for custom built Firefox compared to that of official release. Being static build, memory footprint is rather large (34MB resident and around 14 MB shared) compared to other applications. Its same for official release as well as custom build. I am yet to detect any memory leaks in my build.

Most of the documentation you can find on developer.mozilla.org.

July 1, 2007

USB automount under Debian etch (post-upgrade)

Filed under: FOSS, Tech — strike @ 8:11 pm

If you connect fat32 usb mass storage device your machine under Debian etch, it won’t automount. The reason as specified is “The vfat file system does not yet fully implement sync-mounting.” So if you want it to automount, you simply need to add “vfat” to the FILESYSTEMS variable in configuration file /etc/usbmount/usbmount.conf.

My file /etc/usbmount/usbmount.conf looks like this (only relevant part):

FILESYSTEMS="ext2 ext3 vfat"
MOUNTOPTIONS="sync,noexec,nodev,noatime"

December 27, 2006

GPRS connection using Nokia E50 on GNU/Linux

Filed under: FOSS, Tech — strike @ 12:47 am

It was a child’s play to configure Linux for GPRS. There was hardly anything considerable I did to get it working. I connect using my mobile, Nokia E50 with Nokia Connectivity Cable (data cable) CA-53 on my historic laptop Acer TravelMate 240.

Before I start, about my system:

Hardware: Acer Travelmate240 with 2.4 GHz Intel Celeron and 768MB memory.

OS: Debian GNU/Linux, Kernel 2.6.8-2-686 (precompiled, from Debian apt system)

So this is how it goes. I connected my USB connectivity cable CA-53 that came bundled with E50. As soon as I connected mobile to the cable, phone poped a message on its screen as shown in the image below.

data connection screen

I selected cancel here. If you select OK, it will treat it as a USB storage media. At this time dmesg registered messages as shown below.

usb 3-1: new full speed USB device using address 7
scsi2 : SCSI emulation for USB Mass Storage devices
Vendor: Nokia Model: E50 Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 2011917 512-byte hdwr sectors (1030 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
/dev/scsi/host2/bus0/target0/lun0:
Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0
USB Mass Storage device found at 7
usb 3-1: USB disconnect, address 7
scsi2 (0:0): rejecting I/O to dead device
SCSI error: host 2 id 0 lun 0 return code = 4000000
Sense class 0, sense error 0, extended sense 0

As you see, the device is detected correctly and it has also detected my 1GB microSD card.

Next, it poped a screen asking to select mode. Here I selected “PC Suite” as shown in image below.

Selection mode screen

At this stage dmesg showed following messages:

usb 3-1: new full speed USB device using address 3
drivers/usb/class/cdc-acm.c: Ignoring extra header
cdc_acm 3-1:1.10: ttyACM0: USB ACM device
usbcore: registered new driver cdc_acm
drivers/usb/class/cdc-acm.c: v0.23:USB Abstract Control Model driver for USB modems and ISDN adapters

As can be seen from these messages, mobile phone is detected as v0.23:USB Abstract Control Model driver for USB modems and ISDN adapters. It also registered the drivers for our device. The line

cdc_acm 3-1:1.10: ttyACM0: USB ACM device

shows that our device is detected as ttyACM0. It means it is placed under /dev/ttyACM0.

Next, since I was not using my built in modem, I did not have a /etc/wvdial.conf file. So I created a /etc/wvdial.conf file with following contents:

[Dialer Defaults]
Init1 = AT+CGDCONT=1,”IP”,”airtelgprs.com”
Modem Type = USB Modem
Phone = *99#
Password = “”
Username = “”
Modem = /dev/ttyACM0
Baud = 460800

In this file, first line is an initialization string. You can obtain this string from your GPRS service provider. If you are lucky and the help desk guy/girl not clueless, you will get this info. In India, my service provider is airtel. Fortunately in the second call to helpdesk, I found the right guy who had a clue about what Initialization string is :). So armed with this info, it is really trivial to write a configuration script.

In connect string, the part after equals sign, i.e. AT+CGDCONT=1 can be different. “IP” is the IP which will be dynamic mostly. Next is the Access Point Name*, which, in my case is “airtelgprs.com”.
Next line specifies a name for this modem, which can be any arbitrary name you want. Third line specifies the number to dial, in my case it is *99#. You have to obtain this from your service provider. For my network username and password is blank. But wvdial does not like blanks. So you need to supply something there as I did, an empty string. The line starting with “Modem” specifies where our device is located. You can keep the Baud rate as it is.

Next I ran the command wvdial in a shell. Here are the messages from wvdial:

swordfish:/etc# wvdial
–> WvDial: Internet dialer version 1.54.0
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: AT+CGDCONT=1,”IP”,”airtelgprs.com”
AT+CGDCONT=1,”IP”,”airtelgprs.com”
OK
–> Modem initialized.
–> Sending: ATDT*99#
–> Waiting for carrier.
ATDT*99#
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}”}&} }*} } g}%~
–> Carrier detected. Waiting for prompt.
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}”}&} }*} } g}%~
–> PPP negotiation detected.
–> Starting pppd at Mon Dec 25 21:54:16 2006
–> pid of pppd: 18155
–> Using interface ppp0
–> local IP address 10.148.27.10
–> remote IP address 10.6.6.6
–> primary DNS address 202.56.230.5
–> secondary DNS address 202.56.230.6
Caught signal #2! Attempting to exit gracefully…
–> Terminating on signal 15
–> Connect time 2.5 minutes.
–> Disconnecting at Mon Dec 25 21:56:50 2006
swordfish:/etc#

You may use other tools like KPPP or whatever you prefer instead of wvdial.

* GSM GPRS/EDGE cellular data networks use a mechanism called an APN (Access Point Name) to determine how a Mobile Station (MS), communicates via the GSM network to a host site (i.e., how the carrier network passes IP traffic to the host network). An APN determines what IP addresses are assigned to the mobile station, what security methods are used, and how the GSM data network connects to the customer’s network.

February 11, 2006

FSF-India at LinuxAsia 2006 - Day 3

Filed under: FOSS — strike @ 3:13 pm

On day 3 we had a few visitors till lunch. The start was slow but towards the end of day we had some visitors who were not familiar with FSF and GNU. Some of these were interested in Associate Memberships provided by FSF-I. We directed them to gnu.or.in for memberships as we did not have any receipts.

In the afternoon Nikhil Prabhakar (nipra) started taking signatures of GNU/Linux users and collected quite a few. There was a photo session at all our stalls. As always Karunakar was our resource of photographs. There were guys from Fedora, Hindawi, IndLinux and other stalls in the photo session :). We had a nice time near the end of the day as guys from stalls in .ORG mela came together. There were few like Ramki, Sankarshan, Niyam, Vivek, Abhishek, Amol, Vinod, Bir, Milind etc. At around 1730 Hrs in the evening we had to close the stalls and hand over stalls and other things to LA people so we peeled off all the posters collected all our stuff and walked to have tea/coffee.

On the tea table a discussion started on localization and native language support at command level in GNU Linux, ways to achieve it and related problems. Abhishek was very enthusiastic about porting Hindawi on GNU systems. Also Vivek from sarai was there passionately presenting the issue of mentor-ship of OSS projects in Delhi and NCR. The discussion stretched till almost 8 in the evening. We were all tired till then, so we concluded the meeting and called it a day with promises to meet online.

February 9, 2006

FSF-India at LinuxAsia 2006 - Day 2

Filed under: FOSS — strike @ 11:31 pm

Some work at office held me back till 1400 Hrs today. Handed over the distribution CD of Hindawi to Abhishek Choudhary as he forgot to bring it along. There is no Internet Connection available at the conference so I had to download it at office. It would be great contribution if Hidawi could be ported on GNU Linux.

Met Karunakar G. of IndLinux at his stall. In foss.in IndLinux aroused considerable interest so this time I was determined to take a look at the work they had done. Many applications have been translated in Hindi and other languages. Many more still to be translated. This is a good indication that localization projects are maturing slowly. A lot of people have already came forward for mentor-ship of these localization projects. Sarai (sarai.net) is one of it working in Delhi-NCR region.

In the evening there was a meet arranged by ILUG-Delhi with Klaus Knopper of Knoppix and Mark Shuttleworth of Ubuntu. I reached there at least 15 minutes late as there was no one at the FSF-I stall and we had a few visitors.

The discussion with Klaus Knopper included the OSS movement in Germany and EU, different laws in Germany and the software patents. How OSS community is fighting against software patents in EU and Germany. The discussion also drifted on the efforts to make computer usable for disabled people. In the discussion a surprising fact Klaus told is that there is a syndicate of publishers who force writers to sale all their rights to them and won’t let you sell it to anyone out of Germany. Meaning they won’t let writers have share on royalty. He called them ’sort of publication mafia’. He also discussed the future of Knoppics and shared his views.

In the meeting with Mark Shuttleworth, he gave a small presentation on Ubuntu Linux as a part of his Asia Business Tour. He mentioned the goals of Ubuntu are to make it easy to use for desktop users and general computer users, build good user base of Ubuntu by providing full commercial support, translations and device drivers. Ubuntu is already providing certification programs for techies. Ubuntu is acquiring or have already acquired certifications from companies like IBM, Oracle that Ubuntu is ready for their product, told Mark.

This meet made day 2 memorable.

February 8, 2006

FSF-India at LinuxAsia 2006 - Day 1

Filed under: FOSS — strike @ 11:55 pm

As Amol told, it was a gross mismanagement. No one was available there at 0930 Hrs. We reached Hazrat Nizamuddin station, Delhi @ 1000 Hrs. It was 1300 Hrs when we reached at the India Habitat Center after getting fresh. The stall was set up by Amol and Vinod. We started attending visitors. Yes, there were a few. Most did not know about GNU and FSF-I.

We got too late for lunch so we had to grab food at one of the pub in India Habitat Center “The Diners Club”. It was expensive but food was good none the less. It was already 1700 Hrs. I got back to the stall where I met Abhishek Choudhary who wrote “Hindawi” which is a programming system for Indic languages (scripts). Though it is not a GNU system it is worth mentioning here. Abhishek is currently looking for volunteers to help him port it on GNU Linux systems. More info can be found here.

In the evening all of us attended “Meet the Gurus” corridor party. We had an interesting discussion with David Axmark of MySql about current MySql status, its port on FreeBSD system, its current feature set and other future plans. In all the concluding part of first day was interesting.

While leaving we met Ramki, Sankarshan and other Fedora guys.

February 7, 2006

FSF-India at LinuxAsia 2006 - Update 2

Filed under: FOSS — strike @ 9:11 am

No merchandise. We had to scrap the Idea of T-shirts. Posters are ready, FSF-I and SPACE handouts arrived today; pretty much in time. Stall space confirmed. 5 volunteers: me, Amol, Nikhil (nipra) Prabhakar, Vinod, Birchandra Singh Sanasam are all set for the event. Probably Milind Paralkar will also be there with us.

January 28, 2006

FSF-India at LinuxAsia 2006 - Update 1

Filed under: FOSS — strike @ 11:06 am

Got posters printed. Designs were sent by Anivar Aravind. Hope to receive handouts before the event.

Printed some stickers for car bumper and laptop/Desktops. Car bumper stickers look good on laptops as well.. ;-). Comp sticker is overexposed in pic below. This one looks good as well.

Gnu comp sticker Car bumper sticker on laptop.

January 18, 2006

FSF-India at LinuxAsia 2006 - Update 0

Filed under: FOSS — strike @ 2:42 pm

Authorities from LinuxAsia confirmed that we have been allotted stall space for FSF-India. The t-shirt design is on finalization stage. Sticker design have been finalized. We have decided not to sale merchandise in LinuxAsia because of Tax implications.

The organizers refused to take any responsibility of registration for tax. FSF India will have to register locally with Delhi authorities which was not possible. So we decided not to put anything on sale.

Suggestion to keep books, printed by FSF-I on stall is still on the list. Burning CDs is not finalized yet. There will be at least 5 volunteers on FSF-I stall. So we have good chance to attend talks of interest.

January 13, 2006

FSF-India at LinuxAsia 2006

Filed under: FOSS — strike @ 6:16 pm

Planning started in full swing today to represent FSF-India in LinuxAsia 2006. Shot several mails on iLUG Delhi and FSF-Delhi mailing lists. Got things moving in many directions.

FSF supporters have started suggesting things. Sent mail for getting space allotted for FSF-India in .org Mela in LinuxAsia. Did not get any reply regarding the space request. So called them up in the evening. They say the concerned person is not in town and will be back on Monday. So we can get the status only on or after Monday 16th Jan 2006.
Some suggestions from Nikhil Prabhakar and Baishampayan Ghose are valuable.

Next Page »