text-to-png-cli

Crates.iotext-to-png-cli
lib.rstext-to-png-cli
version0.2.0
sourcesrc
created_at2021-10-25 00:36:53.339636
updated_at2022-03-05 01:31:35.358056
descriptionA command-line tool to render text to a png image with basic options
homepage
repositoryhttps://github.com/RookAndPawn/text-to-png
max_upload_size
id470608
size25,279
Kevin Guthrie (johnhurt)

documentation

README

Text To Png Cli (txt2png)

This crate provides a command-line application for rendering simple text to an image

Usage

This is a classic clap app, you can see all the options with -h

kguthrie@home text-to-png % ./txt2png -h
Text To Png Cli 0.1.0
Kevin G. <kevin.guthrie@gmail.com>
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

To render text into a png file with the default font, run:

kguthrie@home text-to-png % ./txt2png -o text.png -c DarkTurquoise -s 64 Rénder this, brö

And you'll get

Rendered Text Image

To render text into a png file with the a custom font, run:

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\!"

And you'll get

Rendered Text Image

Commit count: 14

cargo fmt