Bug 17830 - postscript cuts text when rotated
Summary: postscript cuts text when rotated
Status: RESOLVED NOTABUG
Alias: None
Product: cairo
Classification: Unclassified
Component: postscript backend (show other bugs)
Version: 1.8.0
Hardware: All All
: medium normal
Assignee: Adrian Johnson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-29 15:02 UTC by Charles Doutriaux
Modified: 2008-10-12 08:01 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Result that works ok, legend is full and theres about 20 "X" (55.68 KB, application/postscript)
2008-09-29 15:32 UTC, Charles Doutriaux
Details
bad file, only a few "X" legend label are also cropped (45.31 KB, application/postscript)
2008-09-29 15:34 UTC, Charles Doutriaux
Details
the FULL C code, not just the snippet (90.44 KB, text/plain)
2008-09-29 15:34 UTC, Charles Doutriaux
Details

Description Charles Doutriaux 2008-09-29 15:02:02 UTC
THe pasted snipet of code shows an example that works compiled under 1.6.4, and works under other backend (png/svg/pdf).

Somehow I get a truncated output since 1.7.4 (at least) it seems as if the text is truncated as if the page was orientated portrait (i first rotate it and then draw as if it was landscape)

1.8.0 still has the problem.

C.

#include <cairo.h>
#include <cairo-ps.h>
int main(){
cairo_surface_t *surface;
cairo_t *cr;
cairo_pattern_t *pattern=NULL;
cairo_surface_t *image=NULL;
cairo_t *cr2=NULL;
double dashes[4];
int ndashes;
cairo_matrix_t matrix;
char achar[2];
surface = cairo_ps_surface_create("test.ps", 792, 612);
cairo_ps_surface_dsc_begin_setup (surface);
cairo_ps_surface_dsc_begin_page_setup (surface);
cr = cairo_create (surface);
cairo_translate(cr,0,612);
cairo_rotate(cr,-1.5707963267948966);
cairo_move_to(cr,660.600037,460.631622);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-76.967621,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = 'X';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_restore(cr);
cairo_save(cr);
cairo_rectangle(cr,18.000000,599.000000,756.000000,-761.800003);
cairo_clip(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_set_source_rgb (cr, 0.600000, 0.000000, 0.000000 );
cairo_restore(cr);
cairo_save(cr);
cairo_rectangle(cr,18.000000,599.000000,756.000000,-761.800003);
cairo_clip(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,92.630608);
cairo_line_to(cr,55.799999,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,101.160004,92.630608);
cairo_line_to(cr,101.160004,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,146.520004,92.630608);
cairo_line_to(cr,146.520004,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,191.880005,92.630608);
cairo_line_to(cr,191.880005,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,237.240021,92.630608);
cairo_line_to(cr,237.240021,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,282.600006,92.630608);
cairo_line_to(cr,282.600006,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,327.960022,92.630608);
cairo_line_to(cr,327.960022,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,373.320007,92.630608);
cairo_line_to(cr,373.320007,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,418.680023,92.630608);
cairo_line_to(cr,418.680023,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,464.040039,92.630608);
cairo_line_to(cr,464.040039,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,509.400024,92.630608);
cairo_line_to(cr,509.400024,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,554.760010,92.630608);
cairo_line_to(cr,554.760010,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,600.120056,92.630608);
cairo_line_to(cr,600.120056,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,645.480042,92.630608);
cairo_line_to(cr,645.480042,85.565033);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,690.840027,92.630608);
cairo_line_to(cr,690.840027,85.565033);
cairo_stroke(cr);
cairo_restore(cr);
cairo_save(cr);
cairo_rectangle(cr,18.000000,599.000000,756.000000,-761.800003);
cairo_clip(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_set_source_rgb (cr, 0.600000, 0.000000, 0.000000 );
cairo_restore(cr);
cairo_save(cr);
cairo_rectangle(cr,18.000000,599.000000,756.000000,-761.800003);
cairo_clip(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,445.911591);
cairo_line_to(cr,48.239998,445.911591);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,422.359528);
cairo_line_to(cr,48.239998,422.359528);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,398.807465);
cairo_line_to(cr,48.239998,398.807465);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,375.255402);
cairo_line_to(cr,48.239998,375.255402);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,351.703308);
cairo_line_to(cr,48.239998,351.703308);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,328.151245);
cairo_line_to(cr,48.239998,328.151245);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,304.599182);
cairo_line_to(cr,48.239998,304.599182);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,281.047119);
cairo_line_to(cr,48.239998,281.047119);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,257.495056);
cairo_line_to(cr,48.239998,257.495056);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,233.943008);
cairo_line_to(cr,48.239998,233.943008);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,210.390915);
cairo_line_to(cr,48.239998,210.390915);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,186.838852);
cairo_line_to(cr,48.239998,186.838852);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,163.286789);
cairo_line_to(cr,48.239998,163.286789);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,139.734726);
cairo_line_to(cr,48.239998,139.734726);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,55.799999,116.182671);
cairo_line_to(cr,48.239998,116.182671);
cairo_stroke(cr);
cairo_restore(cr);
cairo_save(cr);
cairo_rectangle(cr,18.000000,599.000000,756.000000,-761.800003);
cairo_clip(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_set_source_rgb (cr, 0.600000, 0.000000, 0.000000 );
cairo_restore(cr);
cairo_save(cr);
cairo_rectangle(cr,18.000000,599.000000,756.000000,-761.800003);
cairo_clip(cr);
cairo_move_to(cr,48.239998,445.911591);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-7.044495,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '0';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,422.359528);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-17.848419,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '0';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '.';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '6';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,398.807465);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-17.848419,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '1';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '.';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '2';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,375.255402);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-17.848419,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '1';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '.';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '8';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,351.703308);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-17.848419,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '2';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '.';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '4';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,328.151245);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-7.044495,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '3';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,304.599182);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-17.848419,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '3';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '.';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '6';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,281.047119);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-17.848419,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '4';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '.';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '2';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,257.495056);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-17.848419,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '4';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '.';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '8';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,233.943008);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-17.848419,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '5';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '.';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '4';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,210.390915);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-7.044495,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '6';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,186.838852);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-17.848419,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '6';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '.';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '6';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,163.286789);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-17.848419,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '7';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '.';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '2';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,139.734726);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-17.848419,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '7';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '.';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '8';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_move_to(cr,48.239998,116.182671);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_rel_move_to(cr,-17.848419,4.506000);
cairo_rotate(cr,0.000000);
achar[0] = '8';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '.';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
achar[0] = '4';
achar[1] = '\0';
cairo_rel_move_to(cr,0.000000,0.000000);
cairo_show_text (cr, achar);
cairo_rotate(cr,-0.000000);
cairo_restore(cr);
cairo_save(cr);
cairo_rectangle(cr,18.000000,599.000000,756.000000,-761.800003);
cairo_clip(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_set_source_rgb (cr, 0.600000, 0.000000, 0.000000 );
cairo_restore(cr);
cairo_save(cr);
cairo_rectangle(cr,18.000000,599.000000,756.000000,-761.800003);
cairo_clip(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,445.911591);
cairo_line_to(cr,743.760010,445.911591);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,422.359528);
cairo_line_to(cr,743.760010,422.359528);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,398.807465);
cairo_line_to(cr,743.760010,398.807465);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,375.255402);
cairo_line_to(cr,743.760010,375.255402);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,351.703308);
cairo_line_to(cr,743.760010,351.703308);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,328.151245);
cairo_line_to(cr,743.760010,328.151245);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,304.599182);
cairo_line_to(cr,743.760010,304.599182);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,281.047119);
cairo_line_to(cr,743.760010,281.047119);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,257.495056);
cairo_line_to(cr,743.760010,257.495056);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,233.943008);
cairo_line_to(cr,743.760010,233.943008);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,210.390915);
cairo_line_to(cr,743.760010,210.390915);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,186.838852);
cairo_line_to(cr,743.760010,186.838852);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,163.286789);
cairo_line_to(cr,743.760010,163.286789);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,139.734726);
cairo_line_to(cr,743.760010,139.734726);
cairo_stroke(cr);
ndashes=0;
cairo_set_dash(cr,dashes,ndashes,0.);
cairo_set_line_width(cr,1.000000*.5);
cairo_set_source_rgb (cr, 0.000000, 0.000000, 0.000000 );
cairo_move_to(cr,736.200012,116.182671);
cairo_line_to(cr,743.760010,116.182671);
cairo_stroke(cr);
cairo_restore(cr);
cairo_save(cr);
cairo_rectangle(cr,18.000000,599.000000,756.000000,-761.800003);
cairo_clip(cr);
cairo_destroy (cr);
cairo_surface_flush(surface);
cairo_surface_finish(surface);
cairo_surface_destroy (surface);
}
Comment 1 Behdad Esfahbod 2008-09-29 15:05:40 UTC
Can you please attach PS/PDF/SVG of both 1.6.x and 1.8.0 please?  Plus one screenshot of what you consider correct rendering.

I know sent some of these to the list, but I didn't see PDF/SVG output of it.

Thanks,
Comment 2 Charles Doutriaux 2008-09-29 15:32:55 UTC
Created attachment 19290 [details]
Result that works ok, legend is full and theres about 20 "X"

note that the legend labels extend all the way and that there's about 20 X

I looked at the ps file both on a linux box and a Mac OS X, (ps generated originally on Linux) and I see the error (next attachement on both platform)
Comment 3 Charles Doutriaux 2008-09-29 15:34:20 UTC
Created attachment 19291 [details]
bad file, only a few "X" legend label are also cropped

same C code but run linked against 1.7.6
Comment 4 Charles Doutriaux 2008-09-29 15:34:54 UTC
Created attachment 19292 [details]
the FULL C code, not just the snippet
Comment 5 Chris Wilson 2008-09-29 15:49:25 UTC
In the test case, you take a landscape page, rotate it into a portrait orientation and then proceed to draw on it as if it were still in landscape configuration.

The two postscript examples display identically using GhostScript and match the description above of the drawing being in the wrong orientation wrt the page, and match the output of the test case.
Comment 6 Charles Doutriaux 2008-09-29 16:20:23 UTC
Which ghostcritp do you use?

I'm using the latest

C.

On Sep 29, 2008, at 3:49 PM, bugzilla-daemon@freedesktop.org wrote:

> http:// bugs.freedesktop.org/show_bug.cgi?id=17830
>
>
>
>
>
> --- Comment #5 from Chris Wilson <chris@chris-wilson.co.uk>   
> 2008-09-29 15:49:25 PST ---
> In the test case, you take a landscape page, rotate it into a portrait
> orientation and then proceed to draw on it as if it were still in  
> landscape
> configuration.
>
> The two postscript examples display identically using GhostScript  
> and match the
> description above of the drawing being in the wrong orientation wrt  
> the page,
> and match the output of the test case.
>
>
> -- 
> Configure bugmail: http:// bugs.freedesktop.org/userprefs.cgi? 
> tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.
>
Comment 7 Chris Wilson 2008-09-29 16:48:11 UTC
Finally I understand... You're not telling gs the size of the page you've drawn but leaving it to gs to automatically choose. You've transposed your page dimensions in the call to cairo_ps_surface_create() [and in the rotation function].

Add a cairo_rectangle (cr, 0, 0, 792, 612); cairo_clip (cr); immediately after the cairo_create (surface); (or even just a cairo_paint(cr); to fill the background with black) and hopefully you'll see what's going on.
Comment 8 Charles Doutriaux 2008-10-02 16:01:27 UTC
Ok that confirms what I thought it doesn't know I rotated the plot.
Even if my rotation is badly implemented then the actual grpahics should be consistently cropped in a similar manner as the text.

What do you recommend i change in my rotation/translation in order to get the text to appear again ?

I have to admit  I'm lost here. Not sure what to do next? Is it a problem with my code or the text portion of cairo ? (or both?)

Thanks for any help on how to fix this, I would like to move to cairo 1.8.0

C.


(In reply to comment #7)
> Finally I understand... You're not telling gs the size of the page you've drawn
> but leaving it to gs to automatically choose. You've transposed your page
> dimensions in the call to cairo_ps_surface_create() [and in the rotation
> function].
> 
> Add a cairo_rectangle (cr, 0, 0, 792, 612); cairo_clip (cr); immediately after
> the cairo_create (surface); (or even just a cairo_paint(cr); to fill the
> background with black) and hopefully you'll see what's going on.
> 

Comment 9 Adrian Johnson 2008-10-12 08:01:39 UTC
Closing this as it is not a bug but the result of drawing outside of the page due to transposed page dimensions. I described how to create a landscape page in this message:

http://lists.cairographics.org/archives/cairo/2008-October/015366.html


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.