Fix offset passed in for source patterns. (#2333, Tim Rowley)

Fix font to Vera Sans rather than "Sans"
This commit is contained in:
Owen Taylor 2005-08-18 17:19:54 +00:00
parent 8f93bcfa47
commit c1b5a19624
5 changed files with 23 additions and 12 deletions

View file

@ -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

View file

@ -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);
}

View file

@ -52,6 +52,7 @@ text-antialias-gray
text-antialias-none
text-antialias-subpixel
text-cache-crash
text-pattern
text-rotate
transforms
translate-show-surface

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -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");