On, Thu Apr 19, 2007, Noah Kantrowitz wrote: > Marcus von Appen wrote: > > On, Thu Apr 19, 2007, Noah Kantrowitz wrote: > > > > > >> As OLPC is in need of both SVG and Pango support in Pygame, I am looking > >> at making wrappers for SDL_svg and SDL_pango. Rene mentioned that > >> someone has some code for using Cairo, is this online somewhere? Also, > >> how would people feel about this as an addition to pygame itself vs. a > >> secondary library? > >> > > > > There is an Cookbook entry using py-cairo at > > http://www.pygame.org/wiki/CairoPygame?parent=CookBook. > > > > I wrote an own small module, which uses libsvg-cairo to load and > > renderer SVG graphics as pygame surfaces. As it's 'not really' my own > > code, I'll contact you in private about it ;-). > > > > A direct addition to pygame should be handled using the > > pygame.image.load() methods and the support should be optional. Using > > libsvg-cairo this could be achieved pretty fast, but I there does not > > seem to be any support for other platforms besides Win32, the common > > Unices and probably MacOS X. > > I wonder for which platforms SDL_svg is currently available. > > > I would actually disagree here. I would rather be able to load an svg > object, and then render it as needed. This makes it easy to have the
Do you have a SVG library at hand, which supports all the platforms supported by pygame? If not, it would not make sense, to make an own module of it. As far as I know, cairo and cairo-svg are supporting the most platforms, but might still lack support for the one or other. Thus the module would be only availabe on a certain platform. As I understand at least Win32, Unices (X11), MacOS X and QNX should be supported. > same icon in two different sizes, while minimizing wasted cycles. I see > SVG support working much more like the Font object than an image. You > load from a file, set parameters, and then render to a surface. Right. That's what SVG is for. > > Regarding SDL_pango I already started some code to enhance the font and > > text rendering support in pygame. Pango brings some really important > > features such as (nearly) correct complex script handling, good text > > layout and formatting capabilities and more. My code however currently > > does not work and will take some more time to be suitable for > > pygame. > > > > Is your code actually based on Pango, or just on SDL_ttf? For a project SDL_ttf does not make use of Pango as far as I know. When I say Pango, I mean that ;-). The code is based on Pango 1.11. I think, I need to look through it in order to make it work with pygame and the latest pango release. > like OLPC there are a lot of issues with stuff like RTL languages and > Arabic scripts, both of which as painful with a simple font layout system. > Regards Marcus
pgpZKbaF8t5im.pgp
Description: PGP signature