Pages: [1]   Go Down
Author Topic: inserting regional language in lcd(programming CGRAM of lcd)  (Read 2055 times)
0 Members and 1 Guest are viewing this topic.
india
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,
    i have 16x2 lcd. in which i can program only 8 char. i want to insert my regional language (country - india  language-hindi). can any one please suggest which lcd is best.  or is there any lcd which come up with preloadead language. 
Logged

Germany
Offline Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As far as I know Hindi Alphabet is mainly based on Sanskrit. Altogether you may need around 50 glyphs. So the question is: Is an character LCD really sufficient?

I am working on an new graphics library for the Arduino Board, which will also allow to display foreign languages (like Sanskrit). This lib, however, will only support graphics LCDs.
Indeed i wanted to add an example with sanskrit to my lib to show that any language could be supported. See the alphabet on the project page here:

http://code.google.com/p/u8glib/wiki/fontgroupunifont

A beta version is already there for download, which already allows you to put Sanskrit on an graphics display.
So instead of an 16x2 display i would really suggest to look for a cheap KS0108 based graphics display or any other type of display which is listed here:

http://code.google.com/p/u8glib/wiki/device


see here for example: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1276043339

Oliver


« Last Edit: January 12, 2012, 08:06:03 am by olikraus » Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2702
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you decide to use a ks0108 based glcd, you could also use the glcd library.
While it does not come with the font you are wanting, it
will allow you to create your own custom fonts from  any of the fonts installed on your system.
(You use the JAVA based GLCDFontCreator2 tool)
The library also supports many graphical functions like drawing lines, circles, bitmaps etc...
It does require using quite a bit of pins though.. It takes 13 pins to run it.
Here is a link to the ks0108 glcd library play ground page.
http://www.arduino.cc/playground/Code/GLCDks0108

And here is a link to the google code page where the latest source with downloadable
images can be found. You will want glcd v3 RC3
http://code.google.com/p/glcd-arduino/

You can look at the ks0108 playground page
as well as download the package and review the documentation, to see if that is the way you want to go.
The HTML documentation for the library will be in glcd/doc/GLCDref.htm inside the zip image.


The nice thing about getting a ks0108 display is that you could use either the glcd library or
Oliver's u8glib.

--- bill
« Last Edit: January 13, 2012, 02:09:11 pm by bperrybap » Logged

india
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi iam using glcd library. now if i create my own fonts but i want to send data which is logically OR with other (means pixel should be ored before sending it to lcd).  what changes i need to do in library
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2702
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure what you are wanting.
In the glcd library if you use any of the drawing primitives, the pixels are already OR'd into whatever
pixels are already there.

Text is a bit different as it clears the pixels under the glyph. Changing that would be very difficult.
The easiest thing in that case is to render the text first then draw the graphics on top of it.


--- bill
Logged

india
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks for reply sir.
actually i want to disply regional language hindi.
in that language if i send data"Ka" it should be single font
means e.g i want send data in following manner
GLCD.CursorTo(0, 0); on this position i want data from "System5X7" which is oring of 'K' and 'a'
'K'=   0x7F, 0x08, 0x14, 0x22, 0x41,// K
'a'=   0x20, 0x54, 0x54, 0x54, 0x78,// a
------------------------------------------------
"Ka"= (0x7F|0x20), (0x08|0x54), (0x14|0x54), (0x22|0x54), (0x41|0x78),
so this ored data i need to send to position (0,0)
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2702
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So  you want something that is an "a" overstrike on top of a "K"?
(image attached).

The glcd library cannot do overstrike text. But it does allow you to create your own fonts.
You can convert an existing font or define any glyph you want for any given character.

--- bill


* Ka.png (2.07 KB, 164x134 - viewed 24 times.)
Logged

india
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ohh thank you very much sir.
one more in GLCD library exactly where is the code which move data to lcd
'K'=   0x7F, 0x08, 0x14, 0x22, 0x41,
where in that library this data of 'K' is moved to lcd.
i write  GLCD.print("hello world");
but i cant find any GLCD::print() defination in library.
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2702
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

print() is handled by the print class.
The print class eventually calls write()
In the glcd library you can see the write() function in
the gText class in the module gText.cpp which then
calls the PutChar() function to render the glyph for the
particular character.

Changing the PutChar() function to render characters with overstrike
is not really a simple modification as any change in the PutChar() function affects
all character rendering all fonts and for all text areas.

It would be far simpler to create a custom glcd library font that contains the glyphs
you need, especially if there is already an existing font that can be used
to create the glcd library font.

--- bil
Logged

india
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

but in that case i need to create more than 500 custom characters.
but i think i cant create more than 255. as this is limit of ASCII.
am i write?
 or is it possible to create 500 character.
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2702
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The limit will be 255 per font. It really isn't a ASCII limit
but rather a limit of the write() API interface which passes 8 bit values.

So are you saying that regional language hindi  characters
are just "normal" ascii characters using overstrike?

There is a small modification you can do to the PutChar()
function that will *always* or in the pixels for each character glyph.
It will cause the character to render its glyph on top of what ever is already on the display.
This means that if you don't want overstrike
you will have to be careful to clear the text area or row
before writing a character the display.

In order to get proper character overstrike you will need to use fixed width fonts.
Depending on the size of the font, it may be difficult to identify the combined
overstrike "character".
There is another small patch that can render all the variable font characters
within the center of the fixed sized width for the variable font. Which will make the font
look a bit funny (spaced) but will allow variable fonts to use overstrike.

If you are interested in these modifications,
PM me your email address and I'll walk you through the process of those changes.

--- bill


Logged

Germany
Offline Offline
Edison Member
*
Karma: 136
Posts: 1491
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just a little remark on U8glib: I have already added Devanagari/Sanskrit to u8glib as part of the release. This includes unicodes 0x0900..0x09ff (as far as I remember):
http://code.google.com/p/u8glib/wiki/fontgroupunifont

Glyphs are taken from Unifont (http://unifoundry.com/unifont.html). In principle, any glyphs from Unifont can be translated to a font for u8glib. However, for u8glib a font can only contain 256 glyphs.

U8glib also supports KS0108 devices (limited to 128x64 pixel at the moment and lower speed than GLCDv3)

Oliver
Logged

india
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@bperrybap
MY EMAIL   cnavnath@gmail.com
i am interested in those changes please help me
Logged

Pages: [1]   Go Up
Jump to: