Package: libcairo2 Version: 1.10.2-6.2 Severity: normal Attached very simple C program compiled and run as follows:
gcc -Wall `pkg-config --cflags --libs cairo` test.c -o test && \ ./test && \ eog test.png produces incorrect results in Debian testing with libcairo2 1.10.2 and correct results in Debian stable with libcario2 version 1.8.10-6. The output file generated by the test program (test.png) has two lines of text. There should be one line of large text and one line of small text. With libcario2 from testing, both lines are the large size. -- System Information: Debian Release: wheezy/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores) Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C) Shell: /bin/sh linked to /bin/dash Versions of packages libcairo2 depends on: ii libc6 2.13-24 ii libfontconfig1 2.8.0-3 ii libfreetype6 2.4.8-1 ii libpixman-1-0 0.24.0-1 ii libpng12-0 1.2.46-3 ii libx11-6 2:1.4.4-4 ii libxcb-render0 1.7-4 ii libxcb-shm0 1.7-4 ii libxcb1 1.7-4 ii libxrender1 1:0.9.6-2 ii zlib1g 1:1.2.3.4.dfsg-3 libcairo2 recommends no packages. libcairo2 suggests no packages. -- no debconf information
/* gcc -Wall `pkg-config --cflags --libs cairo` cairo-text-size-test.c -o cairo-text-size-test */ #include <stdio.h> #include <stdlib.h> #include <cairo.h> static const char font_family [] = "Terminus" ; static void render_text (cairo_surface_t * surface) { const char * text ; cairo_t * cr ; cr = cairo_create (surface) ; cairo_set_source_rgb (cr, 1.0, 1.0, 1.0) ; /* Print title. */ cairo_select_font_face (cr, font_family, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL) ; cairo_set_font_size (cr, 30.0) ; text = "Big text" ; cairo_move_to (cr, 20.0, 48.0) ; cairo_show_text (cr, text) ; cairo_set_font_size (cr, 12.0) ; text = "Normal text" ; cairo_move_to (cr, 20.0, 100.0) ; cairo_show_text (cr, text) ; cairo_destroy (cr) ; } /* render_text */ int main (void) { cairo_surface_t * surface = NULL ; cairo_status_t status ; surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, 400, 300) ; if (surface == NULL || cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS) { status = cairo_surface_status (surface) ; printf ("Error while creating surface : %s\n", cairo_status_to_string (status)) ; exit (1) ; } ; cairo_surface_flush (surface) ; render_text (surface) ; status = cairo_surface_write_to_png (surface, "test.png") ; if (status != CAIRO_STATUS_SUCCESS) printf ("Error while creating PNG file : %s\n", cairo_status_to_string (status)) ; cairo_surface_destroy (surface) ; return 0 ; } /* main */