Re: fp_TextRun coalescing weirdness

From: Tomas Frydrych <tf_at_o-hand.com>
Date: Tue Apr 10 2007 - 10:07:18 CEST

J.M. Maurer wrote:
> Could someone (martin, tf?) explain me why the following happens:
>
> 1. Type something like "lalala l" (ie, some text, a space, and 1 more
> char). At this point, this is all rendered as 1 fp_TextRun, and hence 1
> call to gr_UnixPangoGraphics::renderChars() is made.
>
> 2. Then type 1 more char, so you get something like: "lalala la". Now
> all of a sudden for the last "a" a new fp_TextRun is created, and thus
> the string is drawn in 2 separate runs.
>
> Could someone enlighten me if this is a bug or intended behavior? Fixes
> if it is a bug would be really welcome as well.
>

Havn't had a chance to look closer at this, but it should work something
like this:

1. When you type a new character, it is inserted in as a new fp_TextRun
of length 1.

2. Subsequently an attempt is made to merge runs on the line with their
neighbours.

There are some circumstances where runs cannot/will not be merged; those
are defined by fp_TextRun::canMergeWithNext() and
GR_*RenderInfo::canAppend(); this includes not merging runs past word
boundaries, which means that 'lalala la' will always be represented by
two runs, but the second one should be length 2.

Tomas
Received on Tue Apr 10 10:06:50 2007

This archive was generated by hypermail 2.1.8 : Tue Apr 10 2007 - 10:06:51 CEST