Blame test/twin-antialias-none.c

Packit 324a5c
/*
Packit 324a5c
 * Copyright 2008 Chris Wilson
Packit 324a5c
 *
Packit 324a5c
 * Permission to use, copy, modify, distribute, and sell this software
Packit 324a5c
 * and its documentation for any purpose is hereby granted without
Packit 324a5c
 * fee, provided that the above copyright notice appear in all copies
Packit 324a5c
 * and that both that copyright notice and this permission notice
Packit 324a5c
 * appear in supporting documentation, and that the name of
Packit 324a5c
 * Chris Wilson not be used in advertising or publicity pertaining to
Packit 324a5c
 * distribution of the software without specific, written prior
Packit 324a5c
 * permission. Chris Wilson makes no representations about the
Packit 324a5c
 * suitability of this software for any purpose.  It is provided "as
Packit 324a5c
 * is" without express or implied warranty.
Packit 324a5c
 *
Packit 324a5c
 * CHRIS WILSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
Packit 324a5c
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
Packit 324a5c
 * FITNESS, IN NO EVENT SHALL CHRIS WILSON BE LIABLE FOR ANY SPECIAL,
Packit 324a5c
 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
Packit 324a5c
 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
Packit 324a5c
 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
Packit 324a5c
 * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Packit 324a5c
 *
Packit 324a5c
 * Author: Chris Wilson <chris@chris-wilson.co.uk>
Packit 324a5c
 */
Packit 324a5c
Packit 324a5c
#include "cairo-test.h"
Packit 324a5c
Packit 324a5c
static cairo_test_status_t
Packit 324a5c
draw (cairo_t *cr, int width, int height)
Packit 324a5c
{
Packit 324a5c
    cairo_font_options_t *options;
Packit 324a5c
Packit 324a5c
    cairo_set_source_rgb (cr, 1, 1, 1);
Packit 324a5c
    cairo_paint (cr);
Packit 324a5c
    cairo_set_source_rgb (cr, 0, 0, 0);
Packit 324a5c
Packit 324a5c
    cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
Packit 324a5c
Packit 324a5c
    cairo_select_font_face (cr,
Packit 324a5c
			    "@cairo:",
Packit 324a5c
			    CAIRO_FONT_SLANT_NORMAL,
Packit 324a5c
			    CAIRO_FONT_WEIGHT_NORMAL);
Packit 324a5c
Packit 324a5c
    options = cairo_font_options_create ();
Packit 324a5c
    cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_NONE);
Packit 324a5c
    cairo_set_font_options (cr, options);
Packit 324a5c
    cairo_font_options_destroy (options);
Packit 324a5c
Packit 324a5c
    cairo_set_font_size (cr, 16);
Packit 324a5c
Packit 324a5c
    cairo_move_to (cr, 4, 14);
Packit 324a5c
    cairo_show_text (cr, "Is cairo's twin giza?");
Packit 324a5c
Packit 324a5c
    cairo_move_to (cr, 4, 34);
Packit 324a5c
    cairo_text_path (cr, "Is cairo's twin giza?");
Packit 324a5c
    cairo_fill (cr);
Packit 324a5c
Packit 324a5c
    cairo_move_to (cr, 4, 54);
Packit 324a5c
    cairo_text_path (cr, "Is cairo's twin giza?");
Packit 324a5c
    cairo_set_line_width (cr, 2/16.);
Packit 324a5c
    cairo_stroke (cr);
Packit 324a5c
Packit 324a5c
    return CAIRO_TEST_SUCCESS;
Packit 324a5c
}
Packit 324a5c
Packit 324a5c
CAIRO_TEST (twin_antialias_none,
Packit 324a5c
	    "Tests the internal font (with antialiasing disabled)",
Packit 324a5c
	    "twin, font", /* keywords */
Packit 324a5c
	    "target=raster", /* requirements */
Packit 324a5c
	    140, 60,
Packit 324a5c
	    NULL, draw)