Subpixel Hinting Packages (Ubuntu Lucid Patches) are now available for 11.3

A follow up to my previous post at :- Subpixel Hinting for 11.2- GTK Apps- Solution, where I had patched 11.2 RPMs with Ubuntu patches for better subpixel hinting and font configuration support. I have now rebuilt the cairo, freetype and fontconfig packages with patches from Lucid/Maverick. They’re available at:- Index of /repositories/home:/anshuljain:/ubuntu_patch_11.3/openSUSE_11.3

To install the procedure is as follows:-

  1. Run the command: zypper ar

  2. Run this command: zypper dup. This will upgrade your existing cairo, freetype and fontconfig packages to the patched ones.

  3. Add the following lines in /etc/X11/Xresources:-

Xft.dpi: 96
Xft.antialias: true
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
Xft.lcdfilter: lcddefault

Change the line “Xft.hintstyle: hintslight” to “Xft.hintstyle: hintslight/hintmedium/hintfull” depending on what you select in your GNOME or KDE desktop font settings.

My recommendation is to set the settings to “Slight” and turn on “Subpixel Hinting” under (for GNOME only) Change Desktop Background (Right click on desktop) -> Fonts -> Details -> Subpixel & Slight. In the screenshot below, I’ve used Calibri fonts with 10 pt size, disabled embedded bitmaps through .fonts.conf. Choose whats best for you :slight_smile:](

The screenshot above is from a pretty crappy laptop that I’m using right now, in the next few days I’ll post a few more screenshots from my vastly better laptop which has a top of the line graphics card :slight_smile:

Whats so special about these patches? Ubuntu has always had better font rendering support as compared to other distros. Their patches are never adapted upstream as they tend to deviate from what the devs want. But, they’re better than the original LCD filtering patches provided by the freetype devs.


A quick update- I’ve created a backport of freetype 2.4.0 which has the bytecode interpreter enabled by default, due to the expiration of Apple patents. Also compiled are fontconfig and cairo against this updated freetype. Eager users may use this repo :- Index of /repositories/home:/anshuljain:/ubuntu_patch_11.3_backport/openSUSE_11.3 and the instructions in the post above. You should use either this repo, or the one specified in the previous post. Please do not use both the repos!!

By the way, in 11.2 I had good fonts in Open Office under Gnome. But not in 11.3. Dont know what to do.

Can you post the output of xrdb -q? Have you applied the lines mentioned in #3 to your Xresources file?

Well indeed when I applied your changes all looks great (i.e. OpenOffice). I even can say it’s better than I had under 11.2: in 11.2 OOo only had subpixel hinting in Gnome and not under KDE3. Now that is in KDE3 also.

Now subpixel rendering does not work only in some Java apps (FrostWire) and Mono Winforms (SMath Studio).

Hmm the repo seems to be down.

The repo should be up now. I had to disable the builds to remove an experimental patch. There are now 2 repos- one which carries the openSUSE default freetype 2.3.9 and the other is the latest freetype 2.4.1. The fontconfig and cairo libs are both built against this freetype. The repo which has freetype 2.4.1 is named “_backport”.

I’ll be packaging another set of patches from the blog which has an interesting set (and superior set as compared to the Ubuntu patches) of patches. I’ll be releasing them in the “_experimental” repo.

With your suggested changes in x11 configuration I now even have subpixel rendering in GDM logon screen. Can you pack this config in a separate package?

(BTW, slight hinting is not good in fact, only full is good).

Thanks for the great work, works like a charm in openSUSE 11.3 KDE (FF and Ooo looking MUCH nicer)

Thanks a lot, it looks awesome!!

you made my desktop just more beautiful…

I’ll try to package this configuration seperately. If full hinting works good for you, then thats what you should choose :slight_smile: Font rendering is a personal choice.

In that case maybe package full hinting and slight hinting configurations in different packages?

I’m looking at home:anshuljain:ubuntu_patch_11.3 and have some doubts.
[li]Why are you building against openSUSE:11.3:Update? Since you don’t build kernel modules doesn’t seems to make sense.[/li][li]Your cairo package includes a baselibs.conf… about fontconfig? Doesn’t seems to be having any effect.[/li][li]Your cairo package has three patches. 04, the only related to fonts is already available in the official package. What your package is supposed to improve? In fact 06, related to images, is also available and 01 doesn’t changes the behavior in any way.[/li][li]Your fontconfig package doesn’t includes three patches from the official package?? One is a fix for a crash…[/li][LIST=1]
[li]In openSUSE bitmaps seems to be used only for CJK languages. But anyway it’s just a config options.[/li][li]The lcddefault is missing from openSUSE. But since I don’t get fonts of colors I suppose lcddefault is the default anyway. If isn’t a bug report is in order.[/li][li]The rest seems to just set the default to the same that openSUSE does. If there is any difference that you consider important (lcdlegacy for DejaVu Sans Mono and Bitstream Vera Sans Mono?) open a bug report.[/li][/ol]
[li]The freetype package has the bdflib-large-encodings and hmtx-no-shorts patches that I don’t know what do (if it’s important should be reported). But also misses patches from openSUSE.[/li][li]The only freetype relevant change seems to be enabling the subpixel rendering.[/li][/LIST]

Can’t you get the exact same results with just recompiling the official freetype package with subpixel rendering support (is an option in the spec file) and a “ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d”?
Also… you can’t host subixel rendering enabled freetype packages in the openSUSE Build Service, those must be removed. That’s why the official package has it disabled and there is a package available at the freetype repository.

  1. Building against “_update” is an error. I’ll have that removed. Thanks for pointing it out.
  2. Removed baselibs.conf, wasn’t needed. Thanks again…
  3. Patch #4 comes from Ubuntu. AFAIK, the lcd filtering patch in the official package is different as compared to the Ubuntu ones. In my searches on font rendering patches there happen to be 3 different types, one is the LCD Filter patch, the other is a Cleartype and finally the Ubuntu patch.
  4. I had missed the patches for the fontconfig crash, added it. It should be available now.
  5. I’ll look into the missing patches from openSUSE. The patches you’ve mentioned come from Ubuntu. I’ll check out the bug reports behind them.

AFAIK, adding a subpixel patch to freetype does not help GTK apps which require a separate patch in cairo. Thats why cairo needs to be patches and not just freetype.

I’m aware that subpixel rendering patches fall into a grey area. However, I’ve seen that some home repos provided freetype packages with subpixel hinting. My work started off as an experimental project for me and I then gradually moved it to the OBS. This is in no way meant to supplant the official/semi-official ones. This repo still remains a personal project for me. Now, as far as removing the packages are concerned- I do not want to fall afoul of the OBS terms and conditions. If the OBS maintainer says that it needs to be removed- I’ll do it and take the packages private.

For 11.3 the patches are exactly the same:

$ osc co home:anshuljain:ubuntu_patch_11.3 cairo 04_lcd_filter.patch
$ osc co openSUSE:11.3 cairo cairo-lcd-filter.patch
$ diff cairo-lcd-filter.patch 04_lcd_filter.patch
< #! /bin/sh /usr/share/dpatch/dpatch-run
< ## 04_lcd_filter.dpatch by Fabien Tassin <>
< ##
< ## All lines beginning with `## DP:’ are a description of the patch.
< ## DP: Add a Cairo LCD filter to use FreeType LCD colour filtering features;
< ## DP: initial implementation from FreeDesktop ##10301; from git rev
< ## DP: 5d887ad5dca5af0f8216830d1b04d08a5aba9bee

And it’s also the same one from openSUSE 11.2.

Seems like they are…its just a naming difference :slight_smile:

But subpixel hinting in 11.2 in GTK did not work untill you installed Cairo from Packman.

Hi, I tried many times to do command 1: I copied “zypper ar plus the http:// …” but I does not work. Another problem is the x11/x file - how to update it if I can’t open it? Please help me Marek

Note that for openSUSE 11.3, there is no point patching cairo, as the patches written by Ubuntu are already included in the openSUSE cairo package.
You only need to patch + upgrade the freetype packages (libfreetype6 on openSUSE >= 11.3).

Those are also provided in the subpixel repository at Index of /subpixel/ (pick a subdirectory depending on your openSUSE version, e.g. Index of /subpixel/openSUSE_11.3/)
It is probably a better idea to take them from there, as it is unclear whether those patched freetype packages may remain in the openSUSE Build Service (for legal reasons).