How to create a letter spacing attribute with pycairo?

Looks like this issue was already solved, using pycairo 1.20.0 and PyGObject 3.40.1: import cairo import gi gi.require_version(‘Pango’, ‘1.0’) gi.require_version(‘PangoCairo’, ‘1.0’) from gi.repository import Pango, PangoCairo width, height = 328, 48 surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height) context = cairo.Context(surface) layout = PangoCairo.create_layout(context) font_desc = Pango.font_description_from_string(‘Sans, 40px’) layout.set_font_description(font_desc) letter_spacing_attr = Pango.attr_letter_spacing_new(1024 * 10) attr_list = Pango.AttrList() … Read more

What exactly are GLib and GObject?

GLib and GOBject are 2 separate C libraries from which the GTK+ GUI toolkit is built (among other things). Since C is a lower-level language, GLib provides a lot of basic functionality like those utilities similar to what is built-in with Python (file input/output, string manipulation, memory management, threading, etc.). Since C is not an … Read more

GtkDialog mapped without a transient parent

You fix this warning by giving the GtkDialog a parent to be modal to. The relevant functions are gtk_window_set_transient_for() (which sets this window to always be on top of, or transient for, another one) and optionally gtk_window_set_modal() to make it a modal dialog. This is ultimately what the various GtkDialog constructors do.

pygobject-2.28.6 won’t configure: No package ‘gobject-introspection-1.0’ found, how do I resolve?

You’re probably missing the development package. The package name varies by distribution, but it’s the one containing /usr/lib/pkgconfig/gobject-introspection-1.0.pc (or /usr/lib64/pkgconfig/gobject-introspection-1.0.pc for some 64-bit distros): Fedora, CentOS, RHEL, etc.: gobject-introspection-devel Debian, Ubuntu, Mint, etc.: libgirepository1.0-dev Arch: gobject-introspection FreeBSD: gobject-introspection Cygwin: libgirepository1.0-devel msys2: mingw-w64-x86_64-gobject-introspection and/or mingw-w64-i686-gobject-introspection