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

RE: [XaraXtreme-dev] Rescanning available fonts



In message <5056CBC646CB4047BB26120F4377DB719BA464@xxxxxxxxxxxxxxxxxxx 
>
          "Charles Moir" <CharlesM@xxxxxxxx> wrote:

> Martin said
>> The question is what is better: Permanently scanning the font
>> system to detect changes or simply providing a "Rescan"
>> button in the font gallery?
> 
> That's a really ugly solution.
>
> Mac and Windows provide font change events so we know we can do it
> properly on those platforms.
> [...]
>
> So I'd hope there were some system wide font changed messages (so we do
> not need any background tasks permanently doing anything). I can't
> really see how the OS can not have this. How would other parts of the OS
> (e.g. font managers) or applications know about font changes if there
> was not some system like this.

Maybe you are asking a bit too much from a system that does not even 
have a global concept of the set of "available" fonts. I doubt there 
is anything like a font change message, at least not for Linux in 
general. This is confirmed by the fact that after installing a new 
font, KDE displays the message "Please note that applications have to 
be restarted for the change to take effect".

I have just added a font list cache that can be updated incrementally 
(i.e., it will not try and reread information on fonts it already 
knows), which means it can be updated reasonably quickly. Currently, 
it is updated each time the OIL layer is asked for the font list, 
which is each time the text tool is selected (plus I have added an 
update call at start up when the Kernel font manager is initialised).

Unfortunately, as far as I can see, making the cache incremental was a 
bit of a waste because even after installing a new font wxWidgets does 
not list it, so it seems that the KDE message is right: We only see a 
changed font set after restarting the application.

Martin