Clearing some areas from the GLCD

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Tue Dec 12, 2006 9:16 pm

You might want to go to the wiki and download a font converter update

http://www.sfcompiler.co.uk/wiki/pmwiki ... sefulLinks

This version will allow you to set a range of ASCII characters to generate. When you have downloaded the executable, double click to install the plugin. From the IDE, just select PLUGIN...SWORDFISH...FONT CONVERTER

Then select OPTIONS...SET RANGE. A dialog box will be shown. Make sure it has the following entries

32 - 126, 176

This will generate the standard font characters, plus the degree symbol. Click OK, then press 'Convert'. The code will be automatically posted into the IDE.

Save as 'xArial.bas' in either the UserLibrary or wherever you source code is located.

Here is some code to display the degree symbol...

Code: Select all

// set options here !!
include "graphics.bas"
include "GLCD.bas"
include "xArial.bas"

const DegreeSym = 127

GLCD.Cls
GLCD.SetFont(Arial)
WriteAt(10,10,"10.25 ",DegreeSym,"C")
You can use the font converter to generate other symbols, such as copyright etc (assuming the font supports it). Use something like word to get the extended ASCII value.

Notice when displaying the symbol, it is at 127. If you also generated a copyright symbol, it would be at 128 and so on.

This should really make displaying a degree symbol with most fonts really easy. You wont need to mess about with images etc...

CS
Posts: 127
Joined: Thu Nov 02, 2006 9:14 am

Post by CS » Tue Dec 12, 2006 10:11 pm

Hi David,

I love the way how fast you solve problems. At this time I'll only say thanks, because I know that this solution will work perfect but I can't test it now because I have to go to bed now. (It's an order from my chef! :lol: )

Reguards

CS

Post Reply