Creating the Devanagari font for the DMD
-
- Posts: 2
- Joined: Fri May 05, 2017 4:46 am
Creating the Devanagari font for the DMD
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
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
Re: Creating the Devanagari font for the DMD
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
All the best, Geoff
-
- Posts: 2
- Joined: Fri May 05, 2017 4:46 am
Re: Creating the Devanagari font for the DMD
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.
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.
Re: Creating the Devanagari font for the DMD
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
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
-
- Posts: 7
- Joined: Mon Mar 19, 2018 5:41 am
Re: Creating the Devanagari font for the DMD
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.
please help.
-
- Posts: 144
- Joined: Fri Sep 20, 2013 7:25 am
Re: Creating the Devanagari font for the DMD
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.
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.
-
- Posts: 7
- Joined: Mon Mar 19, 2018 5:41 am
Re: Creating the Devanagari font for the DMD
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?
-
- Posts: 144
- Joined: Fri Sep 20, 2013 7:25 am
Re: Creating the Devanagari font for the DMD
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.
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.
-
- Posts: 7
- Joined: Mon Mar 19, 2018 5:41 am
Re: Creating the Devanagari font for the DMD
ok thanks for you help