Showing posts with label cl-cairo2. Show all posts
Showing posts with label cl-cairo2. Show all posts

Thursday, January 26, 2012

cl-cairo2: new maintainer, new license

cl-cairo2 was one of the first Common Lisp libraries I wrote, but I haven't been using it much for the last year or so (currently I am experimenting with cl-pdf as a backend for my new plotting library, which will be released soon). I have been pretty busy with research, so I didn't have time to merge (and test) patches, also, I didn't even contemplate updating the library to make use of the latest version of cairo. So when Ryan Pavlik contacted me about adding compatibility with cl-freetype2, I asked him whether he wants to take over as a maintaner. He kindly agreed, so I have transferred the repository to him, and he already merged a lot of patches.

One last thing that I wanted to fix before handing the repository over is the license. Originally, the library was licensed under the GPL — in retrospect, I think that

  1. I was very naive about software licenses, and didn't really understand what GPL means in the context if Common Lisp (I still don't claim that I do :-P), and
  2. I didn't realize that there are a lot of commercial applications in the Common Lisp world, whose authors are wary of depending on GPL'ed libraries.

Consequently, I received many complaints about the license of the library, and decided to change it. I picked the Boost Software License, and contacted all who contributed to the library for permission. All contributors approved the change, so now the library has a simple, permissive non-copyleft free software license. However, it is always possible that I missed someone, so if you contributed to cl-cairo2 in the past but didn't hear from me regarding the license change, please get in touch (eg via the Github issue tracker).

I would like to thank (in alphabetical order) Ala'a Mohammad Alawi, Jay Bromley, Pau Fernández, Johann Korndoerfer, Peter Mikula, and especially Kei Suzuki (who did the last major reorganization) for their contributions to the library (again, I apologize if I missed anyone). I would also like to thank Ryan for taking over — I am convinced that the library is in good hands.

Monday, June 15, 2009

updates to cl-cairo2 and cl-2d

Following the discussion and the resulting poll, I updated cl-cairo2 and consequently cl-2d to use the special variable *context* as the default context. This does not affect the interface of cl-2d (except for user-defined functions that draw directly on the cairo context, of course), since in cl2d, the context is always saved in the frame and there is no "default" frame. Nevertheless, updating the cl-2d code was beneficial because I was able to see if the new style makes things easier. It appears that it simplifies the code quite a bit: I would like to thank everyone who argued for the change. Enjoy. Bug reports and contributed code are appreciated.

Saturday, May 23, 2009

cl-cairo2 interface poll

It seems that what I considered a wart is a feature to some people. I would like to make the users of cl-cairo2 happy, so I am considering reverting to the older interface. Also, I experimented with some other code I am using, and I think that wrapping my code in (let ((*context* context1)) ...) is not too much of a hassle anyway. So I am conducting an informal poll: please comment below. If you like the
(move-to context ...)
interface, say explicit, if you prefer the
(move-to ... &key (context *context*))
interface, say global. If you are indifferent, just state that. You can also tell me if you have code that already uses either interface, and whether you it would be a great inconvenience to change that (but I can't imagine that very many people have a lot of code using the explicit interface at this stage). I have listened to your arguments, so you won't need to repeat them, unless you feel that you have something crucual to add. I will take a look at the results on Tuesday, May 26, and update the library (and cl-2d) if necessary. I would rather complete the transition quickly, as I want the API to be relatively stable. I do know that in the previous post I said that there will be no more changes, guess I am dynamically inconsistent :-P

Tuesday, May 19, 2009

announcing cl-2d

Cl-2d is a two-dimensional graph library for Common Lisp. It builds on cl-cairo2 and thus uses the Cairo library, which provides various backends, including pixel-based (eg PNG, X11) and vector-based (PDF, SVG, PS) ones. It is meant solely for 2-dimensional plotting (hence the name). Cl-2d is available from Github. The license is LLGPL. Cl-2d is designed to be extensible instead of providing a plethora of "canned" functions - the latter of course exist, but the emphasis is on flexibility. Most plots used in scientific visualization are customized, and the purpose of this library is to make customization easy. Plotting happens on frames, which are rectangular areas. A DSL is available for splitting frames. A frame combined with a mapping from plot coordinates to Cairo coordinates is a drawing area. Functions named plot-* take a frame, set up and return a drawing area (on which you can continue drawing), while draw-* functions draw on an existing drawing area. This library is still under development, suggestions and contributions are welcome. I mean to clear up the axes code and add contour plots soon. See the example/ directory for a wide variety of examples. Some of the example plots, converted from PDF, are shown below.

Friday, May 15, 2009

cl-cairo2 *context* wart fixed

I pushed an updated version of cl-cairo2 to the repository today. The most important change is the fixing of a major design wart that was the result of a bad initial design choice. Originally, cl-cairo2 functions had an optional context argument as the last argument, which defaulted to *context*. This seemed to make sense at the time, it saved typing, but later on I realized it is very unLispy. So now context is the first argument, and is never optional, *context* is gone. I realize that this might break some code for people who are using cl-cairo2, and for this I apologize. But it had to be done sooner or later, I kept putting it off but finally could not bear it any more. Since I was using macros to generate most of the function definitions, effecting the change was a matter of minutes. I also cleaned up the documentation a bit.

Wednesday, May 13, 2009

cl-cairo2 migrated to github.com

I have migrated cl-cairo2 to github.com. If you want to install it, just clone from the repository:
git clone git://github.com/tpapp/cl-cairo2.git
You might have to create a symlink to the asd file in your ASDF systems directory. This is just a migration, no new code added. The package is no longer ASDF-installable. I have began to hate ASDF-install, it is more trouble than it is worth. For those who insist, it is possible to download a tar.gz file from Github, but the name of the link changes with updates, so I can't put one on cliki.net. Believe me, you are just better off pulling it from the git repository. Eventually, I plan to add support for Mudballs, but not soon.

Wednesday, August 13, 2008

cl-cairo2 updates: win32 and mac extensions

Thanks to the contributions Kei Suzuki, cl-cairo2 underwent quite a few changes. Most importantly, as Kei contributed Win32 and OS X-specific code, I decided to separate all parts of the library that use a GUI. So now if you load cl-cairo2 (using ASDF), only GUI-independent parts of the library will be loaded. If you need the rest, you will have to load cl-cairo2-x11, cl-cairo2-mac or cl-cairo2-win using ASDF. All of these put their functions in the :cl-cairo2 package, without creating a new one, so the organization of namespaces is simplified. Also, cl-cairo2 and the GUI extensions are still packaged into a single tarball, which you can download or install directly using ASDF-Install. Here are some screenshots contributed by Kei Suzuki: You can find the code for these in tutorial/lissajous.lisp and tutorial/lissajous-win.lisp.

Thursday, June 26, 2008

changes in cl-cairo2

Johann Korndoerfer kindly submitted a patch that adds patterns to cl-cairo2, and also includes some code cleanup. Here is the example Johann contributed to the tutorial, a rainbow created with patterns: Thanks for the nice work, Johann! I am happy that others also find cl-cairo2 useful. cl-cairo2 still suffers from the elusive floating point bug (possibly in libcairo), I am still working on that. In the meantime, you can work around that by not generating PS files directly, but converting them from PDF or SVG files. Since common-lisp.net appears to be down, I took the opportunity to migrate the repository to git, which I am now hosting on my webpage. I find git to be much more convenient than SVN, especially when it comes to ease of distribution. As before, the package remains ASDF-installable. Update: the GIT repository is here, but can also be found from the cliki page for cl-cairo2.