Trying to render a font with simple grayscale anti-aliasing, like: cairo_font_options_t* fopts = cairo_font_options_create(); cairo_font_options_set_subpixel_order(fopts, CAIRO_SUBPIXEL_ORDER_DEFAULT); cairo_font_options_set_antialias(fopts, CAIRO_ANTIALIAS_GRAY); cairo_set_font_options(cr, fopts); fails to work. The options are ignored and instead the resulting rendering will produce results identical with CAIRO_ANTIALIAS_SUBPIXEL with colored pixel around the edge instead of grayscale ones. A simple example program reproducing the problem is attached.
(In reply to comment #0) > A simple example program reproducing the problem is attached. Are you sure about that? Where?
Created attachment 50660 [details] Demo of the problem Yes, reasonable sure about that. The problem originally showed up in Gnome: https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/703191 But seems to have its cause in Cairo.
Most probably you have fontconfig config files that override the hinting unconditionally. That's what's shipped with fontconfig but disabled by default. It's a bug to ship those (as opposed to config that only sets antialiasiing if not explicitly set), and cairo can force it if user asked, but that wouldn't work nice with fontconfig.
Created attachment 50661 [details] [review] Patch for grayscale anti-aliasing issue Attached is a patch for the issue.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/135.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.