Last active
August 27, 2025 03:59
-
-
Save cumulus13/b0f4a525b65a2eceb02d79ab1227ee07 to your computer and use it in GitHub Desktop.
Logo generator use 'art'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # Author: Hadi Cahyadi <[email protected]> | |
| # Date: 2025-08-27 10:18:57.533760 | |
| # Description: Create ascitext Logo | |
| # License: MIT | |
| import art | |
| from licface import makelist, CustomRichHelpFormatter | |
| import argparse | |
| import sys | |
| import clipboard | |
| def main(): | |
| parser = argparse.ArgumentParser(formatter_class=CustomRichHelpFormatter, prog='logo') | |
| parser.add_argument('TEXTS', help = 'Text to convert', nargs = '*') | |
| parser.add_argument('-l', '--fonts', help = 'List available fonts', action='store_true') | |
| parser.add_argument('-f', '--font', help = 'Font name, use "-l" to get list of available fonts', default='big') | |
| parser.add_argument('-c', '--clip', help = 'Copy result to clipboard', action='store_true') | |
| parser.add_argument('-o', '--export', help='export/save as/to file', type=argparse.FileType('w')) | |
| if len(sys.argv) == 1: | |
| parser.print_help() | |
| exit(0) | |
| args = parser.parse_args() | |
| if args.fonts: | |
| makelist.FCOLOR = '#00FFFF' | |
| print(makelist.makeList(art.FONT_NAMES, 6)) | |
| else: | |
| result = art.text2art(" ".join(args.TEXTS), font=args.font) | |
| if args.clip: | |
| clipboard.copy(result) | |
| print(result) | |
| if args.export: | |
| args.export.write(result + "\n") | |
| args.export.close() | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment