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

<define name="office-document-styles">
  <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:

<style:font-face style:name="EIDQUI+CMSLTT10"
                 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.

<style:font-face style:name="HG Mincho Light J"
                 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.

  1. 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.
  2. 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:

Font Replacement Dialog

Click for full size image

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% [?]

  • DZone
  • StumbleUpon
  • Technorati
  • del.icio.us
  • Slashdot
  • Digg
  • Reddit
  • NewsVine
  • SphereIt
  • e-mail
  • Facebook
  • Google Bookmarks
  • Live
  • Propeller
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 9.00 out of 10)
Loading ... Loading ...

32 Responses to “OpenOffice .odt Opened Up – Part 3a: Styles/font-face-decls”

  1. Article Submission Says:

    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.

  2. Mat Heating Says:

    I have used OpenOffice on a number of occasions, and it comes in handy when on a friend’s computer without an office suite. It’s great to know that it’s customizable as well!
    Love your layout by the way!

  3. Doctor Andrew Wojtkowski Says:

    I know this may sound incredible however it is real. And, its an Ecommerce Promoter’s Exclusive! With One Click you can submit your offer to thousand’s of network message boards, personal message boards, blogs, FFA networks and safelists. Customers that have tried this service report a noted increase in exposure and sales. Right now its just $19.95 and you also get a Bonus Contact Solo-Emailing.

  4. Demetrius Sliman Says:

    Hopefully people will put their ear to the ground and pay attention. This is topnotch information that could easily make up for a membership site.

  5. Lin Denjen Says:

    keep at it man, your almost there , thanks for the read!

  6. Jada Burckhard Says:

    Above everything else I appreciate making room for alternatives, even though these are not perfectly tailored on your frame of mind and action.

  7. Fotele Says:

    Hello,
    good info, thanks for that. I got one ask: can u comment my website http://www.centrumkrzesel.pl ?
    Should i change something ? Ty for info about that.

  8. cheap home phone Says:

    Great article about Cheap Home Phones…thanks! =)

  9. tynki cementowe Says:

    Fajny blog, pewnie cz?¶ciej b?d? tu wpada?.

  10. Reed Deuell Says:

    I never had any luck on hotjobs finding a job :-( I had to use veemin.com to find a decent paying fulltime job.

  11. Marguerite Pascher Says:

    Good day very cool web site!! Guy .. Beautiful .. Amazing .. I’ll bookmark your site and take the feeds also…I am satisfied to seek out a lot of useful info here in the publish, we need develop extra strategies in this regard, thank you for sharing. . . . . . Executive Elite, 18a Greycoat Gardens, Greycoat Street, London, SW1P 2QA, 028 2088 0135

  12. Interior Sliding Doors Says:

    I don’t usually post on blogs but had to on yours. You have a very easy to read writing style. I really enjoy posts about this topic, they give me a lot to reflect on. I don’t have time to read everything right now, I found this site when looking for something else on Yahoo, but I’ve bookmarked your homepage and will check back soon to see the latest thoughts.

  13. Dirk Sattel Says:

    Your website is so educational … hold up the excellent work!!?!!!?!

  14. Elfreda Sarracino Says:

    Hi there, I discovered your web site by the use of Google even as searching for a related topic, your website got here up, it seems great. I have bookmarked it in my google bookmarks. – Elegant London Escorts, 65-67 Brewer Street, Floor: 2, London W1F 9UP. Phone: 020 3011 2941

  15. Lavinia Moscaritolo Says:

    I got what you mean , thanks for putting up.Woh I am glad to find this website through google.

  16. Jude Lietzow Says:

    My partner and I stumbled over here different web page and thought I might check things out. I like what I see so now i am following you. Look forward to looking at your web page again.

  17. Edwina Fillion Says:

    It is the best time to make some plans for the future and it is time to be happy. I have read this post and if I could I desire to suggest you few interesting things or advice. Perhaps you can write next articles referring to this article. I desire to read more things about it!

  18. Daryl Gum Says:

    I’m not sure why but this blog is loading incredibly slow for me. Is anyone else having this problem or is it a problem on my end? I’ll check back later and see if the problem still exists.

  19. Tyler Mayben Says:

    Some times its a pain in the ass to read what blog owners wrote but this internet site is real user genial ! .

  20. EarKandy Says:

    Hey, I recommend that the Admin set up a forum or discussion board, so that we can communicate and talk with each other! Thanks

  21. Michael Wallace Says:

    Sup , I am making a new site almost like wikipedia and your articles would fit the style good. Would you let me copy think article for my readers?

  22. Dominic Karren Says:

    I was recommended this blog by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my problem. You are amazing! Thanks!

  23. albanian airlines Says:

    When I initially commented I clicked the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the same comment. Is there any means you can take away me from that service? Thanks!

  24. Mark Says:

    What superb piece of text! I have no clue how you were able to say this text..it’d take me weeks. Well worth it though, I’d assume. Have you considered selling advertising space on your blog?

  25. airalbania Says:

    Rattling informative and fantastic anatomical structure of content , now that’s user genial (:.

  26. legalpowder.cn.com SCAM Says:

    This provider took my hard earned money so i’d like to help make people today advised of it, please help us spread around this thing so they can not steal other peoples capital!!! They took all my cash (600$) and just do not respond anymore… same thing happened to a person well before but i found that too late. Now i am trying to pre warn many people so they do not get rid of their income like it has happened to others… The name of the website: legalpowder.cn.com

  27. hotel pristina Says:

    Merely to follow up on the update of this issue on your blog and want to let you know how much I prized the time you took to generate this useful post. In the post, you really spoke of how to definitely handle this issue with all ease. It would be my personal pleasure to gather some more concepts from your website and come as much as offer other folks what I learned from you. Thanks for your usual great effort.

  28. prishtina taxi Says:

    Thanks so much pertaining to giving my family an update on this topic on your website. Please understand that if a new post appears or in the event that any changes occur with the current post, I would want to consider reading more and understanding how to make good use of those strategies you share. Thanks for your efforts and consideration of other individuals by making this site available.

  29. pristina hotels Says:

    Purely to follow up on the up-date of this issue on your web page and wish to let you know just how much I appreciated the time you took to generate this valuable post. Inside the post, you spoke of how to seriously handle this issue with all ease. It would be my personal pleasure to collect some more thoughts from your site and come as much as offer some others what I discovered from you. Many thanks for your usual wonderful effort.

  30. Lili Dirth Says:

    Do you mind if I quote a few of your posts as long as I provide credit and sources back to your webpage? My website is in the very same niche as yours and my visitors would certainly benefit from a lot of the information you present here. Please let me know if this ok with you. Thanks!

  31. testujemy22 Says:

    Thank’s for your post. I’ll be back and read more! Regards

  32. Android Free Application Says:

    I got what you impart, thanks for swing up. Woh I am glad to see this website finished google. Thanks For Share 3monkeys » OpenOffice .odt Opened Up – Part 3a: Styles/font-face-decls.

Leave a Reply