

def calcfontsize(font):
    'Returns the maximum width and maximum height used by any character in this font. This function is used to calculate the cell size.'
    maxwidth = 0
    maxheight = 0
    for i in range(32, 127):
        surf = font.render(chr(i), True, (0, 0, 0))
        if (surf.get_width() > maxwidth):
            maxwidth = surf.get_width()
        if (surf.get_height() > maxheight):
            maxheight = surf.get_height()
    return (maxwidth, maxheight)

dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py calcfontsize/original