def __init__(self, dinfo, char, nchars):
     PostscriptPage.__init__(self, dinfo)
     self.char = char  # char to year
     self.nchars = nchars  # number of chars to use for calendars
     # Configurable variables
     self.mvprop = 0.92  # proportion of month box that gets printed in
     self.mhprop = 0.90  # proportion of month box that gets printed in
 def __init__(self, dinfo, char, nchars):
     PostscriptPage.__init__(self, dinfo)
     self.char = char                # char to year
     self.nchars = nchars            # number of chars to use for calendars
     # Configurable variables
     self.mvprop = 0.92              # proportion of month box that gets printed in
     self.mhprop = 0.90              # proportion of month box that gets printed in
Example #3
0
 def __init__(self,month1,nmonths,dinfo):
     PostscriptPage.__init__(self,dinfo)
     self.nmonths = nmonths
     self.month1 = month1
     self.fontsize = self.di.subtitleFontSize
     self.titleheight = self.fontsize * 2.0
     self.monthheight = float(self.pHeight) / float(self.nmonths)
     self.monthwidth = self.pWidth - self.titleheight
     self.column1x = self.monthwidth * (1.0 - 2.0*self.inoutcolumnwidths)
     self.column2x = self.monthwidth * (1.0 - self.inoutcolumnwidths)
Example #4
0
    def setMargins(self):
        """Override setMargins() specially for diary pages."""
        PostscriptPage.setMargins(self)
        di = self.di
        self.pTop_diary = di.pageHeight - di.tMargin
        self.pHeight_diary = self.pTop_diary - self.pBottom
        self.ptop_diary = 0
        self.pheight_diary = 0

        if di.layout == "week-to-opening":
            self.dheight = self.pHeight_diary / 4.0
        elif di.layout == "week-to-page" or di.layout == "week-with-notes":
            self.dheight = self.pHeight_diary / 7.0
        elif di.layout == "day-to-page":
            self.dheight = self.pHeight_diary * 0.9
            self.bottomcalheight = self.pHeight_diary - self.dheight
        elif di.layout == "work":
            self.dheight = self.pHeight_diary * 0.45
            self.bottomcalheight = self.pHeight_diary - self.dheight * 2.0
            self.weekendDheight = self.dheight / 2.0
        else:
            self.dheight = self.pHeight_diary / 2.0
        self.dwidth = self.pWidth

        # In here, "app" is short for appointment.
        if di.appointments:
            self.appProportion = self.di.appointmentWidth / 100.0  # Proportion of page width
            self.appLeft = self.dwidth * (1.0 - self.appProportion)
            self.appRight = self.dwidth
            self.appWidth = self.appRight - self.appLeft
            self.dwidthLines = self.appLeft - 0.2 * di.lineSpacing
        else:
            self.dwidthLines = self.pWidth

        # These are the settings that have the most effect on the layout of a day.
        if di.layout == "week-to-opening" or di.layout == "week-to-page":
            # Smaller boxes when we cram a week into one or two pages
            self.titleboxsize = di.lineSpacing * 1.2
        else:
            self.titleboxsize = di.lineSpacing * 1.4
        self.titleboxy = self.dheight - self.titleboxsize
        self.titlefontsize = self.titleboxsize * 0.63
        self.titlefonty = self.dheight - self.titleboxsize * 0.7
        if self.di.dayTitleBoxes:
            # If we're printing boxes around the title, move the title text in slightly so it's
            # inside the box.
            self.titlefontgap = self.titlefontsize * 0.5
        else:
            # No boxes, so put the title text at the edge.
            self.titlefontgap = 0
        self.subtitlefontsize = self.titleboxsize * 0.35

        # Number of writing lines
        self.nlines = int(self.titleboxy / di.lineSpacing)
Example #5
0
    def setMargins(self):
        """Override setMargins() specially for diary pages."""
        PostscriptPage.setMargins(self)
        di = self.di
        self.pTop_diary = di.pageHeight - di.tMargin
        self.pHeight_diary = self.pTop_diary - self.pBottom
        self.ptop_diary = 0
        self.pheight_diary = 0

        if di.layout == "week-to-opening":
            self.dheight = self.pHeight_diary/4.0
        elif di.layout == "week-to-page" or di.layout == "week-with-notes":
            self.dheight = self.pHeight_diary/7.0
        elif di.layout == "day-to-page":
            self.dheight = self.pHeight_diary * 0.9
            self.bottomcalheight = self.pHeight_diary - self.dheight
        elif di.layout == "work":
            self.dheight = self.pHeight_diary * 0.45
            self.bottomcalheight = self.pHeight_diary - self.dheight * 2.0
            self.weekendDheight = self.dheight / 2.0
        else:
            self.dheight = self.pHeight_diary/2.0
        self.dwidth = self.pWidth

        # In here, "app" is short for appointment.
        if di.appointments:
            self.appProportion = self.di.appointmentWidth /100.0 # Proportion of page width
            self.appLeft = self.dwidth * (1.0 - self.appProportion)
            self.appRight = self.dwidth
            self.appWidth = self.appRight - self.appLeft
            self.dwidthLines = self.appLeft - 0.2*di.lineSpacing
        else:
            self.dwidthLines = self.pWidth

        # These are the settings that have the most effect on the layout of a day.
        if di.layout == "week-to-opening" or di.layout == "week-to-page":
            # Smaller boxes when we cram a week into one or two pages
            self.titleboxsize = di.lineSpacing * 1.2
        else:
            self.titleboxsize = di.lineSpacing * 1.4
        self.titleboxy = self.dheight - self.titleboxsize
        self.titlefontsize = self.titleboxsize * 0.63
        self.titlefonty = self.dheight - self.titleboxsize * 0.7
        if self.di.dayTitleBoxes:
            # If we're printing boxes around the title, move the title text in slightly so it's
            # inside the box.
            self.titlefontgap = self.titlefontsize * 0.5
        else:
            # No boxes, so put the title text at the edge.
            self.titlefontgap = 0
        self.subtitlefontsize = self.titleboxsize * 0.35

        # Number of writing lines
        self.nlines = int(self.titleboxy / di.lineSpacing)
Example #6
0
 def __init__(self, dinfo, imgfilename, imagetitle=None, left=0.0, right=1.0):
     PostscriptPage.__init__(self, dinfo)
     self.imgfilename = imgfilename
     self.imagetitle = imagetitle
     assert left >= 0.0
     assert right > 0.0
     assert left < 1.0
     assert right <= 1.0
     assert left < right
     assert (right - left) > 0.1
     self.left = left
     self.right = right
Example #7
0
 def __init__(self,dinfo):
     PostscriptPage.__init__(self,dinfo)
     self.otherdaygray = (1.0+self.di.titleGray)/2.0
     self.weekendgray = self.di.titleGray
     # When we print six month calendars across the bottom of a page, there will (obviously)
     # be 12 calendars across an opening.  We want the left page of the opening to have the
     # five months before the current month, and the current month, and the right page to
     # have the six months after the current month.  Because the current month can change in
     # the course of printing an opening (or even in the course of printing a page) we save
     # the date of the first day printed on the opening, and then we can refer to that when
     # printing month calendars on both the pages of the opening.  The first page of an
     # opening is always an even page.  Currently, we always start a year of diary pages on
     # an even page.  This will have to be revisited if that changes.
     if self.di.evenPage:
         self.di.openingCalendarsCurrentDate = self.di.dt
Example #8
0
 def __init__(self,dinfo):
     PostscriptPage.__init__(self,dinfo)
     self.otherdaygray = (1.0+self.di.titleGray)/2.0
     self.weekendgray = self.di.titleGray
     # When we print six month calendars across the bottom of a page, there will (obviously)
     # be 12 calendars across an opening.  We want the left page of the opening to have the
     # five months before the current month, and the current month, and the right page to
     # have the six months after the current month.  Because the current month can change in
     # the course of printing an opening (or even in the course of printing a page) we save
     # the date of the first day printed on the opening, and then we can refer to that when
     # printing month calendars on both the pages of the opening.  The first page of an
     # opening is always an even page.  Currently, we always start a year of diary pages on
     # an even page.  This will have to be revisited if that changes.
     if self.di.evenPage:
         self.di.openingCalendarsCurrentDate = self.di.dt
Example #9
0
 def __init__(self, year, startingmonth, nmonths, dinfo, doEvents):
     PostscriptPage.__init__(self, dinfo)
     self.nondaygray = self.di.titleGray
     self.weekendgray = (1.0+self.di.titleGray)/2.0
     self.titlegray = self.weekendgray
     self.year = year
     self.startingmonth = startingmonth
     self.nmonths = nmonths
     self.top = self.pTop - 2.0 # was 5.0
     self.bottom = self.pBottom + 2.0 # was 5.0
     self.lineheight = float(self.top - self.bottom) / float(self.nlines)
     self.daywidth = self.lineheight * 2
     self.monthwidth = float(self.pWidth - self.daywidth) / nmonths
     self.fontsize = self.lineheight * 0.7
     self.textb = self.lineheight * 0.2
     self.titleboxThick = self.di.underlineThick / 2.0
     self.doEvents = doEvents
Example #10
0
 def __init__(self,
              dinfo,
              imgfilename,
              imagetitle=None,
              left=0.0,
              right=1.0):
     PostscriptPage.__init__(self, dinfo)
     self.imgfilename = imgfilename
     self.imagetitle = imagetitle
     assert left >= 0.0
     assert right > 0.0
     assert left < 1.0
     assert right <= 1.0
     assert left < right
     assert (right - left) > 0.1
     self.left = left
     self.right = right
 def __init__(self, dinfo):
     PostscriptPage.__init__(self, dinfo)
     self.linenum = 1                #
     self.linespacing = 0            #
     self.minlines = 20              # Required no of lines to fit in all our info
Example #12
0
 def __init__(self, dinfo, epsfilename, epstitle=None):
     PostscriptPage.__init__(self, dinfo)
     self.epsfilename = epsfilename
     self.epstitle = epstitle
Example #13
0
 def __init__(self,dinfo):
     PostscriptPage.__init__(self,dinfo)
Example #14
0
 def __init__(self, di, thetitle):
     PostscriptPage.__init__(self, di)
     self.thetitle = thetitle
Example #15
0
 def __init__(self, dinfo, notesTitle="Notes"):
     self.notesTitle = notesTitle
     PostscriptPage.__init__(self, dinfo)
Example #16
0
 def __init__(self, di, thetitle):
     PostscriptPage.__init__(self, di)
     self.thetitle = thetitle
 def __init__(self, dinfo):
     PostscriptPage.__init__(self, dinfo)
     self.linenum = 1  #
     self.linespacing = 0  #
     self.minlines = 20  # Required no of lines to fit in all our info
Example #18
0
 def __init__(self, dinfo, epsfilename, epstitle=None):
     PostscriptPage.__init__(self, dinfo)
     self.epsfilename = epsfilename
     self.epstitle = epstitle