Show HN:我制作了一个用于激光切割的命令行ASCII标志SVG生成器
Show HN: I built a command line ASCII logo SVG generator for laser cutting

原始链接: https://github.com/ykhli/ascii-logo

`ascii-logo-generator`是一个命令行工具,用于创建ASCII文本艺术并将其转换为SVG徽标。使用`npm install -g ascii-logo-generator`全局安装它。使用`ascii-logo generate "你的文本"`创建基本的ASCII艺术,使用`--font "字体名称"`自定义字体,并使用`--output filename.txt`将输出保存到文本文件。 对于SVG转换,添加`--svg`标志。可以使用`--color "#十六进制代码"`和`--background "#十六进制代码"`自定义SVG颜色。可以使用`--width`和`--height`调整尺寸。使用`--output filename.svg`将SVG输出保存到文件。 示例用法包括创建彩色的徽标,例如`ascii-logo generate "Logo" --svg --color "#FF6600" --background "#EEEEEE" --output brand-logo.svg"`。该工具还提供本地开发说明,包括克隆存储库、安装依赖项(`npm install`)、构建项目(`npm run build`)和本地运行(`npm start`)。包含一个基于Web的SVG查看器用于测试目的。该项目采用MIT许可证。

Hacker News 最新 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交 登录 Show HN:我构建了一个用于激光切割的命令行 ASCII logo SVG 生成器 (github.com/ykhli) 4 分,作者 ykhli,1 小时前 | 隐藏 | 过去 | 收藏 | 讨论 加入我们 6 月 16-17 日在旧金山举办的 AI 初创公司学校! 指导原则 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系我们 搜索:

原文

A command-line tool for creating ASCII text art and converting it to SVG logos.

I built this so I can generate a ASCII logo and run it through my laser cutter. Example: Screenshot 2025-03-24 at 11 29 33 AM

Laser cut on Midori notebook:

Screenshot 2025-03-24 at 11 31 33 AM
npm install -g ascii-logo-generator
# Basic usage
ascii-logo generate "Hello World"

# Use a specific font
ascii-logo generate "Hello World" --font "Standard"

# Save to a file
ascii-logo generate "Hello World" --output hello.txt
# Generate an SVG
ascii-logo generate "Hello World" --svg

# Customize SVG colors
ascii-logo generate "Hello World" --svg --color "#3366FF" --background "#EEEEEE"

# Set custom dimensions
ascii-logo generate "Hello World" --svg --width 800 --height 200

# Save to a specific file
ascii-logo generate "Hello World" --svg --output my-logo.svg
Option Alias Description Default
--font -f Font to use for text rendering "Standard"
--output -o Output file path Auto-generated filename
--svg -s Convert to SVG format false
--color -c Text color for SVG (hex code or name) "#000000"
--background -b Background color for SVG (hex code or name) "transparent"
--width -w SVG width "500"
--height -h SVG height "auto"

Basic ASCII Art Generation

ascii-logo generate "Big Text"

Output:

 ____  _       _____         _
| __ )(_) __ _|_   _|____  _| |_
|  _ \| |/ _` | | |/ _ \ \/ / __|
| |_) | | (_| | | |  __/>  <| |_
|____/|_|\__, | |_|\___/_/\_\\__|
         |___/

Creating an SVG with Custom Colors

ascii-logo generate "Logo" --svg --color "#FF6600" --background "#EEEEEE" --output brand-logo.svg

This will create an SVG file named brand-logo.svg with orange text on a light gray background.

# Clone the repository
git clone https://github.com/yourusername/ascii-logo-generator.git
cd ascii-logo-generator

# Install dependencies
npm install

# Build the project
npm run build

# Run locally
npm start

This package includes a web-based SVG viewer for testing:

MIT

联系我们 contact @ memedata.com