Changing the font size of an output string to the LCD

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

Changing the font size of an output string to the LCD

Postby Gatanui » Thu Feb 23, 2012 1:12 pm

Just a quick question... is it possible to change the font size of an output string to the LCD and if yes, how? I checked the API for the LCD class, but it did not help very much, since I am not familiar with many of the methods. I tried changing the value of the final class variables FONT_HEIGHT and FONT_WIDTH, but without success. Does anybody know how to solve this issue?

~Gatanui
Gatanui
New User
 
Posts: 13
Joined: Thu Jun 16, 2011 2:08 pm

Re: Changing the font size of an output string to the LCD

Postby gloomyandy » Thu Feb 23, 2012 1:27 pm

You can use a different fonts, there are currently 3 supported. But you need to use a different set of classes take a look at the Graphics class:
http://lejos.sourceforge.net/nxt/nxj/ap ... phics.html
You should also take a look at the graphicssample (one of the many sample apps supplied with leJOS and installed on your system as part of the standard setup). The source for the 0.9.1 version can be seen here:
http://lejos.svn.sourceforge.net/viewvc ... threv=6356

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3881
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Changing the font size of an output string to the LCD

Postby Gatanui » Thu Feb 23, 2012 1:34 pm

So if I am getting this right, I cannot change the font size, merely the font style? Would I have to draw a larger letter pixel by pixel or importing a source image with a method like bitBlt() then?

~Gatanui
Gatanui
New User
 
Posts: 13
Joined: Thu Jun 16, 2011 2:08 pm

Re: Changing the font size of an output string to the LCD

Postby gloomyandy » Thu Feb 23, 2012 1:41 pm

Run the sample program and it will show you what you can do. There are three font sizes available if you use the classes I pointed you at. No need to draw things pixel by pixel...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3881
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK


Return to NXJ Software

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests

cron
more stuff