bugThe FreeType Project - Bugs: bug #53749, RBGA Order options for modern...


bug #53749: RBGA Order options for modern panels (Pentile, RGBG, OLED)

Submitted by:  Sander <redsandro>
Submitted on:  Wed 25 Apr 2018 11:39:34 AM UTC  
Severity:  3 - Normal Item Group:  Wishlist
Status:  Fixed Privacy:  Public
Assigned to:  Alexei Podtelezhnikov <podtelez> Open/Closed:  Closed
Planned Release:  2.10.0

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Thu 03 May 2018 04:57:03 PM UTC, comment #12:


Initially I thought that this is how ClearType works, too, except only in one dimension in stead of two: https://i.imgur.com/4QzJ4OT.png

I'm guessing it's more complex than I realize.

Sander <redsandro>
Thu 03 May 2018 03:59:36 PM UTC, comment #11:


Please consider this a proof of concept at this stage. This is a big change for many key players, like Skia (bungeman?), pango, cairo, Qt, fontconfig, etc. They are not used to thinking about subpixel rendering in terms of outline shifts (as opposed to ClearType filtering). This has to come through.

There is an interesting interplay with subpixel positioning, where folks think in terms of outline shifts too. Both have tio be considered together. So we will get there. Even if display resolution grows, the size of monitors also grows. So there will always be a need for these technologies.

Thank you for testing!

Alexei Podtelezhnikov <podtelez>
Project MemberIn charge of this item.
Wed 02 May 2018 09:31:38 PM UTC, comment #10:

-update- actually it could be (an improved version of) S-Stripe. But it would still make sense to describe the pattern if it would be an option.

Sander <redsandro>
Wed 02 May 2018 09:14:35 PM UTC, comment #9:


This is pretty awesome. I'm not sure if I'm doing this right; pressing Shift + D definitely improves the fringes, although the little text reads "LCD horiz. RGB" (and this is not RGB). I'm comparing this to Shift + B "Normal AA" as this one looks like the default on my laptop.

This is a job well done. I would like to have this subpixel rendering option in GNOME/Cinnamon.

It will be difficult to name this pattern as a choosable option. I think the OLED panel is made by Samsung, but it's not in any of the previously observed layouts. It is not Super AMOLED. It is not Samsung Pentile. It looks like - but is not - Samsung S-Stripe. It's like S-Stripe with an extra blue pixel.

If it is possible to detect the panel type used, it would be nice if Linux could have a whitelist of autodetect values for the right subpixel rendering setting. Not everyone will be able to use a microscopic camera on their monitor.

Two observations. First, I do think you should rename "LCD" to something else that is more technology-agnostic, because my panel doesn't have any liquid crystals, just organic LEDs. Whenever I read "LCD", I think "this is outdated and not relevant to me".

Technology-agnostic suggestions:

  • Panel Geometry
  • Display Geometry
  • Subpixel Rendering

Second, I would prefer this type of font-rendering on my machine. I'd consider it an improvement. However it does look a tiny little bit more blurred vertically. Perhaps some kind of hinting could improve on that, although this is where it gets too technical for me to make recommendations.

For other testers, here's how I got this to compile on Ubuntu 16.04:

    sudo apt install build-essential autotools-dev automake libtool


    git clone -b Harmony https://git.savannah.nongnu.org/git/freetype/freetype2.git /tmp/freetype2 && cd $_
    ./autogen && ./configure


    git clone -b Harmony https://git.savannah.nongnu.org/git/freetype/freetype2-demos.git /tmp/freetype2-demos && cd $_


    bin/ftview -L -11,16,-11,-16,22,0 24 /usr/share/fonts/truetype/noto/NotoSans-Regular.ttf

Sander <redsandro>
Wed 02 May 2018 03:04:28 AM UTC, comment #8:

I have set up a testing framework for you. You will need to get the Harmony branches for both freetype and freetype-demos in side-by-side folders. Compile freetype and, then, freetype-demos. Then use the following command from freetype-demos folder:

bin/ftview -L -11,16,-11,-16,22,0  24 Font.ttf

then press 'D' for subpixel rendering. This LCD geometry descriptor should work for your oled_pattern.png.

Alexei Podtelezhnikov <podtelez>
Project MemberIn charge of this item.
Mon 30 Apr 2018 10:59:05 AM UTC, comment #7:

Alexei, I'm not very techical in this regard. If I can try this out without breaking my (Ubuntu 16.04) system by means of either a stand alone app, an AppImage, or a snap, I'd sure be up for that.

I've used a macro magnifier to the upper left corner of the screen and observed that the pixel does indeed start with red, so the pixel layout is:


Or to be more precice, per 4x4 pixels:



Sander <redsandro>
Mon 30 Apr 2018 04:14:46 AM UTC, comment #6:

Please checkout Harmony branch. The top commits describe how you would specify and achieve subpixel rendering for arbitrary subpixel arrangement.

Sander: if you are adventurous and want to test, I can modify ftview for you to try. 

Alexei Podtelezhnikov <podtelez>
Project MemberIn charge of this item.
Thu 26 Apr 2018 11:58:22 PM UTC, comment #5:

> Using a recent Windows version, do you get (ClearType) subpixel-hinting at all?

Yes actually, I just tried Windows 10. I pretty much never use (native) Windows so I hadn't seen this before, but the ClearType (that's how they call it) dialog is pretty sweet. You get a five page visual dialog.

You get to see rectangular boxes with a little "The Quick Brown Fox..." sample. First, you get to "Choose the one that looks best" between two samples. Then six samples. Then another three samples, and then two more times six samples. I don't know what's actually going on under the hood, but sometimes it's the fringing (subpixel rendering) and sometimes it's just font hinting.

It's hard to see the difference, but the text does look sharper. Some samples have a bluish cast, greenish cast or reddish cast. The problem is that when they look good, under 40x magnification they all look horrible.

It does seem that Windows adds mild sharpening, but I am not sure. It's hard to judge. You'd really need two identical screens and identical fonts, one Windows and one Linux to see what's going on.

Sander <redsandro>
Thu 26 Apr 2018 09:14:32 PM UTC, comment #4:

The last time I looked into this it turned out to be more involved that it seems at first. In particular, it isn't generally possible to send a buffer in the screen format to the screen itself. Usually with these sorts of setups the gpu or screen hardware only allows writing into (or reading from) an RGB buffer and then the hardware maps this to the physical screen, so there's no means to really get at the spatial resolution. Often this translation from RGB to screen is done by a physical chip hooked up to the screen, so there's no means even at a low level for software to "directly" address the physical layout of the screen with any accuracy. If there is such a means, I'd be interested to hear it.

bungeman <bungeman>
Thu 26 Apr 2018 07:35:29 AM UTC, comment #3:

I don't have Windows on this laptop. Let me find out if a BPE for Windows 10 exists. There are VM images of Windows 10.

There are some VM images here, but I guess Microsoft hasn't made it easy to boot from them on an actual laptop.


Sander <redsandro>
Thu 26 Apr 2018 07:10:29 AM UTC, comment #2:

It would be interesting to know how subpixel positioning works on Windows for this screen.

Using a recent Windows version, do you get (ClearType) subpixel-hinting at all?

Werner LEMBERG <wl>
Project Administrator
Wed 25 Apr 2018 07:59:38 PM UTC, comment #1:

Reposting from fdo...

I know what to do theoretically for such weird pixel geometry, see brief summary how Harmony LCD rendering works here. You need to combine the LCD image from three separate grayscale images, each of which is obtained after slightly shifting the outline. The shifting direction should be opposite to the location of the color channel relative to the center of the whole pixel.

It is actually not that hard. Should FreeType provide an API for that is a big question.

Alexei Podtelezhnikov <podtelez>
Project MemberIn charge of this item.
Wed 25 Apr 2018 11:39:34 AM UTC, original submission:

There are no RBGA Order options for moden panels (Pentile, RGBG, OLED etc) in Font Settings.

Redirected from https://bugs.freedesktop.org/show_bug.cgi?id=106219

I have a Lenovo OLED screen and there is green and red fringing on grayscale antialiasing. There are no suitable RGBA options.

I have attached a microscope image of the panel. It seems like the subpixels are:


I don't know if this specific layout has a name, but I think font rendering can be improved.

Sander <redsandro>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #44026:  oled_pattern.png added by redsandro (1MiB - image/png)
file #44027:  oled_settings.png added by redsandro (28KiB - image/png)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by fitojb
  • -email is unavailable- added by podtelez
  • -email is unavailable- added by bungeman (Posted a comment)
  • -email is unavailable- added by wl (Posted a comment)
  • -email is unavailable- added by podtelez (Posted a comment)
  • -email is unavailable- added by redsandro (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-04-18 podtelez StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
        Planned ReleaseNone => 2.10.0
    2018-06-03 fitojb Carbon-Copy- => Added fitojb
    2018-05-13 wl SummaryRBGA Order options for moden panels (Pentile, RGBG, OLED) => RBGA Order options for modern panels (Pentile, RGBG, OLED)
    2018-05-03 podtelez Carbon-Copy- => Added behdad@gnu.org
    2018-05-03 wl StatusNone => Ready For Test
        Assigned toNone => podtelez
    2018-04-25 redsandro Attached File- => Added oled_pattern.png, #44026
        Attached File- => Added oled_settings.png, #44027

    Back to the top

    Powered by Savane 3.4