Page 10 of 12

Re: New beta release "DMD2" Library

Posted: Wed Apr 20, 2016 11:14 pm
by RuralGeek
Curious to know why the size of font changes how text is displayed?
If you choose a large font - once it reaches the edge of the display the first characters 'scoll' off and the new characters come on the end.
With the small font that spreads across two lines - it basically fills both lines and then stops. Any reason why the small fonts can't be scrolled like the larger fonts?

Re: New beta release "DMD2" Library

Posted: Tue May 03, 2016 6:12 am
by angusgr
RuralGeek, are you able to post your sketch code for me to take a look at?

Angus

Re: New beta release "DMD2" Library

Posted: Tue May 03, 2016 6:40 am
by RuralGeek
Fairly sure it was the SAMPLES -> DMD2 -> ScrollingAlphabet

Will try it in the morning to confirm this.

Re: New beta release "DMD2" Library

Posted: Thu May 05, 2016 3:55 am
by RuralGeek
Can confirm from the built -in sample, if you use this font: const uint8_t *FONT = Arial14;
The display simply keeps scrolling the text continuously.

With this font: const uint8_t *FONT = SystemFont5x7;
It fills the display and then stops...

Will investigate the code a bit more in depth over the weekend.

Re: New beta release "DMD2" Library

Posted: Tue Oct 31, 2017 3:17 pm
by plito
Why can´t I use a different font with DMD2 ? I modified a standar font but I had to use the same name ( Arial_Black ) because it doesn´t let me use a font with another name on the compilation. Sorry for my english.

Re: New beta release "DMD2" Library

Posted: Wed Nov 01, 2017 8:59 pm
by plito
Is there any instruction to replace "stepMarquee" of DMD library ? I´ve tried with "marqueeScrollX" but the scrolling is too slow using 4 P10 panels.
Thanks

Re: New beta release "DMD2" Library

Posted: Wed Nov 29, 2017 5:08 pm
by felipedream
Hi, How do I connect a 5x2 panel to arduino? with this dmd2 library, since the other one does not work for me at all.
Code:
http://www.shinedesign.cl/p10.html
Config:
Image

Re: New beta release "DMD2" Library

Posted: Wed Mar 07, 2018 2:40 am
by chello
ESP8266 swapbuffer support?

Re: New beta release "DMD2" Library

Posted: Tue May 01, 2018 6:47 am
by Brissieboy
Not sure how much support the DMD2 library is getting these days.
Seems to have stagnated.

Re: New beta release "DMD2" Library

Posted: Tue May 08, 2018 4:50 am
by Brissieboy
The DMD2 library (DMD2-0.0.3) has the same problem as the original DMD library where is cannot handle a variable width font space character - it always gives it an 'n' width regardless of the font definition.
I have modified the charWidth() method in the library to correct this problem. If you want to define your own width for the space character, you can replace the existing method in the DMD_Text.cpp file in the DMD2 directory under the Arduino libraries directory with the following:

Code: Select all

//Find the width of a character
//int DMDFrame::charWidth(const char letter, const uint8_t *font)
int DMDFrame::charWidth(char letter, const uint8_t *font)
{
  struct FontHeader header;
  memcpy_P(&header, (void*)this->font, sizeof(FontHeader));

  if(!font)
    font = this->font;

  if((uint8_t)letter < header.firstChar || (uint8_t)letter >= (header.firstChar + header.charCount)) {
    return 0;
  }

  if(header.size == 0) {
    // zero length is flag indicating fixed width font (array does not contain width data entries)
    return header.fixedWidth;
  } else {
  // variable width font, read width data for character
    if((letter == ' ') && (pgm_read_byte(this->font + sizeof(FontHeader)) == 0)) {
      // if the letter is a space and it is not defined in the font
	  // (ie the width value is zero) then give it the same width as an 'n'
	  letter = 'n';
    }
  }
  return pgm_read_byte(this->font + sizeof(FontHeader) + letter - header.firstChar);
}
This now correctly handles all cases:- fixed width; variable width without space definition; variable width with space definition.