diff options
author | Carl Worth <cworth@cworth.org> | 2005-08-23 10:11:16 +0000 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2005-08-23 10:11:16 +0000 |
commit | 9e68e0ceef2519b28e582fdaa8f2a8a33401735a (patch) | |
tree | d92d00d74da6fefe1992396697ef58a66811bd51 /test/text-rotate.c | |
parent | 985c919b9fca504125df024e511eacf42a001985 (diff) | |
download | cairo-9e68e0ceef2519b28e582fdaa8f2a8a33401735a.tar.gz |
Add more comments on the improved state of this bug. Commit a reference image generated with cairo_text_path; cairo_fill. (We may not require getting this exact result, but I think it is worth examining the differences closely.)
Diffstat (limited to 'test/text-rotate.c')
-rw-r--r-- | test/text-rotate.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/test/text-rotate.c b/test/text-rotate.c index 56bfe7a6f..d1985e53f 100644 --- a/test/text-rotate.c +++ b/test/text-rotate.c @@ -42,7 +42,7 @@ * * 2004-11-03 Carl Worth <cworth@cworth.org> * - * Looks like the major problems with this bg appeared in the great + * Looks like the major problems with this bug appeared in the great * font rework between 0.1.23 and 0.2.0. And it looks like we need * to fix the regression test suite to test the xlib target (since * the bug does not show up in the png backend). @@ -55,6 +55,26 @@ * text--a new version of freetype will change everything. We may * need to add a simple backend for stroked fonts and add a simple * builtin font to cairo for pixel-perfect tests with text. + * + * 2005-08-23 + * + * It appears that the worst placement and glyph selection problems + * have now been resolved. In the past some letters were noticeably + * of a different size at some rotations, and there was a lot of + * drift away from the baseline. These problems do not appear + * anymore. + * + * Another thing that helps is that we now have font options which + * we can use to disable hinting in order to get more repeatable + * results. I'm doing that in this test now. + * + * There are still some subtle positioning problems which I'm + * assuming are due to the lack of finer-than-whole-pixel glyph + * positioning. I'm generating a reference image now by replacing + * cairo_show_text with cairo_text_path; cairo_fill. This will let + * us look more closely at the remaining positioning problems. (In + * particular, I want to make sure we're rounding as well as + * possible). */ #include "cairo-test.h" @@ -76,6 +96,7 @@ draw (cairo_t *cr, int width, int height) { int i, x_off, y_off; cairo_text_extents_t extents; + cairo_font_options_t *font_options; static char text[] = "cairo"; cairo_select_font_face (cr, "Bitstream Vera Sans", @@ -83,6 +104,15 @@ draw (cairo_t *cr, int width, int height) CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size (cr, TEXT_SIZE); + font_options = cairo_font_options_create (); + + cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); + cairo_font_options_set_hint_metrics (font_options, CAIRO_HINT_METRICS_OFF); + cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); + + cairo_set_font_options (cr, font_options); + cairo_font_options_destroy (font_options); + cairo_set_source_rgb (cr, 0, 0, 0); cairo_translate (cr, WIDTH/2.0, HEIGHT/2.0); @@ -105,7 +135,12 @@ draw (cairo_t *cr, int width, int height) cairo_stroke (cr); cairo_move_to (cr, x_off - extents.x_bearing, y_off - extents.y_bearing); cairo_set_source_rgb (cr, 0, 0, 0); +#if CAIRO_TEST_GENERATE_REFERENCE_IMAGE + cairo_text_path (cr, "cairo"); + cairo_fill (cr); +#else cairo_show_text (cr, "cairo"); +#endif cairo_restore (cr); } @@ -116,5 +151,5 @@ int main (void) { return cairo_test_expect_failure (&test, draw, - "known bugs in positioning rotated glyphs"); + "minor bugs in positioning rotated glyphs"); } |