[cairo-commit] src/cairo-ft-font.c src/cairo-xlib-surface.c

罗晶华 Jinghua Luo jinghua at kemper.freedesktop.org
Thu Jun 8 16:06:59 PDT 2006


 src/cairo-ft-font.c      |    3 +++
 src/cairo-xlib-surface.c |    3 +++
 2 files changed, 6 insertions(+)

New commits:
diff-tree ac20c80960ccf233f9582da88f0d7aa4a181099e (from d3c782320a76d8e79099e5c5dc03c7dd819573d7)
Author: Jinghua Luo <sunmoon1997 at gmail.com>
Date:   Fri Jun 9 07:06:51 2006 +0800

    freetype: Ignore global advance unconditionally.
    
    Global advance exists for historical reasons. Nowadays, most of fonts
    support unicode, means it's no guaranteed to every glyphs in the font
    has the same advance.Sometimes it maybe is biger/smaller then the global
    advance even for monospace fonts!So forcing their advance to global
    advance, it's obviously wrong.

diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 61a2c23..998c361 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -1762,6 +1762,9 @@ _cairo_ft_scaled_glyph_init (void			*abs
     if (!face)
 	return CAIRO_STATUS_NO_MEMORY;
 
+    /* Ignore global advance unconditionally */
+    load_flags |= FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;
+
     if ((info & CAIRO_SCALED_GLYPH_INFO_PATH) != 0 &&
 	(info & CAIRO_SCALED_GLYPH_INFO_SURFACE) == 0)
 	load_flags |= FT_LOAD_NO_BITMAP;
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index a34862a..6b8748d 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -2245,6 +2245,9 @@ _cairo_xlib_surface_add_glyph (Display *
 
 	cairo_destroy (cr);
 
+	tmp_surface->device_x_offset = glyph_surface->base.device_x_offset;
+	tmp_surface->device_y_offset = glyph_surface->base.device_y_offset;
+
 	glyph_surface = (cairo_image_surface_t *) tmp_surface;
 
 	if (status)


More information about the cairo-commit mailing list