Re: [Fwd: calculating text length]



On Thu, 2007-04-19 at 11:14 +0300, Tapani P�i wrote:
> 
> Well this is actually more of a problem of our current browser build
> that updates title far too often, few times in a second to be
> exact :-)
> And this triggers ellipsation pretty frequently ... but that reminded
> me
> of one feature I was experimenting with earlier, 'scrolling window
> titles', where updating is needed and fast algorithm wanted. Also in
> our
> search application title displays the amount of results found, so it's
> updated frequently.

The best strategy would be to avoid duplicate work.  As long as you just
vaguely describe your usecase and how you are calling into pango, there
is not much we can say.


> The real performance problem here is not exactly Pango but how it is
> being called. So basically I'd like to know what is the quickest way
> to get (approx) width for a string with Pango. 

I've recently added a call pango_glyph_string_get_width() that is much
faster than pango_glyph_string_extents() or
pango_glyph_string_get_logical_widths().


-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759






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