CalendarWizard: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
(Created page with "CalendarWizard.py has been one of the script included with Scribus for quite some time. It's a complex script that uses tkinter to create a multisetting dialog to set various...")
 
No edit summary
Line 11: Line 11:
Here a "golden mean" is calculated, and this is used to determine the size of the calendar area at the bottom. ((sqrt(5) - 1)/2) is going to be a bit less than half.
Here a "golden mean" is calculated, and this is used to determine the size of the calendar area at the bottom. ((sqrt(5) - 1)/2) is going to be a bit less than half.


If we changed this to simple half, and comment out the original line:
If we changed this to simply half, and comment out the original line:
<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
     def goldenMean(self, aSize):
     def goldenMean(self, aSize):
Line 18: Line 18:
#        return aSize * ((sqrt(5) - 1)/2)
#        return aSize * ((sqrt(5) - 1)/2)
</syntaxhighlight>
</syntaxhighlight>
===The result===
Here is the result of this change. This is on a US Letter page.
[[File:Calendarwizard_results.png]]

Revision as of 14:54, 11 December 2016

CalendarWizard.py has been one of the script included with Scribus for quite some time. It's a complex script that uses tkinter to create a multisetting dialog to set various parameters. Something which is hard-coded into the script is the layout, which makes some calculations based on the page size and its margins, and the proportion allotted to the actual calendar space at the bottom is assigned.

I was disappointed that this careful calculation ends up with a very large image frame which seems to crowd out the business part of the calendar. Manually editing the final calendar is certainly possible, but some work, and a lot of work if you would be trying to edit an entire year, therefore I searched the script to try to find where this space distribution was determined. I was able to find a point to edit the script minimally to produced a redistribution of the spaces.

Look at this section:

    def goldenMean(self, aSize):
        """ Taken from samples/golden-mean.py."""
        return aSize * ((sqrt(5) - 1)/2)

Here a "golden mean" is calculated, and this is used to determine the size of the calendar area at the bottom. ((sqrt(5) - 1)/2) is going to be a bit less than half.

If we changed this to simply half, and comment out the original line:

    def goldenMean(self, aSize):
        """ Taken from samples/golden-mean.py."""
       return aSize * 1/2
#        return aSize * ((sqrt(5) - 1)/2)

The result

Here is the result of this change. This is on a US Letter page.

Calendarwizard results.png