The Flying Meat Wiki : AcornFileFormat

HomePage :: Categories :: PageIndex :: RecentChanges :: Login/Register

Acorn's File Format


Disclaimer: This information may change in a future release, and only represents Acorn at version 1.0.

The Acorn file format at a high level, is a serialized NSDictionary, written out in a binary plist format. You can open it up in Property List Editor and snoop around. For the most part, it's self explanatory. It might even look a little bit like what you'd find in /Developer/Examples/AppKit/Sketch/.

The data for the bitmap images is found in the key "TSBitmapLayerCompressedImageDataKey". You can reconstruct it by decompressing it using zlib, and then handing it off to CGBitmapContextCreate with the size information taken from the TSBitmapLayerSizeKey key. 8 bits per component, kCGImageAlphaPremultipliedFirst. The key "TSBitmapLayerDrawDelta" is what the translation is from the document's canvas size.

The "class" key lets you know if the layer is a shape or bitmap layer. The string "TSBitmapLayer" is a bitmap layer, and the string "TSShapeLayer" is for a shape layer.

For the individual shapes, you'll find the in the "GraphicsList" key in a shape layer. The "Class" key will tell you what kind of shape it is, the "Bounds" key will tell you where it is located in the layer. There are a handful of other attributes, which should be pretty explanatory.

For a set of classes you can use to display an Acorn image, download the source to Acorn's Quick Look plugin:
http://flyingmeat.com/download/latest/AcornQuickLook.zip

Back to Acorn -> Acorn Plugins
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.3
Page was generated in 0.0282 seconds