Difference between revisions of "CalendarWizard"

From Scribus Wiki
Jump to: navigation, search
(The result)
Line 19: Line 19:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
===The result===
 
===The result===
Here is the result of this change. This is on a US Letter page.  
+
Here is the result of this change, on US Letter pages. The left document uses the original calculation, and the right this simple 50% calculation. This can probably be improved upon according to taste, but now you can see a specific point to make a big impact.
  
 
[[File:Calendarwizard_results.png]]
 
[[File:Calendarwizard_results.png]]

Revision as of 14:57, 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, on US Letter pages. The left document uses the original calculation, and the right this simple 50% calculation. This can probably be improved upon according to taste, but now you can see a specific point to make a big impact.

Calendarwizard results.png