Initial commit of Roster
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
from PIL import ImageFont
|
||||
|
||||
def get_text_width(text, font_path, font_size):
|
||||
font = ImageFont.truetype(font_path, font_size)
|
||||
bbox = font.getbbox(text) # (left, top, right, bottom)
|
||||
width = bbox[2] - bbox[0]
|
||||
return width
|
||||
Reference in New Issue
Block a user