[cairo-commit] src/cairo-atsui-font.c

Behdad Esfahbod behdad at kemper.freedesktop.org
Sat Dec 16 12:44:06 PST 2006


 src/cairo-atsui-font.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

New commits:
diff-tree be6edd64a3f45f7fb33f7d57b71b1ef467b474e1 (from bf1c2ef1e2b6cffffb0f02fe5cb8df0728026642)
Author: Brian Ewins <Brian.Ewins at gmail.com>
Date:   Sat Dec 16 15:43:46 2006 -0500

    [ATSUI] Round glyph locations to nearest pixel
    
    This is what cairo_scaled_font_show_glyphs() does, as well as backends like
    xlib and win32.

diff --git a/src/cairo-atsui-font.c b/src/cairo-atsui-font.c
index d345ebc..6ba9c2e 100644
--- a/src/cairo-atsui-font.c
+++ b/src/cairo-atsui-font.c
@@ -722,9 +722,11 @@ _cairo_atsui_font_old_show_glyphs (void	
     for (i = 0; i < num_glyphs; i++) {
         CGGlyph theGlyph = glyphs[i].index;
 
+	/* round glyph locations to the nearest pixel */
+	/* XXX: FRAGILE: We're ignoring device_transform scaling here. A bug? */
         CGContextShowGlyphsAtPoint(drawingContext,
-				   glyphs[i].x,
-                                   glyphs[i].y,
+				   _cairo_lround (glyphs[i].x),
+				   _cairo_lround (glyphs[i].y),
                                    &theGlyph, 1);
     }
 


More information about the cairo-commit mailing list