def get_text_size(
    text,
    font_height=ENC_SANS_BOLD_FONT_HEIGHT,
    font_path=ENC_SANS_BOLD_FONT_PATH,
    padding=0,
):
    """Return surf size of text as if it were rendered.

    text
        Any string.
    font_height
        Integer indicating desired font height in pixels.
    font_path
        either ENC_SANS_BOLD_FONT_PATH for default font or any other key
        from the font path map found on the font.py module.
    """
    font = FONTS_DB[font_path][font_height]

    width, height = (dimension + (padding * 2) for dimension in font.size(text))

    return width, height
Return surf size of text as if it were rendered.

    text
        Any string.
    font_height
        Integer indicating desired font height in pixels.
    font_path
        either ENC_SANS_BOLD_FONT_PATH for default font or any other key
        from the font path map found on the font.py module.
    
nodezator/textman/render.py