[Vala] Pango and Justify



Hello,

I'm having some trouble working with pango and layouts.

I have a large body of text that I would like to draw onto a widget using pango. However, I'm having problems with the justify property. Justify is not working properly. Could somebody please give me an example of a pango layout with a specific width that prints the paragraph of text "justified" (doesn't wrap every word, only when it hits the width, then goes to new line). The code that I am using now that does not work is something like this (psuedo):

layout.width = 400;
layout.justified = true;
layout.set_text("this should be wrapping itself but instead it prints a new line after every word");

Pango.cairo_update_layout (cr, this.layout);
Pango.cairo_show_layout (cr, this.layout);

Thank you,

Scott


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