Update gerty api line lengths
This commit is contained in:
parent
6cb837d2b7
commit
b1c9e9a87e
1 changed files with 5 additions and 7 deletions
|
|
@ -15,17 +15,15 @@ def get_percent_difference(current, previous, precision=4):
|
||||||
# A helper function get a nicely formated dict for the text
|
# A helper function get a nicely formated dict for the text
|
||||||
def get_text_item_dict(text: str, font_size: int, x_pos: int = None, y_pos: int = None):
|
def get_text_item_dict(text: str, font_size: int, x_pos: int = None, y_pos: int = None):
|
||||||
# Get line size by font size
|
# Get line size by font size
|
||||||
line_width = 60
|
line_width = 20
|
||||||
if font_size <= 12:
|
if font_size <= 12:
|
||||||
line_width = 75
|
line_width = 60
|
||||||
elif font_size <= 15:
|
elif font_size <= 15:
|
||||||
line_width = 58
|
line_width = 45
|
||||||
elif font_size <= 20:
|
elif font_size <= 20:
|
||||||
line_width = 40
|
line_width = 35
|
||||||
elif font_size <= 40:
|
elif font_size <= 40:
|
||||||
line_width = 30
|
line_width = 25
|
||||||
else:
|
|
||||||
line_width = 20
|
|
||||||
|
|
||||||
# wrap the text
|
# wrap the text
|
||||||
wrapper = textwrap.TextWrapper(width=line_width)
|
wrapper = textwrap.TextWrapper(width=line_width)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue