OpenOffice .odt Opened Up – Part 3a: Styles/font-face-decls
Overview
In my last article, OpenOffice .odt Opened Up – Part 2: Meta and Settings, I discussed two of the four top level subdocument elements, office:document-meta and office:document-settings. In this article, I will be taking a closer look at the office:document-styles element, in particular the office:font-face-decls sub-element. As before, my test cases where produced with the following software:
- SuSE Linux 10.1
- OpenOffice 2.0.2.7.1
- zip 2.31 (March 8th 2005)
The Relax-NG schema language is used to define elements of the specification. The original source document can be downloaded here oo_part1.odt, and in particular the subdocument under observation can be downloaded here styles.xml.
The office:document-styles element
The office:document-styles root element contains all font face declarations, named styles, automatic styles and master styles need for the document.
office:document-styles schema
<element name="office:document-styles">
<ref name="office-document-common-attrs" />
<ref name="office-font-face-decls" />
<ref name="office-styles" />
<ref name="office-automatic-styles" />
<ref name="office-master-styles" />
</element>
</define>
Next let us explore the office:font-face-decls sub-element.
The office:font-face-decls element
This element is actually duplicated in the top-level office:document-content element. A few simple test indicate that, if differences exist in the two sub-elements, complete element omissions in one are populated by the other, and where two elements differ in content the definition in office:document-styles takes precedence, though this behavior is not defined explicately in the specification.
The office:font-face-decls element consist of style:font-face elements. If you remember, we generated our test document by selecting text from a pdf and pasting that text into an .odt. This generated such style:font-face elements as follows:
svg:font-family="EIDQUI+CMSLTT10"/>
<style:font-face style:name="FFWLFJ+CMR10"
svg:font-family="FFWLFJ+CMR10"/>
<style:font-face style:name="GRVNVC+CMTT9"
svg:font-family="GRVNVC+CMTT9"/>
<style:font-face style:name="HJCZVV+CMTT8"
svg:font-family="HJCZVV+CMTT8"/>
<style:font-face style:name="Lucidasans1"
svg:font-family="Lucidasans"/>
With the exception of the last element, this looks pretty ugly. The following is a sample of style:font-face elements taken from a newly created document.
svg:font-family="’HG Mincho Light J’"
style:font-pitch="variable"/>
<style:font-face style:name="Lucidasans"
svg:font-family="Lucidasans"
style:font-pitch="variable"/>
<style:font-face style:name="Thorndale AMT"
svg:font-family="’Thorndale AMT’"
style:font-family-generic="roman"
style:font-pitch="variable"/>
<style:font-face style:name="Albany AMT"
svg:font-family="’Albany AMT’"
style:font-family-generic="swiss" />
The reason for this is that OpenDocument font face declarations directly correspond to the @font-face font description of CSS2 and the <font-face> element of SVG, but have two extensions.
- OpenDocument font face declarations optionally may have an unique name. This name can be used inside styles as the value of the style:font-name attribute to immediately select a font face declaration. If a font face declaration is referenced this way, the steps described in CSS2 font matching algorithms for selecting a font declaration based on the font-family, font-style, font-variant, font-weight and font-size descriptors will not take place, but the referenced font face declaration is used directly.
- Some additional font descriptor attributes may exist.
Which basically means svg:font-family="EIDQUI+CMSLTT10" uses the SVG font matching algorithm and not the named font. SVG is beyond the scope of this article. Reference material for SVG font declarations can be found here.
Back to the bigger picture. The benefit we can observe from this, is that a predefined set of fonts can be applied to an .odt. By doing this we can ensure that documents contain a consistent set of fonts and eliminate potential redundancy or functional overlap. Care must be taken that if a style:font-face is replaced, that all style:font-name, style:font-name-complex and style:font-name-asian attributes are examined and replaced as well. While potential size gains are arguably minimal, gains in consistent look and output are immeasurable.
One option Open Office gives the user to tackle this issue is the font replacement option. Simply choose Tools -> Options then OpenOffice.org -> Fonts. You should see a dialog similar to the following:
The Open Office user can simply select which fonts to replace with which fonts on an Always or Screen only case. Though this is not always a complete solution. Amore complete solution will be provided in the final installment of OpenOffice .odt Opened Up – Part 3: Styles. I will provide an application that will indeed optimize all of the aspects of the office:document-style elements. Up next is the office:styles element.
Until next time,
-3monkeys
Popularity: 18% [?]














(1 votes, average: 9.00 out of 10)
December 3rd, 2009 at 10:44 am
Hi, just thought you’d be interested to know that I have added your blog to my Google bookmarks because of your beautiful blog layout (LOL). With that said, seriously, I believe your blog has one of the cleanest theme I’ve came across. It really makes your blog post easier to read.
June 14th, 2010 at 9:05 am
I didn’t know you can edit .odt files in this way, thanks for the info.
July 6th, 2010 at 12:55 am
Hi,just learned your web-site when i google some thing and wonder what web hosting do you use for the wordpress,the speed is much more faster than my online web page, i really have to have it.will back to verify it out,several thanks!
July 7th, 2010 at 1:11 pm
Excellent blog. Can’t wait to check out just what exactly you construct next!
July 11th, 2010 at 6:31 am
Hi admin How are You ? I like your post and i want to stumble it for my friend but i cant see your social bookmark widget in this blog. Please help me friend Thank You
July 11th, 2010 at 3:50 pm
oh my god most of the comments most people make usually are such stoner comments, now and then i question whether they actually examine the content material pieces and reports prior to posting or if perhaps they generally skim the titles and publish first thing comes to mind. anyway, it’s satisfying to go through smart commentary now and then when compared to similar, obsolete post vomit which i generally see on the net
July 12th, 2010 at 8:59 am
Just one single question though. Maybe you have made creating this blog as your career or do you do this in your spare time? Just curious..
July 13th, 2010 at 1:34 am
you have a great page here, lots of good stuff about employment in usa.
July 13th, 2010 at 3:52 am
Lol that is certainly one of the ways to observe that
July 15th, 2010 at 10:12 am
Go to http://www.ultrarom.com for the best forums
July 15th, 2010 at 10:15 am
http://www.nightmareforums.com pokemon forums the best of the best
July 16th, 2010 at 1:04 pm
Hardy is known to incorporate Japanese aesthetics into the American tattoo styles and these can be clearly seen in the jeans designed by him. Actually, Hardy started introducing tattoos on clothes in the year 2002, but in 2004, he paired with Christian Audigier for making the brand fashionable and famous.
July 21st, 2010 at 2:52 am
Im trying to decide between MCSE and CCNA
July 21st, 2010 at 2:12 pm
Good post! I have a random question for you. How do you get your blog indexed by bing? I have a related web blog.
July 21st, 2010 at 6:33 pm
Xclusive Articles – Free article directory to submit your articles to get backlinksand traffic for your site.
July 26th, 2010 at 4:55 am
Extremely interesting stuff. Would you mind if I placed a link to your site from my blog? Google
July 28th, 2010 at 2:11 pm
Thank you ! nice find
July 29th, 2010 at 5:40 am
Excellent article, I really enjoyed reading it and so I have subscribed to the rss feed. It is nice to see that there are other people out there who think along the same lines as I do. Keep up the good work.