Bug 9378

Summary: ATSUI glyph paths are incorrectly rotated.
Product: cairo Reporter: Brian Ewins <Brian.Ewins>
Component: quartz font backendAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: high    
Version: 1.3.7   
Hardware: PowerPC   
OS: Mac OS X (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 9350    
Attachments: pass rotation matrix into the atsui path callbacks
path output (in black) overlaid on text output (in green)

Description Brian Ewins 2006-12-17 08:27:52 UTC
In text-rotate.c, the code to generate the reference image does:
cairo_text_path (cr, text);
        cairo_fill (cr);

instead of: cairo_show_text(cr, text);

With ATSUI these produce very different outputs - in the path version, the
characters are all positioned correctly but still in their original rotation.
This is because there's an additional rotation being used to draw the text that
isn't stored in the glyph. Patch follows.
Comment 1 Brian Ewins 2006-12-17 08:31:19 UTC
Created attachment 8146 [details] [review]
pass rotation matrix into the atsui path callbacks

The code to extract the rotation could probably be made into a cairo-matrix
utility. I feel there ought to be a way to avoid these shenanigans entirely, ie
to just transform the glyphs once, but I couldn't find it. In any case, this
code will be needed to measure the unrotated paths to find the inked extents
(since thats what I'm going to have to do).
Comment 2 Brian Ewins 2006-12-17 08:34:35 UTC
Created attachment 8147 [details]
path output (in black) overlaid on text output (in green)

Rather than repeatedly run the text-rotate test with different options, I
changed the inner loop to show the text and the paths at the same time:
	cairo_set_source_rgb (cr, 0, 1, 0);
	cairo_show_text (cr, text);
	cairo_move_to (cr, x_off - extents.x_bearing, y_off -
extents.y_bearing);
	cairo_set_source_rgb (cr, 0, 0, 0);
	cairo_text_path (cr, text);
	cairo_fill (cr);

I'm not pixel-aligning paths yet and there may be issues with device vs user
space (I'll follow that up separately)
Comment 3 Behdad Esfahbod 2006-12-17 11:35:35 UTC
Vlad, I'll leave this one to you :).
Comment 4 Brian Ewins 2007-01-07 17:15:28 UTC
Committed as 9a005c6221cc279e65d94956c74028a84baf1716

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.