File indexing completed on 2025-01-05 04:00:26

0001 #!/usr/bin/env python3
0002 
0003 import json
0004 import sys
0005 import os
0006 import argparse
0007 sys.path.insert(0, os.path.join(
0008     os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
0009     "lib"
0010 ))
0011 from lottie.utils.font import fonts
0012 from lottie import __version__
0013 
0014 parser = argparse.ArgumentParser(
0015     description="List available fonts",
0016 )
0017 parser.add_argument("--version", "-v", action="version", version="%(prog)s - python-lottie " + __version__)
0018 parser.add_argument(
0019     "fonts",
0020     default=[],
0021     nargs="*",
0022     help="Font family names"
0023 )
0024 
0025 
0026 def _fonts(flist):
0027     for font in flist:
0028         if font in fonts:
0029             yield font
0030 
0031 
0032 if __name__ == "__main__":
0033     ns = parser.parse_args()
0034     font_iter = _fonts(ns.fonts) if ns.fonts else fonts
0035     for font in font_iter:
0036         print("* %s" % font)
0037         for style in fonts[font].files.keys():
0038             print("  * %s" % " ".join(style))