Re: CJK patch (was Re: pango)

From: Tomas Frydrych <tomasfrydrych_at_yahoo.co.uk>
Date: Tue Mar 22 2005 - 08:58:23 CET

Roland Kay wrote:
> Is there any mechanism for storing meta data relating to characters in the
> document? Line breaking would be an awful lot faster if we looked up the
> categorisation of each character on input rather than doing it twice for
> every call to Gr_Graphics::canBreak().
>

Not in the document itself (in the sense that it would be saved), but it
could be stored in the layout engine as part of GR_XPRenderInfo (as is
done in the Uniscribe and Pango classes). My only concern is that we do
not increase the size of this object too much, but if we used bit-fields
to store the boolean information, we would probably only add a byte per
character, which might be acceptable.

probably want

typedef struct
{
        bool someattr:1;
        ...
} GR_XPCharAttributes;

and then add GR_XPCharAttributes * to GR_XPRenderInfo.

The values would need to be calculated in GR_Graphics::shape() and the
GR_XPRenderInfo::append(), cut() and split() would need to be modified
accordingly.

GR_Graphics::canBreak() would then only query the pre-calculated
attributes and deal with the special cases where we are wanting to break
  before the first or after the last character of the run.

Tomas
Received on Tue Mar 22 08:59:02 2005

This archive was generated by hypermail 2.1.8 : Tue Mar 22 2005 - 08:59:04 CET