54 lines
1.6 KiB
XML
54 lines
1.6 KiB
XML
|
<?xml version="1.0" encoding="utf-8"?>
|
||
|
<xml>
|
||
|
<include src="settings/generic.xml"/>
|
||
|
<synopsis name="UFO" description="About the UFO tools"/>
|
||
|
<title>RoboFab UFO</title>
|
||
|
|
||
|
<div class="content">
|
||
|
|
||
|
|
||
|
<textile><![CDATA[
|
||
|
|
||
|
h1. Property List File Format (.plist)
|
||
|
|
||
|
|
||
|
|
||
|
A Property List (.plist) file uses a simple XML format, defined by Apple. The DTD
|
||
|
is at "http://www.apple.com/DTDs/PropertyList-1.0.dtd":http://www.apple.com/DTDs/PropertyList-1.0.dtd. We use it in the
|
||
|
"Unified Font Object":ufo/specification.html and the "Glyph Interchange Format":ufo/glif.html.
|
||
|
|
||
|
It's a generic format supporting basic data types and structures. It can
|
||
|
contain arrays, dictionaries, integers, floats, strings and arbitrary binary
|
||
|
data. Dictionary keys are restricted to strings. Apart from this restriction,
|
||
|
Plist objects map nicely to the analogous Python types, for example
|
||
|
dictionary values and array items can be any other type supported by plist.
|
||
|
They can be arbitrarily nested.
|
||
|
|
||
|
To read and write plist data we use the robofab.plistlib module,
|
||
|
which is an improved version of the plistlib.py that ships with
|
||
|
MacPython 2.3. It is very easy to use: robofab.plistlib.readPlist(path)
|
||
|
will give you the top level object inside the plist file. To create a plist
|
||
|
file do:
|
||
|
|
||
|
{{{
|
||
|
#!python
|
||
|
robofab.plistlib.writePlist(topLevelObject, path)
|
||
|
}}}
|
||
|
|
||
|
The object passed to writePlist() must only contain types supported by plist, any
|
||
|
dictionaries must use strings as keys.
|
||
|
|
||
|
Unicode strings are fully supported. plistlib.py uses UTF-8 as the file's
|
||
|
encoding.
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
]]>
|
||
|
</textile>
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
</xml>
|