Not sure if it helps but... I made a small library to unify drawing API for various backends. So far it only supports "vector" drawing. It does not provide you with Cairo but at least you can have the same code for PyCairo as well as for Pythonista. See https://github.com/xxao/pero
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Best posts made by xxao
-
RE: Import cairo
-
Pero - Simply draw by Python
Hi all,
Finally I released initial alpha version of my Python drawing API library. The aim of the library was to unify drawing experience (API) throughout multiple available backends such as wxPython, PyCairo or PyMuPDF. In addition, the very same API can easily be used within the Pythonista app. Feel free to try it out. I hope someone will find it useful as well as I do.Regards,
martin
Latest posts made by xxao
-
RE: Import cairo
Not sure if it helps but... I made a small library to unify drawing API for various backends. So far it only supports "vector" drawing. It does not provide you with Cairo but at least you can have the same code for PyCairo as well as for Pythonista. See https://github.com/xxao/pero
-
Pero - Simply draw by Python
Hi all,
Finally I released initial alpha version of my Python drawing API library. The aim of the library was to unify drawing experience (API) throughout multiple available backends such as wxPython, PyCairo or PyMuPDF. In addition, the very same API can easily be used within the Pythonista app. Feel free to try it out. I hope someone will find it useful as well as I do.Regards,
martin -
RE: Removing current clipping
Thanks, that works. Unfortunately I cannot use the "with..." directly but storing the state and using state.enter() and state.exit() does exactly what I need. Would be nicer to use something like state.save() and state.restore() but I have not found anything like this.
Thanks again.
-
Removing current clipping
Hi,
is there any way to remove clipping path? I haven't found any specific method so I've tried to set a new clipping to the size of full image, but it did not help. It looks like the clip can only be shrinked more and more but never enlarged. Or did I missed something?Thanks for any help.
# set clip ui_path = ui.Path.rect(x, y, width, height) ui_path.add_clip() # remove clip ui_path = ui.Path.rect(0, 0, full_width, full_height) ui_path.add_clip()