[scribus] Image to frame "spacing"
Ken Springer
snowshed1 at q.com
Wed Jan 25 21:51:00 UTC 2017
On 1/25/17 12:58 PM, Gregory Pittman wrote:
>
>>> You can do this by adjusting the scaling, but there are no measurements
>>> to help you -- you just "eyeball it".
>>
>> Hi, Greg,
>>
>> Sorry for the late reply, other life activities took priority. LOL
>>
>> Scaling did what I was looking for, and I got things more or less
>> centered. <G>
>>
>> It would be nice if, in a future version of Scrbus, the ability to
>> automatically center the newly scaled image vertically and horizontally
>> in the frame would be convenient. Along with next to each edge of the
>> frame.
>>
>>
>
> Here is something that might help a bit. On the wiki there is a script
> that will place guides at the borders of a frame or object:
>
> https://wiki.scribus.net/canvas/Making_Guides_at_an_Object%27s_Borders
>
> Here is a modification that will create borders inside the borders of a
> frame, to create a space 80% of the original dimensions.
> *******begin script*******
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
>
> import scribus
>
> if scribus.haveDoc():
> try:
> f = scribus.getSelectedObject()
> xpos, ypos = scribus.getPosition(f)
> width, height = scribus.getSize(f)
> scribus.setHGuides(scribus.getHGuides() + [ypos + 0.1*height,
> ypos + height - 0.1*height])
> scribus.setVGuides(scribus.getVGuides() + [xpos + 0.1*width,
> xpos + width - 0.1*width])
> scribus.setRedraw(1)
> except:
> result = scribus.messageBox('Error', 'You must select an object')
> sys.exit(1)
>
> else:
> result = scribus.messageBox('Error','You need a Document open')
> *******end script*******
>
> In the math there, I am moving the guides from the edges inward, 10%.
> Since I'm moving from each side, this is a total reduction of 20% of the
> width and height. Change the decimals to your liking -- if you only
> wanted a total reduction of 10%, then make each decimal 0.05, for
> example. It would also be possible to add a valueDialog() so that you
> could enter a reduction percentage or decimal.
>
> The usage in your case would go something like this.
> Make your original image frame, load an image and adjust frame size
> (presumably you want a proportional scaling).
> Now run this script, creating the guides.
> Adjust the scaling of your image (easy way is to lock the X-Y scaling,
> then multiply one of the values by 0.8 -- add *0.8 to the spinbox and
> press Return, it does the math for you and both values change since
> they're locked).
> Now adjust the X-Pos and Y-Pos in the Image tab so that your scaled down
> image fits the guides. What would also work would be to add 10% of the
> width of the frame to the X-Pos in Image and 10% of the height to Y-Pos
> in Image.
>
> If the guides are annoying afterward, either delete them or uncheck View
>> Grids and Guides > Show Guides.
Greg, I really appreciate your efforts for the scripting, and I'm sure
there are Scribus user who can do this as easy as brushing their teeth. LOL
But for me, that's above my abilities, I'm afraid.
--
Ken
Mac OS X 10.11.6
Firefox 49.0.1
Thunderbird 45.3.0
"My brain is like lightning, a quick flash
and it's gone!"
More information about the scribus
mailing list