def make_default_style(self, default_style):
        """Make the default output style for the Person Everything Report."""
        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=12, bold=1)
        para = ParagraphStyle()
        para.set_header_level(1)
        para.set_bottom_border(1)
        para.set_top_margin(ReportUtils.pt2cm(3))
        para.set_bottom_margin(ReportUtils.pt2cm(3))
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_description(_("The style used for the title of the page."))
        default_style.add_paragraph_style("PE-Title", para)

        font = FontStyle()
        font.set(face=FONT_SERIF, size=10)
        for i in range(1, 33):
            para = ParagraphStyle()
            para.set_font(font)
            para.set_top_margin(ReportUtils.pt2cm(font.get_size() * 0.125))
            para.set_bottom_margin(ReportUtils.pt2cm(font.get_size() * 0.125))
            para.set_left_margin(min(10.0, float(i - 1.0)))
            para.set_description(
                _("The style used for the "
                  "level %d display.") % i)
            default_style.add_paragraph_style("PE-Level%d" % min(i, 32), para)

        add_endnote_styles(default_style)
    def __stat_right_style(self):
        """
        Define the style used for the stat table right
        """
        font = FontStyle()
        font.set(face=FONT_SERIF, size=10)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_RIGHT)       
        para.set_description(_('The style used for the stat table right.'))
        self.default_style.add_paragraph_style("SRC-StatCell", para)

#    def __personevent_table_style(self):
        """
        Define the style used for personevent table
        """
        table = TableStyle()
        table.set_width(100)
        table.set_columns(7)
        table.set_column_width(0, 5)
        table.set_column_width(1, 35)
        table.set_column_width(2, 10)
        table.set_column_width(3, 15)
        table.set_column_width(4, 15)
        table.set_column_width(5, 15)
        table.set_column_width(6, 30)
        
        self.default_style.add_table_style("SRC-PersonEventTable", table)
Beispiel #3
0
    def __stat_right_style(self):
        """
        Define the style used for the stat table right
        """
        font = FontStyle()
        font.set(face=FONT_SERIF, size=10)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_RIGHT)
        para.set_description(_('The style used for the stat table right.'))
        self.default_style.add_paragraph_style("SRC-StatCell", para)

        #    def __personevent_table_style(self):
        """
        Define the style used for personevent table
        """
        table = TableStyle()
        table.set_width(100)
        table.set_columns(7)
        table.set_column_width(0, 5)
        table.set_column_width(1, 35)
        table.set_column_width(2, 10)
        table.set_column_width(3, 15)
        table.set_column_width(4, 15)
        table.set_column_width(5, 15)
        table.set_column_width(6, 30)

        self.default_style.add_table_style("SRC-PersonEventTable", table)
 def __details_style(self):
     """
     Define the style used for person and event details
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=10)
     para = ParagraphStyle()
     para.set_font(font)
     para.set_description(_('The style used for event and person details.'))
     self.default_style.add_paragraph_style("PLC-Details", para)
Beispiel #5
0
 def __details_style(self):
     """
     Define the style used for person and event details
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=10)
     para = ParagraphStyle()
     para.set_font(font)
     para.set_description(_('The style used for event and person details.'))
     self.default_style.add_paragraph_style("PLC-Details", para)
Beispiel #6
0
    def make_default_style(self, default_style):
        """Make the default output style for the Simple Boot Title report."""
        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=16, bold=1, italic=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_header_level(1)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set(pad=0.5)
        para.set_description(_("The style used for the title of the page."))
        default_style.add_paragraph_style("SBT-Title", para)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=14, italic=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_header_level(2)
        para.set(pad=0.5)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_description(_("The style used for the subtitle."))
        default_style.add_paragraph_style("SBT-Subtitle", para)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=10, italic=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_header_level(2)
        para.set(pad=0.5)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_description(_("The style used for the footer."))
        default_style.add_paragraph_style("SBT-Footer", para)
Beispiel #7
0
    def make_default_style(self, default_style):
        """Make the default output style for the Custom Text report."""
        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=12, bold=0, italic=0)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set(pad=0.5)
        para.set_description(_('Text to display at the top'))
        default_style.add_paragraph_style("CBT-Initial", para)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=12, bold=0, italic=0)
        para = ParagraphStyle()
        para.set_font(font)
        para.set(pad=0.5)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_description(_('Text to display in the middle'))
        default_style.add_paragraph_style("CBT-Middle", para)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=12, bold=0, italic=0)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set(pad=0.5)
        para.set_description(_('Text to display at the bottom'))
        default_style.add_paragraph_style("CBT-Final", para)
Beispiel #8
0
    def make_default_style(self,default_style):
        """Make the default output style for the Custom Text report."""
        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=12, bold=0, italic=0)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set(pad=0.5)
        para.set_description(_('The style used for the first portion of the custom text.'))
        default_style.add_paragraph_style("CBT-Initial", para)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=12, bold=0, italic=0)
        para = ParagraphStyle()
        para.set_font(font)
        para.set(pad=0.5)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_description(_('The style used for the middle portion of the custom text.'))
        default_style.add_paragraph_style("CBT-Middle", para)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=12, bold=0, italic=0)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set(pad=0.5)
        para.set_description(_('The style used for the last portion of the custom text.'))
        default_style.add_paragraph_style("CBT-Final", para)
 def __place_details_godparents_style(self):
     """
     Define the style used for the place details
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=10, italic=1, bold=0)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=0, lmargin=4.5)
     para.set_description(_('The style used for Godparents details.'))
     self.default_style.add_paragraph_style("PLC-Godparents", para)        
 def __place_details_children_style(self):
     """
     Define the style used for the place details
     """
     font = FontStyle()
     font.set(face=FONT_SANS_SERIF, size=10)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=-2.0, lmargin=4.5)
     para.set_description(_('The style used for place details.'))
     self.default_style.add_paragraph_style("PLC-PlaceDetailsChildren", para)
 def __place_details_godparents_style(self):
     """
     Define the style used for the place details
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=10, italic=1, bold=0)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=0, lmargin=4.5)
     para.set_description(_('The style used for Godparents details.'))
     self.default_style.add_paragraph_style("PLC-Godparents", para)
 def __column_title_style(self):
     """
     Define the style used for the event table column title
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=10, bold=1)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=0.0, lmargin=0.0)
     para.set_description(_('The style used for a column title.'))
     self.default_style.add_paragraph_style("SRC-ColumnTitle", para)
Beispiel #13
0
 def __source_details_style(self):
     """
     Define the style used for the place details
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=10)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=0.0, lmargin=0.0)
     para.set_description(_('The style used for Source details.'))
     self.default_style.add_paragraph_style("SRC-SourceDetails", para)
 def __place_details_children_style(self):
     """
     Define the style used for the place details
     """
     font = FontStyle()
     font.set(face=FONT_SANS_SERIF, size=10)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=-2.0, lmargin=4.5)
     para.set_description(_('The style used for place details.'))
     self.default_style.add_paragraph_style("PLC-PlaceDetailsChildren", para)
Beispiel #15
0
 def __column_title_style(self):
     """
     Define the style used for the event table column title
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=10, bold=1)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=0.0, lmargin=0.0)
     para.set_description(_('The style used for a column title.'))
     self.default_style.add_paragraph_style("SRC-ColumnTitle", para)
 def __source_subtitle_style(self):
     """
     Define the style used for the source subtitle
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=11, italic=0, bold=1)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=0.0, lmargin=0.0)
     para.set_description(_('The style used for source subtitle.'))
     self.default_style.add_paragraph_style("SRC-SourceSubTitle", para)
 def __source_details_style(self):
     """
     Define the style used for the place details
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=10)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=0.0, lmargin=0.0)
     para.set_description(_('The style used for Source details.'))
     self.default_style.add_paragraph_style("SRC-SourceDetails", para)
Beispiel #18
0
    def __repository_title_style(self):
        """
        Define the style used for the repository title
        """

        font = FontStyle()
        font.set(face=FONT_SERIF, size=14, italic=0, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_top_margin(ReportUtils.pt2cm(10))
        para.set_bottom_margin(ReportUtils.pt2cm(7))
        para.set_description(_('The style used for repository title.'))
        self.default_style.add_paragraph_style('REPO-RepositoryTitle', para)
 def __report_footer_style(self):
     """
     Define the style used for the report footer
     """
     font = FontStyle()
     font.set(face=FONT_SANS_SERIF, size=10, bold=1)
     para = ParagraphStyle()
     para.set_font(font)
     para.set_alignment(PARA_ALIGN_CENTER)
     para.set_top_border(True)
     para.set_top_margin(utils.pt2cm(6))
     para.set_description(_('The style used for the footer of the report.'))
     self.default_style.add_paragraph_style("SRC-Footer", para)
    def __repository_title_style(self):
        """
        Define the style used for the repository title
        """

        font = FontStyle()
        font.set(face=FONT_SERIF, size=14, italic=0, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_top_margin(ReportUtils.pt2cm(10))
        para.set_bottom_margin(ReportUtils.pt2cm(7))
        para.set_description(_('The style used for repository title.'))
        self.default_style.add_paragraph_style('REPO-RepositoryTitle', para)
Beispiel #21
0
 def __section_style(self):
     """
     Define the style used for each section
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=10, italic=0, bold=0)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=-1.5, lmargin=1.5)
     para.set_top_margin(0.5)
     para.set_bottom_margin(0.25)
     para.set_description(_('The basic style used for the text display.'))
     self.default_style.add_paragraph_style("PLC-Section", para)
 def __section_style(self):
     """
     Define the style used for each section
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=10, italic=0, bold=0)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=-1.5, lmargin=1.5)
     para.set_top_margin(0.5)
     para.set_bottom_margin(0.25)
     para.set_description(_('The style used for each section.'))
     self.default_style.add_paragraph_style("PLC-Section", para)
Beispiel #23
0
 def __place_title_style(self):
     """
     Define the style used for the place title
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=12, italic=0, bold=1)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=-1.5, lmargin=1.5)
     para.set_top_margin(0.75)
     para.set_bottom_margin(0.25)
     para.set_description(_('The style used for the section headers.'))
     self.default_style.add_paragraph_style("PLC-PlaceTitle", para)
 def __section_style(self):
     """
     Define the style used for each section
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=10, italic=0, bold=0)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=-1.5, lmargin=1.5)
     para.set_top_margin(ReportUtils.pt2cm(10))
     para.set_bottom_margin(ReportUtils.pt2cm(10))       
     para.set_description(_('The style used for each section.'))
     self.default_style.add_paragraph_style("REPO-Section", para)
Beispiel #25
0
    def make_default_style(self, default_style):
        """Make the default output style for the AlphabeticalIndex report."""
        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=14)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for the title.'))
        default_style.add_paragraph_style("IDX-Title", para)

        table = TableStyle()
        table.set_width(100)
        table.set_columns(2)
        table.set_column_width(0, 80)
        table.set_column_width(1, 20)
        default_style.add_table_style("IDX-Table", table)

        cell = TableCellStyle()
        default_style.add_cell_style("IDX-Cell", cell)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=10)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style("IDX-Entry", para)
    def make_default_style(self, default_style):
        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=16, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_header_level(1)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_description(_('The style used for the title of the page.'))
        default_style.add_paragraph_style("LOD-Title", para)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=15, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set(lmargin=1.5)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for the title of a line.'))
        default_style.add_paragraph_style("LOD-Line", para)

        para = ParagraphStyle()
        para.set(lmargin=1.5)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style("LOD-Entry", para)
 def __citation_title_style(self):
     """
     Define the style used for the citation title
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=12, italic=0, bold=1)
     para = ParagraphStyle()
     para.set_font(font)
     para.set_header_level(3)
     para.set(first_indent=0.0, lmargin=0.0)
     para.set_top_margin(0.75)
     para.set_bottom_margin(0.0)        
     para.set_description(_('The style used for citation title.'))
     self.default_style.add_paragraph_style("SRC-CitationTitle", para)
 def __report_title_style(self):
     """
     Define the style used for the report title
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=16, bold=1)
     para = ParagraphStyle()
     para.set_font(font)
     para.set_header_level(1)
     para.set_top_margin(0.25)
     para.set_bottom_margin(0.25)
     para.set_alignment(PARA_ALIGN_CENTER)       
     para.set_description(_('The style used for the title of the report.'))
     self.default_style.add_paragraph_style("SRC-ReportTitle", para)
    def make_default_style(self, default_style):
        """Make the default output style for the Person Everything Report."""
        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=12, bold=1)
        para = ParagraphStyle()
        para.set_header_level(1)
        para.set_bottom_border(1)
        para.set_top_margin(ReportUtils.pt2cm(3))
        para.set_bottom_margin(ReportUtils.pt2cm(3))
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_description(_("The style used for the title of the page."))
        default_style.add_paragraph_style("PE-Title", para)

        font = FontStyle()
        font.set(face=FONT_SERIF, size=10)
        for i in range(1, 33):
            para = ParagraphStyle()
            para.set_font(font)
            para.set_top_margin(ReportUtils.pt2cm(font.get_size()*0.125))
            para.set_bottom_margin(ReportUtils.pt2cm(font.get_size()*0.125))
            para.set_left_margin(min(10.0, float(i-1.0)))
            para.set_description(_("The style used for the "
                                "level %d display.") % i)
            default_style.add_paragraph_style("PE-Level%d" % min(i, 32), para)

        add_endnote_styles(default_style)
 def __report_footer_style(self):
     """
     Define the style used for the report footer
     """        
     
     font = FontStyle()
     font.set_size(8)
     para = ParagraphStyle()
     para.set_font(font)
     para.set_alignment(PARA_ALIGN_CENTER)
     para.set_top_border(True)
     para.set_top_margin(ReportUtils.pt2cm(8))
     para.set_description(_('The style used for the footer.'))
     self.default_style.add_paragraph_style('SRC-Footer', para)
Beispiel #31
0
 def __report_title_style(self):
     """
     Define the style used for the report title
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=16, bold=1)
     para = ParagraphStyle()
     para.set_font(font)
     para.set_header_level(1)
     para.set_top_margin(0.25)
     para.set_bottom_margin(0.25)
     para.set_alignment(PARA_ALIGN_CENTER)
     para.set_description(_('The style used for the title of the report.'))
     self.default_style.add_paragraph_style("SRC-ReportTitle", para)
    def __child_section_style(self):
        """
        Define the style used for secondary section
        """

        font = FontStyle()
        font.set(face=FONT_SERIF, size=10, italic=1, bold=0)
        para = ParagraphStyle()
        para.set_font(font)
        para.set(first_indent=0, lmargin=1)
        para.set_top_margin(ReportUtils.pt2cm(1))
        para.set_bottom_margin(ReportUtils.pt2cm(1))
        para.set_description(_('The style used for child section.'))
        self.default_style.add_paragraph_style('REPO-Section2', para)
Beispiel #33
0
    def __report_footer_style(self):
        """
        Define the style used for the report footer
        """

        font = FontStyle()
        font.set_size(8)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_top_border(True)
        para.set_top_margin(ReportUtils.pt2cm(8))
        para.set_description(_('The style used for the footer.'))
        self.default_style.add_paragraph_style('SRC-Footer', para)
Beispiel #34
0
    def __child_section_style(self):
        """
        Define the style used for secondary section
        """

        font = FontStyle()
        font.set(face=FONT_SERIF, size=10, italic=1, bold=0)
        para = ParagraphStyle()
        para.set_font(font)
        para.set(first_indent=0, lmargin=1)
        para.set_top_margin(ReportUtils.pt2cm(1))
        para.set_bottom_margin(ReportUtils.pt2cm(1))
        para.set_description(_('The style used for child section.'))
        self.default_style.add_paragraph_style('REPO-Section2', para)
Beispiel #35
0
 def __citation_title_style(self):
     """
     Define the style used for the citation title
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=12, italic=0, bold=1)
     para = ParagraphStyle()
     para.set_font(font)
     para.set_header_level(3)
     para.set(first_indent=0.0, lmargin=0.0)
     para.set_top_margin(0.75)
     para.set_bottom_margin(0.0)
     para.set_description(_('The style used for citation title.'))
     self.default_style.add_paragraph_style("SRC-CitationTitle", para)
Beispiel #36
0
 def make_my_style(self,
                   default_style,
                   name,
                   description,
                   size=9,
                   font=FONT_SERIF,
                   justified="left",
                   color=None,
                   align=PARA_ALIGN_CENTER,
                   shadow=None,
                   italic=0,
                   bold=0,
                   borders=0,
                   indent=None):
     """ Create paragraph and graphic styles of the same name """
     # Paragraph:
     f = FontStyle()
     f.set_size(size)
     f.set_type_face(font)
     f.set_italic(italic)
     f.set_bold(bold)
     p = ParagraphStyle()
     p.set_font(f)
     p.set_alignment(align)
     p.set_description(description)
     p.set_top_border(borders)
     p.set_left_border(borders)
     p.set_bottom_border(borders)
     p.set_right_border(borders)
     if indent:
         p.set(first_indent=indent)
     if justified == "left":
         p.set_alignment(PARA_ALIGN_LEFT)
     elif justified == "right":
         p.set_alignment(PARA_ALIGN_RIGHT)
     elif justified == "center":
         p.set_alignment(PARA_ALIGN_CENTER)
     default_style.add_paragraph_style(name, p)
     # Graphics:
     g = GraphicsStyle()
     g.set_paragraph_style(name)
     if shadow:
         g.set_shadow(*shadow)
     if color is not None:
         g.set_fill_color(color)
     if not borders:
         g.set_line_width(0)
     default_style.add_draw_style(name, g)
Beispiel #37
0
 def __note_text_style(self):
     """
     Define the style used for the place details
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=10)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=0.0, lmargin=0.0)
     para.bgcolor = (255,0,0)
     para.set_description(_('The style used for Note Text.'))
     para.set_top_border(True)
     para.set_left_border(True)
     para.set_right_border(True)
     para.set_bottom_border(True)
     self.default_style.add_paragraph_style("SRC-NoteText", para)
    def __report_title_style(self):
        """
        Define the style used for the report title
        """

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=20, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_header_level(1)
        para.set_bottom_border(1)
        para.set_top_margin(ReportUtils.pt2cm(20))
        para.set_bottom_margin(ReportUtils.pt2cm(20))
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_description(_('The style used for the title of the report.'))
        self.default_style.add_paragraph_style('REPO-ReportTitle', para)
Beispiel #39
0
    def __report_title_style(self):
        """
        Define the style used for the report title
        """

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=20, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_header_level(1)
        para.set_bottom_border(1)
        para.set_top_margin(ReportUtils.pt2cm(20))
        para.set_bottom_margin(ReportUtils.pt2cm(20))
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_description(_('The style used for the title of the report.'))
        self.default_style.add_paragraph_style('REPO-ReportTitle', para)
 def __note_text_style(self):
     """
     Define the style used for the place details
     """
     font = FontStyle()
     font.set(face=FONT_SERIF, size=10)
     para = ParagraphStyle()
     para.set_font(font)
     para.set(first_indent=0.0, lmargin=0.0)
     para.bgcolor = (255,0,0)
     para.set_description(_('The style used for Note Text.'))
     para.set_top_border(True)
     para.set_left_border(True)
     para.set_right_border(True)
     para.set_bottom_border(True)
     self.default_style.add_paragraph_style("SRC-NoteText", para)
def add_endnote_styles(style_sheet):
    """
    Add paragraph styles to a style sheet to be used for displaying endnotes.
    
    @param style_sheet: Style sheet
    @type style_sheet: L{docgen.StyleSheet}
    """

    font = FontStyle()
    font.set(face=FONT_SERIF, size=10)
    para = ParagraphStyle()
    para.set_font(font)
    para.set(first_indent=-0.75, lmargin=1.00)
    para.set_top_margin(ReportUtils.pt2cm(font.get_size()*0.125))
    para.set_bottom_margin(ReportUtils.pt2cm(font.get_size()*0.125))
    para.set_description(_('The basic style used for the endnotes source display.'))
    style_sheet.add_paragraph_style("Endnotes-Source", para)
    def make_default_style(self, default_style):
        """Make the default output style for the Number of Ancestors Report."""
        font = FontStyle()
        font.set_size(16)
        font.set_type_face(FONT_SANS_SERIF)
        font.set_bold(1)
        para = ParagraphStyle()
        para.set_header_level(1)
        para.set_bottom_border(1)
        para.set_bottom_margin(ReportUtils.pt2cm(8))
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_description(_("The style used for the title of the page."))
        default_style.add_paragraph_style("NOA-Title", para)

        font = FontStyle()
        font.set_size(12)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style("NOA-Normal", para)
Beispiel #43
0
    def make_default_style(self, default_style):
        """Make the default output style for the AlphabeticalIndex report."""
        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=14)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_bottom_margin(0.25)
        para.set_description(_("The style used for the title."))
        default_style.add_paragraph_style("IDX-Title", para)

        table = TableStyle()
        table.set_width(100)
        table.set_columns(2)
        table.set_column_width(0, 80)
        table.set_column_width(1, 20)
        default_style.add_table_style("IDX-Table", table)

        cell = TableCellStyle()
        default_style.add_cell_style("IDX-Cell", cell)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=10)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_description(_("The style used for index entries."))
        default_style.add_paragraph_style("IDX-Entry", para)
    def make_default_style(self, default_style):
        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=16, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_header_level(1)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_description(_('The style used for the title of the page.'))
        default_style.add_paragraph_style("LOD-Title", para)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=15, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set(lmargin=1.5)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for the title of a line.'))
        default_style.add_paragraph_style("LOD-Line", para)

        para = ParagraphStyle()
        para.set(lmargin=1.5)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style("LOD-Entry", para)
Beispiel #45
0
 def get_optimized_font_size(self, line, font, max_width):
     """
     for a given width, guess the best font size which is equals
     or smaller than font which make line fit into max_width
     """
     test_font = FontStyle(font)
     width = utils.pt2cm(self.doc.string_width(test_font, line))
     while width > max_width and test_font.get_size() > 1:
         test_font.set_size(test_font.get_size() -1)
         width = utils.pt2cm(self.doc.string_width(test_font, line))
     return test_font.get_size()
Beispiel #46
0
    def make_default_style(default_style):
        """Define the default styling."""
        font = FontStyle()
        font.set(size=10)
        para = ParagraphStyle()
        para.set_font(font)
        default_style.add_paragraph_style("Default", para)

        font = FontStyle()
        font.set(size=16, bold=1)
        para.set_font(font)
        para.set_header_level(1)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_alignment(PARA_ALIGN_CENTER)
        default_style.add_paragraph_style("Heading", para)
Beispiel #47
0
    def make_default_style(self, default_style):
        """Make the default output style for the TableOfContents report."""
        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=14)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for the title.'))
        default_style.add_paragraph_style("TOC-Title", para)

        table = TableStyle()
        table.set_width(100)
        table.set_columns(2)
        table.set_column_width(0, 80)
        table.set_column_width(1, 20)
        default_style.add_table_style("TOC-Table", table)

        cell = TableCellStyle()
        default_style.add_cell_style("TOC-Cell", cell)

        para = ParagraphStyle()
        para.set_font(font)
        para.set_description(_('The style used for first level headings.'))
        default_style.add_paragraph_style("TOC-Heading1", para)

        para = ParagraphStyle()
        para.set_font(font)
        para.set_first_indent(0.5)
        para.set_description(_('The style used for second level headings.'))
        default_style.add_paragraph_style("TOC-Heading2", para)

        para = ParagraphStyle()
        para.set_font(font)
        para.set_first_indent(1)
        para.set_description(_('The style used for third level headings.'))
        default_style.add_paragraph_style("TOC-Heading3", para)
Beispiel #48
0
    def make_default_style(self, default_style):
        """Make the default output style for the TableOfContents report."""
        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=14)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for the title.'))
        default_style.add_paragraph_style("TOC-Title", para)

        table = TableStyle()
        table.set_width(100)
        table.set_columns(2)
        table.set_column_width(0, 80)
        table.set_column_width(1, 20)
        default_style.add_table_style("TOC-Table", table)

        cell = TableCellStyle()
        default_style.add_cell_style("TOC-Cell", cell)

        para = ParagraphStyle()
        para.set_font(font)
        para.set_description(_('The style used for first level headings.'))
        default_style.add_paragraph_style("TOC-Heading1", para)

        para = ParagraphStyle()
        para.set_font(font)
        para.set_first_indent(0.5)
        para.set_description(_('The style used for second level headings.'))
        default_style.add_paragraph_style("TOC-Heading2", para)

        para = ParagraphStyle()
        para.set_font(font)
        para.set_first_indent(1)
        para.set_description(_('The style used for third level headings.'))
        default_style.add_paragraph_style("TOC-Heading3", para)
Beispiel #49
0
    def make_default_style(self, default_style):
        """Define the default styling."""
        para = ParagraphStyle()
        default_style.add_paragraph_style("Default", para)

        font = FontStyle()
        font.set(size=16, bold=1)
        para.set_font(font)
        para.set_header_level(1)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_alignment(PARA_ALIGN_CENTER)
        default_style.add_paragraph_style("Heading", para)

        font = FontStyle()
        font.set(size=12, bold=1)
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_LEFT)
        default_style.add_paragraph_style("Heading2", para)

        cell = TableCellStyle()
        default_style.add_cell_style("cell", cell)

        tbl = TableStyle()
        tbl.set_width(100)
        tbl.set_columns(4)
        tbl.set_column_width(0, 20)
        tbl.set_column_width(1, 30)
        tbl.set_column_width(2, 20)
        tbl.set_column_width(3, 30)
        default_style.add_table_style('tbl', tbl)

        tbl = TableStyle()
        tbl.set_width(100)
        tbl.set_columns(2)
        tbl.set_column_width(0, 50)
        tbl.set_column_width(1, 50)
        default_style.add_table_style('tbl2', tbl)

        tbl = TableStyle()
        tbl.set_width(100)
        tbl.set_columns(1)
        tbl.set_column_width(0, 100)
        default_style.add_table_style('tbl3', tbl)
Beispiel #50
0
 def make_my_style(self, default_style, name, description, 
                   size=9, font=FONT_SERIF, justified ="left", 
                   color=None, align=PARA_ALIGN_CENTER, 
                   shadow = None, italic=0, bold=0, borders=0, indent=None):
     """ Create paragraph and graphic styles of the same name """
     # Paragraph:
     f = FontStyle()
     f.set_size(size)
     f.set_type_face(font)
     f.set_italic(italic)
     f.set_bold(bold)
     p = ParagraphStyle()
     p.set_font(f)
     p.set_alignment(align)
     p.set_description(description)
     p.set_top_border(borders)
     p.set_left_border(borders)
     p.set_bottom_border(borders)
     p.set_right_border(borders)
     if indent:
         p.set(first_indent=indent)
     if justified == "left":
         p.set_alignment(PARA_ALIGN_LEFT)       
     elif justified == "right":
         p.set_alignment(PARA_ALIGN_RIGHT)       
     elif justified == "center":
         p.set_alignment(PARA_ALIGN_CENTER)       
     default_style.add_paragraph_style(name, p)
     # Graphics:
     g = GraphicsStyle()
     g.set_paragraph_style(name)
     if shadow:
         g.set_shadow(*shadow)
     if color is not None:
         g.set_fill_color(color)
     if not borders:
         g.set_line_width(0)
     default_style.add_draw_style(name, g)
Beispiel #51
0
    def make_default_style(self, default_style):

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=16, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_header_level(1)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for the liste eclair.'))
        default_style.add_paragraph_style("Eclair-Report", para)
        """
        Define the style used for the place title
        """
        font = FontStyle()
        font.set(face=FONT_SERIF, size=12, italic=0, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set(first_indent=-1.5, lmargin=1.5)
        para.set_top_margin(0.75)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for place title.'))
        default_style.add_paragraph_style("Eclair-ReportTitle", para)
def add_endnote_styles(style_sheet):
    """
    Add paragraph styles to a style sheet to be used for displaying endnotes.

    @param style_sheet: Style sheet
    @type style_sheet: L{docgen.StyleSheet}
    """

    font = FontStyle()
    font.set(face=FONT_SERIF, size=10)
    para = ParagraphStyle()
    para.set_font(font)
    para.set(first_indent=-0.75, lmargin=1.00)
    para.set_top_margin(ReportUtils.pt2cm(font.get_size()*0.125))
    para.set_bottom_margin(ReportUtils.pt2cm(font.get_size()*0.125))
    para.set_description(_('The basic style used for the endnotes source display.'))
    style_sheet.add_paragraph_style("Endnotes-Source", para)
Beispiel #53
0
    def make_default_style(self, default_style):

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=16, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_header_level(1)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for the liste eclair.'))
        default_style.add_paragraph_style("Eclair-Report", para)

        """
        Define the style used for the place title
        """
        font = FontStyle()
        font.set(face=FONT_SERIF, size=12, italic=0, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set(first_indent=-1.5, lmargin=1.5)
        para.set_top_margin(0.75)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for place title.'))
        default_style.add_paragraph_style("Eclair-ReportTitle", para)
Beispiel #54
0
    def make_default_style(self, default_style):
        """Make the default output style for the Descendant Report."""
        f = FontStyle()
        f.set_size(12)
        f.set_type_face(FONT_SANS_SERIF)
        f.set_bold(1)
        p = ParagraphStyle()
        p.set_header_level(1)
        p.set_bottom_border(1)
        p.set_top_margin(ReportUtils.pt2cm(3))
        p.set_bottom_margin(ReportUtils.pt2cm(3))
        p.set_font(f)
        p.set_alignment(PARA_ALIGN_CENTER)
        p.set_description(_("The style used for the title of the page."))
        default_style.add_paragraph_style("DR-Title", p)

        f = FontStyle()
        f.set_size(10)
        for i in range(1, 33):
            p = ParagraphStyle()
            p.set_font(f)
            p.set_top_margin(ReportUtils.pt2cm(f.get_size()*0.125))
            p.set_bottom_margin(ReportUtils.pt2cm(f.get_size()*0.125))
            p.set_first_indent(-0.5)
            p.set_left_margin(min(10.0, float(i-0.5)))
            p.set_description(_("The style used for the "
                                "level %d display.") % i)
            default_style.add_paragraph_style("DR-Level%d" % min(i, 32), p)

            p = ParagraphStyle()
            p.set_font(f)
            p.set_top_margin(ReportUtils.pt2cm(f.get_size()*0.125))
            p.set_bottom_margin(ReportUtils.pt2cm(f.get_size()*0.125))
            p.set_left_margin(min(10.0, float(i-0.5)))
            p.set_description(_("The style used for the "
                                "spouse level %d display.") % i)
            default_style.add_paragraph_style("DR-Spouse%d" % min(i, 32), p)
Beispiel #55
0
    def make_default_style(self, default_style):
        """Make the default output style for the Fan Chart report."""
        background_colors = [(255, 63, 0),
                             (255, 175, 15),
                             (255, 223, 87),
                             (255, 255, 111),
                             (159, 255, 159),
                             (111, 215, 255),
                             (79, 151, 255),
                             (231, 23, 255),
                             (231, 23, 221),
                             (210, 170, 124),
                             (189, 153, 112)
                            ]

        #Paragraph Styles
        f_style = FontStyle()
        f_style.set_size(18)
        f_style.set_bold(1)
        f_style.set_type_face(FONT_SANS_SERIF)
        p_style = ParagraphStyle()
        p_style.set_font(f_style)
        p_style.set_alignment(PARA_ALIGN_CENTER)
        p_style.set_description(_('The style used for the title.'))
        default_style.add_paragraph_style("FC-Title", p_style)

        f_style = FontStyle()
        f_style.set_size(9)
        f_style.set_type_face(FONT_SANS_SERIF)
        p_style = ParagraphStyle()
        p_style.set_font(f_style)
        p_style.set_alignment(PARA_ALIGN_CENTER)
        p_style.set_description(
            _('The basic style used for the text display.'))
        default_style.add_paragraph_style("FC-Text", p_style)

        for i in range(0, self.max_generations):
            f_style = FontStyle()
            f_style.set_size(9)
            f_style.set_type_face(FONT_SANS_SERIF)
            p_style = ParagraphStyle()
            p_style.set_font(f_style)
            p_style.set_alignment(PARA_ALIGN_CENTER)
            p_style.set_description(
                _('The style used for the text display of generation "%d"') % i)
            default_style.add_paragraph_style("FC-Text" + "%02d" % i, p_style)

        # GraphicsStyles
        g_style = GraphicsStyle()
        g_style.set_paragraph_style('FC-Title')
        default_style.add_draw_style('FC-Graphic-title', g_style)

        for i in range(0, self.max_generations):
            g_style = GraphicsStyle()
            g_style.set_paragraph_style('FC-Text' + '%02d' % i)
            g_style.set_fill_color(background_colors[i])
            default_style.add_draw_style('FC-Graphic' + '%02d' % i, g_style)
Beispiel #56
0
    def make_default_style(self, default_style):
        """Make the default output style for the Note Link Report."""
        # Paragraph Styles
        f = FontStyle()
        f.set_size(16)
        f.set_type_face(FONT_SANS_SERIF)
        f.set_bold(1)
        p = ParagraphStyle()
        p.set_header_level(1)
        p.set_bottom_border(1)
        p.set_top_margin(utils.pt2cm(3))
        p.set_bottom_margin(utils.pt2cm(3))
        p.set_font(f)
        p.set_alignment(PARA_ALIGN_CENTER)
        p.set_description(_("The style used for the title of the page."))
        default_style.add_paragraph_style("NoteLink-Title", p)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=14, italic=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_header_level(2)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for the section headers.'))
        default_style.add_paragraph_style("NoteLink-Heading", para)

        font = FontStyle()
        font.set_size(12)
        p = ParagraphStyle()
        p.set(first_indent=-0.75, lmargin=.75)
        p.set_font(font)
        p.set_top_margin(utils.pt2cm(3))
        p.set_bottom_margin(utils.pt2cm(3))
        p.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style("NoteLink-Normal", p)

        font = FontStyle()
        font.set_size(12)
        font.set_bold(True)
        p = ParagraphStyle()
        p.set(first_indent=-0.75, lmargin=.75)
        p.set_font(font)
        p.set_top_margin(utils.pt2cm(3))
        p.set_bottom_margin(utils.pt2cm(3))
        p.set_description(_('The basic style used for table headings.'))
        default_style.add_paragraph_style("NoteLink-Normal-Bold", p)

        #Table Styles
        cell = TableCellStyle()
        default_style.add_cell_style('NoteLink-TableCell', cell)

        table = TableStyle()
        table.set_width(100)
        table.set_columns(4)
        table.set_column_width(0, 10)
        table.set_column_width(1, 15)
        table.set_column_width(2, 65)
        table.set_column_width(3, 10)
        default_style.add_table_style('NoteLink-Table', table)
Beispiel #57
0
    def make_default_style(self,default_style):
        """Make the default output style for the Detailed Ancestral Report"""
        font = FontStyle()
        font.set(face=FONT_SANS_SERIF,size=16,bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_header_level(1)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_description(_('The style used for the title of the page.'))
        default_style.add_paragraph_style("DAR-Title",para)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF,size=14,italic=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_header_level(2)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for the generation header.'))
        default_style.add_paragraph_style("DAR-Generation",para)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF,size=10,italic=0, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_left_margin(1.0)   # in centimeters
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for the children list title.'))
        default_style.add_paragraph_style("DAR-ChildTitle",para)

        font = FontStyle()
        font.set(size=10)
        para = ParagraphStyle()
        para.set_font(font)
        para.set(first_indent=-0.75,lmargin=1.75)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for the children list.'))
        default_style.add_paragraph_style("DAR-ChildList",para)

        font = FontStyle()
        font.set(face=FONT_SANS_SERIF,size=10,italic=0, bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set(first_indent=0.0,lmargin=1.0)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        default_style.add_paragraph_style("DAR-NoteHeader",para)

        para = ParagraphStyle()
        para.set(lmargin=1.0)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style("DAR-Entry",para)

        para = ParagraphStyle()
        para.set(first_indent=-1.0,lmargin=1.0)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for the first personal entry.'))
        default_style.add_paragraph_style("DAR-First-Entry",para)

        font = FontStyle()
        font.set(size=10,face=FONT_SANS_SERIF,bold=1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set(first_indent=0.0,lmargin=1.0)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for the More About header.'))
        default_style.add_paragraph_style("DAR-MoreHeader",para)

        font = FontStyle()
        font.set(face=FONT_SERIF,size=10)
        para = ParagraphStyle()
        para.set_font(font)
        para.set(first_indent=0.0,lmargin=1.0)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(_('The style used for additional detail data.'))
        default_style.add_paragraph_style("DAR-MoreDetails",para)

        endnotes.add_endnote_styles(default_style)