Question

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.

Was it helpful?

Solution

freetype can do it

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top