def lazy_load_font(font_size=default_font_size):
    """
    Lazy loading font according to system platform
    """
    if font_size not in _font_cache:
        if _platform.startswith("darwin"):
            font_path = "/Library/Fonts/Arial.ttf"
        elif _platform.startswith("linux"):
            font_path = "/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-R.ttf"
        elif _platform.startswith("win32"):
            font_path = "C:\\Windows\\Fonts\\arial.ttf"
        _font_cache[font_size] = ImageFont.truetype(font_path, font_size)
    return _font_cache[font_size]
def lazy_load_font ( font_size = default_font_size ) : if font_size not in _font_cache : if _platform . startswith ( "darwin" ) : font_path = "/Library/Fonts/Arial.ttf" elif _platform . startswith ( "linux" ) : font_path = "/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-R.ttf" elif _platform . startswith ( "win32" ) : font_path = "C:\\Windows\\Fonts\\arial.ttf" _font_cache [ font_size ] = ImageFont . truetype ( font_path , font_size ) return _font_cache [ font_size ]
Lazy loading font according to system platform