image_colored_text

Crates.ioimage_colored_text
lib.rsimage_colored_text
version0.1.3
created_at2023-03-20 19:31:46.439304+00
updated_at2025-01-03 11:56:59.120993+00
descriptionA basic extension of the image/imageproc crates for writing multiline colored text
homepagehttps://github.com/erwanM974/image_colored_text
repositoryhttps://github.com/erwanM974/image_colored_text
max_upload_size
id815576
size442,293
(erwanM974)

documentation

README

A basic extension of the image/imageproc crates for writing multiline colored text

I initially wrote this code for this project: hibou.

Since then it has evolved a bit and I decided to repackage it on its own as a library.

Single line colored text

In the example below some colored text is written on a single line at different positions. In each of the three example, the little cross corresponds to the anchor position on which the text is written, with different options on how to use this position:

  • in the first example the text is written below and on the right of the anchor
  • in the second the text is centered around the anchor
  • in the third example, it is written above and on the left

The horizontal lines correspond to the expected width of the text.

drawing single line colored text

Multiline colored text

In the example below we have a similar example except that the input text is formatted in several lines. We also provide a means to specify the text alignment which is:

  • on the left for the first example
  • centered for the second
  • on the right for the third
drawing multi lines colored text

It is also possible to specify a background color:

drawing multi lines colored text with background color

And borders that can also be colored (here black) :

drawing multi lines colored text with background color and border
Commit count: 4

cargo fmt