@Gordon, with that code there is a slowing down of the frame rate with/without the setFontDennis8() (the time i've gave you, was resulting of the code above with commented or not the font call...) just that...
Using custom font is 10 time slower.. why?
how to reduce the delay?
if i reduce the design of char (if i remove unused char design with white pixels...)will it be less time consuming for setting the font?
in other way why your custom font is quicker use than an external font?
Is it because the font is smaller (4x3 or 5x4)?
is it possible to produce a custom firmware with a custom font embeded with accent (yes i'm french and i use accents like many other non-english writers :) )
regards
var TX_ENABLE_PIN = A8;
var TX_PIN = B6;
var compteur=0;
var longT = 0;
var g = Graphics.createArrayBuffer(8,7,1);
var texte = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pellentesque dui at leo consectetur, finibus tempor tellus sollicitudin. Maecenas dignissim est sem, feugiat mollis sem aliquet a. Sed nunc ex, faucibus dapibus tortor et, dignissim tincidunt nisl. Nulla facilisi. Maecenas nunc nunc, interdum eu vulputate id, laoreet a lacus. Sed et felis dapibus sapien porta euismod vel ut mi. Etiam at augue vel quam dictum sodales a et purus. Donec ac erat posuere, maximus erat sit amet, facilisis lacus. Aenean dictum, sem et dignissim sagittis, eros velit ultrices purus, nec lobortis risus elit sed lectus. Maecenas tincidunt convallis mauris sit amet scelerisque. Suspendisse et lorem sit amet ligula dignissim feugiat. Maecenas tincidunt, eros non ultricies tincidunt, risus magna laoreet urna, in ultrices mi ipsum eget metus. Nam mollis ultricies fermentum. Fusce ac molestie mi, non suscipit quam. Nunc sit amet facilisis diam. Donec erat tellus, pellentesque vitae erat eget, viverra rutrum ex. Proin rhoncus nisl quam, a sodales nibh vulputate molestie. Proin at ex dolor. Cras turpis lacus, volutpat ut purus et, volutpat luctus massa. Mauris vel diam vestibulum, gravida risus sit amet, tristique ante. Mauris imperdiet lobortis arcu, in sollicitudin sem malesuada at. Donec volutpat justo quam, non viverra nulla ultrices quis. Duis luctus, turpis nec faucibus consequat, augue sapien consectetur ex, sit amet rhoncus ante purus in purus. In tristique dui nisl, ac fermentum turpis dictum et. Cras eu rutrum neque. Donec tempus tincidunt justo, quis elementum ex cursus eu. In lobortis, velit at tempor fringilla, ante risus feugiat dolor, eget eleifend nulla nibh eu urna. Nam quis sodales tortor, vitae convallis nisl. Suspendisse at accumsan ipsum, vel semper sapien. Sed sit amet sem dignissim, ultricies justo eget, euismod metus. Donec condimentum molestie velit, a sagittis turpis luctus vitae. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Duis id fermentum neque. Fusce euismod tristique urna at molestie. Maecenas eget facilisis magna, et euismod tellus. Nulla lacus nulla, cursus gravida libero vel, ultrices pharetra lacus. Vivamus sagittis ante leo, sed ultrices purus vestibulum at. Fusce aliquam blandit arcu, nec sodales diam interdum vel. Phasellus eget felis vitae elit vehicula porta ut eu sapien. Morbi congue eu dui vel posuere. Quisque sit amet mattis diam, porttitor porta nibh. Etiam id dictum ligula, a viverra fusce.";
function sendData() {
if (longT === 0) {
longT = g.stringWidth(texte);
console.log(longT);
}
if (compteur < -longT)
compteur = 7;
g = Graphics.createArrayBuffer(8,7,1);
t = getTime();
g.setFontDennis8();
g.drawString(texte,compteur,0);
console.log("Draw took ",getTime()-t);
LED1.toggle();
digitalPulse(TX_ENABLE_PIN,1,7);
Serial1.write([0x80,0x87,0xFF],g.buffer,[0x8F]);
compteur--;
}
function onInit() {
require("FontDennis8").add(Graphics);
g.setFontDennis8();
Serial1.setup(19200,{tx:TX_PIN});
setInterval(sendData, 70);
}
ps: i define only one time (in this code) the stringWidth() ;) thxs for the advice.
ps:2 with shorter text, it's quicker but not that much.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@Gordon, with that code there is a slowing down of the frame rate with/without the
setFontDennis8()
(the time i've gave you, was resulting of the code above with commented or not the font call...) just that...Using custom font is 10 time slower.. why?
how to reduce the delay?
if i reduce the design of char (if i remove unused char design with white pixels...)will it be less time consuming for setting the font?
in other way why your custom font is quicker use than an external font?
Is it because the font is smaller (4x3 or 5x4)?
is it possible to produce a custom firmware with a custom font embeded with accent (yes i'm french and i use accents like many other non-english writers :) )
regards
ps: i define only one time (in this code) the
stringWidth()
;) thxs for the advice.ps:2 with shorter text, it's quicker but not that much.