Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

XOR compressed fonts... #19

Closed
wants to merge 7 commits into from
Closed

XOR compressed fonts... #19

wants to merge 7 commits into from

Conversation

eltomjan
Copy link

@eltomjan eltomjan commented Apr 14, 2017

Hello,

this is a "POC" of simple, but effective font compression already implemented on of my project; please check also original repository (https://github.com/eltomjan/Adafruit_ILI9340) - do not know how to propagate latest changes to this request.
You can see results on my https://github.com/eltomjan/ETEhomeTools or test on Windows port in https://github.com/eltomjan/ETEhomeTools/tree/master/ArduinoSimulator, there is also Win build EXE https://github.com/eltomjan/ETEhomeTools/raw/master/ArduinoSimulator/ArduinoSimulatorEXE.zip of this demo.
I found fonts I am using are a bit bigger if XORed by both axes, but it should be quite random, so I left optional row xor logic in place.
I have changed also GFX, etc. 4 my project - I am printing same way like clear screen, so there is way better print speed (as SPI data are significantly reduced).
There is also option to print font as proportional, also write return pixel width instead of char's no 4 proportional.

Older version run on Pololu - A-Star 32U4 Micro, but latest changes were made & tested in simulator and then merged to original version.
If you prefer simple Arduino cage test, there is also a Cage.cpp in my Simulator, that should work in Arduino directly (if few related files from Simulator folder are included).

In case you want to create or import different fonts, there is also a cmd tool fntXorPacker.cpp (fntXorPacker was a main originally, but the renamed as I placed test parameters 2 different main calling that function).
It has GLCD, ASCII and "own" XORed fonts import options (GLCD & XORed are read as = {data} array from include file) , export only as XORed, but with huge comment showing whole proces, etc. (ASCII original, XORed, row bitmap bit 4 each row, column bitmap in case there are any data in the row, ASCII bytes again with dots instead of zeros and hexa non-zero data in output for particular row bytes).
Then ASCII part (even full comment content from XORed) could be used to (edit?) & read font again.

I am open to any questions/comments or improvements ;-)
Fonts could be switched, but I am using only one size for each font.

BR,
El Tom
P.S. For testing GLCD font import this project used https://github.com/andygock/glcd (planning to propose XORed export there too).

@ladyada
Copy link
Member

ladyada commented Nov 4, 2018

this library is deprecated, you can use Adafruit_ILI9341 instead!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants