Compiling Firefox Beta 5 on Ubuntu Gutsy Gibbon with nicer fonts
May 5th, 2008The firefox binaries available on Mozilla’s site is compiled with a version of cairo that does a different type of subpixel rendering when anti-aliasing than what is used by the Ubuntu Gutsy system - I much prefer the way fonts look in ubuntu on my LCD display. To fix this I had to compile Firefox myself with the enable-system-cairo option. But for this I also needed a more recent version of cairo than what Gutsy provides - which is probably why mozilla decided to include their own version in the binaries.
You will need to get the source and compile the following packages yourself from freetype’s download page and cairo’s releases page:
- freetype-2.3.5
- pixman-0.10.0
- cairo-1.6.4
with the usual
./configure && make && sudo make install You might have to install make with the following before you can compile cairo:
sudo apt-get install build-essential Freetype needs special attention to enable LCD sub-pixel rendering because of these patent issues. So uncomment define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in devel/ftoption.h to enable it.
It is not really necessary to recompile freetype, I just included it to play around with it - and the new cairo is just so that firefox will compile. You can delete the new libraries (by default in /usr/local/lib) after firefox is compiled with system cairo. Then everything should be back to using the default font settings as set in the gutsy preferences. Or so I am guessing, works for me ;)
Now to compile Firefox:
Create a ~/.mozconfig file as described here.
This is mine:
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/ff-opt
ac_add_options --disable-tests
ac_add_options --enable-optimize
ac_add_options --enable-libxul
ac_add_options –enable-system-cairo Make sure you have all the build prerequisites. I had to install the following packages:
sudo apt-get install build-essential
sudo apt-get install libdbus-glib-1-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libxt-dev If you have everything, start compiling with this command
make -f client.mk build After some time, build a tarball as recommended with:
cd ff-opt
make package You will find your new firefox package in the dist/ directory. Unpack somewhere and enjoy ;)
