RoboFab

Support RoboFab

Up

See also

RoboFab Mailinglist

Join the RoboFab users community at Google groups.

Google Groups

Email:

Visit this group

RoboFab Sponsors

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. We use it in the
Unified Font Object and the Glyph Interchange Format.

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.