Re: [Fwd: calculating text length]



ext Tapani P�i wrote:
> ext Federico Mena Quintero wrote:
>   
>> El mi�18-04-2007 a las 13:43 +0300, Tapani P�i escribi�>
>>   
>>     
>>> I have a performance problem with Matchbox window manager calculating
>>> window title width rather slowly with Pango when doing ellipsation for
>>> the title.
>>>     
>>>       
>> Ouch.  We didn't get around to optimizing ellipsization during the
>> initial profiling spree in Pango.
>>
>> Do you want to revive that benchmark?  It's in the 'pango-profile'
>> module on svn.
>>
>> Still, how did you find about this problem?  Are you running a window
>> manager benchmark, or is it measuring the text way too often, or what?
>>
>>   
>>     
>
> 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 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.
>
>   
Answering myself here ... I think it's
"pango_glyph_string_get_logical_widths" I was missing. I guess you
should have RTFM'd me on this one. This function returns a nice table of
values, maybe I could have a precalculated table of values aswell.

>>   Federico
>>
>>
>>   
>>     
>
> // Tapani
>
> _______________________________________________
> Performance-list mailing list
> Performance-list gnome org
> http://mail.gnome.org/mailman/listinfo/performance-list
>   

// Tapani




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