How to compile haiku with sub-pixel font rendering endabled


Since the full implementation of font rendering is missing from the binary distribution, and since it’s an important feature, could somebody post a how-to guide on how to compile (part of) Haiku to enable the sub-pixel font rendering ?
(If it’s legal to do so, I’m not sure about it).


To get sub-pixel rendering to work, you have to compile Haiku with the “–include-patented-code” flag (minus the quotes). Just remember to jam -aq @alpha-cd. That “-a” flag added to jam will make sure that all the elements of haiku know about your change to the code.

Thank you.

Could you put here the full commands to be entered in the terminal ? I do programming in c,c++,java,php but i don’t know yet how to compile with gcc or recompile an os entirely.

Basic instructions:

  1. get the Haiku source (use svn)
  2. If using Linux: Get buildtools source, build & install Haiku’s jam, compile the buildtools (configure does this).
  3. run configure with switches you want (./configure --help); found in root Haiku folder. Creates generated subfolder unless you specify different name. Contains object and binary files created during compile. Run configure only once or again if you remove generated folder (or buildtools).
  4. jam with switches; jam --help

You can also jam a single component if you know it by name. Or change into a source folder and jam everything in one directory.

Read the link above to give you greater information & get you started.


sorry for digging out such an old thread, but it seems that something has changed in the buildprocess because the above mentioned configure switch has no effect on the freetype library (ftoption.h still has subpixel rendering commented out).

Any hints on how to enable it now?


Freetype has been moved out of the Haiku repository and is built separately. When building Haiku now, the pre-build Freetype package (and headers) are downloaded and extracted.

As such, there’s no longer an easy way to fiddle with the freetype settings when you build haiku without first building your own freetype package and replacing the downloaded copy with it.


are there any plans to enable Subpixel Rendering in the future by default?



if one would subpixel rendering and subpixel hinting in Haiku, follow the steps below. It’s just a quick and dirty approach without package management but works as expected:

Download and extract Freetype
gzip -dc freetype-2.5.2.tar.gz | tar -xvf -

Configure the build
cd freetype-2.5.2
nano include/config/ftoption.h

Remove the comments from the necessary parts

Build it
./configure --prefix=$(finddir B_COMMON_DIRECTORY)
make -j 4
make install

After a reboot you can verify if you are using the new libraries with

listimage | grep freetype

I have to admit that to me Grayscale rendering looks better in Haiku than Subpixel Rendering, now that i have tested it (as opposed to linux where grayscale rendering looks kinda shitty). It seems that either Haiku is optimized for it or i am too used to it.