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

RE: [XaraXtreme-dev] Current/default font



There is obviously much confusion about what is really meant by the
terms default and current when dealing with attributes.

The default attributes are the ones right at the top of the document
tree that ensure that all attributes get set to a sensible initial value
when the tree is rendered.  In the case of text, this is always Times
New Roman and always has been.  The default attributes do not get saved
in the Xar format as every xar file would have to have a copy of them
and this would be a waste of space.  They must therefore never change.

A current attribute is the attribute applied when a new object is
created.  For text this is currently Arial.  The current attributes are
saved in the xar format.  In fact, two sets of them are saved, one set
that applies to new text objects and another set that applies to
everything else.

Attribute optimisation ensures that there are at most two attributes of
each type affecting each object.  One of these is always the default
attribute at the top of the tree and the other is the actual attribute
applied to the object (though it can be either a child of the object or
a left-sibling or a left sibling of an ancestor due to optimisation).
This attribute is only present if it is different to the default one.

The issue here seems to be that if the current font attribute in a
document is not installed, whether we can change it to one that is
installed.  There should be no danger whatsoever in changing the current
attributes to ones that make sense for the user's machine.  The only
issue I can really come up with is if someone creates a template for a
specific purpose that has the current font set to something explicit, if
the current font is silently changed because you don't have the correct
one installed then text you create will not be in the "correct" font.

Gerry

-----Original Message-----
From: owner-dev@xxxxxxxxxxxxxxxx [mailto:owner-dev@xxxxxxxxxxxxxxxx] On
Behalf Of Alex Bligh
Sent: 27 July 2006 12:49
To: dev@xxxxxxxxxxxxxx
Cc: Alex Bligh
Subject: Re: [XaraXtreme-dev] Current/default font

Neil Howe wrote:

> Ok - specific question Phil. Is the default font saved in a document
or
> not? I'm surprised if it's not saved, but that's what Martin is
saying. 
> 
> If the default font is saved, we can safely change both as originally
> decided. If it isn't saved we should only change the current font.

No that's not the right question. The default attribute doesn't need
to be saved. What we need to be sure of is that any text node saved
always has AN attribute attached when saved. If so, we don't care
what the default attribute is, as it won't influence rendering.

Alex