This module provides access to the Cairo vector graphics library from within Lua. It has a somewhat object-oriented API, and binds almost all the functionality available in Cairo. Documentation and example programs are included.
Documentation
- oocairo
- oocairo-context
- oocairo-fontface
- oocairo-fontopt
- oocairo-matrix
- oocairo-path
- oocairo-pattern
- oocairo-scaledfont
- oocairo-surface
- oocairo-userfont
Releases
Version 1.2
Released 7 November 2008. Download lua-oocairo-1.2.tar.gz.
- Integration with Lua-Gnome for drawing in GUIs:
- New constructor: context_create_gdk
- New methods on contexts to set source based on Gdk object: set_source_gdk_color, set_source_pixbuf, set_source_pixmap
- New method on image surfaces: get_gdk_pixbuf
- Examples which show Cairo drawing in GUI applications.
- Translate between image surfaces and raw pixel data:
- New constructor: image_surface_create_from_data
- New method on image surfaces: get_data (based on a patch by Julien Danjou)
- New top-level function ‘format_stride_for_width’ and constant ‘BYTE_ORDER’ to allow creating suitable data for constructor
Version 1.1
Released 17 October 2008. Download lua-oocairo-1.1.tar.gz.
- Include MacOS X makefile, and fix compilation bug with Cairo 1.8, both thanks to Asko Kauppi.
- Added font options objects:
- New constructor: font_options_create
- New getter method ‘get_font_options’ on context and surface classes
- New setter method ‘set_font_options’ on context class
- Added scaled font objects:
- New constructor: scaled_font_create
- Accessors on context class: get_scaled_font, set_scaled_font
- Most of the new functionality in Cairo 1.8 is now bound:
- New font face constructor functions: toy_font_face_create, user_font_face_create
- New methods on toy font faces: get_family, get_slant, get_weight
- The ‘text_to_glyphs’ method on scaled fonts, and ‘show_text_glyphs’ method on context objects, with text clusters bound as a Lua table.
- New ‘has_show_text_glyphs’ method on surface objects
- New feature flag: HAS_USER_FONT
- Plugged memory leaks in some functions which accept a table of glyphs.
Version 1.0
Released 12 September 2008. Download lua-oocairo-1.0.tar.gz.
- Initial release.