CSSToXSLFO is a utility which can convert an XML document, together with a CSS2 style sheet, into an XSL-FO document, which can then be converted into PDF, PostScript, etc. with an XSL-FO-processor. It has special support for the XHTML vocabulary, because that is the most obvious language it would be used for. The tool has a number of page-related extensions. It also comes with an API in the form of an XML filter.
<foo id="bar"/> match { // prints "bar"
case n @ <foo/> if (n \ "@id" text) == "bar" => println("bar")
case n @ <foo/> if (n \ "@id" text) == "baz" => println("baz")
}
# Introductions to several of the Apache Foundation’s hottest projects, including Xerces, Axis, and Xindice
# Building XML–driven websites using the popular Cocoon project
# Transforming XML–based documents into a variety of formats, including PDF, SVG, and PS, using the Formatting Objects Processor (FOP) project
I'd like to extend Scribus using Python, not just automate things with it...
Currently, that's not really possible. There is work on making it possible to extend Scribus with Python to some extent, especially the GUI. It's now possible to use PyQt to write your own palettes, but you won't be able to use custom Scribus widgets or get into the innards of the application. The Scribus core is unfortunately not well suited to extension from Python. More advanced or tightly integrated extensions are probably better written as C++ plug-ins.
Local fonts: before using them you must call GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts() or GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(). Then supply name to Font constructor and specify font via setFont, as in Java 1.1.