lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

Philippe Lhoste wrote:
On 15/11/2007 02:03, Hakki Dogusan wrote:
You may get it here:
http://www.dogusan.net/dogusanh/download/luacairo-0.7.zip (~3.5Mb)

I am testing it right now, starting by playing the demos and tests, of course.
They work fine, I think I will have some fun soon...

BUT (there is often a but, no?) two demos fail after spitting out a number of files:

C:\PrgCmdLine\luacairo
 > lua5.1.exe draw.c.lua
lua5.1.exe: draw.c.lua:297: bad argument #2 to 'font_extents' (cairo.FontExtents.mt expected, got table)
stack traceback:
        [C]: in function 'font_extents'
        draw.c.lua:297: in function 'draw_textextents'
        draw.c.lua:402: in function 'draw_diagram'
        draw.c.lua:440: in function 'diagram'
        draw.c.lua:466: in function 'main'
        draw.c.lua:472: in main chunk
        [C]: ?

C:\PrgCmdLine\luacairo
 > lua5.1.exe diagram.c.lua
lua5.1.exe: diagram.c.lua:420: bad argument #1 to 'matrix_init' (cairo.Matrix.mt expected, got table)
stack traceback:
        [C]: in function 'matrix_init'
        diagram.c.lua:420: in function 'diagram'
        diagram.c.lua:478: in function 'main'
        diagram.c.lua:504: in main chunk
        [C]: ?

Running on WinXP Pro SP2.


Thanks for reporting.

My fault. I forgot to update these samples. Now, cairo_matrix_t, cairo_text_extents_t, cairo_fontt_extents_t are implemented as userdata (previosly they were tables).

You may get modified samples from http://www.dogusan.net/dogusanh/download.html#luacairo

luacairo-src.zip includes them too (111 Kb)


Good work, anyway!


Thanks.

PS.: don't search specifically, I did it and didn't find a clear answer. But if you know a way to make animated Gifs with Cairo, I would be glad. Otherwise, I suppose I will generate a bunch of files and some tool to assemble them in Gif format.

Too bad MNG never took off.


As I see, there is no GIF surface in Cairo API (1.4.10).
There are only following configuration flags for surfaces:
CAIRO_HAS_SVG_SURFACE, CAIRO_HAS_PDF_SURFACE,
CAIRO_HAS_PS_SURFACE, CAIRO_HAS_XCB_SURFACE, CAIRO_HAS_XLIB_SURFACE, CAIRO_HAS_WIN32_SURFACE, CAIRO_HAS_BEOS_SURFACE, CAIRO_HAS_DIRECTFB_SURFACE, CAIRO_HAS_OS2_SURFACE, CAIRO_HAS_GLITZ_SURFACE, CAIRO_HAS_QUARTZ_SURFACE



--
Regards,
Hakki Dogusan