Re: [Inkscape-devel] Re: [cairo] Pango + cairo

On Thu, 2005-03-17 at 09:27 -0500, Owen Taylor wrote:
> [ Adding gtk-i18n-list back to the CC, since it's quite relevant to 
>   Pango development ]
> > On Wed, Mar 16, 2005 at 11:17:26PM -0500, Owen Taylor wrote:
> > 
> > > Non-greedy linebreaking is very challenging to do with good
> > > internationalized shaping.
> > 
> > In another window I have code that implements non-greedy line breaking
> > (not in pango).  It's for research purposes (to do with choosing sizes
> > for table cells), and doesn't make much attempt yet to get international
> > text right at the moment.  However, we do have some interest in getting
> > non-greedy line breaking into pango or inkscape, so I have looked a
> > little at what issues are presented by international text.  Can you give
> > a reference to the issues?  The issues I'm aware of are:
> > 
> >   - Identifying line-breaking opportunities.
> > 
> >   - Changes to text (and more importantly widths) depending on whether
> >     or not a break appears, i.e. suppression of spaces, and possible
> >     changes to spelling as mentioned at
> >, and possibly
> >     kerning/ligature issues for scripts like Thai.
> > 
> >   - If using non-rectangular text areas, then we need to be aware of
> >     bidi reordering.  (If using rectangular text areas, then I believe
> >     we can ignore bidi except to the extent that it affects widths of
> >     things via kerning, ligatures.)
> > 
> > That's all I can think of at the moment.
> Are those not enough? :-) Beyond those, there are some issues specific
> to how Pango works, e.g. you don't have the information about "what
> would be the change in line length if I broke here" until you do the
> break.

Also, text is justified in different ways in different languages.
They can use word spacing, letter spacing, kashidas, or a combination.
See the CSS3 Text draft at:

Why does bidi reordering affect non-rectangular areas?

> There is also the problem that most features in PangoLayout (letter
> spacing, tab alignment, forced break, etc) tend to complicate the line
> breaking ... they all interact to some extent.

Supporting some features like left/center/right-aligned tab stops may be
just too complex with a non-greedy algorithm.

I think it is best to get as many of the features we want into Pango
using a greedy algorithm. We could then add non-greedy code that would
only be used for simple paragraphs.


PS. My unfinished justification patch is on the end of this bug:

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