freetype
[Top][All Lists]
Advanced

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

[ft] Unusual LCD pixel layout


From: Alexei Podtelezhnikov
Subject: [ft] Unusual LCD pixel layout
Date: Wed, 2 May 2018 10:51:41 -0400

Hi all,

If you own an LCD panel with unusual pixel layout, not the regular RGB
or BGR stripes, this is a call for testing for you. Traditional
ClearType-style subpixel rendering would not work for you, but Harmony
LCD rendering just might.

Harmony was discovered when I realized that ClearType rendering with
light 3-tap filter can be exactly reproduced by shifting the glyph
outline and combining 3 independent grayscale bitmaps into one LCD
bitmap. The shits were 1/3 of a pixel, which is how usual RGB stripes
are layed out. Harmony went in FreeType 2.8.1.

Harmony is generalized now for arbitrary layout of RGB channels within
a pixel. You would need to specify where these subpixels are relative
to the pixel center. The proposed API function is
FT_Library_SetLcdGeometry ( FT_Library library, FT_Vector sub[3] ).
Please see the top commits in the Harmony branch,
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/log/?h=Harmony
.

To test this, ftview now takes "-L x1,y1,x2,y2,x3,y3" option with 3
pairs of subpixel coordinates in 26.6 format or 1/64ths of pixel size.
This is also in the Harmony branch,
http://git.savannah.gnu.org/cgit/freetype/freetype2-demos.git/log/?h=Harmony
. Here is some examples, which are supposed to produce good rendering
with "vert RGB" when you press [D].

For default RGB stripes
bin/ftview -L -21,0,0,0,21,0  24 font.ttf

For swapped BGR stripes
bin/ftview -L 21,0,0,0,-21,0  24 font.ttf

For a certain OLED screen from https://savannah.nongnu.org/bugs/?53749
bin/ftview -L -11,16,-11,-16,22,0  24 font.ttf

Please reports your results or suggestions especially if you own
unusual LCD panel. If you are not sure which coordinates to use,
please post a picture for your layout. Comments are also welcome.

Alexei



reply via email to

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