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 End of Line Report.""" # Paragraph Styles 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(utils.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("EOL-Title", para) font = FontStyle() font.set(face=FONT_SANS_SERIF, size=12, italic=1) para = ParagraphStyle() para.set_bottom_margin(utils.pt2cm(6)) para.set_font(font) para.set_alignment(PARA_ALIGN_CENTER) para.set_description(_('The style used for the section headers.')) default_style.add_paragraph_style("EOL-Subtitle", para) font = FontStyle() font.set_size(10) para = ParagraphStyle() para.set_font(font) para.set_top_margin(utils.pt2cm(6)) para.set_bottom_margin(utils.pt2cm(6)) para.set_description(_('The basic style used for the text display.')) default_style.add_paragraph_style("EOL-Normal", para) font = FontStyle() font.set_size(12) font.set_italic(True) para = ParagraphStyle() para.set_font(font) para.set_top_margin(utils.pt2cm(6)) para.set_description( _('The basic style used for generation headings.')) default_style.add_paragraph_style("EOL-Generation", para) font = FontStyle() font.set_size(8) para = ParagraphStyle() para.set_font(font) para.set_top_margin(0) para.set_bottom_margin(utils.pt2cm(6)) para.set_description(_('The basic style used for the text display.')) default_style.add_paragraph_style("EOL-Pedigree", para) #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)
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(utils.pt2cm(8)) para.set_bottom_margin(utils.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(utils.pt2cm(3)) para.set_bottom_margin(utils.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(utils.pt2cm(3)) para.set_bottom_margin(utils.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(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("IDS-Normal", para) font = FontStyle() font.set_size(12) font.set_italic(1) para = ParagraphStyle() para.set_font(font) para.set_top_margin(utils.pt2cm(3)) para.set_bottom_margin(utils.pt2cm(3)) para.set_description(_('The style used for the section headers.')) default_style.add_paragraph_style("IDS-Section", para) font = FontStyle() font.set_size(8) para = ParagraphStyle() para.set_alignment(PARA_ALIGN_RIGHT) para.set_font(font) para.set_top_margin(utils.pt2cm(3)) para.set_bottom_margin(utils.pt2cm(3)) para.set_description(_('A style used for image facts.')) default_style.add_paragraph_style("IDS-ImageNote", para) font = FontStyle() font.set_size(8) para = ParagraphStyle() para.set_alignment(PARA_ALIGN_CENTER) para.set_font(font) para.set_top_margin(utils.pt2cm(3)) para.set_bottom_margin(utils.pt2cm(3)) para.set_description(_('A style used for image captions.')) default_style.add_paragraph_style("IDS-ImageCaptionCenter", 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, 50) tbl.set_column_width(2, 30) default_style.add_table_style('IDS-PersonTable', tbl) 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-PersonTable2', tbl) tbl = TableStyle() tbl.set_width(100) tbl.set_columns(5) tbl.set_column_width(0, 22) # Type tbl.set_column_width(1, 22) # Date tbl.set_column_width(2, 16) # Status tbl.set_column_width(3, 22) # Temple tbl.set_column_width(4, 18) # Place default_style.add_table_style('IDS-OrdinanceTable', tbl) tbl = TableStyle() tbl.set_width(100) tbl.set_columns(6) tbl.set_column_width(0, 20) # empty tbl.set_column_width(1, 18) # Type tbl.set_column_width(2, 18) # Date tbl.set_column_width(3, 14) # Status tbl.set_column_width(4, 18) # Temple tbl.set_column_width(5, 12) # Place default_style.add_table_style('IDS-OrdinanceTable2', tbl) tbl = TableStyle() tbl.set_width(100) tbl.set_columns(3) tbl.set_column_width(0, 33) tbl.set_column_width(1, 33) tbl.set_column_width(2, 34) default_style.add_table_style("IDS-GalleryTable", tbl) Endnotes.add_endnote_styles(default_style)