views:

590

answers:

3

Hi SO Friends,

I am working on embedded system, with own windowing system and rendering library. Before someday when I installed Ubuntu, to my surprise it has LCD subpixel rendering. It really looks cool to have it on my device. Because it is very readable.

Currently I ask for particular glyph in freetype, freetype gives me one memory buffer with values of alpha, with that it is not possible to have subpixel rendering. What I have is normal antialiazed font. As in subpixel - rendering left most pixel of font is anti-aliazed with Red and Rightmost with Blue ( Assuming Screen is RGB ).

Is there any methods with which freetype can give me information that whether current pixel is left or right or centerone?

Thanks, Sunny.

+1  A: 

freetype can do it

Chris Dodd
Any tutorial on How to achive LCD Antialiasing with freetype. As I am using freetype to render fonts. I created own wrapper to draw font using freetype 2.
Sunny
I'm not aware of a tutorial, but I would assume you'd just use FT_RENDER_MODE_LCD and it would more or less just work.
Chris Dodd
+1  A: 

As you point out, the desktop environment you're using (GNOME, KDE, whatever) may implement this. The setting for it varies by environment.

As to how to do it in your own code, you can use the same routines the window manager does (Gtk+ on GNOME, Qt on KDE, etc.), or you can use a separate library like FreeType or SDL_ttf. Antialiasing -- the generic term for this, as ClearType is a patented algorithm specific to Microsoft -- is usually optional in these libraries, disabled by default for speed.

Warren Young
ClearType refers specifically to (Microsoft's implementation of) subpixel rendering. Subpixel rendering and antialiasing are two completely different things.
Captain Segfault
+1  A: 

I think that libcairo is at the bottom of most GTK applications in Ubuntu that do antialiasing. I think that whether subpixel rendering is done specifically for an LCD screen is something the user chooses, not the application author. The user controls it through the "Fonts" tab of "Appearance Preferences" in System -> Preferences -> Appearance (which can be run manually as the binary "gnome-appearance-properties") and clicking on the "Subpixel smoothing (LCDs)" option.

Maybe there's a way that an application can override this setting for themselves? Not sure why they'd want to, though, since an app doesn't control what kind of display the user is using.

Brandon Craig Rhodes
I am working on an embedded system, I don't have GNOME on my device, But as GNOME can do it, I am sure there must be some opensource implementation of this. Right now I am drawing font using freetype 2. Want to write code so that I can get it on my devide. Thanks.
Sunny