On 8/2/11, Marco Leise <marco.le...@gmx.de> wrote: > Am 02.08.2011, 04:48 Uhr, schrieb Adam D. Ruppe > <destructiona...@gmail.com>: > >> I've been thinking about a minimalist drawing library for >> phobos - just basic 2d stuff, but with easy enough hooks to >> add more (native api events and handles. >> >> Nobody is likely to agree on a widget set, but basic drawing >> functions give a little usability with pretty small cost. >> >> I had a decent start a month or two ago but have since stalled out >> as my schedule became more ridiculous. > > I used a few drawing APIs: Delphi/Win32, Java2D, HTML5 Canvas, Gtk+ and > recently Cairo. If there was a drawing API in Phobos I wish it was like > Cairo. While some basic APIs have some special ability (like shadows in > the HTML canvas) they often lack some essential functions. Java2D offers a > lot, but I consider it bloated, YMMW. When I was writing a tool I came to > need more and more advanced features: > - fonts and text drawing > - clipping > - scaling (part of matrix manipulation) > - transparency > - measuring of the extents of what is about to be drawn > I was using GtkD, the D wrapper for Gtk and Gtk lacked a lot of this. > Fortunately Gtk comes with Cairo bindings which offered all that. This is > just one example and just me, but I really think Cairo's API is very well > designed, similar to Java2D and HTML5 Canvas and would be my reference for > a drawing API in D. It doesn't need to offer bezier curves and > anti-aliasing in the first version, but the idea of filling and stroking > shapes or drawing surfaces that can be rendered into each other are kind > of a standard now that can be built upon :) > > - Marco >
Johannes Pfau is working on a D2 wrapper for Cairo: https://github.com/jpf91/cairoD Unlike gtkD the bindings are Boost licensed, so I think one could make a small trivial windowing library with Cairo drawing and put that into Phobos. Of course the user would have to install either Gtk itself or the Cairo DLLs from the Gtk website before they can use the code.