cairo

How to install cairo on Windows

被刻印的时光 ゝ 提交于 2019-12-06 21:45:48
问题 For the life of me I can't figure out how to install cairo on Windows! I need it for Haskell Charts, but when I follow setup instructions and get to running: cabal install gtk I get this error: Linking dist/setup-wrapper\setup.exe ... Configuring glib-0.12.2... setup.exe: The program pkg-config version >=0.9.0 is required but it could not be found. cabal.exe: Error: some packages failed to install: cairo-0.12.2 failed during the configure step. The exception was: ExitFailure 1 gio-0.12.2

Cannot create dylib for distribution that works on OS X 10.5 (building in 10.6 environment)

邮差的信 提交于 2019-12-06 16:01:08
I'm trying to distribute cairo (1.10.2) with my application. I can create the necessarily dylibs using Homebrew but they are dependent on versions of other dynamic libraries that aren't present in OS X 10.5 (libfontconfig, libfreetype, and others located primarily in /usr/X11/lib ). I assume to solve this I want it to be using the dylibs in /Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib rather than the libraries in /usr/X11/lib . I've tried anything I could find for targeting cairo against the 10.5 SDK. Setting MACOSX_DEPLOYMENT_TARGET environment variable to 10.5 (before calling brew or using

How to rotate image using GTK+ / Cairo

血红的双手。 提交于 2019-12-06 13:22:41
I've got a simple application that is supposed to rotate a decorated wheel so many degrees every x number of milliseconds using GTK+ and Cairo . I've got some code below that calls cairo_rotate() from a timer. However, the image doesn't change. Do I have to invalidate the image to cause the expose-event to fire? I'm so new to Cairo that a simple example demonstrating how to rotate an image using Cairo in GTK+ would be highly appreciated. #include <cairo.h> #include <gtk/gtk.h> cairo_surface_t *image; cairo_t *cr; gboolean rotate_cb( void ) { cairo_rotate (cr, 1); //cairo_paint(cr); printf(

C/GTK+3 draw event for multiple widgets

对着背影说爱祢 提交于 2019-12-06 09:42:56
I am currently trying to learn GTK+3/cairo using C. I have written a small application which draws a gauge face and needle on a gtk drawing area using cairo. This works well so far, i have tried creating multiple drawing areas (multiple gauges) which all have the same callback function for the draw event, this also works well with static values. Now my question, i would like to be able to draw multiple gauges each with their own values. But how do i know in my callback function which gauge (drawing area) emitted the draw signal? I guess this also includes how do i "create and store" data for

Activating cairo-dependent features of graph_tool

陌路散爱 提交于 2019-12-06 06:19:06
I have been using the graph-tool library for a while now, thus far I hadn't really been using most of its drawing features. Today when trying to use graph_tool.draw.graph_draw I realised that I had configured graph-tool initially without cairo , ./configure --disable-cairo and this is exactly the graphics library that graph_draw uses. If I install cairo now, is there a way to activate the features of graph_tool that rely on cairo without having to remove and reinstall the whole graph_tool module? This would spare a few hours of re-installation. (the make process takes about 3 hours on my

load svg with Cairo

╄→гoц情女王★ 提交于 2019-12-06 03:41:38
问题 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. 回答1: Cairo itself cannot read SVG files. You need something like librsvg to render SVGs to a Cairo surface. From a quick look at their API documentation, it looks like you need rsvg_handle_new_from_file() to load a file and something like rsvg_handle_render_cairo() or rsvg_handle_get_pixbuf() to

Cairo context and persistence?

拥有回忆 提交于 2019-12-06 02:22:15
I am just getting started using pycairo, and I ran into the following interesting error. The program I write creates a simple gtk window, draws a rectangle on it, and then has a callback to draw a random line on any kind of keyboard input. However, it seems that with each keyboard input, I have to create a new context, or I get an error at the moment the program receives first keyboard input (specifically, on the .stroke() line). Error is as follows, if it matters. 'BadDrawable (invalid Pixmap or Window parameter)'. (Details: serial 230 error_code 9 request_code 53 minor_code 0) #! /usr/bin

Gulp issues with cario install command not found when trying to installing canvas

筅森魡賤 提交于 2019-12-06 02:21:12
I'm fairly new to working in command line. I have a project that I'm setting up with gulp, and have gulp installed and compiling the sass files successfully. However, I cannot install canvas via: $ npm install canvas I need to install canvas because of the dependencies css-sprite has to run. I am getting the following error. I have installed cairo, quartz, and homebrew installed. I've researched other tickets and tried to run the export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig and install again. I've had no luck, and have no idea what else to do in attempts to troubleshoot. Here is the error...

Set system font in R package Cairo in Mac OS X

妖精的绣舞 提交于 2019-12-05 19:18:32
Because of the issue raised in Using Unicode inside R's expression() command , I am switching to R on Mac OS X to create some plots. Using CairoPDF() , however, the commands I use in Windows to select my fonts don't have any effect on Mac OS X, where the output .pdf file always has the Helvetica font. library(package = "Cairo") CairoPDF("test.pdf") plot.new() text(x=.5,y=.5,labels="\u0260",family="Times New Roman") dev.off() The output in Windows is: The output in Mac OS X is: The Times New Roman font is exactly the same on both systems. I did it with CairoFonts rather than the family argument

How to display interactive SVG in a window on Linux?

本秂侑毒 提交于 2019-12-05 16:09:02
I really like SVG, it's very nice to draw with it. So far i've made static images using Inkscape. I'd like to make them interactive though. I did some trials, following tutorials like this one . But i can see a SVG and interact with it in my web browser only. I'd like to make such things in a window on the desktop. There are drawing kits like Cairo or OpenGL, but then i have to draw from code. It seems a more clever thing to use SVG (which was drawn using Inkscape). What does it require to view interactive/animated SVG in a plain desktop window/canvas? I've seen some modules to convert SVG to