revised code to fix newline issue

10.5.x-maintenance
root 2019-04-04 20:21:34 +00:00
parent d58b721ab9
commit e72807a874
1 changed files with 4 additions and 2 deletions

View File

@ -96,7 +96,7 @@ FONT.constants = {
* Each line is composed of 8 asci 1 or 0, representing 1 bit each for a total of 1 byte per line
*/
FONT.parseMCMFontFile = function (data) {
var data = data.split("\n");
var data = data.trim().split("\n");
// clear local data
FONT.data.characters.length = 0;
FONT.data.characters_bytes.length = 0;
@ -115,7 +115,9 @@ FONT.parseMCMFontFile = function (data) {
FONT.data.hexstring = [];
var pushChar = function () {
// Only push full characters onto the stack.
if (character_bytes.length != 64) { return; }
if (character_bytes.length != FONT.constants.SIZES.MAX_NVM_FONT_CHAR_FIELD_SIZE) {
return;
}
FONT.data.characters_bytes.push(character_bytes);
FONT.data.characters.push(character_bits);
FONT.draw(FONT.data.characters.length - 1);