Go Down

Topic: Arabic Font? (Read 1 time) previous topic - next topic

Adam212

may you help me please to know from where can i get Arabic font for DMD?
i have 16X32 DMD and its working fine with English ,but i hope if i can display Arabic font.
thanks in advance.

Code

#include <SPI.h>        //SPI.h must be included as DMD is written by SPI (the IDE complains otherwise)
#include <DMD.h>        //
#include <TimerOne.h>   //
#include "SystemFont5x7.h"
#include "Arial_black_16.h"


//Fire up the DMD library as dmd
#define Budrate 9600
#define DISPLAYS_ACROSS 2
#define DISPLAYS_DOWN 1
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN);

/*--------------------------------------------------------------------------------------
  Interrupt handler for Timer1 (TimerOne) driven DMD refresh scanning, this gets
  called at the period set in Timer1.initialize();
--------------------------------------------------------------------------------------*/
void ScanDMD()
{
  dmd.scanDisplayBySPI();
}

/*--------------------------------------------------------------------------------------
  setup
  Called by the Arduino architecture before the main loop begins
--------------------------------------------------------------------------------------*/
void setup(void)
{
   //initialize TimerOne's interrupt/CPU usage used to scan and refresh the display
   Timer1.initialize( 5000 );           //period in microseconds to call ScanDMD. Anything longer than 5000 (5ms) and you can see flicker.
   Timer1.attachInterrupt( ScanDMD );   //attach the Timer1 interrupt to ScanDMD which goes to dmd.scanDisplayBySPI()
   dmd.clearScreen( true );   //true is normal (all pixels off), false is negative (all pixels on)
   Serial.begin(Budrate);

}


void loop(void)
{
   
   dmd.clearScreen( true );
   dmd.selectFont(Arial_Black_16);

 String content = "";
 char character;
 
 while(Serial.available())
 {
   character = Serial.read();
   content.concat(character);
  // delay (10);
 }
 if (content != "")
 {
   Serial.println(content);
 }
char *txt;
txt=&content[0];

   dmd.clearScreen( true );
   for (byte x=0;x<DISPLAYS_ACROSS;x++) {
     for (byte y=0;y<DISPLAYS_DOWN;y++) {
       if(content.length()==6)
       dmd.drawString(  5,  1+(16*y), txt,content.length(), GRAPHICS_NORMAL );
       if(content.length()==5)
       dmd.drawString(  10,  1+(16*y), txt,content.length(), GRAPHICS_NORMAL );
       else  if(content.length()==4)
       dmd.drawString(  15,  1+(16*y), txt,content.length(), GRAPHICS_NORMAL );
       //Ahmed rememeber that MEssage must be more or = 7 Char.
       else if(content.length()>=7)
       {
        dmd.drawMarquee(txt,content.length(),(32*DISPLAYS_ACROSS)-1,0);
        long start=millis();
        long timer=start;
        boolean ret=false;
        while(!ret){
        if ((timer+30) < millis()) {
        ret=dmd.stepMarquee(-1,0);
        timer=millis();
    }
  }
       }
     }
   }
   delay( 500 );   
   
}

Peter_I

maybe there is something here:
http://firstrobote.blogspot.dk/2012/12/arduino-with-lcd.html
?


(I can't read it, hopefully I have not linked to something naughty!)
"Nothing is foolproof to a sufficiently talented fool"

Adam212


Adam212

it's not Arabic font , but thanks peter for your help.

dannable

Is Arabic a 'letter' based language? If so you are importing what appears to be a couple of font files. Have a look at those to see if you can create your own font?
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

Adam212


Peter_I

Is Arabic a 'letter' based language? If so you are importing what appears to be a couple of font files. Have a look at those to see if you can create your own font?
It is, and there is a set of ASCII codes for the letters:
http://www.ascii.ca/iso8859.6.htm

"Nothing is foolproof to a sufficiently talented fool"

Go Up