Questions tagged [cairo]

Cairo is a software library used to provide a vector graphics-based, device-independent API for software developers.

Cairo is a software library used to provide a vector graphics-based, device-independent API for software developers. It is designed to provide primitives for 2-dimensional drawing across a number of different backends. Cairo is designed to use hardware acceleration when available.

Although written in C, there are bindings for using the cairo graphics library from many other programming languages, including C++, Factor, Haskell, Lua, Perl, Python, Ruby, Scheme, Smalltalk and several others. Dual licensed under the GNU Lesser General Public License and the Mozilla Public License, cairo is free software.

Cairo Homepage includes documentation and examples.

1254 questions
10
votes
1 answer

Convert SVG to PNG with Python on Windows

Question: Which reproducible process can enable Windows Python users to render a SVG image into PNG? Many questions/answers (such as Convert SVG to PNG in Python and Server-side SVG to PNG (or some other image format) in python, which are not…
Basj
  • 41,386
  • 99
  • 383
  • 673
10
votes
5 answers

Why Do I get Xcode 1.5 not supported?

I am trying to install Cairo/Xlib on macOS I couldn't get this to work cmake -G "Xcode" --config Debug "-DCMAKE_BUILD_TYPE=Debug" ../. CMake Error: Xcode 1.5 not supported. CMake Error: Could not create named generator Xcode Generators *…
Necati Yesil
  • 143
  • 1
  • 5
10
votes
1 answer

How to create a cairo-gl surface under Gtk

I want to create a window using GTK 3 under linux (fedora 12) and draw on it a simple rectangle using cairo-gl backend, for this I want to create a cairo-gl surface. How can I do this, can anybody help me with a sample code. Thanks in advance. RC7
RC7
  • 101
  • 1
  • 4
10
votes
2 answers

Haskell, GHC, win32, cairo

I have problem with ghci+cairo on windows. When I try to load, for example like this "ghci -package cairo" it fails with the following error: Loading package random-1.0.0.2 ... linking ... done. Loading package haskell98 ... linking ...…
dilettant
  • 399
  • 2
  • 6
10
votes
3 answers

Failed to install "Cairocffi"

I'm working with python3, and i'm trying to install " cairocffi" on Ubuntu. To do this, i've successfully installed: python-dev libffi-dev cffi But when i've trying to install "cairocffi" with pip install cairocffi,I got: File…
Sam
  • 523
  • 2
  • 5
  • 14
10
votes
1 answer

What is the right way to render Cairo updates in Gtk2hs?

I'm writing a Haskell program with click-and-drag functionality, so with each mouse movement event an update gets painted to the window. At the moment I'm using renderWithDrawable myCanvas update However this is flickering a lot. My understanding…
Paul Johnson
  • 17,438
  • 3
  • 42
  • 59
10
votes
0 answers

graphviz embed svg images

I am trying to generate a diagram with embeded svg images. If I run graphviz with the regular svg command, the images are only referenced. dot -Tsvg diagram.dot -O Here it says to build with -Tsvg:cairo but I get the following: dot -Tsvg:cairo…
DavidGamba
  • 3,503
  • 2
  • 30
  • 46
10
votes
1 answer

issue saving R plot with transparent background

I am trying to save a r plot with transparent background with png format. I have followed few recommended method in stackoverflow but every time I am still getting the white background. My test date is as follows: structure(list(wd = c(7.5, 22.5,…
Achak
  • 1,286
  • 2
  • 18
  • 36
10
votes
1 answer

Why am I seeing streaks with rotation on mobile browsers?

I'm performing a rotation of a 2d canvas which works pretty well on the desktop but there's one small issue in the mobile space. Here's a zoomed in screenshot: The thumb image is rotated about 0.2rad over the course of 500ms. What I think is all of…
Chris Tonkinson
  • 13,823
  • 14
  • 58
  • 90
9
votes
1 answer

How to draw directly on the desktop?

I'm wondering how to draw directly on the root window in an X11 environment with Cairo (in C), in order to make widgets. I've copied some parts of the code of tint2, but it's quite enormous, and the only result I have is not satisfying. I would be…
Dylar
  • 91
  • 1
  • 2
9
votes
1 answer

Install latest cairo lib in Ubuntu for weasyprint

I just installed an Ubuntu bionic instance. It comes with cairo 1.14.6 preinstalled. I need at least cairo 1.15.4 for weasyprint to work properly. Unfortunately, even after installing the latest cairo, python still picks up the old library. I would…
Josue Montano
  • 521
  • 4
  • 16
9
votes
1 answer

cairosvg installed but ImportError

I just installed cairosvg and it seems to have worked. If i try to install again it says: $ pip install cairosvg Requirement already satisfied(...) But if I try to import it in python3, it delivers an ImportError: >>>import cairosvg …
EliteKaffee
  • 109
  • 1
  • 2
  • 12
9
votes
4 answers

How to return an image in an HTTP response with CherryPy

I have code which generates a Cairo ImageSurface, and I expose it like so: def preview(...): surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height) ... cherrypy.response.headers['Content-Type'] = "image/png" return…
colinmarc
  • 2,421
  • 1
  • 22
  • 34
9
votes
2 answers

convert pdf with 300dpi bitmaps to svg

I'm creating a tool to convert pdf's into svg. These pdf's contain graphical data, including large bitmaps at 300 dpi and a bunch of vectors as well. Poking around here on stackoverflow, I've found pdf2svg, which great -- works like a charm, and the…
Paul Degnan
  • 1,972
  • 1
  • 12
  • 28
9
votes
4 answers

How do I use Homebrew to install Python libraries like Py2Cairo

Here's what I've done so far: I've installed Homebrew: /usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)" Then python: brew install python Then py2cairo: brew install…
Lockyer
  • 1,311
  • 1
  • 13
  • 30