Which is maybe related more to the document than the script itself. ValueError: Text distances out of bounds, must be positive. This script overcomes the fact that the script mentioned in Jon Bentley's answer did not work for me (in Scribus 1.4.6 at least), showing an error message with the following line: it cannot center the text if it is overflowing as it creates some kind of top and bottom margins (so maybe not ideal for large texts).Width of the text frame has been modified it is necessary to rerun the script if either the height or.I could experience at least two drawbacks with this script: The text inside the selected text frame will then be vertically centred. a Run Script window appears in which you select the.go to Script (next to Extras) in the main menu at the top, then select Execute Scripts.py file, calling it whatever name you want Notepad for example) with no style formatting applied to the document copy and paste the script in a text document (using bloc note or.Scribus.sizeObject(w, original_height, frame) # undo the latest 10pt step and fine adjust in 1pt steps While (scribus.textOverflows(frame) > 0) : While ((scribus.textOverflows(frame) = 0) and (h > 0)) : # if the frame doesn't overflow, shorten it to make it overflow (dl, dr, dt, db) = scribus.getTextDistances() ssageBox('Error:', 'You can\' center a text which is overflowing') ssageBox('Error:', 'You can\'t adjust an empty frame') ssageBox('Error:', 'You may only adjust text frames') ssageBox('Error:', 'You may select only one frame') # check that the selection is one text frame and get that frame Print "This script only works from within Scribus" To exactly put its content in the middle of the alessandro 1.0 / (c) 2009 alessandro rimoldi under the mit license This script adjust the top and bottom distance of a text frame ![]() Here is the script (if needed, a brief instruction on how to use the script follows these lines of code): #!/usr/bin/python and with multiple paragraphs of different styles.doing so automatically even when the linespacing and/or the first line offset is changed afterwards. ![]() ![]() They'll show how different Scribus is to a word processor and you'll find things much easier afterwards.Using Scribus 1.4.6, the following script center (vertical) align the content of a text frame by Alessandro Rimoldi was able to vertically align the text within a text frame: I'd agree with Nermander that you should have a look at some of the tutorials first. It might be a little over the top but at least I know that it's just text that's going in there and no hidden control characters or whatever.) (Sometimes you can't be sure exactly what the copy function actually copies and it might bring something along that messes something up in the future. Personally, if there isn't too much text, I'd go for the copy/paste route - possibly via a basic text editor - just to make sure there were no strange character/style issues. ![]() However, if you want to start from a "cleaner" text, you can - as Wena mentioned - copy and paste the text from Word to either the Story Editor or directly into a frame. Then you can use the "Get Text" function of a text frame to import the text, again as already said. The "safer" route seems to be, as Nermander first suggested, opening the DOC in OpenOffice or LibreOffice and saving as ODT there rather than trusting the Word export function. Importing text from an ODT, as mentioned above, is a good way to get text into your Scribus document - and in certain circumstances you can also preserve paragraph styles with a bit of work - but be aware that there may be a problem with ODT files exported from Word.
0 Comments
Leave a Reply. |