Questions tagged [pango]

Pango is a C API for Unicode-based text layout and rendering.

Pango allows advanced layout of text using C, C++, Perl, and a number of other languages. It is primarily used with (), although it can be used with other backends, such as Win32 API, Xft, and others.

The website is http://pango.org.

Documentation can be found at https://developer.gnome.org/pango/unstable/.

228 questions
2
votes
2 answers

Pygtk3 Specify gtk3 Label/CellRenderer font

According to a pygtk2 doc on faq.pygtk.org The way to change a font is by a definition like so: ... label = gtk.Label("MyLabel") label.modify_font(pango.FontDescription("sans 48")) ... What is the equivalent in pyGtk3? I was looking to avoid the…
ThorSummoner
  • 16,657
  • 15
  • 135
  • 147
2
votes
4 answers

Error when trying to use pango with imagemagick on OSX

I am wanting to use imagemagick to add watermarks to photographs. I am using OSX and Python scripts for the code and was trying the code from (http://www.imagemagick.org/Usage/text/#pango_markup) currently I am struggling to understand why I can't…
Neil Stoker
  • 284
  • 3
  • 16
2
votes
1 answer

AttributeError: 'module' object has no attribute 'cairo_font_map_get_default'

If I try to run this example from the cairo website, I get: AttributeError: 'module' object has no attribute 'cairo_font_map_get_default' I guess I'm missing some packages? (I'm on Ubuntu 14.04) However, I try to find the dev packages I would need,…
knocte
  • 16,941
  • 11
  • 79
  • 125
2
votes
0 answers

Updating pango broke gtkmm (Arch)

I just updated the pango package (running Arch Linux), and now I can't link any of my gtkmm code. Here's the error: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../lib/libpangocairo-1.0.so: undefined reference…
vinit_ivar
  • 610
  • 6
  • 16
2
votes
1 answer

C++ pango text orientation

I'm trying to label the y-axis in a plot built using pango. I'm unable to orient the text to run vertically up along the y-axis. Relevant portion of code is: #include Pango::FontDescription font; cr->save(); // where cr is…
Aditya Sihag
  • 5,057
  • 4
  • 32
  • 43
2
votes
2 answers

Using GTK/GDK to get Pango-rendered pixels

I'm trying to get a bitmap rendered by Pango with a given character, in this case the letter "T". I thought this should work, but it just prints out garbage.. In this code, gtk_window is already initialized as a GTK window. int width,…
Steve
  • 1,849
  • 2
  • 19
  • 19
2
votes
0 answers

Difference in rendered text width measured between freetype and pango/cairo

I am trying to predict how wide the text will appear rendered by pango library but I am trying to achieve it in bare Freetype for performance sake. To answer the commenters - yes I measured performance with the callgrind tool. And pango is spending…
RushPL
  • 4,732
  • 1
  • 34
  • 44
2
votes
1 answer

Convert 8 bit color component to 16 bit color component

I am writing a GTK+ application that is using Pango text attributes to determine the color and other aspects of the text written onto a GtkLabel using something like this: attributes = pango_attr_list_new(); pango_attr_list_insert(attributes,…
Chimera
  • 5,884
  • 7
  • 49
  • 81
2
votes
4 answers

How to get the default font used by the system using pygtk or pango?

I have a fontbutton using pygtk. Initially, i do not want to set the font, as the system will take its default one. My question is what is the line of code to get the default font used by the system , so that i keep things default at first. Later…
mrabhiram
  • 53
  • 1
  • 5
2
votes
2 answers

Trying to format a string into columns with python

I am trying to format a string to display two columns for a high score table. Python is able to do this well when using print print '{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x) but when trying to use a formatted string, but becomes more challenging…
Made2k
  • 222
  • 3
  • 15
2
votes
1 answer

PyGTK Transparent Window

I want the window transparent, but the label to be 100% in opacity. How can I achieve this? BTW: I noticed when I upgraded to Ubuntu 12.04's unity interface that window.set_opacity wasn't working like it did on GNOME, but even if it did all the…
Michael Schwartz
  • 8,153
  • 14
  • 81
  • 144
1
vote
1 answer

Printing with Gtk.Printing/cairo/pango in gtk2hs - Print-operations in Haskell

I am currently trying to print files or text (to a printer, not to a terminal etc.) in Haskell with gtk(2hs) using Graphics.UI.Gtk.Printing, Cairo and Pango. Code is the following: op <- printOperationNew on op printOptBeginPrint $ \context -> do …
forste
  • 1,103
  • 3
  • 14
  • 33
1
vote
1 answer

Variable in Pango Markup

I am using Python 2.7 and PyGObject 3.0. (This is VERY important! the PyGObject syntax changed with 3.0!) I need to put a variable in place of a string in a markup, so the output is formatted. This is the code I have for formatting a standard string…
CodeMouse92
  • 6,840
  • 14
  • 73
  • 130
1
vote
1 answer

Change font of Gtk::Label

Using gtkmm 3.0 with c++, in a Gtk::Window, I have a Gtk::Label named "bezeichnung" showing text. How can I change the font of this label? There seems to be no function to set the font for a Gtk::Label. To deal with functions of the general…
bejo
  • 71
  • 7
1
vote
0 answers

Is there a way how to suppress pango console warning?

Pango is producing number of useless messages to console for common user. E.g. text2image --list_available_fonts produces huge number of lines like this: (process:24244): Pango-CRITICAL **: 13:07:20.751: pango_font_description_set_size: assertion…
ZdPo Ster
  • 300
  • 5
  • 12