Thanks Rob, makes sense,
The automatic styles seem non intuitively named to me, but thanks for the explanation. I shall check it out to clarify it in my little brain. Cheers, Ian On Sun, May 27, 2012 at 11:05 PM, Rob Weir <robw...@apache.org> wrote: > On Sun, May 27, 2012 at 10:13 AM, Ian <i...@amham.net> wrote: >> Thanks Andrew, >> >> I am coming to that conclusion. I'm not sure why some of the styles >> are there though. >> >> Are there some default styles in a vanilla new text document. The one >> I have may have been based on some other and inherited its styles etc? >> > > Think of it this way: a document is created based on a default > template that has definitions for a harmonious set of styles. When > the document is saved, it saves the definitions for all of these > styles, not just the ones actually in use. Imagine if it were > otherwise. I create a document that uses only header-1 and default > paragraph styles. If I save with only those definitions, what happens > when I (or someone else) tries to edit the document and wants to add a > header-2, or a list, or a quotation? These style definitions would > not exist. > > So, you really want to save the harmonious set of style definitions, > so these styles have expected relationships in terms of font face, > size, etc. > > That said, there is nothing wrong, from an ODF perspective, to omit > unused style definitions. You could create a document like this from > the Apache ODF Toolkit, and it would load correctly in OpenOffice. > But, depending on the intended use, the user might expect to be able > to pick from the full set of styles. > >> I see in the spec there are automatic styles too... which are inherant >> in a given object. I will do some head scratching and more >> reading/digging. >> > > It works like this: Automatic styles are the styles created on the > fly when the user directly applies attributes to objects rather than > using a predefined, named style. So if you select some text and click > the bold icon, and increase the font size to 14pt, then an automatic > style is created to express that combination of attributes. > > -Rob > >> Thanks again. >> >> On Sun, May 27, 2012 at 10:02 PM, Andrew Douglas Pitonyak >> <and...@pitonyak.org> wrote: >>> >>> I did not bother to check the spec, but I will hazard a guess that the >>> problem is that the information is in the style itself. If the information >>> is in the style, then if it is not persisted then it will be lost. >>> >>> Are you looking at a style that has a parent style? I expect that if I >>> create a child style and do NOT set a specific attribute, that it inherits >>> the value from the parent and will not, therefore, be persisted into the >>> file. The parent will have the values persisted, of course.... >>> >>> >>> >>> On 05/27/2012 06:06 AM, Ian wrote: >>>> >>>> Ah I think I see why the font declarations are there now. >>>> They are required to meet some of the style definitions. >>>> >>>> But I'm not sure why all those styles attriburtes are there? >>>> >>>> <style:text-properties style:use-window-font-color="true" >>>> style:font-name="Liberation Serif" fo:font-size="12pt" >>>> fo:language="en" fo:country="US" style:letter-kerning="true" >>>> style:font-name-asian="文泉驛正黑" style:font-size-asian="12pt" >>>> style:language-asian="zh" style:country-asian="CN" >>>> style:font-name-complex="Lohit Devanagari" >>>> style:font-size-complex="12pt" style:language-complex="hi" >>>> style:country-complex="IN" fo:hyphenate="false" >>>> fo:hyphenation-remain-char-count="2" >>>> fo:hyphenation-push-char-count="2"/> >>>> >>>> Are they required? >>>> >>>> Cheers, >>>> >>>> Ian >>>> >>>> >>>> ---------- Forwarded message ---------- >>>> From: Ian<i...@amham.net> >>>> Date: Sun, May 27, 2012 at 5:35 PM >>>> Subject: [Dev] Redundant information in ODF document >>>> To: ooo-dev@incubator.apache.org >>>> >>>> >>>> Hi, >>>> >>>> I am interested in looking into the ODF documents produced by AOO with >>>> a respect to the document schema etc. >>>> >>>> One thing I noticed when creating a simple almost "Hello World" >>>> document is that there are some unused and probably not required font >>>> infomation in the content.xml. >>>> >>>> <office:font-face-decls> >>>> <style:font-face style:name="Lohit Devanagari1" >>>> svg:font-family="'Lohit Devanagari'"/> >>>> <style:font-face style:name="URW Bookman L" svg:font-family="'URW >>>> Bookman L'" style:font-adornments="Light" >>>> style:font-pitch="variable"/> >>>> <style:font-face style:name="Liberation Serif" >>>> svg:font-family="'Liberation Serif'" style:font-family-generic="roman" >>>> style:font-pitch="variable"/> >>>> <style:font-face style:name="Liberation Sans" >>>> svg:font-family="'Liberation Sans'" style:font-family-generic="swiss" >>>> style:font-pitch="variable"/> >>>> <style:font-face style:name="Lohit Devanagari" >>>> svg:font-family="'Lohit Devanagari'" >>>> style:font-family-generic="system" style:font-pitch="variable"/> >>>> <style:font-face style:name="文泉驛正黑" svg:font-family="文泉驛正黑" >>>> style:font-family-generic="system" style:font-pitch="variable"/> >>>> </office:font-face-decls> >>>> >>>> Is this by design? Why? Or some sort of bug? >>>> >>>> Only the URW Bookman font is used by the few lines of text in the >>>> document. >>>> >>>> And looking into the Styles xml document I see tons of possibly >>>> redundant entries. There for possible future edits of the document? Eg >>>> Footer styles. >>>> >>>> Cheers, >>>> >>>> Ian >>>> >>> >>> -- >>> Andrew Pitonyak >>> My Macro Document: http://www.pitonyak.org/AndrewMacro.odt >>> Info: http://www.pitonyak.org/oo.php >>>