Exemplo n.º 1
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)
Exemplo n.º 2
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)
Exemplo n.º 3
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)
Exemplo n.º 4
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)
Exemplo n.º 5
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)
Exemplo n.º 6
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)
Exemplo n.º 7
0
    def make_default_style(self, default_style):
        """Make the default output style for the Individual Complete Report."""
        # Paragraph Styles
        font = FontStyle()
        font.set_bold(1)
        font.set_type_face(FONT_SANS_SERIF)
        font.set_size(16)
        para = ParagraphStyle()
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_top_margin(ReportUtils.pt2cm(8))
        para.set_bottom_margin(ReportUtils.pt2cm(8))
        para.set_font(font)
        para.set_description(_("The style used for the title of the page."))
        default_style.add_paragraph_style("IDS-Title", para)

        font = FontStyle()
        font.set_bold(1)
        font.set_type_face(FONT_SANS_SERIF)
        font.set_size(12)
        font.set_italic(1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_top_margin(ReportUtils.pt2cm(3))
        para.set_bottom_margin(ReportUtils.pt2cm(3))
        para.set_description(_("The style used for category labels."))
        default_style.add_paragraph_style("IDS-TableTitle", para)

        font = FontStyle()
        font.set_bold(1)
        font.set_type_face(FONT_SANS_SERIF)
        font.set_size(12)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_top_margin(ReportUtils.pt2cm(3))
        para.set_bottom_margin(ReportUtils.pt2cm(3))
        para.set_description(_("The style used for the spouse's name."))
        default_style.add_paragraph_style("IDS-Spouse", para)

        font = FontStyle()
        font.set_size(12)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_top_margin(ReportUtils.pt2cm(3))
        para.set_bottom_margin(ReportUtils.pt2cm(3))
        para.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style("IDS-Normal", para)

        # Table Styles
        tbl = TableStyle()
        tbl.set_width(100)
        tbl.set_columns(2)
        tbl.set_column_width(0, 20)
        tbl.set_column_width(1, 80)
        default_style.add_table_style("IDS-IndTable", 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("IDS-ParentsTable", tbl)

        cell = TableCellStyle()
        cell.set_top_border(1)
        cell.set_bottom_border(1)
        default_style.add_cell_style("IDS-TableHead", cell)

        cell = TableCellStyle()
        default_style.add_cell_style("IDS-NormalCell", cell)

        cell = TableCellStyle()
        cell.set_longlist(1)
        default_style.add_cell_style("IDS-ListCell", cell)

        tbl = TableStyle()
        tbl.set_width(100)
        tbl.set_columns(3)
        tbl.set_column_width(0, 20)
        tbl.set_column_width(1, 40)
        tbl.set_column_width(2, 40)
        default_style.add_table_style('IDS-PersonTable', tbl)

        Endnotes.add_endnote_styles(default_style)
Exemplo n.º 8
0
    def make_default_style(self, default_style):

        #Paragraph Styles
        font = FontStyle()
        font.set_type_face(FONT_SANS_SERIF)
        font.set_size(16)
        font.set_bold(True)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_description(_("The style used for the report title."))
        default_style.add_paragraph_style('REC-Title', para)

        font = FontStyle()
        font.set_type_face(FONT_SANS_SERIF)
        font.set_size(12)
        font.set_bold(True)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_bottom_border(True)
        para.set_bottom_margin(ReportUtils.pt2cm(8))
        para.set_description(_("The style used for the report subtitle."))
        default_style.add_paragraph_style('REC-Subtitle', para)

        font = FontStyle()
        font.set_size(12)
        font.set_bold(True)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_top_margin(ReportUtils.pt2cm(6))
        para.set_description(_('The style used for headings.'))
        default_style.add_paragraph_style('REC-Heading', para)

        font = FontStyle()
        font.set_size(10)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_left_margin(0.5)
        para.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style('REC-Normal', para)

        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.'))
        default_style.add_paragraph_style('REC-Footer', para)
Exemplo n.º 9
0
    def make_default_style(self, default_style):
        """Make default output style for the Family Group Report."""
        para = ParagraphStyle()
        #Paragraph Styles
        font = FontStyle()
        font.set_size(4)
        para.set_font(font)
        default_style.add_paragraph_style('FGR-blank', para)

        font = FontStyle()
        font.set_type_face(FONT_SANS_SERIF)
        font.set_size(16)
        font.set_bold(1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_alignment(PARA_ALIGN_CENTER)
        para.set_header_level(1)
        para.set_description(_("The style used for the title of the page."))
        default_style.add_paragraph_style('FGR-Title', para)

        font = FontStyle()
        font.set_type_face(FONT_SERIF)
        font.set_size(10)
        font.set_bold(0)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style('FGR-Normal', para)

        para = ParagraphStyle()
        font = FontStyle()
        font.set_type_face(FONT_SERIF)
        font.set_size(10)
        font.set_bold(0)
        para.set_font(font)
        para.set(lmargin=0.0)
        para.set_top_margin(0.0)
        para.set_bottom_margin(0.0)
        para.set_description(_('The basic style used for the note display.'))
        default_style.add_paragraph_style("FGR-Note", para)

        font = FontStyle()
        font.set_type_face(FONT_SANS_SERIF)
        font.set_size(10)
        font.set_bold(1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_description(
            _('The style used for the text related to the children.'))
        default_style.add_paragraph_style('FGR-ChildText', para)

        font = FontStyle()
        font.set_type_face(FONT_SANS_SERIF)
        font.set_size(12)
        font.set_bold(1)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_header_level(3)
        para.set_description(_("The style used for the parent's name"))
        default_style.add_paragraph_style('FGR-ParentName', para)

        #Table Styles
        cell = TableCellStyle()
        cell.set_padding(0.2)
        cell.set_top_border(1)
        cell.set_bottom_border(1)
        cell.set_right_border(1)
        cell.set_left_border(1)
        default_style.add_cell_style('FGR-ParentHead', cell)

        cell = TableCellStyle()
        cell.set_padding(0.1)
        cell.set_bottom_border(1)
        cell.set_left_border(1)
        default_style.add_cell_style('FGR-TextContents', cell)

        cell = TableCellStyle()
        cell.set_padding(0.1)
        cell.set_bottom_border(0)
        cell.set_left_border(1)
        cell.set_padding(0.1)
        default_style.add_cell_style('FGR-TextChild1', cell)

        cell = TableCellStyle()
        cell.set_padding(0.1)
        cell.set_bottom_border(1)
        cell.set_left_border(1)
        cell.set_padding(0.1)
        default_style.add_cell_style('FGR-TextChild2', cell)

        cell = TableCellStyle()
        cell.set_padding(0.1)
        cell.set_bottom_border(1)
        cell.set_right_border(1)
        cell.set_left_border(1)
        default_style.add_cell_style('FGR-TextContentsEnd', cell)

        cell = TableCellStyle()
        cell.set_padding(0.2)
        cell.set_bottom_border(1)
        cell.set_right_border(1)
        cell.set_left_border(1)
        default_style.add_cell_style('FGR-ChildName', cell)

        table = TableStyle()
        table.set_width(100)
        table.set_columns(3)
        table.set_column_width(0, 20)
        table.set_column_width(1, 40)
        table.set_column_width(2, 40)
        default_style.add_table_style('FGR-ParentTable', table)

        table = TableStyle()
        table.set_width(100)
        table.set_columns(4)
        table.set_column_width(0, 7)
        table.set_column_width(1, 18)
        table.set_column_width(2, 35)
        table.set_column_width(3, 40)
        default_style.add_table_style('FGR-ChildTable', table)
Exemplo n.º 10
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(first_indent=0.0, lmargin=0.0)

        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("SRC-Section", para)
Exemplo n.º 11
0
 def __report_title_style(self):
     """
     Define the style used for the report title
     """
     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 report.'))
     self.default_style.add_paragraph_style("SRC-ReportTitle", para)
Exemplo n.º 12
0
    def make_default_style(self, default_style):
        """Make the default output style for the End of Line 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_bottom_margin(ReportUtils.pt2cm(8))
        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("EOL-Title", p)
        
        font = FontStyle()
        font.set(face=FONT_SANS_SERIF, size=12, italic=1)
        p = ParagraphStyle()
        p.set_bottom_margin(ReportUtils.pt2cm(6))
        p.set_font(font)
        p.set_alignment(PARA_ALIGN_CENTER)
        p.set_description(_('The style used for the section headers.'))
        default_style.add_paragraph_style("EOL-Subtitle", p)
        
        font = FontStyle()
        font.set_size(10)
        p = ParagraphStyle()
        p.set_font(font)
        p.set_top_margin(ReportUtils.pt2cm(6))
        p.set_bottom_margin(ReportUtils.pt2cm(6))
        p.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style("EOL-Normal", p)
        
        font = FontStyle()
        font.set_size(12)
        font.set_italic(True)
        p = ParagraphStyle()
        p.set_font(font)
        p.set_top_margin(ReportUtils.pt2cm(6))
        p.set_description(_('The basic style used for generation headings.'))
        default_style.add_paragraph_style("EOL-Generation", p)
        
        font = FontStyle()
        font.set_size(8)
        p = ParagraphStyle()
        p.set_font(font)
        p.set_top_margin(0)
        p.set_bottom_margin(ReportUtils.pt2cm(6))
        p.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style("EOL-Pedigree", p)
        
        #Table Styles
        cell = TableCellStyle()
        default_style.add_cell_style('EOL-TableCell', cell)
        
        cell = TableCellStyle()
        cell.set_bottom_border(1)
        default_style.add_cell_style('EOL_GenerationCell', cell)

        table = TableStyle()
        table.set_width(100)
        table.set_columns(2)
        table.set_column_width(0, 10)
        table.set_column_width(1, 90)
        default_style.add_table_style('EOL-Table', table)
Exemplo n.º 13
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)
Exemplo n.º 14
0
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_SANS_SERIF, size=14, italic=1)
    para = ParagraphStyle()
    para.set_font(font)
    para.set_header_level(2)
    para.set_top_margin(0.2)
    para.set_bottom_margin(0.2)
    para.set_description(_('The style used for the generation header.'))
    style_sheet.add_paragraph_style("Endnotes-Header", para)

    para = ParagraphStyle()
    para.set(first_indent=-0.75, lmargin=.75)
    para.set_top_margin(0.2)
    para.set_bottom_margin(0.0)
    para.set_description(
        _('The basic style used for the endnotes source display.'))
    style_sheet.add_paragraph_style("Endnotes-Source", para)

    para = ParagraphStyle()
    para.set(lmargin=.75)
    para.set_top_margin(0.2)
    para.set_bottom_margin(0.0)
    para.set_description(
        _('The basic style used for the endnotes notes display.'))
    style_sheet.add_paragraph_style("Endnotes-Source-Notes", para)

    para = ParagraphStyle()
    para.set(first_indent=-0.9, lmargin=1.9)
    para.set_top_margin(0.2)
    para.set_bottom_margin(0.0)
    para.set_description(
        _('The basic style used for the endnotes reference display.'))
    style_sheet.add_paragraph_style("Endnotes-Ref", para)

    para = ParagraphStyle()
    para.set(lmargin=1.9)
    para.set_top_margin(0.2)
    para.set_bottom_margin(0.0)
    para.set_description(
        _('The basic style used for the endnotes reference notes display.'))
    style_sheet.add_paragraph_style("Endnotes-Ref-Notes", para)
Exemplo n.º 15
0
    def make_default_style(self, default_style):
        """Make the default output style for the Ancestor Tree."""

        from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
                                     FONT_SANS_SERIF, PARA_ALIGN_CENTER)

        ## Paragraph Styles:
        font = FontStyle()
        font.set_size(9)
        font.set_type_face(FONT_SANS_SERIF)
        para_style = ParagraphStyle()
        para_style.set_font(font)
        para_style.set_description(
            _('The basic style used for the '
              'text display.'))
        default_style.add_paragraph_style("AC2-Normal", para_style)
        box_shadow = PT2CM(font.get_size()) * .6

        font = FontStyle()
        font.set_size(16)
        font.set_type_face(FONT_SANS_SERIF)
        para_style = ParagraphStyle()
        para_style.set_font(font)
        para_style.set_alignment(PARA_ALIGN_CENTER)
        para_style.set_description(
            _('The basic style used for the '
              'title display.'))
        default_style.add_paragraph_style("AC2-Title", para_style)

        ## Draw styles
        graph_style = GraphicsStyle()
        graph_style.set_paragraph_style("AC2-Normal")
        graph_style.set_shadow(1, box_shadow)  #shadow set by text size
        graph_style.set_fill_color((255, 255, 255))
        default_style.add_draw_style("AC2-box", graph_style)

        graph_style = GraphicsStyle()
        graph_style.set_paragraph_style("AC2-Normal")
        #graph_style.set_shadow(0, PT2CM(9))  #shadow set by text size
        graph_style.set_fill_color((255, 255, 255))
        default_style.add_draw_style("AC2-fam-box", graph_style)

        graph_style = GraphicsStyle()
        graph_style.set_paragraph_style("AC2-Title")
        graph_style.set_color((0, 0, 0))
        graph_style.set_fill_color((255, 255, 255))
        graph_style.set_line_width(0)
        default_style.add_draw_style("AC2-Title", graph_style)

        graph_style = GraphicsStyle()
        default_style.add_draw_style("AC2-line", graph_style)
Exemplo n.º 16
0
    def make_default_style(self, default_style):
        """Make the default output style for the Summary 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_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("SR-Title", para)

        font = FontStyle()
        font.set_size(12)
        font.set_bold(True)
        para = ParagraphStyle()
        para.set_font(font)
        para.set_top_margin(0)
        para.set_description(_('The basic style used for sub-headings.'))
        default_style.add_paragraph_style("SR-Heading", para)

        font = FontStyle()
        font.set_size(12)
        para = ParagraphStyle()
        para.set(first_indent=-0.75, lmargin=.75)
        para.set_font(font)
        para.set_top_margin(ReportUtils.pt2cm(3))
        para.set_bottom_margin(ReportUtils.pt2cm(3))
        para.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style("SR-Normal", para)
Exemplo n.º 17
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)
Exemplo n.º 18
0
    def make_default_style(self, default_style):
        """Make the default output style for the Tag 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(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("TR-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("TR-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(ReportUtils.pt2cm(3))
        p.set_bottom_margin(ReportUtils.pt2cm(3))
        p.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style("TR-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(ReportUtils.pt2cm(3))
        p.set_bottom_margin(ReportUtils.pt2cm(3))
        p.set_description(_('The basic style used for table headings.'))
        default_style.add_paragraph_style("TR-Normal-Bold", p)

        para = ParagraphStyle()
        p.set(first_indent=-0.75, lmargin=.75)
        para.set_top_margin(ReportUtils.pt2cm(3))
        para.set_bottom_margin(ReportUtils.pt2cm(3))
        para.set_description(_('The basic style used for the note display.'))
        default_style.add_paragraph_style("TR-Note", para)

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

        table = TableStyle()
        table.set_width(100)
        table.set_columns(4)
        table.set_column_width(0, 10)
        table.set_column_width(1, 30)
        table.set_column_width(2, 30)
        table.set_column_width(3, 30)
        default_style.add_table_style('TR-Table', table)
Exemplo n.º 19
0
    def make_default_style(self, default_style):
        """Make the default output style for the Statistics report."""
        # Paragraph Styles
        f = FontStyle()
        f.set_size(10)
        f.set_type_face(FONT_SERIF)
        p = ParagraphStyle()
        p.set_font(f)
        p.set_alignment(PARA_ALIGN_LEFT)
        p.set_description(_("The style used for the items and values."))
        default_style.add_paragraph_style("SC-Text", p)

        f = FontStyle()
        f.set_size(14)
        f.set_type_face(FONT_SANS_SERIF)
        p = ParagraphStyle()
        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("SC-Title", p)
        """
        Graphic Styles:
            SC-title - Contains the SC-Title paragraph style used for
                       the title of the document
            SC-text  - Contains the SC-Name paragraph style used for
                       the individual's name
            SC-color-N - The colors for drawing pies.
            SC-bar - A red bar with 0.5pt black line.
        """
        g = GraphicsStyle()
        g.set_paragraph_style("SC-Title")
        g.set_color((0, 0, 0))
        g.set_fill_color((255, 255, 255))
        g.set_line_width(0)
        default_style.add_draw_style("SC-title", g)

        g = GraphicsStyle()
        g.set_paragraph_style("SC-Text")
        g.set_color((0, 0, 0))
        g.set_fill_color((255, 255, 255))
        g.set_line_width(0)
        default_style.add_draw_style("SC-text", g)

        width = 0.8
        # red
        g = GraphicsStyle()
        g.set_paragraph_style('SC-Text')
        g.set_color((0, 0, 0))
        g.set_fill_color((255, 0, 0))
        g.set_line_width(width)
        default_style.add_draw_style("SC-color-0", g)
        # orange
        g = GraphicsStyle()
        g.set_paragraph_style('SC-Text')
        g.set_color((0, 0, 0))
        g.set_fill_color((255, 158, 33))
        g.set_line_width(width)
        default_style.add_draw_style("SC-color-1", g)
        # green
        g = GraphicsStyle()
        g.set_paragraph_style('SC-Text')
        g.set_color((0, 0, 0))
        g.set_fill_color((0, 178, 0))
        g.set_line_width(width)
        default_style.add_draw_style("SC-color-2", g)
        # violet
        g = GraphicsStyle()
        g.set_paragraph_style('SC-Text')
        g.set_color((0, 0, 0))
        g.set_fill_color((123, 0, 123))
        g.set_line_width(width)
        default_style.add_draw_style("SC-color-3", g)
        # yellow
        g = GraphicsStyle()
        g.set_paragraph_style('SC-Text')
        g.set_color((0, 0, 0))
        g.set_fill_color((255, 255, 0))
        g.set_line_width(width)
        default_style.add_draw_style("SC-color-4", g)
        # blue
        g = GraphicsStyle()
        g.set_paragraph_style('SC-Text')
        g.set_color((0, 0, 0))
        g.set_fill_color((0, 105, 214))
        g.set_line_width(width)
        default_style.add_draw_style("SC-color-5", g)
        # gray
        g = GraphicsStyle()
        g.set_paragraph_style('SC-Text')
        g.set_color((0, 0, 0))
        g.set_fill_color((210, 204, 210))
        g.set_line_width(width)
        default_style.add_draw_style("SC-color-6", g)

        g = GraphicsStyle()
        g.set_color((0, 0, 0))
        g.set_fill_color((255, 0, 0))
        g.set_line_width(width)
        default_style.add_draw_style("SC-bar", g)

        # legend
        g = GraphicsStyle()
        g.set_paragraph_style('SC-Text')
        g.set_color((0, 0, 0))
        g.set_fill_color((255, 255, 255))
        g.set_line_width(0)
        default_style.add_draw_style("SC-legend", g)
Exemplo n.º 20
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)
Exemplo n.º 21
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)
Exemplo n.º 22
0
def make_basic_stylesheet(**kwargs):
    """
    Create the basic style sheet for the SimpleDoc class.

    kwargs - a dictionary of the form:
           item={method: value, ...}, ...

    Example:

    make_basic_stylesheet(Table={"set_width": 90})

    """
    sheet = StyleSheet()

    pstyle = ParagraphStyle()
    fstyle = pstyle.get_font()
    fstyle.set_type_face(FONT_SANS_SERIF)
    fstyle.set_size(14)
    fstyle.set_bold(True)
    pstyle.set_font(fstyle)
    pstyle.set_alignment(PARA_ALIGN_LEFT)
    # Handle args:
    if "Title" in kwargs:
        for method in kwargs["Title"]:
            value = kwargs["Title"][method]
            if value is not None:
                getattr(pstyle, method)(value)
    sheet.add_paragraph_style('Title', pstyle)

    pstyle = ParagraphStyle()
    fstyle = pstyle.get_font()
    fstyle.set_type_face(FONT_SANS_SERIF)
    fstyle.set_size(12)
    fstyle.set_bold(True)
    pstyle.set_font(fstyle)
    pstyle.set_alignment(PARA_ALIGN_LEFT)
    pstyle.set_tabs([4, 8, 12, 16])
    # Handle args:
    if "Header1" in kwargs:
        for method in kwargs["Header1"]:
            value = kwargs["Header1"][method]
            if value is not None:
                getattr(pstyle, method)(value)
    sheet.add_paragraph_style('Header1', pstyle)

    pstyle = ParagraphStyle()
    fstyle = pstyle.get_font()
    fstyle.set_type_face(FONT_SANS_SERIF)
    fstyle.set_size(10)
    fstyle.set_bold(True)
    pstyle.set_font(fstyle)
    pstyle.set_alignment(PARA_ALIGN_LEFT)
    pstyle.set_tabs([4, 8, 12, 16])
    # Handle args:
    if "Header2" in kwargs:
        for method in kwargs["Header2"]:
            value = kwargs["Header2"][method]
            if value is not None:
                getattr(pstyle, method)(value)
    sheet.add_paragraph_style('Header2', pstyle)

    pstyle = ParagraphStyle()
    fstyle = pstyle.get_font()
    fstyle.set_type_face(FONT_SANS_SERIF)
    fstyle.set_size(10)
    fstyle.set_bold(True)
    fstyle.set_italic(True)
    pstyle.set_font(fstyle)
    pstyle.set_alignment(PARA_ALIGN_LEFT)
    pstyle.set_tabs([4, 8, 12, 16])
    # Handle args:
    if "Header3" in kwargs:
        for method in kwargs["Header3"]:
            value = kwargs["Header3"][method]
            if value is not None:
                getattr(pstyle, method)(value)
    sheet.add_paragraph_style('Header3', pstyle)

    pstyle = ParagraphStyle()
    pstyle.set_tabs([4, 8, 12, 16])
    # Handle args:
    if "Normal" in kwargs:
        for method in kwargs["Normal"]:
            value = kwargs["Normal"][method]
            if value is not None:
                getattr(pstyle, method)(value)
    sheet.add_paragraph_style('Normal', pstyle)

    # Styles for tables:
    tbl = TableStyle()
    tbl.set_width(100)
    tbl.set_columns(2)
    tbl.set_column_width(0, 20)
    tbl.set_column_width(1, 80)
    # Handle args:
    if "Table" in kwargs:
        for method in kwargs["Table"]:
            value = kwargs["Table"][method]
            if value is not None:
                getattr(tbl, method)(value)
    sheet.add_table_style("Table", tbl)

    cell = TableCellStyle()
    cell.set_top_border(1)
    cell.set_bottom_border(1)
    # Handle args:
    if "TableHead" in kwargs:
        for method in kwargs["TableHead"]:
            value = kwargs["TableHead"][method]
            if value is not None:
                getattr(cell, method)(value)
    sheet.add_cell_style("TableHead", cell)

    cell = TableCellStyle()
    # Handle args:
    if "TableHeaderCell" in kwargs:
        for method in kwargs["TableHeaderCell"]:
            value = kwargs["TableHeaderCell"][method]
            if value is not None:
                getattr(cell, method)(value)
    sheet.add_cell_style("TableHeaderCell", cell)

    cell = TableCellStyle()
    cell.set_longlist(1)
    # Handle args:
    if "TableDataCell" in kwargs:
        for method in kwargs["TableDataCell"]:
            value = kwargs["TableDataCell"][method]
            if value is not None:
                getattr(cell, method)(value)
    sheet.add_cell_style("TableDataCell", cell)

    return sheet
Exemplo n.º 23
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)
Exemplo n.º 24
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)
Exemplo n.º 25
0
 def __report_title_style(self):
     """
     Define the style used for the report title
     """
     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 report.'))
     self.default_style.add_paragraph_style("SRC-ReportTitle", para)
Exemplo n.º 26
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)
Exemplo n.º 27
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)
    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)
Exemplo n.º 29
0
 def make_default_style(self, default_style):
     """Make the default output style for the Kinship Report."""
     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_bottom_margin(ReportUtils.pt2cm(8))
     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("KIN-Title", p)
     
     font = FontStyle()
     font.set_size(12)
     font.set_bold(True)
     p = ParagraphStyle()
     p.set_header_level(3)
     p.set_font(font)
     p.set_top_margin(ReportUtils.pt2cm(6))
     p.set_description(_('The basic style used for sub-headings.'))
     default_style.add_paragraph_style("KIN-Subtitle", p)
     
     font = FontStyle()
     font.set_size(10)
     p = ParagraphStyle()
     p.set_font(font)
     p.set_left_margin(0.5)
     p.set_description(_('The basic style used for the text display.'))
     default_style.add_paragraph_style("KIN-Normal", p)
Exemplo n.º 30
0
    def make_default_style(self, default_style):
        """Make the default output style for the Timeline report."""
        # Paragraph Styles
        f = FontStyle()
        f.set_size(10)
        f.set_type_face(FONT_SANS_SERIF)
        p = ParagraphStyle()
        p.set_font(f)
        p.set_description(_("The style used for the person's name."))
        default_style.add_paragraph_style("TLG-Name", p)

        f = FontStyle()
        f.set_size(8)
        f.set_type_face(FONT_SANS_SERIF)
        p = ParagraphStyle()
        p.set_font(f)
        p.set_alignment(PARA_ALIGN_CENTER)
        p.set_description(_("The style used for the year labels."))
        default_style.add_paragraph_style("TLG-Label", p)

        f = FontStyle()
        f.set_size(14)
        f.set_type_face(FONT_SANS_SERIF)
        p = ParagraphStyle()
        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("TLG-Title", p)
        """
        Graphic Styles
            TLG-grid  - 0.5pt wide line dashed line. Used for the lines that 
                        make up the grid.
            TLG-line  - 0.5pt wide line. Used for the line connecting two 
                        endpoints and for the birth marker.
            TLG-solid - 0.5pt line with a black fill color. Used for the date of
                        death marker.
            TLG-text  - Contains the TLG-Name paragraph style used for the 
                        individual's name.
            TLG-title - Contains the TLG-Title paragraph style used for the
                        title of the document.
            TLG-label - Contains the TLG-Label paragraph style used for the year
                        label's in the document.
        """
        g = GraphicsStyle()
        g.set_line_width(0.5)
        g.set_color((0, 0, 0))
        default_style.add_draw_style("TLG-line", g)

        g = GraphicsStyle()
        g.set_line_width(0.5)
        g.set_color((0, 0, 0))
        g.set_fill_color((0, 0, 0))
        default_style.add_draw_style("TLG-solid", g)

        g = GraphicsStyle()
        g.set_line_width(0.5)
        g.set_color((0, 0, 0))
        g.set_fill_color((255, 255, 255))
        default_style.add_draw_style("open", g)

        g = GraphicsStyle()
        g.set_line_width(0.5)
        g.set_line_style(DASHED)
        g.set_color((0, 0, 0))
        default_style.add_draw_style("TLG-grid", g)

        g = GraphicsStyle()
        g.set_paragraph_style("TLG-Name")
        g.set_color((0, 0, 0))
        g.set_fill_color((255, 255, 255))
        g.set_line_width(0)
        default_style.add_draw_style("TLG-text", g)

        g = GraphicsStyle()
        g.set_paragraph_style("TLG-Title")
        g.set_color((0, 0, 0))
        g.set_fill_color((255, 255, 255))
        g.set_line_width(0)
        default_style.add_draw_style("TLG-title", g)

        g = GraphicsStyle()
        g.set_paragraph_style("TLG-Label")
        g.set_color((0, 0, 0))
        g.set_fill_color((255, 255, 255))
        g.set_line_width(0)
        default_style.add_draw_style("TLG-label", g)
Exemplo n.º 31
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(first_indent=0.0, lmargin=0.0)

        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("SRC-Section", para)
Exemplo n.º 32
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)   
                            ]

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

        f = FontStyle()
        f.set_size(9)
        f.set_type_face(FONT_SANS_SERIF)
        p = ParagraphStyle()
        p.set_font(f)
        p.set_alignment(PARA_ALIGN_CENTER)
        p.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style("text_style", p)
            
        # GraphicsStyles
        g = GraphicsStyle()
        g.set_paragraph_style('FC-Title')
        g.set_line_width(0)
        default_style.add_draw_style("t",g)

        for i in range (0, self.MAX_GENERATIONS):
            g = GraphicsStyle()
            g.set_fill_color(BACKGROUND_COLORS[i])
            g.set_paragraph_style('FC-Normal')
            background_style_name = 'background_style' + '%d' % i
            default_style.add_draw_style(background_style_name,g)

            g = GraphicsStyle()
            g.set_fill_color(BACKGROUND_COLORS[i])
            g.set_paragraph_style('text_style')
            g.set_line_width(0)
            text_style_name = 'text_style' + '%d' % i
            default_style.add_draw_style(text_style_name,g)
            
        g = GraphicsStyle()
        g.set_fill_color((255,255,255))
        g.set_paragraph_style('FC-Normal')
        default_style.add_draw_style('background_style_white',g)
Exemplo n.º 33
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 place title.'))
     self.default_style.add_paragraph_style("PLC-PlaceTitle", para)
Exemplo n.º 34
0
    def make_default_style(self, default_style):
        """
        Make the default output style for the Ahnentafel report.

        There are 3 paragraph styles for this report.

        AHN_Title - The title for the report. The options are:

            Font      : Sans Serif
                        Bold
                        16pt
            Paragraph : First level header
                        0.25cm top and bottom margin
                        Centered

        AHN-Generation - Used for the generation header

            Font      : Sans Serif
                        Italic
                        14pt
            Paragraph : Second level header
                        0.125cm top and bottom margins

        AHN - Normal text display for each entry

            Font      : default
            Paragraph : 1cm margin, with first indent of -1cm
                        0.125cm top and bottom margins
        """

        #
        # AHN-Title
        #
        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("AHN-Title", para)

        #
        # AHN-Generation
        #
        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.125)
        para.set_bottom_margin(0.125)
        para.set_description(_('The style used for the generation header.'))
        default_style.add_paragraph_style("AHN-Generation", para)

        #
        # AHN-Entry
        #
        para = ParagraphStyle()
        para.set(first_indent=-1.0, lmargin=1.0)
        para.set_top_margin(0.125)
        para.set_bottom_margin(0.125)
        para.set_description(_('The basic style used for the text display.'))
        default_style.add_paragraph_style("AHN-Entry", para)
Exemplo n.º 35
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("DDR-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("DDR-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.5)  # 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("DDR-ChildTitle", para)

        font = FontStyle()
        font.set(size=10)
        para = ParagraphStyle()
        para.set_font(font)
        para.set(first_indent=-0.75, lmargin=2.25)
        para.set_top_margin(0.125)
        para.set_bottom_margin(0.125)
        para.set_description(_('The style used for the children list.'))
        default_style.add_paragraph_style("DDR-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.5)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        default_style.add_paragraph_style("DDR-NoteHeader", 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("DDR-Entry", para)

        para = ParagraphStyle()
        para.set(first_indent=-1.5, lmargin=1.5)
        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("DDR-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.5)
        para.set_top_margin(0.25)
        para.set_bottom_margin(0.25)
        para.set_description(
            _('The style used for the More About header and '
              'for headers of mates.'))
        default_style.add_paragraph_style("DDR-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.5)
        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("DDR-MoreDetails", para)

        endnotes.add_endnote_styles(default_style)