freetronics / DMD

Arduino library to support the Freetronics Dot Matrix Display
www.freetronics.com/dmd
141 stars 145 forks source link

Font with more than 127 characters: ignored after 127 #6

Open berni-v opened 9 years ago

berni-v commented 9 years ago

As french user, I need to display accented characters, such as é, ä, à, ë, ê, ... The windows fonts have this possibility, special western characters are coded (ISO code) in the range 128..255. For example "é" is the character 233, therefore to allow using such characters, the easy way is to export any windows font, including the characters above nr. 127, using "GLCD FontCreator 2". The DMD and DMD2 librairy is not able to display these characters because the character index used a "char" variable. A simple change to "unsined char" corrects the limitation.

In DMD.cpp: function drawChar can be changed as below:

int DMD::drawChar(const int bX, const int bY, const unsigned char letter, byte bGraphicsMode)

MrSmartus commented 6 years ago

in library file DMD-Text.cpp need to change one string from this: char c = letter; to this: unsigned char c = letter; This way u can get charaters over 127 ASCII