cairocffi is a CFFI-based drop-in replacement for Pycairo, a set of Python bindings and object-oriented API for cairo. Cairo is a 2D vector graphics library with support for multiple backends including image buffers, PNG, PostScript, PDF, and SVG file output.
Additionally, the cairocffi.pixbuf module uses GDK-PixBuf
to decode various image formats for use in cairo.
Free software: BSD license
For Python 3.8+, tested on CPython and PyPy
Documentation: https://doc.courtbouillon.org/cairocffi/
Changelog: https://doc.courtbouillon.org/cairocffi/stable/changelog.html
Code, issues, tests: https://github.com/Kozea/cairocffi
Code of conduct: https://www.courtbouillon.org/code-of-conduct
Professional support: https://www.courtbouillon.org
Donation: https://opencollective.com/courtbouillon
API partially compatible with Pycairo.
Works with any version of cairo.
cairocffi has been created and developed by Kozea (https://kozea.fr). Professional support, maintenance and community management is provided by CourtBouillon (https://www.courtbouillon.org).
Copyrights are retained by their contributors, no copyright assignment is required to contribute to cairocffi. Unless explicitly stated otherwise, any contribution intentionally submitted for inclusion is licensed under the BSD 3-clause license, without any additional terms or conditions. For full authorship information, see the version control history.
Documentation
- Overview
- Python API reference
- Meta
- Surfaces
SurfaceSurface.copy_page()Surface.create_for_rectangle()Surface.create_similar()Surface.create_similar_image()Surface.finish()Surface.flush()Surface.get_content()Surface.get_device_offset()Surface.get_device_scale()Surface.get_fallback_resolution()Surface.get_font_options()Surface.get_mime_data()Surface.has_show_text_glyphs()Surface.mark_dirty()Surface.mark_dirty_rectangle()Surface.set_device_offset()Surface.set_device_scale()Surface.set_fallback_resolution()Surface.set_mime_data()Surface.show_page()Surface.supports_mime_type()Surface.write_to_png()
- ImageSurface
- PDFSurface
- PSSurface
- SVGSurface
- RecordingSurface
- Win32PrintingSurface
- Context
ContextContext.append_path()Context.arc()Context.arc_negative()Context.clip()Context.clip_extents()Context.clip_preserve()Context.close_path()Context.copy_clip_rectangle_list()Context.copy_page()Context.copy_path()Context.copy_path_flat()Context.curve_to()Context.device_to_user()Context.device_to_user_distance()Context.fill()Context.fill_extents()Context.fill_preserve()Context.font_extents()Context.get_antialias()Context.get_current_point()Context.get_dash()Context.get_dash_count()Context.get_fill_rule()Context.get_font_face()Context.get_font_matrix()Context.get_font_options()Context.get_group_target()Context.get_hairline()Context.get_line_cap()Context.get_line_join()Context.get_line_width()Context.get_matrix()Context.get_miter_limit()Context.get_operator()Context.get_scaled_font()Context.get_source()Context.get_target()Context.get_tolerance()Context.glyph_extents()Context.glyph_path()Context.has_current_point()Context.identity_matrix()Context.in_clip()Context.in_fill()Context.in_stroke()Context.line_to()Context.mask()Context.mask_surface()Context.move_to()Context.new_path()Context.new_sub_path()Context.paint()Context.paint_with_alpha()Context.path_extents()Context.pop_group()Context.pop_group_to_source()Context.push_group()Context.push_group_with_content()Context.rectangle()Context.rel_curve_to()Context.rel_line_to()Context.rel_move_to()Context.reset_clip()Context.restore()Context.rotate()Context.save()Context.scale()Context.select_font_face()Context.set_antialias()Context.set_dash()Context.set_fill_rule()Context.set_font_face()Context.set_font_matrix()Context.set_font_options()Context.set_font_size()Context.set_hairline()Context.set_line_cap()Context.set_line_join()Context.set_line_width()Context.set_matrix()Context.set_miter_limit()Context.set_operator()Context.set_scaled_font()Context.set_source()Context.set_source_rgb()Context.set_source_rgba()Context.set_source_surface()Context.set_tolerance()Context.show_glyphs()Context.show_page()Context.show_text()Context.show_text_glyphs()Context.stroke()Context.stroke_extents()Context.stroke_preserve()Context.tag_begin()Context.tag_end()Context.text_extents()Context.text_path()Context.transform()Context.translate()Context.user_to_device()Context.user_to_device_distance()
- Matrix
- Patterns
- Fonts & text
- Font faces
- ScaledFont
- FontOptions
FontOptionsFontOptions.copy()FontOptions.equal()FontOptions.get_antialias()FontOptions.get_hint_metrics()FontOptions.get_hint_style()FontOptions.get_subpixel_order()FontOptions.get_variations()FontOptions.hash()FontOptions.merge()FontOptions.set_antialias()FontOptions.set_hint_metrics()FontOptions.set_hint_style()FontOptions.set_subpixel_order()FontOptions.set_variations()
- Enumerated values
- Content
- Pixel format
- Compositiong operator
OPERATOR_CLEAROPERATOR_SOURCEOPERATOR_OVEROPERATOR_INOPERATOR_OUTOPERATOR_ATOPOPERATOR_DESTOPERATOR_DEST_OVEROPERATOR_DEST_INOPERATOR_DEST_OUTOPERATOR_DEST_ATOPOPERATOR_XOROPERATOR_ADDOPERATOR_SATURATEOPERATOR_MULTIPLYOPERATOR_SCREENOPERATOR_OVERLAYOPERATOR_DARKENOPERATOR_LIGHTENOPERATOR_COLOR_DODGEOPERATOR_COLOR_BURNOPERATOR_HARD_LIGHTOPERATOR_SOFT_LIGHTOPERATOR_DIFFERENCEOPERATOR_EXCLUSIONOPERATOR_HSL_HUEOPERATOR_HSL_SATURATIONOPERATOR_HSL_COLOROPERATOR_HSL_LUMINOSITY
- Antialiasing mode
- Fill rule
- Line cap style
- Line join style
- Font slant
- Font weight
- Subpixel order
- Hint style
- Metrics hinting mode
- Path operation
- Pattern extend
- Pixel filter
- PDF version
- PDF outline
- PDF metadata
- PostScript level
- SVG version
- SVG unit
- Cluster flags
- Decoding images with GDK-PixBuf
- Using XCB surfaces with xcffib
- CFFI API
- cairocffi changelog
- Version 1.7.1
- Version 1.7.0
- Version 1.6.1
- Version 1.6.0
- Version 1.5.1
- Version 1.5.0
- Version 1.4.0
- Version 1.3.0
- Version 1.2.0
- Version 1.1.0
- Version 1.0.2
- Version 1.0.1
- Version 1.0.0
- Version 0.9.0
- Version 0.8.1
- Version 0.8.0
- Version 0.7.2
- Version 0.7.1
- Version 0.7
- Version 0.6
- Version 0.5.4
- Version 0.5.3
- Version 0.5.2
- Version 0.5.1
- Version 0.5
- Version 0.4.3
- Version 0.4.2
- Version 0.4.1
- Version 0.4
- Version 0.3.2
- Version 0.3.1
- Version 0.3
- Version 0.2
- Version 0.1