freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft] How to use subpixel hinting in FreeType


From: katz -
Subject: [ft] How to use subpixel hinting in FreeType
Date: Sun, 7 Jun 2015 09:05:37 +0200

Dear FreeType mailing list,

I am a beginner at using FreeType and new to the concept of subpixel hinting. I've read through most API references that seemed related, but I am still not sure how should I use the library to attain RGB (or RGBA?) bitmaps with glyphs hinted on the subpixel level. If there are any examples on this I did not manage to find, please direct me to it.

So here is what I tried doing so far:
I built the library with both the FT_CONFIG_OPTION_SUBPIXEL_RENDERING and the TT_CONFIG_OPTION_SUBPIXEL_HINTING definitions. Here is my program, that runs without errors:
http://pastebin.com/YNhgwwAN

With this method, I end up with a glyph bitmap which is three times wider than the intended size. If this is the right approach, then my question is how should I use this information to get an RGB bitmap with the right size? The code tries to directly map the values of the result bitmap to the RGB channels, but this doesn't seem right:
http://postimg.org/image/gbfdyh0b9/
The colors are obviously too strong.

I guess I am doing something really wrong here, because if I try different sizes (for example: 31) the result will be distorted:
http://postimg.org/image/7s28scn9j/
I am also getting distortions like that seemingly every time, if I don't turn on LCD filtering.

Any help on the subject is greatly appreciated!

Regards,
- katz

reply via email to

[Prev in Thread] Current Thread [Next in Thread]