This article deals with the content contained in ECMA-376 Part 1. The 3rd edition of ECMA-376 was released in June of 2011 and can be downloaded from the following location: http://www.ecma-international.org/publications/standards/Ecma-376.htm
Where can I get the presetShapeDefinitions.xml file?
What am I supposed to do with this?That's completely up to you. But here's a few ideas…
For the purposes of this blog, I will focus on the second scenario.
How do I do that?In short, any shape definition from the presetShapeDefinitions.xml file can be used within a <custGeom> (§20.1.9.8) element. Sounds easy, right? Well, it is! Here's how to do it:
Wait a second! Why are we renaming the file with a .zip extension? You may have heard that starting with Office 2007 the files that end with 'x', such as .docx, .xlsx, and .pptx are actually zip-compressed packages containing a collection of XML files. Well, you can take that at face value and rename any of those file types with a .zip extension and then open it in your un-zipper of choice and browse the contents, which is exactly what we are going to do.
When you open the file it should look exactly like it did before, but that's exactly the point. You replaced the reference to the shape with the actual definition. It's supposed to look the same.
What's the point?
Remember our 2 scenarios from the "What an I supposed to do with this" section above? Well, we've answered the first question of whether or not the definition is 'good'. If it wasn't, the shape would not have rendered correctly or you would have received an error stating something along the lines of "PowerPoint found a problem with content in MyShapeTest.pptx" when you tried to open the file.
If you're familiar with DrawingML you probably already realized that you can now modify the definition in the slide1.xml file. For those who are not familiar with DrawingML, here's something that you can change in the definition to make the moon a little more interesting.
When you open the file you should see that the inside arc has been replaced with 2 straight lines from the moon's points to the center of the shape. In step 4 we only drew the first line. The second one is drawn automatically by the <close /> element.
Refer to ECMA-376 Part 1, Chapter 14 on DrawingML for more information on how to manipulate and draw your own custom shapes.