diff options
author | Owen Taylor <otaylor@redhat.com> | 2005-08-18 17:19:54 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@redhat.com> | 2005-08-18 17:19:54 +0000 |
commit | c1b5a19624a850885996a6e0778098e77c0fd683 (patch) | |
tree | 702722eded3158c2bb00080f777cd31180de4770 | |
parent | 8f93bcfa47fbdfd20949d09ed677eb5e4d90b12b (diff) |
Fix offset passed in for source patterns. (#2333, Tim Rowley)
Fix font to Vera Sans rather than "Sans"
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/cairo-xlib-surface.c | 18 | ||||
-rw-r--r-- | test/.cvsignore | 1 | ||||
-rw-r--r-- | test/text-pattern-ref.png | bin | 2869 -> 2728 bytes | |||
-rw-r--r-- | test/text-pattern.c | 9 |
5 files changed, 23 insertions, 12 deletions
@@ -1,3 +1,10 @@ +2005-08-18 Owen Taylor <otaylor@redhat.com> + + * src/cairo-xlib-surface.c (_cairo_xlib_surface_show_glyphs): Fix offset + passed in for source patterns. (#2333, Tim Rowley) + + * test/text-pattern.c: Fix font to Vera Sans rather than "Sans" + 2005-08-18 Carl Worth <cworth@cworth.org> * ROADMAP: Update the roadmap. Remove difficulty rating from diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index eafa02a43..42151577e 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -2290,7 +2290,7 @@ _cairo_xlib_surface_show_glyphs32 (cairo_scaled_font_t *scaled_font, src->src_picture, self->dst_picture, mask_format, - source_x, source_y, + source_x + elts[0].xOff, source_y + elts[0].yOff, 0, 0, elts, count); @@ -2393,7 +2393,7 @@ _cairo_xlib_surface_show_glyphs16 (cairo_scaled_font_t *scaled_font, src->src_picture, self->dst_picture, mask_format, - source_x, source_y, + source_x + elts[0].xOff, source_y + elts[0].yOff, 0, 0, elts, count); @@ -2498,7 +2498,7 @@ _cairo_xlib_surface_show_glyphs8 (cairo_scaled_font_t *scaled_font, src->src_picture, self->dst_picture, mask_format, - source_x, source_y, + source_x + elts[0].xOff, source_y + elts[0].yOff, 0, 0, elts, count); @@ -2665,22 +2665,22 @@ _cairo_xlib_surface_show_glyphs (cairo_scaled_font_t *scaled_font, if (elt_size == 8) { status = _cairo_xlib_surface_show_glyphs8 (scaled_font, operator, cache, &key, src, self, - source_x + attributes.x_offset, - source_y + attributes.y_offset, + source_x + attributes.x_offset - dest_x, + source_y + attributes.y_offset - dest_y, glyphs, entries, num_glyphs); } else if (elt_size == 16) { status = _cairo_xlib_surface_show_glyphs16 (scaled_font, operator, cache, &key, src, self, - source_x + attributes.x_offset, - source_y + attributes.y_offset, + source_x + attributes.x_offset - dest_x, + source_y + attributes.y_offset - dest_y, glyphs, entries, num_glyphs); } else { status = _cairo_xlib_surface_show_glyphs32 (scaled_font, operator, cache, &key, src, self, - source_x + attributes.x_offset, - source_y + attributes.y_offset, + source_x + attributes.x_offset - dest_x, + source_y + attributes.y_offset - dest_y, glyphs, entries, num_glyphs); } diff --git a/test/.cvsignore b/test/.cvsignore index d7bea4c93..e09fca989 100644 --- a/test/.cvsignore +++ b/test/.cvsignore @@ -52,6 +52,7 @@ text-antialias-gray text-antialias-none text-antialias-subpixel text-cache-crash +text-pattern text-rotate transforms translate-show-surface diff --git a/test/text-pattern-ref.png b/test/text-pattern-ref.png Binary files differindex 52eed0ac8..6407f3e5c 100644 --- a/test/text-pattern-ref.png +++ b/test/text-pattern-ref.png diff --git a/test/text-pattern.c b/test/text-pattern.c index 347d83ba7..a337a332e 100644 --- a/test/text-pattern.c +++ b/test/text-pattern.c @@ -1,5 +1,5 @@ /* - * Copyright © 2004 Red Hat, Inc. + * Copyright © 2005 Tim Rowley * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without @@ -20,7 +20,7 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * Author: Carl D. Worth <cworth@cworth.org> + * Author: Tim Rowley */ #include "cairo-test.h" @@ -48,6 +48,10 @@ draw (cairo_t *cr, int width, int height) cairo_set_font_options (cr, font_options); cairo_font_options_destroy (font_options); + cairo_select_font_face (cr, "Bitstream Vera Sans", + CAIRO_FONT_SLANT_NORMAL, + CAIRO_FONT_WEIGHT_NORMAL); + cairo_scale (cr, width, height); pat = cairo_pattern_create_linear (0.0, 0.0, 1, 1); @@ -59,7 +63,6 @@ draw (cairo_t *cr, int width, int height) cairo_rectangle (cr, 0, 0, 0.1, 1); cairo_fill (cr); - cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size (cr, 0.4); cairo_move_to (cr, 0.1, 0.6); cairo_show_text (cr, "cairo"); |