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

RE: [XaraXtreme-dev] Current/default font



Hi Phil,

In message <5056CBC646CB4047BB26120F4377DB71DC8425@xxxxxxxxxxxxxxxxxxx 
>
          "Phil Martin" <Phil@xxxxxxxx> wrote:

> Yes I did mean "Times New Roman" and the presence of those records in
> the XAR document does not necessarily indicate a bug: The text system
> could be writing out font face records deliberately even when font face
> attributes are not present in the in-memory tree.

In theory, it could, but I do not think it does (do a grep for 
TAG_FONT_TYPEFACE and you see that only the attribute node saving code 
itself writes this record), and if it did, it would still be wrong. 
When I designed the file records for the new attributes I was gently 
told off for using a few unnecessary *bytes* in my first design and 
was asked to make sure the file is as small as possible. Surely, there 
would be absolutely no point in the text system writing superfluous 
*records* to the file, would there?

Martin

>> -----Original Message-----
>> From: owner-dev@xxxxxxxxxxxxxxxx
>> [mailto:owner-dev@xxxxxxxxxxxxxxxx] On Behalf Of Martin Wuerthner
>> Sent: 27 July 2006 13:44
>> To: dev@xxxxxxxxxxxxxx
>> Subject: RE: [XaraXtreme-dev] Current/default font
>> 
>> In message
>> <5056CBC646CB4047BB26120F4377DB71DC8423@xxxxxxxxxxxxxxxxxxx
>> >
>>           "Phil Martin" <Phil@xxxxxxxx> wrote:
>> 
>> > Further: The ability to save the Current attributes in
>> documents is a
>> > recent addition (<4 years ago). So the current attributes
>> sections of
>> > document are not guaranteed to be present and there will be
>> many old
>> > documents which do not carry /any/ Current attributes.
>> > 
>> > Further2: There are only two Current attribute sets saved
>> in documents
>> > at the moment but there could be more in the future.
>> > 
>> > To answer Neil's question (as Gerry already has): Default
>> attributes
>> > are not saved with documents.
>> > 
>> > To answer Alex's question: It looks as if text objects
>> always carry at
>> > least one pair of TAG_FONT_DEF_XXX and
>> TAG_TEXT_FONT_TYPEFACE records
>> > in XAR files controlling the font - even when that font is "Times
>> > Roman", the value of the Default font face attribute. I
>> can't say for
>> > sure whether that's always been true, though.
>> 
>> If that is true, then it is a bug. And I presume you mean
>> "Times New Roman".
>> 
>> In LX, it is not true. If you apply Times New Roman to a text
>> object it does not have a font attribute nor should it have one.
>> 
>> Martin
>> 
>> >> -----Original Message-----
>> >> From: owner-dev@xxxxxxxxxxxxxxxx
>> >> [mailto:owner-dev@xxxxxxxxxxxxxxxx] On Behalf Of Gerry Iles
>> >> Sent: 27 July 2006 13:16
>> >> To: dev@xxxxxxxxxxxxxx
>> >> Subject: 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