Saturday 3 May 2008

Cairo support for gschem

Following the merge of Werner's branch elimitnating the remaining usage of screen coordinates in gschem's graphics state, gschem is far better at allowing you to zoom and pan whilst making drawing operations.

I have since rebased my pending changes to the object "place" code (inserting symbols, copy / paste with buffers, move, copy, multi-copy etc..) and on top of that branch, have revived the experimental cairo rendering code I started what seems forever ago.



The screenshot above shows cairo rendering of all primitives, including the text (which is via cairo's "toy" text API). Work to allow support of gschem's existing line-font is underway, but dependant on new API aditions scheduled for cairo 1.8. I think I'm getting used to the "Sans" font in gschem, so perhaps that will have to remain an option.

The code is distilling nicely now, and by cooperating with existing code (XOR drawing with GDK during rubberbanding and placing), I now have a branch where pretty graphics are available without the bugs and cut down functionality of my old branch (which removed essential code, but hadn't quite got to replacing it).

5 comments:

  1. This is quite awesome. Is the source available anywhere (as a patch/git/whatever)?

    ReplyDelete
  2. Thanks.

    The code is available here.

    http://repo.or.cz/w/geda-gaf/pcjc2.git?a=shortlog;h=refs/heads/cairo_experiment

    git clone git://repo.or.cz/geda-gaf/pcjc2.git

    Then look in the "cairo_experiment" branch.

    Please note that the polygon / spline path support is due to change its file-format slightly before official release, but I'd appreciate any testing and feedback.

    ReplyDelete
  3. Can use this image
    http://4.bp.blogspot.com/_7sZm58CjSsA/SB0B39sRk4I/AAAAAAAAACw/uSZuDlEJRWw/s1600-h/gschem_cairo2.png

    for a magazine article? Is this image copy righted?

    ReplyDelete
  4. Jeffrey, you didn't leave me an address to contact you privately, so I'll reply here.

    I'd be interested to know more about your article. I'd be happy for you to use the image for a gEDA related article - although we could probably get an even nicer looking screen-shot with the recently released gEDA 1.6.0.

    The schematic shown is distributed with gEDA. In the source repository, it is /examples/lightning_detector/lightning.sch

    It was drawn by a Terry Porter (according to the revision control log), but I haven't been able to contact him with regards licensing. Since the example is distributed with gEDA, I'm fairly sure this counts as fair use.

    ReplyDelete
  5. I don't have your e-mail address to contact you personally.Please do make further contacts via mail.
    When the article gets published next month, I can send you the soft copy of the article.

    Can you take me the screenshot and send me? Its urgent. They are going to print the magazine soon.

    You can find my e-mail from www.jeffrey.co.in

    ReplyDelete