Problem with LVGL subpixel rendering with inverted RGB


I’m working on a project that uses LVGL 8.3.2.

I’m using fonts created with the LVGL converter, with BPP=4 and subpixel rendering.

The display we are using is “upside down”, so the pixels are in BGR order from the user point of view.

To make subpixel rendering work in this configuration I’ve set LV_DRAW_SW_FONT_SUBPX_BGR to 1.

This has the desired effect: the font is sharper and under a lens it’s visible that the curves are correct.

The problem is that now when I set the font to a color different than black, the colors are skewed:

image vs image
with BGR vs original

(this screenshot is taken from the vscode simulator, where the effect is identical to the one on my hardware).

I’m guessing it’s because the colors are interpreted in the reverse order.

Is there a way to correct this?