How to draw underlined spaces



Hi all,
rendering a PangoLayout through gdk_draw_layout(), which contains a string with leading and/or trailing spaces, with an underlined font results in text correctly underlined except for those spaces which are 'trimmed out'.

If I try to render (with underlined attribute set) a string containing only spaces, I get no output at all.

How can I render underlined spaces in pango ?

Thanks a lot!
Francesco


PS: I'm doing something like:

    char data[] = " hello world ";
    datalen = strlen(data);
    pango_layout_set_text( m_layout, data, datalen);

    PangoAttrList *attrs = pango_attr_list_new();
    PangoAttribute *a = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
    a->start_index = 0;
    a->end_index = datalen;

    pango_attr_list_insert(attrs, a);
    pango_layout_set_attributes(m_layout, attrs);
    pango_attr_list_unref(attrs);

    gdk_draw_layout( m_window, m_textGC, x, y, m_layout );

where m_layout, m_window and m_textGC are all correctly initialized.


PS2: I also tried to render all 'space' characters found at
       http://www.unicode.org/charts/charindex3.html#S
(whose name begins with SPACE) but without success - they are always ignored...





Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com

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