TextFrame#

class TextFrame[source]#

Bases: SimpleFrame

Class for a frame containing some text. It is a simple frame with no sub-frames in it. A block of text will be printed in a rectangle with a calculated width and height.

__init__(parent: ContainerFrame, text: str = '', text_style: TextStyle = 'NORMAL', use_full_width: bool = False, text_align: TextAlign = TextAlign.LEFT, wrap_text: bool = True, frame_id: str = '')[source]#

Create a frame for a text

Parameters:
  • parent – The container frame to which the text frame belongs

  • text – The text to put into the frame

  • text_style – The text-style name or instance (default TextStyle.NORMAL)

  • use_full_width – Flag if the whole possible width should be used (default False)

  • text_align – Text alignment (default left)

  • wrap_text – Flag if the text may be wrapped onto multiple lines (default True)

  • frame_id – Ident of the frame (optional)

property use_full_width: bool#

Flag if the frame shall use the full possible width for the frame

Getter:

Returns the flag

Setter:

Sets the flag

property text: str#

The text to be printed in the frame

Getter:

Returns the text

Setter:

Sets the text

property text_style: TextStyle#

The text-style to be used

Getter:

Returns the text-style

Setter:

Sets the text-style

property text_align: TextAlign#

The text-alignment to be used

Getter:

Returns the text-alignment

Setter:

Sets the text-alignment

property wrap_text: bool#

Flag if the text may be wrapped onto multiple lines

Getter:

Returns the flag

Setter:

Sets the flag

property frame_id: str#

The frame id

Getter:

Returns the frame id

Setter:

Sets the frame id

property h_align: HAlign#

Horizontal alignment of the frame

Getter:

Returns the horizontal alignment of the frame

Setter:

Sets the horizontal alignment of the frame

property keep_together: bool#

Flag if the frame shall be kept together on one page

Getter:

Returns the flag

Setter:

Sets the flag

property margin_bottom: float#

Bottom margin in the frame

Getter:

Returns the bottom margin

Setter:

Sets the bottom margin

property margin_left: float#

Left margin in the frame

Getter:

Returns the left margin

Setter:

Sets the left margin

property margin_right: float#

Right margin in the frame

Getter:

Returns the right margin

Setter:

Sets the right margin

property margin_top: float#

Top margin in the frame

Getter:

Returns the top margin

Setter:

Sets the top margin

property max_height: float#

Maximal height for the frame

Getter:

Returns the maximal height

Setter:

Sets the maximal height

property max_width: float#

Maximal width for the frame

Getter:

Returns the maximal width

Setter:

Sets the maximal width

property parent_frame#

The parent frame

Getter:

Returns the parent frame

Setter:

Sets the parent frame

set_margin(margin: float)#

Sets the margin on all four sides to the given value

Parameters:

margin – Margin in mm

property use_full_height: bool#

Flag if the frame shall use the full possible height for the frame

Getter:

Returns the flag

Setter:

Sets the flag

property v_align: VAlign#

Vertical alignment of the frame

Getter:

Returns the vertical alignment of the frame

Setter:

Sets the vertical alignment of the frame