Re: Fill justification for last line to?



Moshe Wagner wrote:
Hi,
When a textview's justification is set to "JUSTIFY_FILL", it expands all the
lines to fit the width of the textview, besides the last line in each
paragraph.
I know normally this is the right way it should be done, but in my specific
case, I need ALL lines justified - In other words, I don't care about
paragraphs or line breaks, I just want all the text to expand to fit the
whole width of the block.

So I input all the text without any line breaks, and everything is expanded,
besides the last line - but I need that expanded to. (I know it looks
stupid, etc', it's for a very specific need, and I'm positive in that case
that it's the best (if not only possible) way to do what I wan't).

Does anyone have any idea how this can be done? I don't mind even messing
around with the text and adding spaces in order to force it to expand, but
the text in the textview is dynamic, and I don't know how to make sure it
will not add a extra line in some cases, and then lose the last line's
expanding again.

I've not added this feature to Pango yet.  The bug to track it is:

  http://bugzilla.gnome.org/show_bug.cgi?id=435413

In the mean time, however, I recently changed Pango to also justify before a
forced line break.  So you can add a U+2028 LINE SEPARATOR character at the
end of text to force justification.  That may give you some unwanted vertical
space though.  And note that because of the greedy justification algorithm
that Pango uses, the last line is going to look ugly.

behdad

Thanks,
Moshe




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