Creating the Devanagari font for the DMD

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Post Reply
piyushpandey
Posts: 2
Joined: Fri May 05, 2017 4:46 am

Creating the Devanagari font for the DMD

Post by piyushpandey » Fri May 05, 2017 4:52 am

Dear FreeTronics Admin and DMD creator,

I want to create the Hindi or Devanagari font for my DMD , but I am stuck at the point from where to start, so can you please help me out in this issue that how should I proceed.

regards

User avatar
stryker
Posts: 268
Joined: Sat Jan 14, 2012 2:44 pm

Re: Creating the Devanagari font for the DMD

Post by stryker » Fri May 05, 2017 7:24 am

I recommend reading this post by @Brissieboy. His custom font is very well commented and from reading that I learned what I needed to create fonts.

All the best, Geoff

piyushpandey
Posts: 2
Joined: Fri May 05, 2017 4:46 am

Re: Creating the Devanagari font for the DMD

Post by piyushpandey » Sun May 07, 2017 11:03 am

Dear Stryker,

Actually, my problem is not designing the font, my problem is to discover the character from a text file or from an array holding the characters in the Devanagari, i.e.

dmd.drawMarquee(" Something written here in devanagri", 17, 31, 0);

or some file with the Devanagari content in it.

Now since there are the ASCII characters for the English alphabets so it's easy to compare which alphabet is there and then pick the corresponding text from the Arial_Black_16.h or some other font header file. But the Devanagari lie in the Unicode region, so my question is how to read from the file the data and then compare it with the text present in the custom made font header file.

User avatar
stryker
Posts: 268
Joined: Sat Jan 14, 2012 2:44 pm

Re: Creating the Devanagari font for the DMD

Post by stryker » Sun May 07, 2017 12:47 pm

Hi,

If your alphabet has a traditional order (akin to A, B, C, etc) then every symbol could be referred to by that index. If there are 30 symbols (I'm basing this entirely from wikipedia) then defining your symbols from A through ^ would allow you to do what you want, as a substitution cypher. It's not ideal, but should be simple enough.

It then comes down to how your data is encoded. How were you intending to feed the Arduino the stream of information to display? It's possible the Arduino could do the look-up to translate to the correct font-character for the symbol, constructing a string that it subsequently displays. If it's only to display hard-coded messages then that could be somthing you translate for it so your strings will be pre-loaded (in latin characters corresponding to the symbols you need to show).

Hope this helps,

Geoff

ankit_gupta
Posts: 7
Joined: Mon Mar 19, 2018 5:41 am

Re: Creating the Devanagari font for the DMD

Post by ankit_gupta » Wed Jul 04, 2018 1:48 pm

i have written the decoder which gives me the unicode decoded values of devanagari characters but my doubt is how to show combined characters of devnagari using the DMD library. i have also made the font file for devnagari the display shows everything properly but it is not able to show combined characters properly. for e.g. if i want to show अं the display shows अ ं as अं made by combining two characters अ and ं.
please help.

Brissieboy
Posts: 134
Joined: Fri Sep 20, 2013 7:25 am

Re: Creating the Devanagari font for the DMD

Post by Brissieboy » Wed Jul 04, 2018 11:54 pm

As it stands the DMD library (and DMD2 as well) cannot display combined characters. Each character is basically a bit map so a new character simply replaces the entire original.
The way the DMDs work does not allow adding anything to an existing display - like over-printing.
You will have to modify your copy of the library in order to achieve combined characters. It should be possible to retrieve the two characters from the font and bitwise 'OR' them to achieve the combined character which you could then display.
The other simpler option would be to just define the combined character within the font, but that might depend on how many combinations you need.

ankit_gupta
Posts: 7
Joined: Mon Mar 19, 2018 5:41 am

Re: Creating the Devanagari font for the DMD

Post by ankit_gupta » Thu Jul 05, 2018 1:35 pm

can you please tell me which function to modify in order to bitwise OR the data to show combined characters. according to my understanding it seems that modification should be done in DMD::writePixel(unsigned int bX, unsigned int bY, byte bGraphicsMode, byte bPixel) function, am i right?

Brissieboy
Posts: 134
Joined: Fri Sep 20, 2013 7:25 am

Re: Creating the Devanagari font for the DMD

Post by Brissieboy » Thu Jul 05, 2018 11:39 pm

I think you might need to add a new function which retrieves your characters and processes them, then call drawChar() to display it.
You would need to manage the display of your string carefully - only using drawstring when there are no overprinted characters. You could do this within your sketch without modifying the library.
This approach would probably rule out the use of marquee/scrolling.
I am also assuming that you are using a fixed width font, otherwise it might add complications overprinting characters of different widths.
There may be better approaches to achieve what you are after. I have never tried to achieve anything like this. Maybe someone else can help with suggestions.

ankit_gupta
Posts: 7
Joined: Mon Mar 19, 2018 5:41 am

Re: Creating the Devanagari font for the DMD

Post by ankit_gupta » Fri Jul 06, 2018 6:34 am

ok thanks for you help

Post Reply