KS0108 Text to Array Converter Program

This program converts the complete character set of any particular font into a data array, which the LCD module and driver program can use. I wrote this at a time when a program that could produce a data array compatible for use by a KS0108 based 128×64 LCD display, did not exist. It can also convert text of other languages besides English and there was nothing like that available. In addition, there was very little information available on how to parse different types of font files to extract the data.

I am no longer developing this, however if you wish to see any additional functionality, feel free to contact me with suggestions, and if I am free I might add it for you.

Program Operation

It is very simple to operate the program, starting from the left hand side controls and progressing to the right hand side.

1. Select the font type you wish to use by pressing the button "Select Font".

  • Choose the font type
  • Choose the font style
  • Choose the font Size

2. Select the ASCII range of the character set you wish to convert.

3. Press the "Calculate Size" button, which will print all the characters of the selected font of a desired ASCII range into a small window, and then calculate the footprint size of the characters. The footprint size defines the maximum placement window in pixel height and width that would be required for one character. The KS0108 LCD driver written in C requires these constants.

4. Press "Build Array File" to generate a .txt file with the font data converted to a data array.

5. Choose the location where you wish to save the font_data.txt file.

6. Open the file in any text editor to view the file.

When you wish to use the data inside it, just change the .txt extension to .h to make it a header file, or you could copy and paste the contents into your project header file.

Font Types

Any font that you have installed in your operating system may convert to a data array. Please note that your fonts must be monochrome. If you are using fonts that require anti-aliasing then those fonts will not appear clearly.

Anti-aliasing requires a grey scale, which LCD displays do not have the capability to display. If you have fonts that appear clear in monochrome, without anti-aliasing, then they should work well. On Windows, you will need to switch off anti-aliasing of the text display. Please check your operating system instructions on how to do this.

Font spacing

There is no font spacing stored in the data array, and instead, the spacing is generated automatically by the driver program, to save memory on the ATMega32. The text driver program generates adjacent character spacing for the LCD.


Some Windows fonts smaller than eight pixels in height may not appear clearly therefore you might have to try different micro fonts obtained from the Internet. Large font sizes will produce large data arrays, and the memory on the ATMega32 is limited. Therefore, when using large fonts, keep the ASCII character set range as narrow as possible. Use a good quality graphics card, and use at least 1024 × 768 or higher screen resolution.

To obtain the program, please click on the Terms and Conditions link below the page.

This Article Continues...

128x64 LCD
Programming the 128x64 LCD
KS0108 128x64 LCD Hardware Control
128x64 Timing and Modes
128x64 LCD Graphics Driver Design
128x64 ASCII Text Driver Design
128x64 Bar Graph