<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Follow up: </div><div>I wrote a short C program to demonstrate the problem. It works with X11, and reliably fails with XQuartz (the rendering is incomplete). I realize this is probably an issue for the XQuartz folks, but before I go there, it would be nice to rule out incorrect Cairo code. The results are the same whether I compile and run my demo on my laptop or on a remote linux server that I connect to using ssh. I updated the images in the links given in my first message. </div><div>--Jennifer</div><div><br></div><div><span class="Apple-style-span" style="font-family: Courier; font-size: 13px; ">/* </span></div><div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;">xdemo.c</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;">for compiling on a mac:</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;">gcc -Wall -g xdemo.c -o xdemo -I/opt/local/include/cairo -L/opt/local/lib -lcairo -lX11</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;">for compiling on linux server (CentOS 5.9):</span></font></div><div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px; ">gcc -Wall -g xdemo.c -o xdemo -I/usr/include/cairo -L/usr/lib64 -lcairo -lX11</span></font></div></div><div><span class="Apple-style-span" style="font-family: Courier; font-size: 13px; ">*/</span></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;">#include <stdio.h></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;">#include <stdlib.h></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;">#include <math.h></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;">#include <cairo.h></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;">#include <cairo-xlib.h></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;">int main () {</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> Display *display = (Display *)NULL; </span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> XEvent xev;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> KeyCode quit;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> Window win;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> Visual *visual;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> cairo_surface_t *surface;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> cairo_t *cr;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> int snum,flag,r,a;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> double x,y,x0,y0,c;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> /* Create X window */</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> display = XOpenDisplay(0);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> snum = DefaultScreen(display);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> win = XCreateSimpleWindow(display, RootWindow(display,snum),100, 0, 500, 500, 4,</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-tab-span" style="white-space:pre"> </span> BlackPixel(display,snum), WhitePixel(display,snum));</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> /* Set event type 'Q' for quit */</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> quit = XKeysymToKeycode(display, XStringToKeysym("Q"));</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> XSelectInput(display, win, KeyPressMask|StructureNotifyMask|ExposureMask);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> </span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> /* Display Window */</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> XMapWindow(display, win);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> /* Wait for the expose event that indicates window is up */</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> flag=1;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> while (flag) {</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> XNextEvent(display,&xev);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> switch (xev.type) {</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> case Expose:</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> if (xev.xexpose.count != 0) break;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> else flag = 0;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> break;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> }</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> }</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> /* create the cairo surface */</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> visual = DefaultVisual(display,snum);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> surface = cairo_xlib_surface_create (display, win, visual, 500, 500);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> cr = cairo_create(surface);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> /* say hello */</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> cairo_set_source_rgb(cr, 0, 0, 0);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> cairo_select_font_face (cr, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> cairo_set_font_size (cr, 32);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> cairo_move_to (cr, 10, 42);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> cairo_show_text (cr, "Hello!");</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> /* draw concentric circles made up of tiny line segments */</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> for (r=10; r<=240; r+=10) {</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> c=(double)r/255.0;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> cairo_set_source_rgb(cr, c, c, c);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> for (a=0; a<360; a++) {</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> x = 250 + r*cos((double)(a)*3.14159/180.0);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> y = 250 + r*sin((double)(a)*3.14159/180.0);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> if (a==0) {</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-tab-span" style="white-space:pre"> </span>x0 = x;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-tab-span" style="white-space:pre"> </span>y0 = y;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-tab-span" style="white-space:pre"> </span>cairo_move_to(cr, x, y);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> }</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> else</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-tab-span" style="white-space:pre"> </span>cairo_line_to(cr, x, y);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> }</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> cairo_line_to(cr,x0,y0);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> cairo_stroke(cr);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> }</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> /* wait for user to hit 'Q' ... */</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> while (1) {</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> XNextEvent(display, &xev);</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> switch(xev.type) {</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> case KeyPress:</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> {</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-tab-span" style="white-space:pre"> </span>XKeyEvent *kev = &xev.xkey;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-tab-span" style="white-space:pre"> </span>if (kev->keycode == quit) return 0;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> }</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> break;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> }</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> }</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;"> return 0;</span></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-size: 13px;">}</span></font></div><div><br></div></div><div><br></div><div><br></div><div><br></div><br><div><div>On Aug 6, 2013, at 5:13 PM, Jennifer Adams wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Experts,<div>I am a developer of GrADS, a visualization tool for meteorological data. GrADS uses X11 for its interactive display window, but it also has a batch mode, so you can create graphics without the use of X. We have developed an interface for Cairo to do the rendering, not only to the X window, but also to create png, ps, eps, pdf, and svg output. </div><div><br></div><div>The problem I am having is with the X rendering when using XQuartz. Everything looks right when I use the old (deprecated) X11 application on my Mac, but if I use XQuartz, I get an incomplete rendering, illustrated by two screen shots (links are given below.) The graphical elements are very basic, these plots contain nothing but line segments and filled rectangles. </div><div><br></div><div><a href="http://iges.org/jma/x11.png">http://iges.org/jma/x11.png</a></div><div><a href="http://iges.org/jma/xquartz.png">http://iges.org/jma/xquartz.png</a></div><div><br><div>The batch-mode renderings by Cairo are correct, and the non-Cairo version of GrADS does not exhibit the problem with the X window display, so I am pretty sure that Cairo and XQuartz are not playing well together. </div><div><br></div><div>I am running Mac OS X 10.7.5. When running the old X11 application, the version information in the "About X11" window says: XQuartz 2.6.5 (xorg-server 1.10.6). When running XQuartz, the version numbers are more recent: XQuartz 2.7.4 (xorg-server 1.13.0). The Cairo version is 1.12.8.</div><div><br></div><div>I searched through my 2-yr archive of forum emails and found nothing related to rendering problems with XQuartz. Any suggestions or ideas about what might be going wrong would be most welcome. </div><div><br></div><div>--Jennifer</div><div><span class="Apple-style-span" style="font-size: 12px; "><br></span></div><div><span class="Apple-style-span" style="font-size: 12px; "><br></span></div><div><span class="Apple-style-span" style="font-size: 12px; ">--</span></div><div><div apple-content-edited="true"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 12px; "><div>Jennifer M. Adams<br>Center for Ocean-Land-Atmosphere Studies (COLA)<br>111 Research Hall, Mail Stop 2B3<br>George Mason University<br>4400 University Drive<br>Fairfax, VA 22030 <br><br></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline">
</div>
<br></div></div></div>-- <br>cairo mailing list<br><a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>http://lists.cairographics.org/mailman/listinfo/cairo</blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams<br>Center for Ocean-Land-Atmosphere Studies (COLA)<br>111 Research Hall, Mail Stop 2B3<br>George Mason University<br>4400 University Drive<br>Fairfax, VA 22030 <br><br></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></div></span></span><br class="Apple-interchange-newline">
</div>
<br></body></html>