Re: logical index to visual index (Pango 1.0.1)



Owen Taylor <otaylor redhat com> said:
[snip]
> > For example, 'H' is rendered first, 'e' second,
> > and so on.
> 
> The result of a layout operation on a PangoLayout is a set of positioned
> glyphs. You could certainly write routines to render subportions of
> a PangoLayout.

Yes, that's what I am in the midst of doing.
[snip]
> > Now, with that little bit of background, let's take
> > it one bit further.  In visual order, our string
> > looks like "?hebrew".  Due to clipping, only the
> > last three "visual character cells" need to be displayed, "rew".
> > BUT, the client only has the logical string "hebrew?".
> > So, I was attempting to obtain the quickest method
> > for deriving the glyph positon of 'r'.
> > 
> > Boy, rereading that paragraph does not instill confidence
> > in my explanatory abilities.  If it does not make sense,
> > I will attempt to explain further.  Otherwise, I already
> > have a method for processing the layout (no bitmap rendering),
> > which I believe provides me with the information I require,
> > though at an expense of speed.
> 
> I'm not really sure I quite understand the problem. Is the place
> where the fixed size messages are a problem when you are passing
> the string to the layout operation or when you are passing the
> resulting glyphs to the renderer?

The multi-pass works,
since it is a state system, render 5, pass back number 5, client
passes 5 back, start rendering at 5, till whatever, say 11 fits,
pass 11 back, client passes 11 back, start rendering at 11, etc.

This issue is when the client wishes to override this, and instead
of starting to render at character 1, they wish to render from
visual position 6 to position 9 only.  Well, the programmer only
has access to the library API, and the above mentioned mechanism
is hidden in the API library.  So, the programmer only has the
logical string to mess with.
  
BUT, as stated below, I will have to
render the layout, without sending the bitmaps, and locate the
visual index that correlates to the logical index.  Though, now
thinking of it, it may not be possible, because the only thing
the programmer provides is the logical index, which corresponds
to say letter 'H'.  Well, if there are multiple letter 'H' values
in the string, it will be impossible to do the correlation.

> It's not, in general, possible to figure out what subportion of a string
> will appear in some visible position without actually laying out
> the string.

OK, this is what I wanted to know, and I figured as much.
I was just look for the magic warp function!

> But once you've laid out the string, you can perform a "clip" operation
> on the resulting glyphs.

Exactly, thanks for your input.
> 
> Regards,
>                                         Owen





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