Text Format
TextFormat
src.drawpyo.diagram.text_format.TextFormat
Bases: DiagramBase
The TextFormat class handles all of the formatting specifically around a text box or label.
Source code in src/drawpyo/diagram/text_format.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|
directions
property
The direction controls the direction of the text and can be either horizontal or vertical.
font_style
property
The font_style is a numeric format that corresponds to a combination of three other attributes: bold, italic, and underline. Any combination of them can be true.
formattedText
deletable
property
writable
formattedText wraps the Draw.io style attribute 'html'. This controls whether the text is rendered with HTML attributes or as plain text.
__init__(**kwargs)
TextFormat objects can be initialized with no properties or any of what's listed below:
Other Parameters:
Name | Type | Description |
---|---|---|
fontColor |
int
|
The color of the text in the object (#ffffff) |
fontFamily |
str
|
The typeface of the text in the object (see Draw.io for available fonts) |
fontSize |
int
|
The size of the text in the object in points |
align |
str
|
The horizontal alignment of the text in the object ('left', 'center', or 'right') |
verticalAlign |
str
|
The vertical alignment of the text in the object ('top', 'middle', 'bottom') |
textOpacity |
int
|
The opacity of the text in the object |
direction |
str
|
The direction to print the text ('vertical', 'horizontal') |
bold |
bool
|
Whether the text in the object should be bold |
italic |
bool
|
Whether the text in the object should be italic |
underline |
bool
|
Whether the text in the object should be underlined |
labelPosition |
str
|
The position of the object label ('left', 'center', or 'right') |
labelBackgroundColor |
str
|
The background color of the object label (#ffffff) |
labelBorderColor |
str
|
The border color of the object label (#ffffff) |
fomrattedText |
bool
|
Whether to render the text as HTML formatted or not |
Source code in src/drawpyo/diagram/text_format.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|