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

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



Trying to maintain state of the font usage in parallel with the
document's true state is disgusting and bound to be unreliable. What's
more maintaining state in UI objects is also just wrong. (The name
gallery is not one of the best designed or implemented feature we have
so this is not totally a surprise).

Oh well.

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)

Charles



> -----Original Message-----
> From: owner-dev@xxxxxxxxxxxxxxxx 
> [mailto:owner-dev@xxxxxxxxxxxxxxxx] On Behalf Of Alex Bligh
> Sent: 22 May 2006 16:08
> To: dev@xxxxxxxxxxxxxx
> Cc: Alex Bligh
> Subject: RE: [XaraXtreme-dev] Substituted fonts and Bug 1057
> 
> Charles,
> 
> --On 22 May 2006 15:53 +0100 Charles Moir <CharlesM@xxxxxxxx> wrote:
> 
> >> > I was assuming the same thing. Just the substituted fonts
> >> from /that/
> >> > document.
> >>
> >> But how do we get them? I am not aware of any data structures that 
> >> would allow us to find out which fonts are substituted in a 
> >> particular document. I do not think we can afford to scan the 
> >> complete document each time the dropdown list is opened 
> because this 
> >> is probably too slow, so we need to add an appropriate 
> data structure 
> >> to the document class to keep track of substituted fonts.
> >
> > How does the Name gallery do it? Does that help? I think it 
> retains a 
> > list of all names of fonts used in the current document 
> (not sure how 
> > or when it does the scan to get this data though).
> 
> The name gallery I am afraid is (my opinion) not too 
> beautiful a piece of code. Essentially, whenever an object 
> gets used, something seems to go call directly into the name 
> gallery to update the it. It then maintains state. The 
> problem with this approach is it depends upon the dialog (or 
> gallery) existing. Essentially, the UI is recording 
> persistent state. This only happens to work in Xtreme because 
> galleries are never actually destroyed (just hidden), and 
> fails dismally on LX.
> 
> So one could go look for the hooks into the name gallery and 
> put in calls to a proper system for remembering these (which 
> is UI independent) which would also be useful for whenever 
> the name-gallery is fixed.
> 
> The file info dialog also gets font usage state but I'm not 
> sure how it does it.
> 
> Alex
>