[scribus-dev] Style Export Feature (primitive version)

Gregory Pittman gpittman at iglou.com
Wed Jan 27 20:27:53 CET 2010


On 01/26/2010 11:12 AM, Jain Basil Aliyas wrote:
> Hello,
>
> I've implemented a feature which exports all the styles in a scribus 
> document. The story goes like this :
>
> I have a scribus document with many styles in it.One of my friends 
> need the styles in that document, so that he can import it into his 
> document using the import option in the Style Manager. But my document 
> is confidential, so I refused to give him the stuff.
>
> Thinking in this way, I decided to implement this feature!
>
> I've added a pushbutton in the Style Manager, named "Export". Clicking 
> this will give you the save dialog to save your file as "sla". This 
> sla will contain only the styles in the current document. See a sample 
> generated be me :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SCRIBUSUTF8NEW Version="1.5.0.svn">
> <DOCUMENT>
> <STYLE NAME="Default Paragraph Style" DefaultStyle="1" ALIGN="0" 
> LINESPMode="0" LINESP="15" INDENT="0" RMARGIN="0" FIRST="0" VOR="0" 
> NACH="0" DROP="0" DROPLIN="2" DROPDIST="0"/>
> <STYLE NAME="Jain's Style" PARENT="Default Paragraph Style" VOR="3" 
> FCOLOR="Red"/>
> <CHARSTYLE CNAME="Default Character Style" DefaultStyle="1" 
> FONT="Arial Regular" FONTSIZE="12" FEATURES="inherit" FCOLOR="Black" 
> FSHADE="100" SCOLOR="Black" SSHADE="100" TXTSHX="5" TXTSHY="-5" 
> TXTOUT="1" TXTULP="-0.1" TXTULW="-0.1" TXTSTP="-0.1" TXTSTW="-0.1" 
> SCALEH="100" SCALEV="100" BASEO="0" KERN="0"/>
> </DOCUMENT>
> </SCRIBUSUTF8NEW>
>
> I imported this document in another place inorder to test whether this 
> works correctly, and it works!
>
> I am attaching the patch and 2 files.
>
> smstyleexport.h and smstyleexport.cpp should be placed inside scribus/ui/
> and apply the patch.
>
> *This is a very primitive version, we may think of expanding it by 
> adding a feature like selective export of styles rather than simply 
> exporting all the styles in document and so on.*
>
> I think this will also help in sharing of Scribus styles and creating 
> a database of cool scribus style :)
Something else to consider adding would be what we might think of as a 
modification of Collect for Output, where not only can you export 
styles, but if desired the font data. If you were going to share a style 
with someone, you would want to make sure they have the font needed for it.

Greg



More information about the scribus-dev mailing list