On Thu, 5 Jul 2007 13:26:22 -0500, "John Hunter" wrote: > On 7/5/07, Carl Worth <[EMAIL PROTECTED]> wrote: > > I don't know if there's anything special about the PostScript output > > you're currently producing that wouldn't make it acceptable to use > > cairo's PostScript output directly. But even if you just want code, > > it's inside cairo under the LGPL. > > I looked at cairo when we first started with the postscript backend, > but in the bad old days it was just a raster dump. I understand it > has come a long way since.
Yes, it's definitely a _lot_ better than that now. As of any recent release of cairo, (1.4.x), you will probably get all-vector output for the kinds of things I would expect matplotlib to do. If you do hit something that requires a raster-based fallback in cairo, (translucence or similar), the current releases of cairo do still compute the fallback by doing full-page rasterization. But there's a patch already put together, (by the expert Adrian Johnson), that makes cairo do rasterization for only the minimal necessary region, (so expect that in cairo 1.6 in the future). > mpl's postscript backend supports latex expressions in PS output, > which requires a fair amount of complex trickery in the postscript > backend, though we we could probably do it with embedded rasters in > cairo. Embedding latex expressions is really cool. If you do try something like this with cairo and find that you wish cairo would do something that it can't, then please let me know. > The postscript backend is also standalone with no dependencies > other than mpl and numpy, and adding cairo to the mix might be a bit > difficult for across platforms for some users (though this appears to > have gotten a lot better too). Yes, cairo should work extremely well across platforms, (and particularly the "generic" backends like the image, PDF, PostScript, and SVG backends). The only outstanding platform-specific issues are in display-device-specific backends such as in cairo's quartz backend, (but even it does work extremely well---just not quite perfectly---and the mozilla people are working hard to complete it). > LGPL means we cannot reuse the code. That's your choice of course. As far as type3 goes, there's really nothing special there. It would be just as easy (or easier) to just read the PostScript language reference and implement things directly as compared to reading cairo's code. That's all I did to write it originally, and it's not hard at all. Now, some of the other font subsetting work in cairo is a bit more sophisticated. Adrian Johnson has done most of that, so he would probably be the person you would need to ask if you would like the code to be made available under a more liberal licence than the LGPL, (or the Mozilla Public License as cairo is currently made available under either of those). > While I like the idea of using cairo for both raster and vector > outputs in principle because it offloads a lot of work onto a large > and well supported project, it would probably take a fair amount of > work to get all of mpl's functionality into the cairo backend (I don't > know this since I have not tested the backend for some time, but does > it support, for example unicode_demo, mathtext_demo, usetex, and > image_demo ?). It doesn't look to me like there's a lot of missing work. Here are the results from unicode_demo: http://www.cworth.org/matplotlib/ To summarize, all of the PNG, PostScript, PDF, and SVG output looks fine from the cairo backend. Meanwhile, the PDF backend, (as of 0.87.7) seems to generate broken output for the accented characters, and the SVG backend doesn't position/scale the text correctly. Cairo's PDF and PostScript output is smaller than matplotlib's native output, (factor of 2.75), while cairo's SVG output is a fair amount larger than matplotlib's, (factor of 11), since it's embedding all of the text glyphs, (which could be either good or bad depending on what you really want). I didn't seem to have any usetex demo installed with the Debian 0.87.7 package of python-matplotlib-doc, and with both mathtext_demo and image_demo I got the following inscrutable error messages: /usr/lib/python2.4/site-packages/matplotlib/backends/backend_cairo.py:329: UserWarning: cairo with Numeric support is required for _draw_mathtext() /usr/lib/python2.4/site-packages/matplotlib/backends/backend_cairo.py:162: UserWarning: cairo with Numeric support is required for draw_image() Does anybody know what that could mean? I have no idea what "cairo with Numeric support" is. Is it perhaps something specific to the pycairo python bindings of cairo? -Carl
pgpZ2aFDbzUty.pgp
Description: PGP signature
------------------------------------------------------------------------- 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/
_______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel