diff options
| author | Francesco Abbate <francesco.bbt@gmail.com> | 2021-12-15 14:52:34 +0100 |
|---|---|---|
| committer | Francesco Abbate <francesco.bbt@gmail.com> | 2021-12-15 14:52:34 +0100 |
| commit | 91e30113cdcc88e83093937c6c60c75e4516da1a (patch) | |
| tree | 9408a65bb3d4415f2fc9374eca5fdc23dbb86eac | |
| parent | 997b3efbb7173bd1eded2de9be2400e47faf461e (diff) | |
| download | lite-xl-improve-lcd-weights.tar.gz lite-xl-improve-lcd-weights.zip | |
Use better LCD filter weight for subpixel renderingimprove-lcd-weights
Based on:
https://freetype.org/freetype2/docs/reference/ft2-lcd_rendering.html
the coefficients should be normalized which was not the case. We use
the values previously used with the AGG library implementation. The
new coefficients are normalized and creates maybe less color fringes.
Ultimately it is difficult and subjective to say which coefficients are
better and the answer may depends on the vision of the person or on the
characteristics of the used monitor.
| -rw-r--r-- | src/renderer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/renderer.c b/src/renderer.c index b0e17f58..58a52c49 100644 --- a/src/renderer.c +++ b/src/renderer.c @@ -76,7 +76,7 @@ static int font_set_render_options(RenFont* font) { if (font->antialiasing == FONT_ANTIALIASING_NONE) return FT_RENDER_MODE_MONO; if (font->antialiasing == FONT_ANTIALIASING_SUBPIXEL) { - unsigned char weights[] = { 0x10, 0x40, 0x70, 0x40, 0x10 } ; + unsigned char weights[] = { 0x17, 0x2f, 0x74, 0x2f, 0x17 } ; switch (font->hinting) { case FONT_HINTING_NONE: FT_Library_SetLcdFilter(library, FT_LCD_FILTER_NONE); break; case FONT_HINTING_SLIGHT: |
