Bug 99021

Summary: bad rendering showing text with CAIRO_ANTIALIAS_BEST
Product: cairo Reporter: Jason Crain <jason>
Component: image backendAssignee: Chris Wilson <chris>
Status: RESOLVED MOVED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: blocker    
Priority: highest CC: bique.alexandre, lionel
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: image of bad text rendering
Test case (source code which generate a png)

Description Jason Crain 2016-12-08 05:14:47 UTC
Created attachment 128375 [details]
image of bad text rendering

Setting the antialias font option to CAIRO_ANTIALIAS_BEST makes text rendering bad, as shown in the following program.

cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
                                                       80, 40);
cairo_t *cr = cairo_create (surface);
cairo_move_to (cr, 5, 30);
cairo_set_font_size (cr, 30);
cairo_font_options_t *font_options = cairo_font_options_create ();
cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_BEST);
cairo_set_font_options (cr, font_options);
cairo_show_text (cr, "hello");
cairo_surface_write_to_png (surface, "out.png");
Comment 1 Uli Schlachter 2016-12-10 17:27:21 UTC
I can reproduce the problem. I took a quick look at this has "something" to do with _render_glyph_outline() in src/cairo-ft-font.c. Ignoring the actual passed-in value here and forcing something else is enough to trigger this problem or make it go away.

So either this is a bug in freetype or _fill_xrender_bitmap in the same source file mis-converts something here. I don't know and I can't figure out more right now.
Comment 2 Alexandre Bique 2018-01-26 11:01:18 UTC
Hi, I'm having the same issue here.
The rendering is totally broken.

I've produced a test case for it.
Comment 3 Alexandre Bique 2018-01-26 11:03:56 UTC
Created attachment 136971 [details]
Test case (source code which generate a png)
Comment 4 Alexandre Bique 2018-01-26 11:07:44 UTC
This happens with cairo 1.15.10 and freetype 2.9.
I've set it as blocker.
Comment 5 GitLab Migration User 2018-08-25 13:42:29 UTC
-- 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/152.

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.