[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] SVG and Pango support



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
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.
> 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
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.

--Noah

Attachment: signature.asc
Description: OpenPGP digital signature