Re: pango or any other way to format text
See http://developer.gnome.org/pango/stable/PangoMarkupFormat.html for the syntax for subscripts and superscripts. Regards, Dov On Mon, May 14, 2012 at 3:38 PM, David Nečas wrote: > 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 > > ___ > gtk-app-devel-list mailing list > gtk-app-devel-list@gnome.org > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list > ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
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 ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: pango or any other way to format text
On Mon, 2012-05-14 at 20:20 +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+? > A minimal(complete with headers) example will be very appriciated. Greek is the same as English - just use the Unicode characters - even for polytonic Greek in most cases. For superscript and subscript you use and as in HTML. These are not needed for Greek accents such as rough breathing, of course. Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
pango or any other way to format text
Can anybody please take some time to show me simple way of implementing pango formatting to get greek letters, subscripts and superscripts in gtk2+? A minimal(complete with headers) example will be very appriciated. -- Rudra JRF; SNBNCBS http://www.bose.res.in/~rudra A bus station is where a bus stops. A train station is where a train stops. On my desk I have a work station. Please, if possible, don't send me MS Word or PowerPoint attachments Why?See: http://www.gnu.org/philosophy/no-word-attachments.html ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list