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
7
votes
1 answer

Pango + Cairo; is there an existing approach for handling style tags in text?

Pango syntax supports some text only markup. As far as i can see this does not extend to embedding images as well. Looking around I cannot find much in the way of an existing implementation, but i havent done pango+cairo work before so i might be…
Vusak
  • 1,420
  • 9
  • 12
7
votes
5 answers

How do I render *parts* of a svg file?

I want to render parts of a svg file by name but for the life of me I cannot figure out how to do so (using python + gtk). Here's the svg file in question: http://david.bellot.free.fr/svg-cards/files/SVG-cards-2.0.1.tar.gz (Update: this file no…
Fake Code Monkey Rashid
  • 13,731
  • 6
  • 37
  • 41
7
votes
1 answer

load svg with Cairo

I want to load a SVG file with the Cairo library, do apply some transformations to it. Then I want to display my svg with a glTexture. But I just find functions which create svg file and not load svg.
Bob
  • 589
  • 1
  • 11
  • 25
7
votes
2 answers

How to make a perspective transformation with Athens/Cairo in Pharo Smalltalk

I found affine transformation functionality (rotate, shear, translate, scale) in Athens/Cairo in Pharo Smalltalk. I am looking for a perspective transformation. Is this possible at all? At least there seem to be no convenience methods for this in…
MartinW
  • 4,966
  • 2
  • 24
  • 60
7
votes
1 answer

problems installing Pango-1.30.1

I have encountered a problem installing Pango-1.30 on a Ubuntu 12.04 platform. During ./configure step I receive a message saying "Could not enable any of Freetype, X11, Cairo, or Win32 backends. Must have at least one backend to build Pango". …
allynm
  • 221
  • 4
  • 7
7
votes
1 answer

How to access a Linux Framebuffer in Mono (Mono.Cairo / GTK#)?

I'm starting to write a small application for Linux under the Mono framework, the application will essentially be a small kiosk front-end with very minimal user interaction. This is to replace a previous version of the same application which was…
Mike Insch
  • 302
  • 3
  • 14
7
votes
1 answer

rsvg with Python 3.2 on Ubuntu

I am trying to use rsvg in Python 3.2 but I keep getting an import error. I have installed all of the librsvg packages along with cairo. I cannot find anything online about what else to install to get it to work. I did hear that the rsvg module…
drewlaqua
  • 101
  • 2
  • 6
6
votes
4 answers

How to draw a line in a GtkDrawingArea using Cairo with Gtk3

Could someone please show me a minimal working example of using C language for Cairo with Gtk3 to draw a single line in a GtkDrawingArea. I've tried to modify testcairo.c in the Gtk3 tests folder but I can't get it to work. Please don't suggest the…
mike
  • 1,135
  • 4
  • 22
  • 39
6
votes
1 answer

Correct RGB values for AVFrame

I have to fill the ffmpeg AVFrame->data from a cairo surface pixel data. I have this code: /* Image info and pixel data */ width = cairo_image_surface_get_width( surface ); height = cairo_image_surface_get_height( surface ); stride =…
GiuTor
  • 149
  • 8
6
votes
1 answer

Using Cairo Regions in python with gi.repository

I can't seem to get cairo regions working in within using the gintrospection. For example from gi.repository import cairo reg = cairo.Region() will give me Traceback (most recent call last): File "", line 1, in MemoryError and…
Nikhil
  • 61
  • 3
6
votes
2 answers

What is the most performant way to implement zoom to a cairo-drawn canvas?

I have a wx.ScrolledWindow where is drawn on using cairo. I have implemented a zoom-functionality which right now redraws the whole content. But as there will be up to 200 curves to draw I should consider a more performant solution. I have thought…
any1
  • 292
  • 3
  • 9
6
votes
4 answers

How to create a cairo object within a gtk window in GTK+3

I'm trying to use cairo to draw some arcs but gcc warns me that gdk_cairo_create() is deprecated. Use gdk_window_begin_draw_frame() and gdk_drawing_context_get_cairo_context() instead. To get around this I did some research and found out that for…
Parsa Mousavi
  • 1,052
  • 1
  • 13
  • 31
6
votes
1 answer

Python SVG converter creates empty file

I have some code below that is supposed to convert a SVG image to a PNG. It runs without errors but creates a PNG file that is blank instead of one with the same image as the original SVG. I did find that it is not an error with cairo but more one…
Andereoo
  • 834
  • 1
  • 8
  • 24
6
votes
2 answers

quickest way to get started with cairo

I have taken passing shots at learning Cairo in the past, but always moved on in favor of some other graphics library. My problem is that I can't find a good tutorial that gives me a simple display for my surface. I have always ended up digging…
Eli
  • 2,041
  • 4
  • 18
  • 20
6
votes
2 answers

Can't install cairo with cabal on Windows - how to get pkg-config on win?

Configuring cairo-0.12.0... setup.exe: The program pkg-config version >=0.9.0 is required but it could not be found. cabal: Error: some packages failed to install: cairo-0.12.0 failed during the configure step. The exception was: ExitFailure 1 so…
cnd
  • 32,616
  • 62
  • 183
  • 313