This repository is a tutorial about how to create fonts (and bitmap images) for embedded system displays to use with my display drivers. It also has some font files prepared following this tutorial. I use this method for all my display driver codes.
Here, I'm using riuson's "lcd-image-converter" software and it's added as a submodule with this repository. This software makes making fonts and image bitmaps really easy. Also, it is highly customizable, so you can tweak your rendering algorithm as per your choice.
A detailed documentation is avaialable in his website. I highly recommend it to go and read that documentation. He also provided rendering algorithm there.
Note: I've modified the template files which are used to format the ouput .h/.c code, and also modified the "bitmap_typedefs.h" slightly. The later one has all the required definitions of custom datatypes used by the font files.
Now, I'm going to explain how to use this software to create fonts that are suitable for my display driver codes (listed below):
This repository contains the lcd-image-converter as a submodule. So,
- To only clone the font files (and templates):
git clone https://github.com/abhra0897/FontsEmbedded.git
- To clone everything (including the software):
git clone --recurse-submodules https://github.com/abhra0897/FontsEmbedded.git
Go to Riuson's website or GitHub repo and download/compile from source code by following the instructions given there. Run the software.
After you run the application, it'll ask you to select either "New Image" or "New Font". Select "New Font".
Give the font a name. I highly recommend giving a meaningful name like "font_ubunu_mono_bold_16".
Select which font you want to use in your embedded application. Then select its style and size. Then click "Ok".
If you're using a monospace font, I'd recommend you to go to the "Parameters" option and check the "Monospace" radio-button. It's not mandatory though.
In this window, you can see each character. If you want, you can modify the glyphs by drawing over them. Click on the "Options" tab.
After selecting option, select "Conversion"
In "Prepare" tab, configure the settings as per the given image:
Go to the "Image" tab and configure the output settings as per the image below:
This is the last step of configuration. Click on the "Template" tab and select the proper template files which are found in this repository.
Click the "OK" button ans "Save Changes".
Configuration is done. Now Go to "File" and click "Convert All". Save the output file in "C/C++ Header" format.
After the file is saved, you can see it's saved as your_file_name .c. We need it to be in .h format. So, reame the file to your_file_name .h.
Now you've successfully created a font, include the generated header file in your code along with the bitmap_typedefs.h file.
lcd-image-converter has its own licensing information.
All other source codes and files of the root directory are licensed under MIT License, unless the source file has no other license asigned for it. See MIT License.