I found this great example of text rendering using XRender extension. But the font is loaded from Freetype in grayscale format, is there a way to ustilize XRender to draw subpixel (LCD) antialiased glyphs? If yes, how?
Asked
Active
Viewed 839 times
1 Answers
2
Glyphs can be in any format you see in QueryPictFormats response (but all glyphs in glyphset share same format). Basically you render subpixel antialiased glyphs with freetype, upload it to rgba32 glyphset and rest is the same as when you use a8 (alpha only, see https://github.com/ereslibre/x11/blob/master/xrender/rendertext.c#L46-L47)

Andrey Sidorov
- 24,905
- 4
- 62
- 75
-
2I created working example on GitHub based on your suggestion. https://github.com/exebook/xrender-subpixel-glyph – exebook May 23 '15 at 11:31
-
You *must* enable freetype's LCD filter for the subpixel rendering to look norrmal, otherwise you'll get very noticeable color fringes. `#include FT_LCD_FILTER_H` and call `FT_Library_SetLcdFilter(library, FT_LCD_FILTER_DEFAULT);` – 12Me21 May 27 '21 at 07:22