1 Since version 1.11.0 Pycairo uses `Semantic Versioning
2 <http://semver.org/>`__ i.e. the newest version is the latest stable one.
9 * `Meson <https://mesonbuild.com/>`__ support (>=0.46). :bug:`114`
17 * :class:`cairo.Surface` and :class:`cairo.Device` can now be used as context
19 * Fix a leak when a cairo error was raised.
20 * Fix a leak when a mapped surface was GCed instead of unmapped.
21 * Make it possible to use the C API with Python 3 outside of the compilation
22 unit doing the import by defining ``PYCAIRO_NO_IMPORT``. :bug:`110`
23 * Implement PEP 561 (added a py.typed marker)
31 * Ship Python type annotation stubs. They are currently supported by mypy and
32 PyCharm. :bug:`99` :pr:`101`
40 * setup.py: Some fixes for Debian pybuild quirks. :bug:`98`
48 * setup.py: correctly install pkgconfig into /usr/lib* again.
49 To make JHBuild on Fedora work the following patch is needed:
50 https://bugzilla.gnome.org/show_bug.cgi?id=793216
58 * Add a :func:`get_include` function which returns the compiler include path
59 needed for interfacing with the Pycairo C API :bug:`92`
60 * Note for packagers: The default header installation path has changed, but a
61 compat header is installed to the old location to prevent breakage in case
62 anyone has hardcoded the old path instead of using pkg-config.
63 Just in case anyone is wondering why there are two header files now.
71 * Experimental PyPy and PyPy3 support :bug:`90`
79 * Support Unicode paths under Windows with cairo 1.15.10+ :pr:`87`
80 * Don't include the pkg-config file when building a wheel :bug:`83`
89 * Fix some enum conversation errors with (unused) large and negative values.
93 * Fix a rare test error :pr:`80` (:user:`Sergei Trofimovich <trofi>`)
102 * setup.py: Install pkgconfig file into /usr/share/pkgconfig to work around
103 JHBuild on Fedora not picking it up.
104 * Fix tests on big endian machines. :bug:`75`
105 * Support building with MSVC :pr:`72` (:user:`Chun-wei Fan <fanc999>`)
108 * Test MSVC builds on appveyor
117 * setup.py: Install pkgconfig file to the same library prefix that Python
118 uses. (/usr/lib64 instead of /usr/lib under Fedora for example) :bug:`70`
119 :pr:`71` (:user:`Sander Sweers <infirit>`)
128 * Improved support for Python filesystem paths including
129 :class:`os.PathLike`. See :class:`pathlike` for details.
130 * Various minor fixes
133 * Expose :class:`cairo.Path`
136 * Improved test coverage from ~70% to ~90%
145 * Add :meth:`Surface.map_to_image` and :meth:`Surface.unmap_image` :bug:`51`
146 * Add :class:`RasterSourcePattern` :bug:`48`
147 * Add :class:`Glyph` :bug:`53`
148 * Add :class:`Rectangle` :bug:`54`
149 * Add :class:`TextCluster` :bug:`61`
150 * Add :meth:`ScaledFont.text_to_glyphs` and :meth:`ScaledFont.glyph_extents`
151 * Add :meth:`Context.show_text_glyphs`
152 * Add :class:`TextExtents` :bug:`62`
155 * Pycairo instances wrapping the same underlying cairo object now hash and
156 compare equally e.g. ``context.get_target() == context.get_target()``
157 * Functions which returned a cairo error with :attr:`Status.NO_MEMORY` no
158 longer raise :exc:`python3:MemoryError`, but a subclass of :exc:`Error`
159 and :exc:`python3:MemoryError`. Similarly errors with
160 :attr:`Status.READ_ERROR` and :attr:`Status.WRITE_ERROR` no longer raise
161 :exc:`python3:IOError`, but a subclass of :exc:`Error` and
162 :exc:`python3:IOError`. :bug:`55`
163 * Some functions which previously returned a tuple now return a tuple
164 subclass like :class:`Rectangle`, :class:`Glyph`, :class:`TextCluster` and
174 * Fix a crash with :meth:`Surface.get_device` :bug:`57`
183 * Requires at least cairo 1.13.1 (The snapshop in Ubuntu 14.04)
186 * Optional `Hypothesis <https://hypothesis.readthedocs.io>`__ tests.
189 * Add :meth:`Surface.set_device_scale` and :meth:`Surface.get_device_scale`.
190 :pr:`44` (:user:`Sander Sweers <infirit>`)
191 * Add :class:`Device` :pr:`45`
192 * Add :meth:`Surface.get_device` :pr:`45`
193 * Add :class:`ScriptDevice` and :class:`ScriptMode` :pr:`46`
194 * Add :class:`ScriptSurface` :bug:`17`
195 * Add :attr:`Status.JBIG2_GLOBAL_MISSING`
196 * Add :meth:`Format.stride_for_width`
197 * Add :class:`TextClusterFlags` and :class:`SurfaceObserverMode`
198 * Add :meth:`Gradient.get_color_stops_rgba`
199 * Add :class:`TeeSurface`
200 * Add :class:`MeshPattern`
209 * Fix a rare crash with :meth:`get_data() <ImageSurface.get_data>` under
210 Python 3 (1.13.3 regression).
219 * Fix ImageSurface leaking in case :meth:`get_data() <ImageSurface.get_data>` is used under Python 3.
223 * Add Pillow to ImageSurface example. :pr:`40` (:user:`Stuart Axon <stuaxo>`)
224 * Describe Freetype-py intergration. :bug:`25` :pr:`43`
225 (:user:`Hin-Tak Leung <HinTak>`)
234 * Fix pip failing to install pycairo in some cases. :bug:`39`
237 * Added continuous testing for Windows using MSYS2 and appveyor. :bug:`19`
246 * setup.py install: Fix generated pkg-config file if ``--home`` or
247 ``--user`` is specified. :bug:`34`
248 * Fix a build error on macOS Sierra. :pr:`36`
249 (:user:`Nicolas P. Rougier <rougier>`)
250 * examples: Fix snippet examples when .pyc files are present. :bug:`35`
253 * Add Pyglet integration example. :pr:`33` (:user:`Stuart Axon <stuaxo>`)
262 * The buffer returned by :meth:`ImageSurface.get_data` under Python 2 now
263 implements the character buffer interface to make it work with
264 pygame.image.frombuffer(). :pr:`29`
265 * All C enum types now have their own corresponding Python enum type:
266 :class:`Antialias`, :class:`Content`, :class:`Extend`, :class:`FillRule`,
267 :class:`Filter`, :class:`FontSlant`, :class:`FontWeight`, :class:`Format`,
268 :class:`HintMetrics`, :class:`HintStyle`, :class:`LineCap`,
269 :class:`LineJoin`, :class:`Operator`, :class:`PDFVersion`,
270 :class:`PSLevel`, :class:`PathDataType`, :class:`RegionOverlap`,
271 :class:`SVGVersion`, :class:`Status`, :class:`SubpixelOrder`. :bug:`26`
273 All relevant constants are now an alias to attributes of those types e.g.
274 :data:`ANTIALIAS_DEFAULT` is the same as :attr:`Antialias.DEFAULT`.
276 All functions returning enum values now return instances of the new types
277 e.g. :meth:`Context.get_antialias` returns a :class:`Antialias`.
279 :attr:`Error.status` is now a :class:`Status`.
280 * All included examples now work with Python 2 & 3
281 * All included examples using GTK+ have been ported to GTK+ 3/PyGObject 3
284 * Fix the signature of the :class:`ImageSurface` buffer interface for Python 2
286 * setup.py: Ensure "-fno-strict-aliasing" is used with Python 2.
289 * Added travis-ci tests for flake8 and sphinx. :pr:`30`, :pr:`32`
290 * The test suite now has optional tests for numpy and pygame integration.
299 * Require cairo 1.12.0
300 * Use C90 and enforce it on travis-ci. :bug:`5`, :fdobug:`22940`
303 * Add various new cairo.OPERATOR_*, cairo.ANTIALIAS_* and
304 cairo.FORMAT_* constants. :bug:`1`
305 * Add :data:`HAS_MIME_SURFACE` and cairo.MIME_TYPE_*. :bug:`7`,
307 * Add cairo.PDF_VERSION_*. :pr:`16`
308 * Add cairo.SVG_VERSION_*
311 * Add a :data:`Error.status` attribute exposing cairo.STATUS_*
312 * Add :exc:`CairoError` alias for :exc:`Error` for cairocffi compatibility
315 * Expose matrix components as read/write properties. e.g. :data:`Matrix.xx`
316 * Fix type checking of the multiplication operator under
317 Python 3. :bug:`8`, :fdobug:`89162` (Lawrence D'Oliveiro)
320 * Add :meth:`Surface.set_mime_data`. :bug:`7`, :fdobug:`58771`
321 * Add :meth:`Surface.get_mime_data`. :bug:`7`, :fdobug:`58771`
322 * Add :meth:`Surface.supports_mime_type`. :bug:`7`, :fdobug:`58771`
323 * Add :meth:`Surface.create_for_rectangle`. :pr:`13`
324 * Add :meth:`Surface.create_similar_image`. :pr:`15`
325 * Add :meth:`Surface.has_show_text_glyphs`
326 * Fix crash when the surface wrapper gets deallocated before the surface
330 * Add :meth:`Context.in_clip`. :pr:`14`
333 * Add :meth:`PDFSurface.restrict_to_version`. :pr:`16`
334 * Add :meth:`PDFSurface.get_versions`. :pr:`16`
335 * Add :meth:`PDFSurface.version_to_string`. :pr:`16`
338 * Add :meth:`SVGSurface.restrict_to_version`
339 * Add :meth:`SVGSurface.get_versions`
340 * Add :meth:`SVGSurface.version_to_string`
343 * Add :meth:`XCBSurface.set_size`
346 * Add :meth:`PSSurface.get_levels`
347 * Add :meth:`PSSurface.level_to_string`
350 * Add :meth:`Pattern.set_filter`
351 * Add :meth:`Pattern.get_filter`
353 :class:`RecordingSurface`:
354 * Add :meth:`RecordingSurface.get_extents`
356 :class:`FontOptions`:
357 * Implement ``__eq__`` and ``__ne__``
358 * Add :meth:`FontOptions.copy`
359 * Add :meth:`FontOptions.hash`
360 * Add :meth:`FontOptions.equal`
361 * Add :meth:`FontOptions.merge`
364 * Add :meth:`ScaledFont.get_ctm`
365 * Add :meth:`ScaledFont.get_font_matrix`
366 * Add :meth:`ScaledFont.get_font_options`
374 This release fixes an ABI breakage. I missed that the original pycairo master
375 had already broken ABI compared to 1.10.0.
383 This version is based on the Python 2 version of pycairo 1.10.0 and is API/ABI
384 compatible with both py2cairo 1.10.0 and py3cairo 1.10.0.
387 * Requires cairo 1.10.2+
388 * Switch to semantic versioning
389 * Switch build system to distutils/setup.py (xpyb integration can be
390 enabled with passing ``--enable-xpyb`` to setup.py build)
391 * Moved to GitHub: https://github.com/pygobject/pycairo
394 * Python 3 support (API/ABI compatible with py3cairo 1.10.0) including
395 support for :exc:`cairo.Error`, :meth:`cairo.ImageSurface.get_data` and
396 :meth:`cairo.ImageSurface.create_for_data`, which were missing in
398 * :class:`cairo.RecordingSurface` (:fdobug:`36854`,
399 `Torsten Landschoff <t.landschoff@gmx.net>`__)
400 * :class:`cairo.Region`, :class:`cairo.RectangleInt` and
401 cairo.REGION_OVERLAP_*
402 (:fdobug:`44336`, `Bug Fly <mozbugbox@yahoo.com.au>`__)
405 * Fix crash when read()/write() methods of file objects passed to pycairo
407 * Fix possible value truncation of handles passed to Win32Surface and
408 Win32PrintingSurface on 64bit Windows. :fdobug:`57493`
415 py2cairo 1.10.0 requires cairo 1.10.0 (or later).
418 cairo.FORMAT_RGB16_565
421 * context.get_source().get_surface() fails :fdobug:`33013`
422 * Add support for './waf configure --libdir=XXX' :fdobug:`30230`
424 Documentation Changes:
425 * Upgrade to using Sphinx 1.0.7.
426 * Include html documentation in the pycairo archive file.
429 * Update waf to 1.6.3
433 * Improve/simplify unicode filename support.
434 * Improve/simplify unicode text support.
441 Pycairo 1.8.10 requires cairo 1.8.10 (or later).
444 * Win32PrintingSurface
445 * XCBSurface - add XCB support using xpyb
448 * Fix for libtool 2.2 (:fdobug:`27974`).
449 * Mingw32 and pypy fixes (:fdobug:`25203`).
454 The Win32PrintingSurface and XCBSurface changes mean that pycairo 1.8.10 is
455 not binary compatible with pycairo 1.8.8. So modules that use the pycairo C
456 API (like pygtk) will need to be recompiled to use pycairo 1.8.10.
463 * Pycairo 1.8.8 requires cairo 1.8.8 (or later).
464 * Move from CVS to git.
465 * Add support for the waf build tool.
468 * The PDF/PS/SVGSurface constructors now accept None as a filename.
475 Pycairo 1.8.6 requires cairo 1.8.6 (or later)
478 * ImageSurface.create_from_png _read_func fix
479 * ToyFontFace type fix
480 * :fdobug:`19221`: restore cairo.Matrix '*' operator to the way it
484 Documentation completed.
491 Pycairo 1.8.4 requires cairo 1.8.4 (or later) and Python 2.6
494 * 20674: Add get/set_extend for Gradient Patterns
502 | ToyFontFace.get_family
503 | ToyFontFace.get_slant
504 | ToyFontFace.get_weight
507 | SurfacePattern.get_extend
508 | SurfacePattern.set_extend
511 Threading for surfaces with stream functions has been reenabled.
512 Documentation updates.
518 Pycairo 1.8.0 resulted in crashes for some applications using threads. So
519 upgrading to 1.8.2 is recommended for threaded applications.
522 * :fdobug:`19287`: Threading support results in crashes in
526 Context.set_scaled_font
529 Matrix multiplication::
531 old code: matrix3 = matrix1 * matrix2
532 new equivalent code: matrix3 = matrix1.multiply(matrix2)
533 matrix3 = matrix1 * matrix2
534 is now equivalent to matrix3 = matrix2.multiply(matrix1)
535 which is consistent with standard matrix multiplication.
542 Pycairo 1.8.0 requires cairo 1.8.0 (or later).
543 Add documentation (available separately)
546 * :fdobug:`18101`: Add support for threading
547 * :fdobug:`18947`: cairo.SurfacePattern should INCREF the used surface
550 | ScaledFont.get_scale_matrix
551 | Surface.mark_dirty_rectangle
552 | Surface.set_fallback_resolution
556 | cairo.HAS_IMAGE_SURFACE
557 | cairo.HAS_USER_FONT
560 * Surface.mark_dirty: no longer accepts keyword arguments with default
562 * PycairoPattern_FromPattern (C API): has a new 'base' argument - to fix
566 Allow unknown cairo Pattern/Surface types to use the pycairo base
567 Pattern/Surface type.
574 Pycairo 1.6.4 requires cairo 1.6.4 (or later).
575 requires Python 2.5 (or later).
578 :fdobug:`16112`: Fix win32 'python setup.py ...' build -- use double quotes
581 | Context.has_current_point
582 | Context.path_extents
583 | ImageSurface.format_stride_for_width
586 | PSSurface.ps_level_to_string
587 | PSSurface.restrict_to_level
592 cairo.PS_LEVEL_2, cairo.PS_LEVEL_3
595 test/pygame-test1.py, test/pygame-test2.py : pygame tests
597 examples/cairo_snippets/snippets/ellipse.py : Update
598 so line-width is a constant width in device-space not user-space
605 Pycairo 1.4.12 requires cairo 1.4.12 (or later).
606 requires Python 2.4 (or later).
609 * :fdobug:`10006`: update autogen.sh to support automake >= 1.10
610 * :fdobug:`13460`: use python-config to get python includes
613 * allow cairo.Context to be subclassed
614 * create a 'doc' subdirectory and start a FAQ file
621 Pycairo 1.4.0 requires cairo 1.4.0 (or later).
624 | Context.clip_extents
625 | Context.copy_clip_rectangles
627 | Context.get_dash_count
628 | Context.get_scaled_font
629 | Context.glyph_extents
631 | Context.show_glyphs
632 | LinearGradient.get_linear_points
633 | RadialGradient.get_radial_circles
634 | SolidPattern.get_rgba
635 | SurfacePattern.get_surface
638 ImageSurface.create_for_array
639 Remove Numeric Python support, since Numeric has been made obsolete by
640 numpy, and numpy data can be read using ImageSurface.create_for_data.
643 the module cairo.gtk has been removed (pygtk 2.7.0 onwards has cairo
650 * Pycairo 1.2.6 requires cairo 1.2.6 (or later).
651 * mingw32 compiler fixes (Cedric Gustin)
652 * setup.py improvements (Cedric Gustin)
653 * ImageSurface.get_data() new method added
654 ImageSurface.get_data_as_rgba() method removed
660 * Pycairo requires cairo 1.2.2 (or later).
661 * setup.py has been updated to allow installation by executing
662 $ python setup.py install
663 * examples/cairo_snippets/snippets/gradient_mask.py
664 A new example to demonstrate pattern masks.
665 * The cairo.svg module has been removed because:
667 1) Cairo does not include SVG parsing, so this module does not belong
669 2) libsvg-cairo (the underlying C library) is unmaintained.
676 Pycairo has been updated to work with cairo 1.2.0.
679 | Surface.set_fallback_resolution
680 | Surface_get_content
681 | ImageSurface_get_format
682 | Image_surface_get_stride
685 PDFSurface.set_dpi, PSSurface.set_dpi, SVGSurface.set_dpi
686 - replaced by Surface.set_fallback_resolution
689 cairo.FORMAT_RGB16_565 added
696 Pycairo has been updated to work with cairo 1.1.6.
702 | Context.get_group_target
703 | Context.new_sub_path
705 | Context.pop_group_to_source
707 | Context.push_group_with_content
708 | FontOptions.get_antialias
709 | FontOptions.get_hint_metrics
710 | FontOptions.get_hint_style
711 | FontOptions.get_subpixel_order
712 | FontOptions.set_antialias
713 | FontOptions.set_hint_metrics
714 | FontOptions.set_hint_style
715 | FontOptions.set_subpixel_order
716 | PDFSurface.set_size
717 | PSSurface.dsc_begin_page_setup
718 | PSSurface.dsc_begin_setup
719 | PSSurface.dsc_comment
721 | ScaledFont.get_font_face
722 | ScaledFont.text_extents
723 | Surface.get_device_offset
724 | XlibSurface.get_depth
727 PDFSurface()/PSSurface() - can now write to file-like objects (like
730 surface.write_to_png() and ImageSurface.create_from_png() can now write to
731 file-like objects (like StringIO).
733 select_font_face, show_text, text_extents and text_path now accept unicode
740 | examples/cairo_snippets/snippets_svg.py
741 | examples/cairo_snippets/snippets/ellipse.py
742 | examples/cairo_snippets/snippets/group.py
743 | examples/svg/svgconvert.py
750 Pycairo has been updated to work with cairo 1.0.2.
752 New cairo functions supported:
753 cairo.ImageSurface.create_for_data()
756 ctx.set_source_rgba (r, g, b, a=1.0) now supports a default alpha argument
759 cairo.Matrix now supports the Python sequence protocol, so you can do:
760 xx, yx, xy, yy, x0, y0 = matrix
767 Pycairo has been updated to work with cairo 1.0.0.
769 New cairo functions supported:
770 | cairo.cairo_version()
771 | cairo.cairo_version_string()
772 | PSSurface.set_dpi()
774 Patterns are now implemented in a class hierarchy, the new constructors are:
775 | cairo.SolidPattern (r, g, b, a=1.0)
776 | cairo.SurfacePattern (surface)
777 | cairo.LinearGradient (x0, y0, x1, y1)
778 | cairo.RadialGradient (cx0, cy0, radius0, cx1, cy1, radius1)
781 Surface.write_to_png() now accepts a file object as well as a filename
784 The gtk examples now work with pygtk >= 2.7.0 without requiring the
788 fix "initializer element is not constant" compiler warnings
795 Pycairo has been updated to work with cairo 0.9.0.
797 New cairo functions supported:
798 | cairo_get_antialias
799 | cairo_set_antialias
800 | cairo_surface_mark_dirty_rectangle
801 | cairo_surface_flush
804 * double buffering now works with the cairo.gtk module
810 This version has many changes which update Pycairo to the new cairo API. The
811 change list is not duplicated here, instead see the cairo/NEWS file for full
812 details of all these API changes.
814 Pycairo method names that were different from the underlying cairo function
815 names have been changed to make Pycairo more closely follow cairo and so
816 enable the cairo documentation to be used for writing Pycairo programs. NOTES
817 has been updated to list the differences between the C API and the Pycairo
820 Context.copy_path() has been implemented, it returns a Path instance which
821 supports the iterator protocol.
823 Python 2.3 is now required.
826 examples/warpedtext.py: shows usage of the Path iterator
828 examples/cairo_snippets/: shows many of the 'cairo-demo/cairo_snippets'
831 examples/gtk/png_view.py: example using cairo.ImageSurface.create_from_png()
834 Pycairo has been updated to work with cairo 0.6.0, including using cairo's
835 new error handling scheme.
838 cairo.CONTENT_COLOR, cairo.ALPHA, cairo.COLOR_ALPHA have been added for
839 working with surfaces.
841 A new class cairo.FontOptions has been added.
843 cairo.ImageSurface.create_from_png() now accepts a filename string or a
846 New wrapper functions have been added for cairo_get_font_options,
847 cairo_set_font_options and cairo_surface_get_font_options.
854 * new class cairo.Win32Surface (Niki Spahiev)
855 * cairo.HAS_WIN32_SURFACE, cairo.HAS_PS_SURFACE etc are defined to give
856 access to the values from cairo-features.h
859 * fix cairo_mask, cairo_mask_surface and cairo_stroke_preserve wrappers
860 * compile properly against GTK+ 2.7 (Gustavo Carneiro)
861 * other small fixes, including fixes for gcc 4.0 warnings
871 | cairo_font_set_transform
872 | cairo_font_current_transform
878 Changed version numbering to correspond directly with the Cairo version
879 Pycairo was developed to work with. So, for example, Pycairo version 0.4.0
880 represents the Pycairo version that has been developed and tested with
887 The Pycairo license has changed so that it is now dual-licensed under the LGPL
888 and the MPL, the same as Cairo itself. For details see the COPYING file as
889 well as COPYING-LGPL-2.1 and COPYING-MPL-1.1.
892 | cairo_pdf_surface_create
893 | cairo_set_target_pdf
895 New libsvg-cairo bindings:
897 | svg_cairo_parse_buffer
902 * Added --without-pygtk configure option.
903 * Renamed the Pycairo API _new() functions to _wrap() to allow _new() to
904 * be used for python __new__ functions.
905 * New examples: svg2png.py and svgview.py.
911 After the recent server compromise we discarded all unsigned
912 snapshots. That left us without a pycairo snapshot.
914 Additionally, there were no tags in the source repository so I
915 couldn't recreate the 0.1.2 snapshot, so here's a new 0.1.3 snapshot.
917 I apologize if I botched the version number or left something
918 significant out of this announcement---I'm not the one who will
919 usually be doing pycairo maintenance.
924 | current_font_extents
927 fill_extents,stroke_extents: Remove unnecessary args and
928 change from a method to an attribute.
931 Added two new examples: context-subclass.py and warpedtext.py