Smoothing fonts using cairo

I am trying to smooth text rendering using anti-aliasing. But this is not smoothing.

http://tinypic.com/r/2h7dy1i/4

  The first line is a png image created using pango and cairo. The second line is an HTML tag <span>. This is in Firefox, Ubuntu with Gnome DE. The difference can be better understood by comparing “W” and “V” between two lines.

The code for rendering the text can be found at http://pastie.org/1073683 The font parameters are set on lines 17 and 20 as follows:

// setting up antialiasing
cairo_font_options_set_antialias(cfo, CAIRO_ANTIALIAS_GRAY);

// set the font options to cairo
cairo_set_font_options(this->cro, cfo);

Can someone tell me how to make these two lines look the same?

+3
1
cairo_font_options_set_antialias(cfo, CAIRO_ANTIALIAS_GRAY);

, . , CAIRO_ANTIALIAS_SUBPIXEL. , , , , . , - RGB . . . , .

+3

Source: https://habr.com/ru/post/1769974/


All Articles