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

RE: [XaraXtreme-dev] Substituted fonts and Bug 1057

In message <12e1152b4e.martin@xxxxxxxxxxxxxxxxxxx>
          Martin Wuerthner <lists@xxxxxxxxxxxxxxx> wrote:

> In message <5056CBC646CB4047BB26120F4377DB719BA486@xxxxxxxxxxxxxxxxxxx
>           "Charles Moir" <CharlesM@xxxxxxxx> wrote:
>> The only really reliable, and simple way to do this is to scan the real
>> document tree when the font usage information is required.
>> So I wonder just how bad this would be. I would have hoped that scanning
>> the tree for specific object types (text objects) would be damn fast. I
>> mean hundreds of thousands of objects per second, surely?  (and that
>> would be plenty fast enough for real time scanning)
> OK, I will try it and see how much time is spent compiling the font
> information.

I have just had a great idea (or so I thought), which resulted in a 
very simple, elegant fix that has the big advantages that (a) it works 
and (b) it is very straightforward, so it is unlikely to break things 
at this critical stage.

The idea is that if the combo box prevents us from showing a font name 
that is not in the list and it might be difficult/time consuming to 
compile the complete document font information each time the font list 
is shown or the font field is updated, then all we need to still show 
the name of a substituted font is ONE additional item that shows 
"Arial (missing)" or whatever the font in question is. This item can 
be created on the fly when the field is set to something that is not 
in the list. The item can also be removed on the fly when the field is 
set to a font that does exist in the list. If the additional item is 
selected, we simply ignore it because the extra item only appears when 
the font in question is selected anyway.

I have just implemented this fix and not only can you now see the name 
of the default font OK even if it is not installed, you can finally 
also see the proper font name of any text selection even if the font 
is not installed.

So, it will certainly do for the 0.5 release. We might even come up 
with something better until tomorrow's release, but it is probably 
good to know that if everything else fails, we have got a working fix.