How can I add new characters and use them in rust?

Hello. This is quite wide question. But how can I create my own characters, integrate them in the system(I am using Linux) and then use them in command line application written in Rust?
Here are examples of characters:
image

Direction of writing is Zig-Zag: first line from left to right, second line from right to left and so on.
There are 4 types of characters, each character have default shape that can be mutated in other shapes by changing or adding elements.
That is basically it.
Thank you for paying attention to this question.

Here is a link to the language writing system http://www.ithkuil.net/11_script.htm.

As far as I know, there’s no way for a command-line program to change the font used by the terminal emulator. There’s three basic approaches you can take:

  • Pick codepoints inside one of the Unicode private use areas to represent your new characters, and provide a font that draws the appropriate character for each codepoint. Users will have to manually switch to your font for the program’s output to be intelligible.
  • Use something like box-drawing characters to approximate your new characters. Users won’t need to install a new font, but you’ll have reduced density and fidelity.
  • Use a graphics package that talks to the windowing system or framebuffer instead of using terminal output.

In the first two cases, you may want to use a crate like termion or ncurses to find out the terminal width to help get your line breaks in the correct place; you’ll probably need to do the right-to-left transformation manually.

3 Likes