1,276 questions
1
vote
0
answers
66
views
How to create a transparent window in GDK 3 that passes mouse events using C?
I need to create transparent window and when user clicks inside this window then mouse event to be passed to a window that is behind. For example, if there is a text editor behind my window then mouse ...
0
votes
1
answer
66
views
Why are my compilation flags looking for errors when connecting cairomm.h?
The first time I decided to write a CMake file, I ran into a problem. To be honest, I don't understand why this is happening. My compilation flags cause errors in cairomm.h. Everything was fine before ...
0
votes
1
answer
42
views
How to use Cairo's CAIRO_FORMAT_RGBA128F for 32 bit color output?
I am currently using Cairo for 8-bit rendering with the following code in my After Effects plug-in, which works just fine using the CAIRO_FORMAT_ARGB32 image surface:
// Write pixel 8-bit
PF_Pixel* ...
0
votes
1
answer
60
views
Text rendering scrolling performance using gtk + cairo
// gcc `pkg-config --cflags gtk+-3.0` main.c `pkg-config --libs gtk+-3.0 cairo`
#include <gtk/gtk.h>
#include <cairo.h>
#include <stdlib.h>
#include <string.h>
#define ...
1
vote
0
answers
47
views
How to use Cairo Graphics in 16 bit color mode?
I am using the Cairo Graphics Library (https://www.cairographics.org/) and I am currently getting my app to export in 8 bits per channel using the following function:
// Write pixel 8-bit
PF_Pixel* ...
3
votes
1
answer
68
views
Change letter spacing in pango/cairo
I want to put more spaces between letters in text in Cairo. Cairo doesn't seem to have a native implementation for changing inter-letter spacing.
It seems like Pango should be a natural fit. However, ...
1
vote
1
answer
45
views
Load custom ttf in cairo or pangocairo
Using the C cairo api or the pangocairo api how can I load a custom ttf font file?
How do I select the font for use when rendering some text?
and.. Can I load the font from RAM rather than a file path?...
0
votes
1
answer
64
views
How to read and write with cairomm png stream?
I'm saving a Cairo::ImageSurface as part of a binary file. Writing pixels from surface->get_data() works fine, however it produces a much larger file compared to when I write it with surface->...
0
votes
1
answer
36
views
X,y coordinates in the drawing area are shifted when other widgets are shown
Please see the attached screenshots to realize the problem. I packed a GTK drawing area with other widgets. When these widgets are shown the coordinates in the drawing area are shifted and so the ...
0
votes
1
answer
47
views
All texts in Jupyter R plot in get scrambled if Cairo package is installed
When I plot in a Jupyter + R session, whether it is a Notebook or R console, base R or ggplot2 plots, texts all get scrambled like this:
sessionInfo:
R version 4.3.3 (2024-02-29)
Platform: x86_64-...
0
votes
0
answers
26
views
Building installer for python program with Conda libraries
I have a problem with making an installer for a python program. The program has a UI based on PyQt5 and QT-PyQt-PySide-Custom-Widgets. During the development phase, I used the Conda environment ...
1
vote
1
answer
270
views
Error when importing `cairosvg` on Windows
I'm on Windows (Windows 11)
I installed cairosvg using pip:
pip install cairosvg
But when I import it I have this error:
OSError: no library called "cairo-2" was found
no library called &...
1
vote
1
answer
56
views
How to load background of GtkGLArea on a Cairo Surface in Gtk 4.12?
Can someone tell me, how to load the background of a GtkGLArea on a Cairo surface? For the gtk version 4.8.3, I did it this way--
GtkWidget *GLArea = gtk_gl_area_new ();
/* draw shape on GLArea */
...
0
votes
1
answer
188
views
Problem with text rendering using CairoSVG
I'm using CairoSVG to convert a SVG file into a PNG image.
The position of the text seems to be off compared to the images rendered by Firefox, Safari and co. I cannot understand if the problem comes ...
4
votes
1
answer
121
views
Keep ggplot font size constant in different figure dimensions
I'm in a position that requires me to frequently change the dimensions of my plots via the fig.dim=c(...,...) option in each r chunk.
However, I have a problem that I haven't been able to solve yet.
...
1
vote
2
answers
171
views
Corners detection fails when textbox is rotated
After rotating the text box in the GTK drawing area, the four corners detection didn't work anymore as the x,y vertices were left to their original values. I used this code to update them but still ...
2
votes
0
answers
92
views
How to take screenshot in gtk4?
I am trying to take a screenshot of the root window in gtk4. This is how I do it in gtk3--
GdkWindow *root_win = gdk_get_default_root_window();
gint width = gdk_window_get_width(root_win);
gint ...
1
vote
1
answer
50
views
How to move a shape on cairo surface by GtkEventControllerScroll (scroll event)?
I am trying to move a shape(circle) on GtkDrawingArea by scroll event(GtkEventControllerScroll). I tried the following code, but it is not working. I tried to move it only horizontally. The default ...
0
votes
1
answer
73
views
What is the best way to draw an CV_8UC1 matrix image with Cairo?
I have a matrix image in the format CV_8UC1, i.e. one byte per pixel of monochrome image data. I need to draw this matrix image using Cairo, i.e. to a Gtk drawing area. Speed is critical, as this ...
0
votes
1
answer
124
views
How to set css radial-gradient (drawing) on cairo surface in gtk4?
I am trying to draw circle on Gtk4 GtkDrawingarea using CSS. And then clicking on it, it will save as a PNG file. But unable to get the drawing (gradient) from drawing area to cairo surface (...
0
votes
1
answer
49
views
How to show linear gradient with color rgb(248, 205, 205, 1) on gtk3 drawing area?
I am trying to draw pattern linear gradient with color rgba(248, 205, 205, 1). I've seen a linear gradient in GtkColorChooserWidget with color rgb(248, 205, 205). But when i tried to draw it with ...
1
vote
3
answers
141
views
How to rotate cairo circle (volume button) on mouse motion event in gtk4?
I'm trying to create a Volume (Cairo circle) button in gtk4. which can be rotate by mouse motion event. By clicking anywhere on the button and rotating it, the value 1-100 will be output. Tried a lot, ...
1
vote
1
answer
93
views
How to draw chessboard like pattern using cairo on gtk3 drawing area?
I am trying to create a color picker widget in gtk3, in this widget, while changing the alpha color value from the scale/spin button; I want to show alpha color status in a drawing area.
Although the ...
1
vote
1
answer
136
views
How to draw rainbow cairo linear gradient using rgb values from an array?
I'm trying to draw a Cairo rainbow gradient on a gtk drawing surface. To do this, the RGB color data will be stored in an array and from that array, the rainbow will be drawn. I tried some functions ...
0
votes
1
answer
84
views
Cairo XCB surface only renders text with pango when written to a png
I've successfully created a window with xcb-rs. When I try to write text to that window with pangocairo, it only renders if I write the surface to a png. If I try to, for example, draw a rectangle ...
0
votes
0
answers
26
views
Using cairo on Windows x64 [duplicate]
I have to get the dominant color of an svg file. So my plan is to convert the SVG to a PNG and for this I wanted to use cairo. After the default package installation in PyCharm I get an
OSError: ...
1
vote
0
answers
45
views
How do I draw on a GLArea with Cairo with gi-gtk (GTK3)?
I'am migrating a program from Gtk2Hs (GTK2) to gi-gtk (GTK3) and can't find how to draw on a GLArea (rendering OpenGL content) with cairo (additional informations).
In Gtk2Hs (GTK2) I used the ...
0
votes
0
answers
51
views
How can I overlay an SVG image over a raster image using Python (Python3)?
I have some generated raster images and SVG images (as an ElementTree), but for the sake of the example, let's say that they are saved as files. This is what I am trying to do:
import cv2 as cv
...
0
votes
0
answers
53
views
Get client content from minimized window - Awesome WM
I am attempting to make a pop-up that displays window previews as a tasklist and have almost gotten it, but for a couple of things.
I first added a tasklist that used a clienticon widget to group ...
0
votes
1
answer
39
views
trouble with cairo install using cabal
While trying to install cairo using cabal, the following runs perfectly well,
`prompt) cabal install --lib cairo`
`Resolving dependencies...
Up to date`
but this does not work:
`prompt) cabal install ...
2
votes
1
answer
145
views
librsvg rsvg_handle_get_dimensions get pixel size is not different with render size in browser
librsvg verions is 2.40.20
I want to convert .svg file to .png file, so I write some codes.
the generated function is very simple.
int svg_file2png_file(char* svg_path, char* png_path) {
GError* ...
0
votes
0
answers
45
views
GTK Cairo. Why gtk_widget_queue_draw called from function (in iddle callback) does not work?
g_idle_add((GSourceFunc)gtk_widget_queue_draw, drawing_area);
When I do this it works (I know it is UB as gtk_widget_queue_draw does not return value), but I have 100% processor time because of UB.
...
0
votes
0
answers
30
views
how do I change the alpha channel along a path in cairo?
In an application using gtk3, I use cairo to do some drawing. What I would like to do is increase the transparency along the path. The path can have any shape.
In very simplified terms, I have ...
0
votes
1
answer
36
views
Cairo: circular path with thick stroke
With Cairo, stroking a circular path with a thick stroke has an undesired result. The circles have a hollow region. Is there a way to prevent this problem?
0
votes
0
answers
30
views
how to stop path closing for kvg definition kanji character
I have this kanji character definition
<kanji id="kvg:kanji_02e95">
<g id="kvg:02e95" kvg:element="⺕" kvg:variant="true" kvg:original="彑" kvg:...
0
votes
1
answer
164
views
node-canvas Fonts dont work once they are deployed on the host
i am using node-canvas to generate a image for my discord server
and i used some custom fonts and put them in my directory and they worked fine but when i deployed them on heroku or techstar host, the ...
1
vote
0
answers
87
views
Can't find ft2build.h when building with Yocto SDK
I'm trying to build file DisplayControl.cpp using SDK generated using bitbake based on my Yocto project. However, on this part:
int DisplayControl::loadFonts()
{
FT_Library library;
...
2
votes
1
answer
474
views
Use a custom font with pycairo
I'm using Pycairo to draw images with text on it, with a custom font.
This works well as long as that font is installed on the system.
However, I would like to distribute my package with my custom ...
0
votes
0
answers
67
views
Linking Cairo (installed with homebrew) on Silicon Apple M2
I am trying to build a Go program which uses github.com/ungerik/go-cairo as a Cairo wrapper in Go. I built it successfully for several months and then it suddenly stopped working. Unfortunately, I don'...
0
votes
0
answers
178
views
libcairo-2.dll or libcairo library not found
I created a tkinter project which shows user-data analysis using pygal graph plotter. The graph is using a library to render the png file called cairosvg. I am facing the following issue when running ...
1
vote
1
answer
102
views
Cairo clip region existing of multiple rectangles?
I need a clip region that exists of a several (possibly overlapping) rectangles, but can't figure out how to create one with cairo.
Since there is a
cairo_rectangle_list_t *
...
0
votes
0
answers
114
views
Converting svg to png while text wrapping using `shape-inside` text property
I have an svg I made in Inkscape that uses the shape-inside text property to wrap text. When I output it to png using cairosvg, svglib, or wand the text bleeds off the image because shape-inside is ...
1
vote
1
answer
83
views
Cairo STM32MP1 cairo_surface_write_to_png always returns CAIRO_STATUS_WRITE_ERROR
I am trying to write a PNG file. I am always getting a write error (CAIRO_STATUS_WRITE_ERROR).
cairo_surface_t *image_surface = cairo_surface_create_similar_image(pBitmap -> mainSurface,
...
0
votes
0
answers
73
views
Not easily debuggable crash on GDK at Gdk::Cairo::set_source_pixbuf()
I have an multithreaded C++ application using GDK Cairo that inconsistently crashes on different lines but approximately all of the segmentation faults happen on the line Gdk::Cairo::set_source_pixbuf(...
0
votes
1
answer
276
views
`cairo_image_surface_create_from_png` returns "out of memory", but I have enough memory
Note: I am writing my own window manager that is similar to AwesomeWM in that it will be written in C, and have a lua api for customisation.
The problem I'm facing is with this code:
local bg_img = ...
0
votes
0
answers
931
views
How to fix 'no library called "cairo" was found' when importing cairocffi?
I was trying to import cariocffi, but when I tried, it gave me this problem:
>>>import cairocffi as cairo
Traceback (most recent call last):
File "<pyshell#1>", line 1, in &...
0
votes
0
answers
271
views
Meson build of pango static library does not link in dependencies
I'm trying to build pango (https://github.com/GNOME/pango) as a static library. It is using Meson build which I'm not familiar with. Anyway, the compile steps succeed, but linking fails with a lot of ...
0
votes
0
answers
42
views
Questions about mouse pointer event listener in GUI
I'm trying to write a gui, as it will be drawn by skia or cairo, I know that they are used to draw GUI elements only and have nothing to do with receiving events, so I will use another library for ...
1
vote
0
answers
158
views
I want to install pango with cairo backend on windows 11, can anyone guide me?
I've looked at multiple posts on SO about how setting up pango or cairo is giving them errors and i tried setting it up a few times myself, but unfortunately there are just so many errors in the ...
1
vote
1
answer
743
views
Convert SVG with embedded images to PDF
I am making a script that auto-generates PDF documents from a template. The document is generated as an SVG, which should then be converted to a PDF using cairosvg. This step, however, fails when an ...