[Cuis-dev] [ANN] Experiment with Cairo graphics

Mariano Montone marianomontone at gmail.com
Wed Oct 9 09:49:06 PDT 2019


Hello!

I've doing some experiments with Cairo graphics in Cuis. I'm doing it
via FFI.

If you want to have a look, you have to load these:
https://bitbucket.org/mmontone/mold/raw/master/Cairo.pck.st
https://bitbucket.org/mmontone/mold/raw/master/CairoMorphic.pck.st

There's a Cairo FFI wrapping class, a CairoContext with fluid api, and a
CairoCanvas for Morphic.

Note that I've spent only a couple of days on this, so it is not ready
for anything very useful yet, but I'm planning to try to use in a
diagrams library I'm building.

Some interesting expressions to try:

CairoCanvas displayWorld.
CairoCanvas displayWorldScaled: 0.8 at 0.8.
CairoCanvas displayWorldRotated: -10.

To switch Display to Cairo canvas based one:

CairoDisplayScreen install.

IMPORTANT: there are segmentation faults when browser methods are opened
(because of a bug in TextComposition rendering), so open all classes
methods before trying the expressions above.

Other issues: text rendering is very basic, uses Cairo toy api
cairo_show_text. And images don't get blended right.

Have fun!

Mariano


More information about the Cuis-dev mailing list