Emulating Chinese fonts on matrix LED screens
There has been several authors working on Hong Kong highway LED signs, including tollauto’s tool and rk113’s tool. Their approaches are functional and are fun to work with, but not elegant. Therefore, I came up with a new approach to emulate LED fonts in their original form.
Most matrix LEDs screen, apart from the advancing technology and increasing resolution, still rely on low-resolution binary matrix fonts. Such as the ones you see in your command prompt, or old screens. These are not the TTF or OTF files familiar by most of the people to date, nor are they as fossil as printing blocks. They are encoded binary files that contains bits that represent each pixel — for example, an 8 px by 5 px font should use 40 bits, so that an A is shown in binary as,
00100
01010
10001
10001
11111
10001
10001
10001
and stored as a hex 22A31FC631
. Similarly for Chinese characters. Therefore, a font file basically contains the hex for each characters, at different locations determined by Big5 (a predecessor of Unicode). Instead of a 8 px font, LED displays in Hong Kong use 24 px x 24 px display for Chinese characters, and there is no kerning, lining, or spacing to consider given the one only benefit of this writing system — they are all monospaced.
The tools are all available, this blog post gives me a direction of the matrix fonts, this post gives an example in C to convert the font to ASCII arts (technically they are Big5 arts 🙂 ). By now, there are enough tools for me to make the code, but I am still lazy and discovered this ready-made python code and adapted it. Here is the code ready to use for generating bitmap images, and the preview shows temporary festive notice board coming from a complete impartial stand point.
