0.8.1 How to Print a String with a lower font size

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

Moderators: roger, gloomyandy, skoehler

User avatar
Advanced Member
Posts: 362
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes

0.8.1 How to Print a String with a lower font size

Postby esmetaman » Sat May 10, 2014 5:08 pm

I would like to print in the screen a message but I would like to configure the screen to show the characters with a lower size.

How to do it?

Code: Select all

System.out.println("LONG EXAMPLE SHOWED IN 2 LINES");
Juan Antonio Breña Moral

New User
Posts: 4
Joined: Fri May 02, 2014 11:14 pm
Location: Germany

Re: 0.8.1 How to Print a String with a lower font size

Postby RMS » Sun Sep 14, 2014 4:45 pm

You need to configure the LCD before and use

GraphicsLCD gLCD = LocalEV3.get().getGraphicsLCD();

and use

gLCD.drawString("LONG EXAMPLE SHOWED IN 2 LINES", 5, 0, 0);

for output.

This code snippet directly shows the 3 available font sizes (LeJOS 0.81):

Code: Select all

GraphicsLCD gLCD = LocalEV3.get().getGraphicsLCD();
gLCD.drawString("Test SMALL", 2, 20, 0);
gLCD.drawString("Test DEFAULT", 2, 40, 0);
gLCD.drawString("Test LARGE", 2, 70, 0);

system.out.println does not support formatting, starts output on upper left corner of the screen and seems to always use DEFAULT font size, which is the medium size.

Hope this helps.

Best regards

Return to “EV3 Software”

Who is online

Users browsing this forum: Google [Bot] and 5 guests