Re: Question about pango_layout_set_spacing().



Tom Liu wrote:

HI,
I have labe has 2 lines. I want to set the space between the lines, The
following code don't work.

        GtkWidget *lbl= gtk_label_new("line1\nline2")
PangoLayout *ly=gtk_label_get_layout(GTK_LABEL(lbl)); pango_layout_set_spacing(ly,20);

Can some one give a look?
Hello,
Try this:
pango_layout_set_spacing(ly, 20*PANGO_SCALE);

Pango uses internal units to represent distances:
http://developer.gnome.org/doc/API/2.0/pango/pango-Glyph-Storage.html#PANGO-SCALE-CAPS
http://developer.gnome.org/doc/API/2.0/pango/pango-Glyph-Storage.html#PANGO-PIXELS-CAPS

   Olexiy




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