Hi People,
A few years ago I started playing with a STM32F411RE & 7 inch 800x480
Lcd display using an SSD1963 controller just to pass the time.
When I required larger fonts such as 72pt numeric characters I found
The memory requirements for the font to be prohibitively large. After
Looking around for a font compression app I was unable to find one,
but I did come across ‘The Dot Factory’ source by Pavius in C# on Github.
https://github.com/pavius/the-dot-factory‘The Dot Factory’ did everything I wanted except give me a compressed
font output. After looking at the source I found a suitable place to break in
and add my own output code. (This is used via a dropdown menu)
I’ve only used MSVC6 & winapi and not worked with C# before so please
keep this in mind when critically viewing the source.
The new output (If selected) will now generate Run-Length-Encoded font
data and spit-out some size statistics to help decide if it’s worthwhile.
Snippet below:
( Ignore ‘Continuous Bitmap’ I lost interest before completing it)
// *** Font Encoding Statistics ***
//
// This font has been encoded with 'The Dot Factory'
// using Run-Length-Encoding (RLE) from a 72-Pt
// TrueType font called "Monofonto"
// '+' (Ascii 43) has the smallest width at 43 Pixels Wide
// '+' (Ascii 43) has the greatest width at 43 Pixels Wide
// '+' (Ascii 43) has the smallest height at 84 Pixels high
// '+' (Ascii 43) has the greatest height at 84 Pixels high
// The total Horizontal RLE bytes created for this font = 2183
// The total Vertical RLE bytes created for this font = 1653
// The total Vert+Horiz RLE bytes created for this font = 1619
// The total Continuous Bitmap bytes created for this font = 6328
// The total Standard Bitmap bytes created for this font = 7056
As you can see from generating 14 72pt chars ‘0123456789.,-+’ using a
Fixed font for a digital meter display, RLE only needs 1619 bytes.
(There are also some house-keeping arrays which need to be added to that figure for RLE)
Normally I would have just uploaded the new code to Github and let
nature take it’s course, and it would be found sooner or latter.
But As I’m still on XP with an old version of Firefox, I found
I could no longer upload files to Github and so ended up zipping
It up and putting it on SourceForge.
https://sourceforge.net/projects/dot-factory-rle/files/latest/downloadAs I’m not sure whether SourceForge is really used anymore I thought
I’d let people know that the app exists. Hopefully someone will find it useful
and maybe improve it and even load it up to Github.