PySolFC -- Python and SVG implementation issues

66 views
Skip to first unread message

Jan Kleks

unread,
Apr 30, 2017, 8:06:26 AM4/30/17
to FOSS Card Games
Shlomif is wondering how to implement SVG support using Python in PySolFC: https://github.com/shlomif/PySolFC/issues/3 Any ideas? I've read that it's possible to extend Python functionality using, for instance, C (https://docs.python.org/2/extending/extending.html), maybe this would be a solution? There also might be some performance benefits when using a lower level language, which I guess might be good for displaying and scaling SVG graphics.

Jan Kleks

unread,
Apr 30, 2017, 8:17:15 AM4/30/17
to FOSS Card Games
Well, I have also found this Python SVG library: https://jugad2.blogspot.com/2014/03/svgfig-pure-python-svg-library.html

Shlomi Fish

unread,
May 1, 2017, 12:41:35 PM5/1/17
to Jan Kleks, FOSS Card Games
Hi Jan,


On Sun, Apr 30, 2017 at 3:17 PM, Jan Kleks <wineb...@gmail.com> wrote:
Well, I have also found this Python SVG library: https://jugad2.blogspot.com/2014/03/svgfig-pure-python-svg-library.html


I'd imagine rendering SVG in pure-Python will be too slow especially considering the fact that I couldn't figure out a way to get tkinter running under pypy,

regards,

-- Shlomi
 
On Sunday, 30 April 2017 14:06:26 UTC+2, Jan Kleks wrote:
Shlomif is wondering how to implement SVG support using Python in PySolFC: https://github.com/shlomif/PySolFC/issues/3 Any ideas? I've read that it's possible to extend Python functionality using, for instance, C (https://docs.python.org/2/extending/extending.html), maybe this would be a solution? There also might be some performance benefits when using a lower level language, which I guess might be good for displaying and scaling SVG graphics.

--
You received this message because you are subscribed to the Google Groups "FOSS Card Games" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foss-card-games+unsubscribe@googlegroups.com.
To post to this group, send email to foss-card-games@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/foss-card-games/ae2c5622-40db-4fd4-a418-1a66ca1c504e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Shlomi Fish http://www.shlomifish.org/

You can never truly appreciate The Gilmore Girls until you've watched it in the original Klingon.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

Shlomi Fish

unread,
May 1, 2017, 1:47:23 PM5/1/17
to Jan Kleks, FOSS Card Games
Hi Jan and all,


On Sun, Apr 30, 2017 at 3:06 PM, Jan Kleks <wineb...@gmail.com> wrote:
Shlomif is wondering how to implement SVG support using Python in PySolFC: https://github.com/shlomif/PySolFC/issues/3 Any ideas?

Perhaps we can take a look at how https://www.kde.org/applications/games/kpatience/ is doing that for some ideas.
 
I've read that it's possible to extend Python functionality using, for instance, C (https://docs.python.org/2/extending/extending.html), maybe this would be a solution? There also might be some performance benefits when using a lower level language, which I guess might be good for displaying and scaling SVG graphics.

There are some other approaches for calling native code from python:

1. http://www.python.net/crew/theller/ctypes/

2. https://en.wikipedia.org/wiki/Cython

3. http://cffi.readthedocs.io/en/latest/

We probably should use an existing library in C for rendering the SVG.
 

--
You received this message because you are subscribed to the Google Groups "FOSS Card Games" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foss-card-games+unsubscribe@googlegroups.com.
To post to this group, send email to foss-card-games@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jan Kleks

unread,
May 1, 2017, 2:48:41 PM5/1/17
to FOSS Card Games


On Monday, 1 May 2017 19:47:23 UTC+2, Shlomi Fish wrote:
Perhaps we can take a look at how https://www.kde.org/applications/games/kpatience/ is doing that for some ideas.

I think Aisleriot (https://github.com/GNOME/aisleriot) uses SVG cards too.

Jan

Shlomi Fish

unread,
May 2, 2017, 4:35:04 AM5/2/17
to Jan Kleks, FOSS Card Games
Hi!


Thanks for the pointer. It may be worthy of investigation as well.

Regards,

Shlomi

Kyle Unverferth

unread,
May 5, 2017, 11:37:23 PM5/5/17
to FOSS Card Games
I started out using SVG for solitaire.gg, it was slow and painful, even on the web (which ostensibly has better SVG support than python). I "solved" the issue by just working with 400x300 raster cards, which is a ridiculous size. I'm working on loading smaller assets now - even though it's only 1MB of compressed images, it explodes to a ton of texture memory, ruining the game for people with shitty computers..

Shlomi Fish

unread,
May 7, 2017, 11:40:01 AM5/7/17
to Kyle Unverferth, FOSS Card Games
Hi Kyle!

Thanks for sharing your experiences. I still would like to  investigate using SVG cards by rendering them first into bitmaps in a similar fashion to how kpat may do it.



--
You received this message because you are subscribed to the Google Groups "FOSS Card Games" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foss-card-games+unsubscribe@googlegroups.com.
To post to this group, send email to foss-card-games@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jan Kleks

unread,
May 7, 2017, 2:03:07 PM5/7/17
to FOSS Card Games
But maybe for the desktop app when using a C library for vector rendering (and possibly some OpenGL/Vulkan acceleration) that wouldn't be that much of a problem?
Reply all
Reply to author
Forward
0 new messages