Re: pango or any other way to format text



On Mon, May 14, 2012 at 08:20:26PM +0800, Rudra Banerjee wrote:
Can anybody please take some time to show me simple way of
implementing pango formatting to get greek letters, subscripts and
superscripts in gtk2+?

What do you mean by âimplementing Pango formatting'?  I suppose you are
not writing a Pango backend, i.e. you are not *implementing* any text
rendering yourself.

If you just want to use Pango to render Greek text, subscripts,
superscripts, Cyrillic, math symbols or whatever, use UTF-8:

GtkWidget *label = gtk_label_new("áÏá ÏÎá áÎÎÎÏ ÎÎÏÎÏÏÎÎÎ");

or

GtkWidget *label = gtk_label_new("a + b = cÂ");

That's it.

Function gtk_label_set_markup() with Pango markup

    http://developer.gnome.org/pango/stable/PangoMarkupFormat.html

can be used for more complex indexes and exponents and other stuff in
labels.

Yeti




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]