コード例 #1
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)
コード例 #2
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)
コード例 #3
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)
コード例 #4
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)
コード例 #5
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)
コード例 #6
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)
コード例 #7
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)
コード例 #8
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 style used for each section.'))
     self.default_style.add_paragraph_style("PLC-Section", para)
コード例 #9
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)
コード例 #10
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)
コード例 #11
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)
コード例 #12
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)
コード例 #13
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)
コード例 #14
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)
コード例 #15
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)
コード例 #16
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)
コード例 #17
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)
コード例 #18
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)
コード例 #19
0
ファイル: TagReport.py プロジェクト: arpalmares/portableApps
    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)
コード例 #20
0
ファイル: AncestorFill.py プロジェクト: phejl/addons-source
    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)
コード例 #21
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)