This is a little app to convert text to a downloadable image file. Demo is here
This is a tool for my friend to help students with reading disability to learn vocabulary.
Simply download as zip, extract then open index.html and use locally. If you want to host it to the Internet, check out the following simple methods:
Configurations can be find in [config.json] (https://github.com/lacek/text2image/blob/master/config.json).
charResMap
(Object)
An object containing mapping of characters to images. The key should be a single character. The value is the path to the image. The path can be absolute or relative.charVerticalAlign
(String [top|center|bottom])
Vertical alignment of character in a row.charHorizontalAlign
(String [left|center|right])
Horizontal alignment of characters in a row.charSpacingRatio
(Float [0-1])
Spacing ratio between each character. Average width of all characters is used as the base.lineSpacingRatio
(Float [0-1])
Spacing ratio between each line. Average height of all characters is used as the base.maxFileNameLength
(Integer [1-...])
Maximum length of the file name of downloadable image.
FileSaver is used to enable the "save as" feature. The list of supported browser can be found [here] (https://github.com/eligrey/FileSaver.js/#supported-browsers).
- If [cross origin image] (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-crossorigin) is used, the result will not be downloadable. You will need to use browser's "Save as" feature to store the result
- Tux Paint for demo image.
The MIT License