def _ismonofont(font):
    minwidth = 0
    minheight = 0
    for i in range(32, 127):
        surf = font.render(chr(i), True, (0,0,0))
        if surf.get_width() < minwidth:
            minwidth = surf.get_width()
        if surf.get_height() < minheight:
            minheight = surf.get_height()

    maxwidth, maxheight = calcfontsize(font)
    return maxwidth - minwidth <= 3 and maxheight - minheight <= 3
Returns True if all the characters in the font are of the same width, indicating that this is a monospace font.
dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py/_ismonofont