PSVG.Text package
Submodules
PSVG.Text.Font module
PSVG.Text.Paragraph module
PSVG.Text.Table module
- class PSVG.Text.Table.Table(text, data: list[list[str]], w=0, h=0)
Bases:
Section
- add_box(row, col, value)
Adds a text box to the table at the intersection of row and column. If something exists there already this will overwrite it.
- Parameters:
row – Integer represent the row to put the box in
col – Integer representing the column to but the box in
value – The text value of the text box
- property c_rng
- even_col_width(total_w)
Given the desired width, computes the column width for each column assuming all columns will have the same column width.
- Parameters:
total_w – number representing the desired width of the table
- even_row_height(total_h)
Given the desired height, computes the row height for each row assuming all rows will have the same row height.
- Parameters:
total_h – number representing the desired height of the table
- property r_rng
- set()
- set_box_color(row: int, col: int, color: tuple[int, int, int], opacity: float)
- set_col_color(col: int, color: tuple[int, int, int], opacity: float)
- set_col_width(width)
- set_row_color(row: int, color: tuple[int, int, int], opacity: float)
- set_row_height(height)
- set_sizes()
- weighted_col_width(total_w: float, weights: list[float])
Given the desired width and weights, computes the column width for each column.
- Parameters:
total_w – number representing the desired width of the table
weights – list of percentages that define column widths
- weighted_row_width(total_h: float, weights: list[float])
Given the desired height and weights, computes the row height for each row.
- Parameters:
total_h – number representing the desired height of the table
weights – list of percentages that define row heights
PSVG.Text.Text module
- class PSVG.Text.Text.Text(font, text='', size=10, x=0, y=0, angle=0, baseline=None, anchor=None, **kwargs)
Bases:
Base
- construct(depth)
Constructs the svg definition :param depth: current depth of this node in the svg tree :return: String containing the svg definition for this object
- copy(item: Text = None)
Creates a copy of this node either by creating a new object or by adjusting the values of the object referenced by item
- Parameters:
item – reference to an existing node
- Returns:
a node with the same attributes as this node
- property width