Beautiful fonts in Linux

20141027-beautiful-font

I love Fedora Linux and I love beautiful fonts. And, to be frank, these two do not easily love each other.

I’ve tried learning the complexities of subpixel rendering and bytecode hinting using freetype, I got fonts from our friends in Redmond and dabbed with infinality, which is a set of patches for freetype.

infinality worked really well until I realised that some software, especially Gimp 2.8 which I use on a daily basis at Knowledge Seven, do not work very well with it.

Fortunately, I also love Reddit and I stumbled upon this comment by ununununu:

You don’t need Infinality for pretty text rendering in Fedora. Here’s how to do it.

You may have noticed that fonts appear jagged and generally terrible-looking in Fedora 17 (and possibly in 18) while they appear smooth and lovely in Ubuntu. Both distributions use freetype for their renderer (kind of), though with different default settings.

The first step is to upgrade from the default freetype package to freetype-freeworld from the RPM Fusion repository. This version of freetype makes use of RGBA subpixel rendering which isn’t included in the default package for, uh, licensing reasons maybe?

Next, use gnome-tweak-tool to set Font Hinting to “None” and Font Antialiasing to “Rgba”. But that’s not all! There’s one more setting that Tweak Tool can’t set.

Create a file called .Xresources in your home directory. Its only contents need be Xft.lcdfilter: lcddefault which actually enables the subpixel rendering.

That’s it. I works great and I’m now looking at gorgeous fonts on my Fedora Linux laptop.

I couldn’t install the latest version of the Liberation fonts though because of Wine. I’ll try later.

[Thanks to Cuong, I did it, at the end, by downloading the Liberation 2.0 TrueType files and overwriting the existing Liberation 1.0 files in /usr/share/fonts. Then I changed my default font in Chrome to be Liberation and used the Stylish extension (with this script) to have this gorgeous font in Gmail, Facebook, Twitter, etc.]

[A second update: Some fonts from our friends in Redmond (e.g. Calibri) look crap at small sizes because of the bitmaps embedded in them. To make freetype ignore all these crap bitmaps, put the following in, say, ~/.config/fontconfig/conf.d/10-ignore-embedded-bitmaps.conf:

<match target=”font” >
<edit name=”embeddedbitmap” mode=”assign”>
<bool>false</bool>
</edit>
</match>

Have fun!

Fixing Bittorrent clients crashing on Ubuntu

20140319-bittorrent

There are many Bittorrent client in Linux and, under Ubuntu (and this is surely true for other Linux distributions too), most of them depend on a library called libtorrent.

Under Ubuntu 12.04 LTS, libtorrent is buggy and causes Bittorrent clients to crash on a regular basis. The solution is, of course, to upgrade libtorrent from 0.15 to its latest version 0.16. The way to do that is to add the ppa:surfernsk/internet-software PPA and upgrade the whole system:

sudo add-apt-repository ppa:surfernsk/internet-software

sudo apt-get update

sudo apt-get upgrade

Doing that upgrades python-libtorrent to 0.16 and installs libtorrent-rasterbar7. Removing libtorrent-rasterbar6 (which is not needed anymore) is simply a

sudo aptitude remove libtorrent-rasterbar6

Since doing that, Deluge, the Bittorrent client I use, hasn’t crashed at all. Life is cool.

(Solution obtained in the Deluge forum)

Hello Java 8

20070918-java-vm

Java 8 has been released!

The Oracle build is available online while the OpenJDK variant will be available very soon. I have just downloaded the Oracle JDK on my Fedora Linux laptop and, lo and behold, here is my first encounter with it:

avinash@laptop02 ~ $ java -version
java version “1.8.0”
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)

avinash@laptop02 ~ $ vi HelloWorld.java

avinash@laptop02 ~ $ javac HelloWorld.java

avinash@laptop02 ~ $ file HelloWorld.*
HelloWorld.class: compiled Java class data, version 52.0
HelloWorld.java: C source, ASCII text

avinash@laptop02 ~ $ java HelloWorld
Hello World

Coming soon: my opinion on the Stream API and, being a lover of functional programming, my take on lambdas.

ManU and Liverpool fans: stop being insulting

20140221-people-arguing

Here is a typical conversation between a Liverpool fan and a Manchester United fan in Mauritius:

ManU fan: Pas simple sa Liverpool là. 5-1 banne Arsenal ek 2-1 gagne baté ar li.

Liverpool fan: Péna problème sa. Nou pas intéressé avec FA Cup. La ligue beaucoup plis important.

ManU fan: Tane sa depi 20 ans. Dépi zot pa ine gagne la ligue.

Liverpool fan: Pas kas la tête. Zou pou couma nous asterla: 20 ans zot pas pou gagne narien.

ManU fan: To pé révé. Nou pou acheté 2-3 top zoueurs l’année prochaine ek nou pou bez toi… comme d’habitude.

Liverpool fan: Avec ki kas? To l’équipe, c’est l’équipe ki ena plis boucou dette au monde. De toute facon, zot péna défense et milieu donc pas zis 2-3 zoueurs zot bizin. Vidic pé al Inter.

ManU fan: To pé révé. To l’équipe pou ramasse ene mari baté ar nou l’année prochaine. Gerrard ine vine dada. Suarez népli pou là. 26 ans mo faire mari ek mo éna l’intention continié.

Liverpool fan: To pé koze n’importe. To bizin réaliste: to l’équipe faible et to entraineur péna l’expérience. Liverpool pé vine mari fort.

ManU fan: Nou va bez zot l’année prochaine. Nou va investi.

Liverpool fan: Ene ferfout. Mo l’équipe pli bon ki to l’équipe.

and, just after that, the fighting begins with insults being thrown, mums being involved and a lot of noise being made.

Sometimes, I ask myself why don’t football fans engage in more intelligent conversation about the evolution of the game, tactics, styles of play, potential signings, training routines, etc. Maybe that’s because a lot of football fans do not really know football very much apart from the latest gossips, results and, of course, their beloved team.

To be complete, I didn’t know a lot about football myself but I read two books and I learned a lot:

Let’s try to stop being insulting to each other. After all, this is just football. Let’s engage in meaningful conversation.

Valentine’s Day

2014_02_14-19_52_50-4823

On Friday, our kids, Anya and Kyan, prepared dinner for Christina and I for Valentine’s Day. They did almost everything including setting up the table, preparing starters (pâté de campagne), a big salad and dessert (biscuits topped with chocolate and almond).

2014_02_14-19_49_41-4820

After dinner, they gave us nice cards, all made by themselves. Kyan did his at school while Anya did hers in secrecy after school.

2014_02_14-19_51_48-4821

As you can easily imagine, Christina and I were delighted. The food was nice. The cards were beautiful. And we enjoyed being together. Since quite a few years, Christina and I avoid going to restaurants on Valentine’s Day for dinner. We much prefer to be together, have something nice to eat and drink and have fun!