Example
Default Dictionary
Create an folder at your project root called letters/default
with this image named 00 abc.png
.
Initialize the default dictionary, you need to do this just once. It'll create a file for each character.
use ;
static LOREM : &str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
Now you can write anything that you want.
use ;
static LOREM : &str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
You'll find the result at the output folder named example-1.png
. For each page handmade
will create a file and will put it on the output file. If None
is used at parse_to_png
function, the files identifier will be page
.
Your own Dictionary
To use your own handwritten letter, first you'll need create a file just like the example below:
All letters must be in one line, in this exactly order to it to work. Remove any imperfections between letters, this kind of thing can lead to unexpected results.
Then you'll need to create a new folder in letters
folder with the desired name for the given dictionary, then put the letters file in it named 00 abc.png
.
The next step is to initialize the dictionary, it's done just like with Default
, but you'll need to pass the dictionary name to update_images
function.
For example, I've created a folder called letters/myDictionary
with the 00 abc.png
, so this is the step-by-step usage:
use ;
static LOREM : &str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
To use you'll need to create the Text struct with the function Text::new_with_dic_name
, passing the dictionary name, besides that, the usage is the same.
use ;
static LOREM : &str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
Documentation
Under construction.
Final Thoughts
The core concept of this lib was gently taken from handwritten.js.