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)
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(utils.pt2cm(3)) para.set_bottom_margin(utils.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(utils.pt2cm(3)) para.set_bottom_margin(utils.pt2cm(3)) para.set_description(_('The basic style used for the text display.')) default_style.add_paragraph_style("SR-Normal", 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("PLC-ColumnTitle", para)
def __place_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=1.5) para.set_description(_('The style used for place details.')) self.default_style.add_paragraph_style("PLC-PlaceDetails", 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)
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)
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 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 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)
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)
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)