persian-figlet
v0.9.0
Published
A Figlet-style ASCII art renderer for Persian (Farsi) text with full contextual character shaping and RTL support.
Downloads
26
Maintainers
Readme
🌐 Try it Online
🚀 Live Demo - Persian Figlet Web Tool
Experience Persian Figlet directly in your browser with our interactive web tool.
✨ Features
- 💻 CLI Tool: Command-line interface for terminal usage with colors and file output
- 🎨 Multiple Font Styles: Standard and Slim fonts with distinct visual characteristics
- 🔤 Complete Persian Support: All Persian chars with proper contextual forms
- ↔️ Kerning System: Intelligent character spacing with overlap support for authentic Persian typography
- 🔗 Smart Char Connection: Automatic handling of char joining rules
- 📝 TypeScript Support: Full type definitions and IntelliSense support
- 🎯 Easy to Use: Simple API with sensible defaults
- 🧪 Well Tested: Comprehensive test coverage
- 📦 Zero Dependencies: Lightweight and self-contained
⚙️ Installation
npm install persian-figletyarn add persian-figlet📖 Usage
Command Line Interface (CLI)
Basic Usage
# Basic text conversion
persian-figlet "سلام دنیا"Advanced CLI Options
# With colors
persian-figlet "تست" --color red
persian-figlet "فارسی" -c blue
# Font selection
persian-figlet "متن" --font standard
persian-figlet "نمونه" -f standard
# Output to file
persian-figlet "ذخیره" --output output.txt
persian-figlet "فایل" -o result.txt
# List available fonts
persian-figlet --list-fonts
# Show library information
persian-figlet --infoCLI Colors
Available colors: red, green, blue, yellow, magenta, cyan, white
Pipe Usage
# Using with pipes
echo "پایپ" | xargs persian-figlet
persian-figlet "رنگی" -c green | less
# Save colored output
persian-figlet "رنگی" -c red > colored-output.txtCLI Help
persian-figlet --help
persian-figlet -v # versionJavaScript/TypeScript Library
Basic Usage
import { print, FontStyle } from 'persian-figlet';
// Basic usage with default font
print('سلام دنیا');
// Using different fonts
print('سلام دنیا', { font: FontStyle.STANDARD });
// Silent mode (no console output)
const result = print('سلام دنیا', { silent: true });
console.log(result);Example Output
print('تست');Will output beautiful ASCII art representation of the Persian text "تست".
█ █ █ █
█ █ █ █ █ █
████████████████████████████🚀 Roadmap & Future Work
Add & Create More Fonts
- Design “Slim”, “Rounded” or “Shadow” variations
- Allow community‑contributed font packs via a simple JSON schema
Ligature & Diacritic Support
- Render optional diacritics above/below base chars
Interactive Playground & Live Preview
- Web demo to type in Persian and see instant Figlet output
- Let users tweak spacing, font, and colors in real time
🙋 Contributing
For help on setting up the repo locally, building, testing, and contributing please see CONTRIBUTING.md.
🧑💻 Code of Conduct
All developers who wish to contribute through code or issues, take a look at the CODE_OF_CONDUCT.md.
📃 License
This project is licensed under the MIT License - see the LICENSE.md file for details.
🙏 Acknowledgments
- Inspired by the classic Figlet tool
- Built with love for the Persian language community
