{"id":48195422,"url":"https://github.com/lsferreira42/figlet-go","last_synced_at":"2026-04-04T18:03:00.634Z","repository":{"id":332361985,"uuid":"1133552845","full_name":"lsferreira42/figlet-go","owner":"lsferreira42","description":"A figlet golang rewrite","archived":false,"fork":false,"pushed_at":"2026-02-06T00:52:18.000Z","size":3340,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-06T10:32:47.151Z","etag":null,"topics":["figlet","figlet-utility","golang","npm","npm-package"],"latest_commit_sha":null,"homepage":"https://lsferreira42.github.io/figlet-go/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lsferreira42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-13T14:02:10.000Z","updated_at":"2026-02-06T00:52:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lsferreira42/figlet-go","commit_stats":null,"previous_names":["lsferreira42/figlet-go"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lsferreira42/figlet-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsferreira42%2Ffiglet-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsferreira42%2Ffiglet-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsferreira42%2Ffiglet-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsferreira42%2Ffiglet-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lsferreira42","download_url":"https://codeload.github.com/lsferreira42/figlet-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsferreira42%2Ffiglet-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31407654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["figlet","figlet-utility","golang","npm","npm-package"],"created_at":"2026-04-04T18:02:41.729Z","updated_at":"2026-04-04T18:03:00.592Z","avatar_url":"https://github.com/lsferreira42.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Go-1.21+-00ADD8?style=for-the-badge\u0026logo=go\u0026logoColor=white\" alt=\"Go Version\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/lsferreira42/figlet-go/ci.yml?branch=main\u0026style=for-the-badge\u0026logo=github\u0026label=Build\" alt=\"Build Status\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-BSD--3--Clause-green?style=for-the-badge\" alt=\"License\"\u003e\n  \u003cimg src=\"https://goreportcard.com/badge/github.com/lsferreira42/figlet-go?style=for-the-badge\" alt=\"Go Report Card\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Linux-FCC624?style=flat-square\u0026logo=linux\u0026logoColor=black\" alt=\"Linux\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/macOS-000000?style=flat-square\u0026logo=apple\u0026logoColor=white\" alt=\"macOS\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Windows-0078D6?style=flat-square\u0026logo=windows\u0026logoColor=white\" alt=\"Windows\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eFIGlet-Go\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eA complete rewrite of \u003ca href=\"http://www.figlet.org/\"\u003eFIGlet\u003c/a\u003e in Go\u003c/p\u003e\n\n```\n _____ ___ ____ _      _         ____       \n|  ___|_ _/ ___| | ___| |_      / ___| ___  \n| |_   | | |  _| |/ _ \\ __|____| |  _ / _ \\ \n|  _|  | | |_| | |  __/ ||_____| |_| | (_) |\n|_|   |___\\____|_|\\___|\\__|     \\____|\\___/ \n```\n\nThis is a **100% compatible** implementation - it passes all the original FIGlet 2.2.5 tests and produces identical output to the C version.\n\n## Why?\n\nI wanted a FIGlet that:\n- Compiles to a single binary with all fonts embedded\n- Works the same way on any platform\n- Can be used as a Go library in other projects ✓\n\n## Installation\n\n```bash\ngit clone https://github.com/lsferreira42/figlet-go.git\ncd figlet-go\nmake build\n```\n\nOr with go install:\n\n```bash\ngo install github.com/lsferreira42/figlet-go@latest\n```\n\n## Usage\n\n### figlet\n\n```bash\n# pipe text\necho \"Hello World\" | ./figlet-bin\n\n# pass as argument\n./figlet-bin \"Hello World\"\n\n# use a different font\n./figlet-bin -f banner \"Hello\"\n\n# centered with slant font\n./figlet-bin -c -f slant \"Centered\"\n\n# right-to-left (Hebrew font)\n./figlet-bin -R -f ivrit \"Hello\"\n\n# custom width\n./figlet-bin -w 120 \"Wide output\"\n\n# full width (no smushing)\n./figlet-bin -W \"FULL\"\n\n# with colors (ANSI)\n./figlet-bin --colors 'red;green;blue' \"Colors\"\n\n# with TrueColor (hex)\n./figlet-bin --colors 'FF0000;00FF00;0000FF' \"TrueColor\"\n\n# HTML output\n./figlet-bin --parser html \"HTML Output\"\n\n# colored HTML output\n./figlet-bin --parser html --colors 'red;green;blue' \"Colored HTML\"\n```\n\n📖 **[Complete Colors and Output Formats Guide →](colors_outputs.md)**\n📖 **[Animated Figlet Guide →](animation.md)**\n\nSample output with different fonts:\n\n**standard (default):**\n```\n _   _      _ _        __        __         _     _ \n| | | | ___| | | ___   \\ \\      / /__  _ __| | __| |\n| |_| |/ _ \\ | |/ _ \\   \\ \\ /\\ / / _ \\| '__| |/ _` |\n|  _  |  __/ | | (_) |   \\ V  V / (_) | |  | | (_| |\n|_| |_|\\___|_|_|\\___/     \\_/\\_/ \\___/|_|  |_|\\__,_|\n```\n\n**banner:**\n```\n#     # ####### #       #       ####### \n#     # #       #       #       #     # \n#     # #       #       #       #     # \n####### #####   #       #       #     # \n#     # #       #       #       #     # \n#     # #       #       #       #     # \n#     # ####### ####### ####### ####### \n```\n\n### Command Line Options\n\n```\nUsage: figlet [ -cklnoprstvxDELNRSWX ] [ -d fontdirectory ]\n              [ -f fontfile ] [ -m smushmode ] [ -w outputwidth ]\n              [ -C controlfile ] [ -I infocode ] [ message ]\n```\n\n| Option | Description |\n|--------|-------------|\n| `-f font` | Specify font file |\n| `-d dir` | Specify font directory |\n| `-w width` | Set output width (default: 80) |\n| `-c` | Center justify |\n| `-l` | Left justify |\n| `-r` | Right justify |\n| `-k` | Kerning mode (letters touch) |\n| `-o` | Overlap mode (letters overlap) |\n| `-W` | Full width (no smushing) |\n| `-S` | Force smushing |\n| `-s` | Use font's default smushing |\n| `-L` | Left-to-right text |\n| `-R` | Right-to-left text |\n| `-X` | Auto direction based on font |\n| `-p` | Paragraph mode |\n| `-n` | Normal mode (default) |\n| `-D` | German character translation |\n| `-E` | Disable German translation |\n| `-C file` | Add control file |\n| `-N` | Clear control file list |\n| `-t` | Use terminal width |\n| `-v` | Display version info |\n| `-I code` | Display info (0=version, 1=version int, 2=font dir, 3=font name, 4=output width, 5=supported font formats) |\n| `--colors colors` | Set colors for output (e.g., `--colors red;green;blue` or `--colors FF0000;00FF00`) - See [Colors Guide](colors_outputs.md) |\n| `--parser parser` | Set output parser (`terminal`, `terminal-color`, or `html`) - See [Output Formats Guide](colors_outputs.md) |\n| `--animation type` | Set animation type (`reveal`, `scroll`, `rain`, `wave`, `explosion`) - See [Animations Guide](animation.md) |\n| `--animation-delay ms` | Set delay between frames in milliseconds (default: 50ms) |\n| `--export file` | Save animation frames to a file |\n| `--animation-file file` | Play an exported animation file |\n\n### chkfont\n\nFont file validator. Checks FIGlet 2.0/2.1 font files (`.flf`) for format errors without modifying them.\n\n```bash\n# build chkfont\nmake build-chkfont\n\n# check a single font\n./chkfont-go fonts/standard.flf\n\n# check multiple fonts\n./chkfont-go fonts/*.flf\n\n# check from stdin\n./chkfont-go -\n```\n\n```\nUsage: chkfont-go fontfile ...\n```\n\n**What it checks:**\n\nErrors (fatal):\n- Invalid magic number (must be `flf2`)\n- First line improperly formatted\n- charheight/maxlen not positive\n- Unexpected end of file\n\nErrors:\n- Filename doesn't end with `.flf`\n- Line length exceeds maxlen\n- Inconsistent character width within a character\n- Too many endmarks (more than 2)\n- Invalid layout values\n- Invalid old_layout values\n- up_height out of bounds\n- Code tag -1 (unusable)\n- Inconsistent Codetag_Cnt\n\nWarnings:\n- Sub-version character is not 'a'\n- Unusual hardblank character\n- Blank endmark\n- Inconsistent endmark between lines\n- Endchar count convention violated\n- Code tag \u003e 65535\n- Code tag in ASCII range (32-126)\n- Code tag in old Deutsch area (-255 to -249)\n- Non-increasing code tags\n- Extra characters after font data\n\n**Output example (valid font):**\n```\nfonts/standard.flf: Errors: 0, Warnings: 0\n-------------------------------------------------------------------------------\n```\n\n**Output example (font with issues):**\n```\ntests/emboss.tlf: ERROR- Filename does not end with '.flf'.\ntests/emboss.tlf: ERROR- Incorrect magic number.\ntests/emboss.tlf: ERROR- Inconsistent character width in line 27.\ntests/emboss.tlf: ERROR- Line length \u003e maxlen in line 38.\n*******************************************************************************\ntests/emboss.tlf: Too many errors/warnings.\ntests/emboss.tlf: Errors: 21, Warnings: 0\ntests/emboss.tlf: maxlen: 8, actual max line length: 13\n-------------------------------------------------------------------------------\n```\n\n### Helper Scripts\n\n```bash\n# list all available fonts and control files\n./figlist\n\n# show a sample of each font\n./showfigfonts\n\n# show a specific word in all fonts\n./showfigfonts \"Test\"\n\n# use fonts from a different directory\n./showfigfonts -d /path/to/fonts\n```\n\n## Using as a Library\n\nFIGlet-Go can be used as a library in your Go projects. See the **[complete library documentation](lib.md)** for a full tutorial and API reference.\n\n### Quick Start\n\n```bash\ngo get github.com/lsferreira42/figlet-go/figlet\n```\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n\n    \"github.com/lsferreira42/figlet-go/figlet\"\n)\n\nfunc main() {\n    // Simple usage\n    result, err := figlet.Render(\"Hello!\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    fmt.Print(result)\n\n    // With a specific font\n    result, err = figlet.RenderWithFont(\"Go!\", \"slant\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    fmt.Print(result)\n\n    // With options\n    result, err = figlet.Render(\"Centered\",\n        figlet.WithFont(\"big\"),\n        figlet.WithWidth(60),\n        figlet.WithJustification(1), // center\n    )\n    if err != nil {\n        log.Fatal(err)\n    }\n    fmt.Print(result)\n}\n```\n\n### Library Features\n\n- **Simple API**: `Render()` and `RenderWithFont()` for quick usage\n- **Functional Options**: Configure with `WithFont()`, `WithWidth()`, `WithJustification()`, etc.\n- **Full Control**: Use `Config` struct directly for advanced usage\n- **146 Embedded Fonts**: All fonts from [figlet.org](http://www.figlet.org/fontdb.cgi) are embedded\n- **Font Discovery**: `ListFonts()` returns all available fonts\n- **Color Support**: ANSI colors and TrueColor (24-bit RGB) support\n- **Output Parsers**: Terminal (normal), terminal with colors, and HTML output formats\n\n📖 **[Colors and Output Formats Documentation →](colors_outputs.md)** - Complete guide for command-line usage\n- **Color Support**: ANSI colors and TrueColor (24-bit RGB) support\n- **Output Parsers**: Terminal (normal), terminal with colors, and HTML output formats\n\n📖 **[Full Library Documentation →](lib.md)**\n\n## Web/Browser Usage\n\nFIGlet-Go can run in the browser via WebAssembly!\n\n### Online Playground\n\nTry it now at: **[FIGlet-Go Playground](https://lsferreira42.github.io/figlet-go/)**\n\n### npm Package\n\nInstall the npm package for Node.js or browser use:\n\n```bash\nnpm install figlet-go\n```\n\n```javascript\nconst figlet = require('figlet-go');\n\n// Simple rendering\nconst art = await figlet.render('Hello!');\nconsole.log(art);\n\n// With a specific font\nconst slantArt = await figlet.renderWithFont('Go!', 'slant');\nconsole.log(slantArt);\n\n// List available fonts\nconst fonts = await figlet.listFonts();\nconsole.log(fonts);\n```\n\n### Building WebAssembly\n\n```bash\n# Build the WASM module\nmake build-wasm\n\n# Build and serve the playground locally\nmake serve-website\n# Opens at http://localhost:8080\n\n# Build the npm package\nmake npm-build\n\n# Publish to npm (requires npm login)\nmake npm-publish\n```\n\n## Compatibility\n\nThis implementation is **100% compatible** with the original FIGlet 2.2.5:\n\n- Passes all 26 official test cases\n- Produces identical output to the C version\n- Supports all command-line options\n- Handles all font files (.flf) and control files (.flc)\n- Supports TOIlet fonts (.tlf)\n- Handles all encoding modes:\n  - ISO 2022 (with G0/G1/G2/G3 character sets)\n  - UTF-8\n  - DBCS (Double-Byte Character Sets)\n  - HZ encoding\n  - Shift-JIS\n\nYou can run compatibility tests against the original C version:\n\n```bash\n# requires figlet (C version) installed\nmake test-compat\n```\n\n## Fonts\n\n**146 fonts** are embedded in the binary, downloaded from the [FIGlet font database](http://www.figlet.org/fontdb.cgi). Popular fonts include:\n\n`standard`, `banner`, `big`, `block`, `slant`, `shadow`, `script`, `small`, `doom`, `graffiti`, `starwars`, `larry3d`, `colossal`, `gothic`, `epic`, `poison`, `roman`, `rounded`, `speed`, `stellar`, and many more!\n\nRun `figlist` to see all available fonts, or use `figlet.ListFonts()` in Go.\n\nThere are also control files (`.flc`) for different encodings: UTF-8, ISO 646 variants, ISO 8859, JIS, KOI8-R, etc.\n\nYou can use fonts from other directories:\n\n```bash\n./figlet-bin -d /path/to/fonts -f myfont \"Hello\"\n# or\nexport FIGLET_FONTDIR=/path/to/fonts\n```\n\n## Building\n\n```bash\nmake build          # build figlet\nmake build-chkfont  # build the font checker\nmake test           # run tests\nmake test-compat    # test against C version (needs figlet installed)\n```\n\nRequires Go 1.21+.\n\n## Project Structure\n\n```\nfiglet-go/\n├── figlet.go              # main executable entry point\n├── chkfont.go             # font file validator\n├── go.mod                 # Go module\n├── Makefile               # build commands\n├── LICENSE                # BSD 3-Clause\n├── lib.md                 # library documentation\n│\n├── figlet/                # FIGlet library package\n│   ├── figlet.go          # core FIGlet implementation\n│   ├── figlet_test.go     # library tests\n│   ├── terminal_unix.go   # terminal width detection (Linux/macOS)\n│   ├── terminal_windows.go # terminal width detection (Windows)\n│   └── fonts/             # 146 embedded .flf fonts + .flc control files\n│\n├── wasm/                  # WebAssembly build source\n│   └── main.go            # WASM entry point\n│\n├── website/               # Online playground\n│   ├── index.html         # playground UI\n│   ├── styles.css         # styles\n│   ├── main.js            # JavaScript\n│   ├── wasm_exec.js       # Go WASM support\n│   └── figlet.wasm        # compiled WASM (generated)\n│\n├── npm/                   # npm package\n│   ├── package.json       # npm configuration\n│   ├── src/               # package source\n│   └── README.md          # npm documentation\n│\n├── example/               # library usage examples\n│   └── main.go\n│\n├── figlet.6               # man page for figlet\n├── chkfont.6              # man page for chkfont\n├── showfigfonts.6         # man page for showfigfonts\n│\n├── figlist                # lists available fonts (shell script)\n├── showfigfonts           # shows samples of all fonts (shell script)\n├── run-tests.sh           # main test runner\n├── run-lib-tests.sh       # library test runner\n├── run-chkfont-tests.sh   # chkfont test runner\n├── run-compatibility-tests.sh  # tests against C version\n├── fonts/                 # fonts for CLI (also embedded in library)\n└── tests/                 # 26 test cases + input files\n```\n\n## Roadmap\n\nDone:\n- [x] Full FIGlet 2.2.5 compatibility\n- [x] Cross-platform (Linux, macOS, Windows)\n- [x] Embedded fonts\n- [x] All encoding modes (UTF-8, ISO 2022, DBCS, HZ, Shift-JIS)\n- [x] TOIlet font support (.tlf)\n- [x] CI/CD\n- [x] **Go library for use in other projects** ([documentation](lib.md))\n- [x] **WASM build for browser usage** ([playground](https://lsferreira42.github.io/figlet-go/))\n- [x] **JavaScript/npm package** ([npm](https://www.npmjs.com/package/figlet-go))\n\nNext:\n- [x] **Color support (ANSI and TrueColor)** ✓ - See [Colors and Output Formats Guide](colors_outputs.md)\n- [x] **Output parsers (terminal with colors, HTML)** ✓ - See [Colors and Output Formats Guide](colors_outputs.md)\n\nThe color and parser ideas come from [figlet4go](https://github.com/mbndr/figlet4go).\n\n## License\n\nBSD 3-Clause. See [LICENSE](LICENSE).\n\nOriginal FIGlet by Glenn Chappell, Ian Chai, John Cowan, Christiaan Keet and Claudio Matsuoka.\n\n## Links\n\n- [Library Documentation](lib.md) - Complete API reference and tutorial\n- [FIGlet Official](http://www.figlet.org/)\n- [FIGlet Font Database](http://www.figlet.org/fontdb.cgi)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsferreira42%2Ffiglet-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flsferreira42%2Ffiglet-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsferreira42%2Ffiglet-go/lists"}