Commit Graph

113 Commits

Author SHA1 Message Date
Christoph Reiter 3c39f6b7a5 getting_started: add Python devel packages to install commands
Otherwise one gets "Python.h: File or folder not found" on install.
2019-01-27 10:17:31 +01:00
Christoph Reiter 91241aff52 docs: getting started: add instructions on how to install pkg-config. See #137 2018-12-08 19:46:50 +01:00
Christoph Reiter 24a0f8cbbe docs: add some instructions for building/installing pycairo. See #136 2018-11-27 16:46:42 +01:00
Matteo Italia 41aea39b09 Fix typo in context.rst (loosing -> losing) 2018-11-07 16:20:52 +01:00
Christoph Reiter d07aa4e613 docs: add CAIRO_VERSION_STRING 2018-11-04 11:49:51 +01:00
Christoph Reiter 025ed8278f Expose compile-time version macros 2018-11-04 10:16:42 +01:00
Christoph Reiter 7473215210 Add new cairo 1.16 API
Plus some mime type constants from 1.14 which I forgot.

All the API is only exposed when building with cairo 1.15.10+ (Ubuntu 18.04)
except the font variation stuff which is 1.15.12+ (Ubuntu 18.10)
2018-11-02 15:03:04 +01:00
Christoph Reiter 425ec3094e docs: use python3 for building; reference the latest 2/3 docs instead of specific versions 2018-11-02 12:50:23 +01:00
nikolas abdd40a8e0
docs: Remove broken link to hamster library
I can't find any active link for this library, and it looks like the tbaugis github user isn't around anymore, so I'm just removing this.
2018-09-28 16:14:39 -04:00
Christoph Reiter 9215412954 c-api: Make it possible to use the C API with Python 3 outside of the CU doing the import. Fixes #110
In case PYCAIRO_NO_IMPORT is defined we declare the api struct as extern and hide the
import function. Also don't make the API struct static so we can access it from outside.
2018-04-13 17:11:32 +02:00
Christoph Reiter e9cc184bb3 Update NEWS and docs for the next release 2018-04-09 19:59:36 +02:00
Christoph Reiter de7e156ec1 docs: sphinx 1.7 no longer allows non-class refs as param types 2018-02-22 09:42:02 +01:00
Christoph Reiter cd4c3c7994 docs: call the sphinx __main__ instead of using sphinx-build
It has stopped working in a --user install, not sure..
2018-02-22 09:37:50 +01:00
Dan Yeaw 3b4e189f56 Fix formatting to PEP8
Signed-off-by: Dan Yeaw <dan@yeaw.me>
2018-02-21 21:48:39 -05:00
Christoph Reiter f0fdcee0ac bump minor version
There are new files to install and new API.
2018-02-05 16:27:09 +01:00
Christoph Reiter fa0707e565 Move header into the package and add a get_include() function. See #92
Pycairo installs .pc files which work quite well where the default
prefix is used, like with distro packaging etc. In virtualenvs
the pkg-config look up path needs to be set manually, and in pip
wheels are involved, where we had to disable installing .pc files
as they can get reused for a different prefix.

To make it easier for other python modules to use the C API introduce
a new function get_include() (similar ot what numpy has) which returns
the include path that needs to be passed to the compiler.

Since we can't really get the old header install path from the module
(one could walk up the tree and look for matching files, but that's ugly)
move the header file into the package itself, so that the path can be
dervived from the package path.

To prevent code from breaking which hardcodes the old include path
install a header to the old location which includes the new header
location.
2018-01-31 21:53:59 +01:00
Christoph Reiter 4e4bfe66e7 Use utf-8 as path encoding for cairo >= 1.15.10. Fixes #86
With https://cgit.freedesktop.org/cairo/commit/?id=84fc0ce91d1a57d20500f710abc0e17de82c67df
cairo has moved from using fopen, which supports ANSI paths, to _wfopen, which
supports all Windows paths. The input is changed/limited to utf-8.

To paper over this "API break" (anything outside of ASCII is different)
adjust the encoding based on the cairo library version at runtime.
2017-12-30 18:24:32 +01:00
Christoph Reiter 469c84ecd0 docs: add faq entry about broken .pc files due to python wheels 2017-12-11 10:55:37 +01:00
Christoph Reiter 7c1ca674a0 README: include an example 2017-10-15 20:56:14 +02:00
Christoph Reiter 1b3527ecb1 release 2017-09-17 22:00:35 +02:00
Christoph Reiter e9446ddeaf release 2017-08-19 11:27:29 +02:00
Christoph Reiter dfa4eb204b docs: update param docs for fspath changes 2017-08-18 17:31:53 +02:00
Christoph Reiter b10da618b1 docs: document more class attributes 2017-07-24 08:44:43 +02:00
Christoph Reiter 87dbb471d7 Add cairo.TextExtents() and ScaledFont.glyph_extents(). Fixes #62 2017-07-24 08:19:48 +02:00
Christoph Reiter 3b1300c475 ScaledFont.text_to_glyphs: Add optional with_clusters argument
If with_clusters == False only the glyph list will be returned.
This matches the API cairocffi provides, except the argument
is not optional there.
2017-07-23 13:09:04 +02:00
Christoph Reiter 0d6fbbc42b Add Context.show_text_glyphs() 2017-07-23 12:50:47 +02:00
Christoph Reiter d5a3a03509 Add ScaledFont.text_to_glyphs 2017-07-22 23:38:50 +02:00
Christoph Reiter 6981691097 Add cairo.TextCluster. Fixes #61 2017-07-22 22:24:07 +02:00
Christoph Reiter 23933c3658 Add cairo.Rectangle. Fixes #54 2017-07-22 21:42:44 +02:00
Christoph Reiter c05af22381 Add cairo.Glyph. Fixes #53
It's a tuple subclass, so can be used everywhere where it was used before.

In the documentation remove all the optional glyph array lengths, as they
are not strictly needed (one cas just pass slices) and just complicate things.
2017-07-22 16:13:30 +02:00
Christoph Reiter ab14d41895 raster pattern: don't pass the pattern to the callback. See #48
The pattern argument in the C API might be some internal thing
and not a bug as suspected. Instead of trying to "fix" it by passing
the pattern where the callback was registered at, pass nothing instead.

https://bugs.freedesktop.org/show_bug.cgi?id=101866#c1

In case the pattern instance is needed in the callback it can easily
be passed by using Python closures.
2017-07-22 13:30:51 +02:00
Christoph Reiter 42eb8a30f5 Add RasterSourcePattern. Fixes #48
This only adds the type, constructor and the get/set_acquire() methods.

Since for some reason the callbacks don't get passed the pattern, this
uses the callback data to access the Python functions in the callbacks.
The whole thing doesn't look heavily tested in cairo, so I'm waiting
for a response in https://bugs.freedesktop.org/show_bug.cgi?id=101866
before looking into wrapping more functions there.
2017-07-21 15:58:34 +02:00
Christoph Reiter df880d58f5 docs: Move the C API documentation from the source code into the docs. Fixes #58
Also add some more info regarding ownership transfer and error handling.
2017-07-19 11:27:33 +02:00
Christoph Reiter 4eafd8798f error: raise cairo.IOError instead of IOError. Fixes #55 2017-07-18 19:12:17 +02:00
Christoph Reiter 2afdb760a7 Raise a subclass of MemoryError and cairo.Error instead of MemoryError. See #55
The plan is to do the same for IOError, but that needs some more work first.

The subclass currently is only exposed in the docs to make it clear that
previously MemoryError was raised.
2017-07-14 20:55:57 +02:00
Christoph Reiter 96a2a26f10 Add Surface.map_to_image() and Surface.unmap_image(). Fixes #51
This keeps the same API as cairo but adds some additional checks
to prevent crashes. Those cases still are undefined but at least
you get some error messages.

* It adds a new ImageSurface subtype so we can do some type checking.
* It swaps the underlying image surface to a dummy finished one
  when it gets unmapped so that operations after unmap
  on the wrapper don't crash.
* It checks if the source surface is correct when unmapping.
2017-07-13 16:38:19 +02:00
Christoph Reiter 1212d50b09 docs: set_device_scale: fix a reference 2017-07-12 15:34:16 +02:00
Christoph Reiter 3ebeb2c951 Add cairo.MeshPattern. Fixes #18 2017-07-11 23:37:16 +02:00
Christoph Reiter 4b8aba8a97 Add TeeSurface 2017-07-11 20:20:15 +02:00
Christoph Reiter 40262070d8 Add Gradient.get_color_stops_rgba()
This wraps cairo_pattern_get_color_stop_count() and
cairo_pattern_get_color_stop_rgba() an returns a list.
2017-07-10 18:10:18 +02:00
Christoph Reiter 92ed20967c Add cairo.SurfaceObserverMode enum 2017-07-10 17:12:00 +02:00
Christoph Reiter 76dbc3044f Add cairo.TextClusterFlags 2017-07-10 17:05:13 +02:00
Christoph Reiter c71f896da4 Add cairo.Format.stride_for_width
Now that we have enum classes we can put the method
in the right place.

This functions was (and still is) available under
ImageSurface.format_stride_for_width
2017-07-10 16:46:25 +02:00
Christoph Reiter 7926ce26d3 Add Status.JBIG2_GLOBAL_MISSING 2017-07-10 14:22:13 +02:00
Christoph Reiter c8713e8132 Add cairo.ScriptSurface. Fixes #17 2017-07-10 10:10:56 +02:00
Christoph Reiter 0a73a8a24d Add cairo.ScriptDevice() 2017-07-09 22:01:00 +02:00
Christoph Reiter 0240732fce Add cairo.Device() class and Surface.get_device()
This only adds new Python API an no C API for now.
2017-07-07 09:45:09 +02:00
Christoph Reiter 319a8d02c1 docs: Add get/set_device_scale. See #44 2017-07-01 13:21:01 +02:00
HinTak f3f40028e8 Adding more detailed descriptions 2017-06-01 09:13:06 +02:00
Christoph Reiter cd6b840aea docs: link to freetype examples. Fixes #25 2017-05-31 15:15:30 +02:00