Re: [Plplot-devel] Cairo Driver Family

2007-06-04 Thread Hazen Babcock

On Jun 3, 2007, at 7:30 PM, Alan W. Irwin wrote:

 On 2007-06-03 18:20-0400 Hazen Babcock wrote:


 Hello,

 I've added the Cairo driver family to PLplot. This includes:

 xcairo (formally known as xwinttf).
 pdfcairo (PDF)
 pscairo (PS)
 svgcairo (SVG)
 pngcairo (PNG)
 memcairo (MEM)

 Known issues:
 1. If you have Cairo but not X Windows your build will likely fail
 since I still haven't solved the pre-processor directive problem I
 mentioned Yesterday.
 2. The svgcairo driver does not display text properly. I'm not really
 sure what to do about this one since it seems to be an issue with the
 cairo library.
 3. The pngcairo driver does not support multiple pages. You only get
 one page, which is the last page that you drew. This could be fixed
 by having the driver generate multiple files, say my-graph.png, my-
 graph-2.png, etc... I don't think the PNG format itself supports
 multiple page output.

 That is correct.  The way this is taken care of for the png device  
 (as well
 as jpeg and gif) for gd.c is to use the normal PLplot familying  
 facility
 (see
 http://plplot.sourceforge.net/docbook-manual/plplot-html-5.7.3/ 
 output-devices.html#familying).
 It's a bit tricky to set up, but if you follow what is done for  
 gd.c, you
 should be fine.  I thought you might have inadvertently set up  
 familying
 already simply by following what is done in gd.c, but apparently  
 not since
 the -fam command-line option only gives the same last page of  
 example 8 that
 you get without the option.

Ok. I'll implement this approach.

 4. The memcairo driver is untested. It appears that a side effect of
 a call to plsmem is to force PLplot to use the mem driver. An
 attempt to overide this behavior by calling plsdev(memcairo) after
 the plsmem call but before plinit was unsuccessful.
 5. Plots output by the pscairo driver do not fit the page, i.e. there
 is a largish white margin on two sides of a plot.

 All the drivers are off by default so you will have to turn them on
 to test them, if you are so inclined.

 I didn't bother with memcairo, but I built all the rest with no  
 build errors
 on Ubuntu Dapper.

 I have only done the most superficial tests of the built results,  
 but I
 immediately noticed two issues on Linux beyond what you mentioned.

 (1) the 'ldd -r cairo.so' test showed the
 following problems:

 undefined symbol: cairo_ps_surface_create   (./cairo.so)
 undefined symbol: cairo_pdf_surface_create  (./cairo.so)
 undefined symbol: cairo_svg_surface_create  (./cairo.so)

 It's fairly urgent to solve these problems since it excludes any  
 testing of
 the pscairo, pdfcairo, or svgcairo devices on Linux.

Maybe this is because I have Cairo v1.2.6 and debian testing is  
v1.2.4? According the cairo docs these functions have been in the  
library since 1.2.

 (2)  ./x08c -dev xcairo shows only the first page of that example.

Hm. On OS-X I get a bus error. It is interesting that it works fine  
if you just type ./x08c and then choose the driver.

-Hazen


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel


Re: [Plplot-devel] Cairo Driver Family

2007-06-04 Thread Alan W. Irwin
On 2007-06-04 21:17-0400 Hazen Babcock wrote:

 On Jun 3, 2007, at 7:30 PM, Alan W. Irwin wrote:

 (1) the 'ldd -r cairo.so' test showed the
 following problems:
 
 undefined symbol: cairo_ps_surface_create   (./cairo.so)
 undefined symbol: cairo_pdf_surface_create  (./cairo.so)
 undefined symbol: cairo_svg_surface_create  (./cairo.so)
 
 It's fairly urgent to solve these problems since it excludes any testing 
 of
 the pscairo, pdfcairo, or svgcairo devices on Linux.

 Maybe this is because I have Cairo v1.2.6 and debian testing is v1.2.4? 
 According the cairo docs these functions have been in the library since 1.2.

Actually, my platform is Ubuntu Dapper (released almost exactly a year ago)
which has version 1.0.4 of the cairo library.  So that explains the missing
symbols for my platform. Note, _some_ Ubuntu Dapper platforms are going to
be around for a long time since Canonical plans to support it for 3 years on
the desktop (and 5 years on the server).  However, I am not sure the
majority of desktop users will actually use Ubuntu Dapper that long since
even a one-year old Linux desktop is already way out of date thanks to the
huge pace of change for Linux development.  (A case in point is this already
old libcairo version for Ubuntu Dapper).  For example, I plan to move to
Debian testing as soon as I can find the time to do the install.

That's the best background I can give you about how relevant libcairo-1.0.4
will be in the future, and I will let you be the judge whether you want to
support this older version of libcairo or not.  I hope to install debian
testing some time this summer after I finish my current research project,
and after that old libcairo versions won't be an issue for me.


 (2)  ./x08c -dev xcairo shows only the first page of that example.

 Hm. On OS-X I get a bus error. It is interesting that it works fine if you 
 just type ./x08c and then choose the driver.

./x08c -dev xcairo now actually pretty much works for me.  I finally figured
out that you should hit CR in the xterm where that command-line is typed and
not the GUI (at least when threading is not turned on).

Now that I know how to run it, ./x08c -dev xcairo shows some issues.

(1) The 3D labelling needs work on the transformation to determine the
rotation and slew of each letter.  I thought there was now standard code
in the plplot library for that?  Or is it a bug in that standard code?

(2) Memory management issues

Here is the associated error message (after I hit one additional CR after
the last page of example 8 is displayed)

*** glibc detected *** double free or corruption (!prev): 0x08050358 ***

Unless there is some internal problem in the Ubuntu Dapper libraries (this
is possible since these are old versions of each library) it sounds like
your code might be trying to free something that has already been freed.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__

Linux-powered Science
__

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel