[scribus] Style Export Feature (primitive version)

Jain Basil Aliyas jainbasil at fedoraproject.org
Tue Jan 26 17:12:01 CET 2010


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 :)

Greetings!
Jain Basil Aliyas

-- 
Student, Dept. Of Computer Science & Engineering,
Govt. Engineering College, Thrissur - 9, Kerala, India.
http://jainbasil.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20100126/b48d4d2b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.patch
Type: text/x-patch
Size: 23674 bytes
Desc: not available
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20100126/b48d4d2b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smstyleexport.cpp
Type: text/x-c++src
Size: 10776 bytes
Desc: not available
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20100126/b48d4d2b/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smstyleexport.h
Type: text/x-chdr
Size: 1347 bytes
Desc: not available
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20100126/b48d4d2b/attachment.h>


More information about the scribus mailing list