| Crates.io | xibao-gen |
| lib.rs | xibao-gen |
| version | 0.1.0 |
| created_at | 2024-12-09 06:54:14.186136+00 |
| updated_at | 2024-12-09 06:54:14.186136+00 |
| description | Generate Xǐbào(喜报, CONGRATULATIONS) image. |
| homepage | |
| repository | https://github.com/onion108/xibao-gen |
| max_upload_size | |
| id | 1477016 |
| size | 2,753,152 |
Generates a picture with a title of Xǐbào (CONGRATULATIONS) and given text in the middle.
Very early stage.
Sample result:

pkg-config, run pkg-config --cflags sdl2 to confirm.pkg-config, run pkg-config --cflags SDL2_image to confirm.This project depends on the following non-rust libraries.
Assuming the tool's binary is called xibao-gen.
To generate a Xǐbào with given text, use
xibao-gen "Your text here"
or
xibao-gen --text "Your text here"
If the given text is in a file, then use -i or --from-file to specify the path of the file.
xibao-gen -i path/to/your/file
instead.
The output image will usually named output.png in the current directory. If you want to specify output image's path, you can use -o or --to-file.
xibao-gen -o path/to/output.png -i path/to/your/file
Notice that .png will be added automatically if you don't.
To adjust size of the image, use --size or for short -s. (Default size is 48)
xibao-gen -s 64 Hello_World
Combine them together, here is an example for generating a Xǐbào picture, which the content is from file xibao_content.txt, and outputs to result.png, using font size of 64:
xibao-gen -i xibao_content.txt -o result.png -s 64
For further help, use
xibao-gen --help