コード例 #1
0
def print_font_info(font, short=False):
    """
    Outputs information about the font on stdout.

    :param font: the name of the font to output the information for
    :type font: str
    :param short: whether to output short or long description
    :type short: bool
    """

    print(FigletFont.infoFont(font, short=short))
コード例 #2
0
def list_fonts():
    """
    Outputs the available fonts on stdout with a short description.
    """

    names = []
    for f in FigletFont.getFonts():
        names.append(f)
    names.sort()
    for name in names:
        print(name)
        desc = FigletFont.infoFont(name, short=True)
        if len(desc.strip()) == 0:
            desc = "-no description-"
        print("   ", desc)