3 个不稳定版本
0.2.0 | 2022 年 3 月 5 日 |
---|---|
0.1.1 | 2021 年 11 月 8 日 |
0.1.0 | 2021 年 10 月 25 日 |
#271 in 可视化
290KB
2K SLoC
Text To Png Cli (txt2png)
这个包提供了一种命令行应用程序,用于将简单的文本渲染为图像
用法
这是一个经典的 clap 应用程序,您可以使用 -h
查看所有选项
kguthrie@home text-to-png % ./txt2png -h
Text To Png Cli 0.1.0
Kevin G. <[email protected]>
Renders text to a png with some options
USAGE:
txt2png [OPTIONS] --output <file> [text]...
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-c, --color <color> Color of the text: e.g. Brown, #45A2f4, 666 [default: Orange Red]
-o, --output <file> Path of the file to write the rendered png
-f, --font-file <font-file> ttf or ttc font file to use
-s, --font-size <font-size> Font height in pixels [default: 64]
ARGS:
<text>... All trailing arguments will be treated as the text to render
要使用默认字体将文本渲染为 png 文件,请运行
kguthrie@home text-to-png % ./txt2png -o text.png -c DarkTurquoise -s 64 Rénder this, brö
您将得到
要使用自定义字体将文本渲染为 png 文件,请运行
kguthrie@home text-to-png % ./txt2png -o text.png -c 439EC2 -s 52 -f "fonts/Because I am Happy Regular.ttf" "Custom Fonts are Cool\!"
您将得到
依赖项
~9.5MB
~174K SLoC