Questions tagged [pangocairo]

Pangocairo is a part of Pango that enables creation of Pango contexts on Cairo surfaces.

Pangocairo allows the creation of Pango contexts on Cairo contexts for the purpose of adding text to a Cairo-manipulated image or drawing.

Documentation: https://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html

50 questions
0
votes
0 answers

Drawing text with pango-cairo in Windows to a pdf surface

I have the following sample code #include #include #define MM_TO_PT (72.0 / 25.4) #define PAGE_WIDTH_A5 148 // mm #define PAGE_HEIGHT_A5 210 // mm void draw(cairo_t* cr, double scale, double x, double…
0
votes
0 answers

Segfault when using `lgi.Pango.AttrList.change` in AwesomeWM

Some context: I am writing a font-previewing application, and one of the things I have to do very often is change the size of the text. As you can see in the image, someone drags the "Size" slider, and the application has to change the size of all…
0
votes
1 answer

pangocairo text in middle of the circle

I am writing an extension / widgets for gnome-shell.So I want to show some information using text. Actually I want to put text in middle of the circle using pangoCairo but I can't figure out how can I put text using pangoCairo? here is my code of…
0
votes
0 answers

Specify Pango markup font (node ImageMagick)

I have a set of local fonts that I'd like to apply on my text in PangoML. AFAIK the way to specify fonts is through the font family attribute in the span element. But where/how can I specify a path to the otf file containing the fonts I'd like to…
0
votes
1 answer

How to install python binding of pango and pangocairo in ubuntu 20.04

I'm pretty new to pango and pangecairo, but I'd like to install a python binding of pango and pangocairo. I've installed pango, pangocffi, pangocairocffi via pip but it still tells me that no module named when I try to import them in python. Btw, I…
Li Wang
  • 11
  • 2
0
votes
0 answers

Draw Directly To The 24 Bit TFT Display Using Cairo

I am developing a Linux application to draw information to a 24 bit LCD screen using Cairo. But the LCD display prints 3 images instead of one image which I drew. This also prints in the wrong colour I tried to change all the cairo_format options…
Arun Kumar K S
  • 422
  • 5
  • 13
0
votes
0 answers

PangoCairo text cut-off when using PANGO_ALIGN_MIDDLE

On a C++ game, we're using Pango to render text with cairo and from there to an OpenGL texture. I noticed this problem recently while working on implementing text-wrapping via Pango. What I'm doing is calculating the width by translating our own…
0
votes
1 answer

Access cairo_path_t when generated using a pattern

I am interesting in drawing various paths in cairo. Then these paths are accessed via cairo_path_t and cairo_path_data_t for pango usage. This becomes a problem when I use patterns. For example the following code works great. cairo_surface_t*…
moi
  • 467
  • 4
  • 19
0
votes
1 answer

How do I resolve error installing manim using poetry?

I want to setup manim community repo using poetry. I ran the command "poetry install". I am getting the following error. Python 3.8.5, Pip 20.2.4 EnvCommandError Command D:\manim\venv\Scripts\pip.exe install --no-deps…
0
votes
1 answer

"stroke" required after "showing" Pango layout?

I have been chasing a problem between PyCairo and PangoCairo. The following code illustrates it: import math import cairo import gi gi.require_version('Pango', '1.0') gi.require_version('PangoCairo', '1.0') from gi.repository import Pango,…
s-m-e
  • 3,433
  • 2
  • 34
  • 71
0
votes
1 answer

How can I activate subpixel positioning with Pango and (py)Cairo?

I just came across this article saying that subpixel positioning was added to Pango 1.44 in 2019 - not without its issues though. Apparently it is switched off by default. Both articles go as far as saying that the latest master from cairo is…
s-m-e
  • 3,433
  • 2
  • 34
  • 71
0
votes
0 answers

Why I am getting error "#error "Only can be included directly." while running make for pygobject-2.15.2?

I am trying to install pygoobject-2.15.2 to make pango, pangocairo work in python3 but I am getting an error while make of pygobject. Also, is there any other way to install pango, pangocairo and cairo in python? (base)…
Agam
  • 11
  • 4
0
votes
1 answer

how to determine cairo drawing with line width even?

I use a cr (from Gtk's widget draw event) and I want to create a rectangle (or a line) using an even number of pixels (2,4,6 etc.) without any «context transformations». According to this the line will be "around the path". And according to this…
ilias iliadis
  • 601
  • 8
  • 15
0
votes
2 answers

pangocairo: discolouration on transparent recording surfaces

When I use Pango to draw text onto a transparent Cairo recording surface, the text becomes quite heavily discoloured, particularly in the semi-transparent anti-aliased regions. For example, this image has the correct (top) and incorrect (bottom)…
0
votes
1 answer

Pango Import is not working

I am very new into this python and its dependencies. I'm trying to install Cairo and Pango, I have successfully installed Cairo, Cairocffi, cffi, Pygi, and gtk+, and they are working just fine. I have tried many ways for the past three days to set…