[scribus] Re. Graphics instructions?

wena-parry at talktalk.net wena-parry at talktalk.net
Fri Jun 5 14:59:11 UTC 2015


Thank you Christoph for your advice, is there any way I can understand the graphics mode now. For my graphics I am unseeing a system that is avaluble for animation and all of it is vector. However it's output are bitmaps so I am limited in it's quality. My graphics so fare as that way of working has been O.K. but if anything of that becomes a good production then I couldn't produce larger graphics. 


I understand some of the vector point system but never got much good work with Inkscape.

Thank you

Wena


----Original Message----
From: scribus-request at lists.scribus.net
Date: 05/06/2015 13:00 
To: <scribus at lists.scribus.net>
Subj: scribus Digest, Vol 87, Issue 10

Send scribus mailing list submissions to
	scribus at lists.scribus.net

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.scribus.net/mailman/listinfo/scribus
or, via email, send a message with subject or body 'help' to
	scribus-request at lists.scribus.net

You can reach the person managing the list at
	scribus-owner at lists.scribus.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of scribus digest..."


Today's Topics:

   1.  Python scripter - scribus.setFont() and
      scribus.setTextAlignment() ? -- Solution (Gregory Pittman)
   2. Re:  Python scripter - scribus.setFont() and
      scribus.setTextAlignment() ? -- Solution (William Bader)
   3. Re:  Graphics instructions? (Christoph Sch?fer)


----------------------------------------------------------------------

Message: 1
Date: Thu, 04 Jun 2015 21:52:32 -0400
From: Gregory Pittman <gpittman at iglou.com>
To: Scribus User Mailing List <scribus at lists.scribus.net>
Subject: [scribus] Python scripter - scribus.setFont() and
	scribus.setTextAlignment() ? -- Solution
Message-ID: <557100E0.3090903 at iglou.com>
Content-Type: text/plain; charset=utf-8

I somehow lost this email from my client, but here it is copied from the
Archives:
*************************
I am trying to run the following (very simple) script:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
try:
   import scribus

except ImportError:
   print "This script only works from within Scribus"
   sys.exit(1)

n = scribus.selectionCount()

for count in range(0,n):
    textbox = scribus.getSelectedObject(count)
    scribus.messageBox('Error:', textbox);
    scribus.setFont('Arial Regular', textbox)
    scribus.setTextAlignment(scribus.ALIGN_CENTERED, textbox)
    scribus.setTextColor("White", textbox)
    scribus.setFillColor("Red", textbox)


However it fails after one iteration. The error message is:

Traceback (most recent call last):
  File "<string>", line 8, in <module>
  File "/home/.../SetTableHeading.py", line 17, in <module>
    scribus.setFont('Arial Regular', textbox)
NoValidObjectError: Cannot use empty string for object name when there is
no selection

If I remove the function calls scribus.setFont() and
scribus.setTextAlignment(), the script runs fine, but I dont know why...

I am running Scribus 1.4.3 and python 2.7.6 under Ubuntu 14.04.2 LTS.

I am not able to find any solution to this - any suggestions?

regards,
Anders

*****************************

I'm not quite sure why this doesn't work, but I am able to accomplish
what you're looking for (I think) with a modified syntax. Basically,
instead of relying on the count of the selection, I create a list of
frame names, then feed that list into your text manipulations...

*************
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
try:
   import scribus

except ImportError:
   print "This script only works from within Scribus"
   sys.exit(1)

n = scribus.selectionCount()
boxes = []

for x in range(n):
  frame = scribus.getSelectedObject(x)
  boxes.append(frame)

for textbox in boxes:
    scribus.messageBox('Error:', textbox);
    scribus.setFont('Arial Regular', textbox)
    scribus.setTextAlignment(scribus.ALIGN_CENTERED, textbox)
    scribus.setTextColor("White", textbox)
    scribus.setFillColor("Red", textbox)

*************

Greg



------------------------------

Message: 2
Date: Thu, 4 Jun 2015 22:38:12 -0400
From: William Bader <williambader at hotmail.com>
To: Scribus User Mailing List <scribus at lists.scribus.net>
Subject: Re: [scribus] Python scripter - scribus.setFont() and
	scribus.setTextAlignment() ? -- Solution
Message-ID: <BLU179-W66101AD79FE0454AAB7525C4B20 at phx.gbl>
Content-Type: text/plain; charset="iso-8859-1"



> Date: Thu, 4 Jun 2015 21:52:32 -0400
> From: gpittman at iglou.com
> To: scribus at lists.scribus.net
> Subject: [scribus] Python scripter - scribus.setFont() and scribus.setTextAlignment() ? -- Solution
> 
> I somehow lost this email from my client, but here it is copied from the
> Archives:
> *************************
> I am trying to run the following (very simple) script:
> 
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
> 
> import sys
> try:
>    import scribus
> 
> except ImportError:
>    print "This script only works from within Scribus"
>    sys.exit(1)
> 
> n = scribus.selectionCount()
> 
> for count in range(0,n):
>     textbox = scribus.getSelectedObject(count)
>     scribus.messageBox('Error:', textbox);
>     scribus.setFont('Arial Regular', textbox)
>     scribus.setTextAlignment(scribus.ALIGN_CENTERED, textbox)
>     scribus.setTextColor("White", textbox)
>     scribus.setFillColor("Red", textbox)
> 
> 
> However it fails after one iteration. The error message is:
> 
> Traceback (most recent call last):
>   File "<string>", line 8, in <module>
>   File "/home/.../SetTableHeading.py", line 17, in <module>
>     scribus.setFont('Arial Regular', textbox)
> NoValidObjectError: Cannot use empty string for object name when there is
> no selection
> 
> If I remove the function calls scribus.setFont() and
> scribus.setTextAlignment(), the script runs fine, but I dont know why...

Arial is a Windows font, and some Linux systems do not have it.
I have the code below in one of my test scripts.
    try:
        scribus.setFont("Arial Regular", txt)
    except:
        try:
            scribus.setFont("FreeSans Medium", txt)
        except:
            pass
Regards,William

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20150604/92893c02/attachment.html>


------------------------------

Message: 3
Date: Fri, 5 Jun 2015 07:18:14 +0200
From: "Christoph Sch?fer" <christoph-schaefer at gmx.de>
To: scribus at lists.scribus.net
Subject: Re: [scribus] Graphics instructions?
Message-ID:
	<trinity-b41f5b13-054b-4a0b-902c-bd3d6d1b621a-1433481494572 at 3capp-gmx-bs41>
	
Content-Type: text/plain; charset=UTF-8



> Gesendet: Mittwoch, 03. Juni 2015 um 18:57 Uhr
> Von: "wena-parry at talktalk.net" <wena-parry at talktalk.net>
> An: scribus at lists.scribus.net
> Betreff: [scribus] Graphics instructions?
>
> 
> 
> 
> I had read on hear, I think of a book on Graphics with Scribus, 
> If so is it been updated for v1.5??
> Wena D.Parry

Hi Wena,

We didn't publish an official manual for the 1.4.x series because life and the catastrophies it can entail prevented us from doing so. Since Scribus 1.5.0 is the equivalent of an alpha or beta release, we certainly won't publish a book on it. When we get close to the 1.6.0 release we will have to update the online manual, which is a huge undertaking in itself, given the countless changes and new features. Once that's finished, we may contemplate to work on a printed "official manual" again.

HTH,

Christoph



------------------------------

Subject: Digest Footer

_______________________________________________
scribus mailing list
scribus at lists.scribus.net
http://lists.scribus.net/mailman/listinfo/scribus


------------------------------

End of scribus Digest, Vol 87, Issue 10
***************************************



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20150605/fada0abc/attachment.html>


More information about the scribus mailing list