File size: 254 Bytes
34c32eb
 
 
 
 
 
 
1
2
3
4
5
6
7
8
from pathlib import Path
from PIL import ImageFont

_FONT = Path(__file__).resolve().parents[3] / 'runtime' / 'native_runtime' / 'fonts' / 'DejaVuSansMono.ttf'

def load_font(size):
    return ImageFont.FreeTypeFont(str(_FONT), max(9, int(size)))