<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.mcselec.com/bavr/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.mcselec.com/bavr/index.php?action=history&amp;feed=atom&amp;title=SETFONT</id>
		<title>SETFONT - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.mcselec.com/bavr/index.php?action=history&amp;feed=atom&amp;title=SETFONT"/>
		<link rel="alternate" type="text/html" href="http://wiki.mcselec.com/bavr/index.php?title=SETFONT&amp;action=history"/>
		<updated>2026-04-26T00:39:31Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.18.6</generator>

	<entry>
		<id>http://wiki.mcselec.com/bavr/index.php?title=SETFONT&amp;diff=827&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;= &lt;span class=&quot;f_Header&quot;&gt;Action&lt;/span&gt; =  Sets the current font which can be used on some graphical displays.  &lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&lt;/span&gt;  &lt;span style=&quot;fo...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.mcselec.com/bavr/index.php?title=SETFONT&amp;diff=827&amp;oldid=prev"/>
				<updated>2013-02-12T16:17:17Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Action&amp;lt;/span&amp;gt; =  Sets the current font which can be used on some graphical displays.  &amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;  &amp;lt;span style=&amp;quot;fo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Action&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
Sets the current font which can be used on some graphical displays.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Syntax&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;f_Syntax&amp;quot;&amp;gt;SETFONT&amp;lt;/span&amp;gt;&amp;amp;nbsp;font&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Remarks&amp;lt;/span&amp;gt; =&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0px; margin: 0px 0px 0px 4px;&amp;quot;&amp;gt;&lt;br /&gt;
{| width=&amp;quot;488&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;1&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;12%&amp;quot; style=&amp;quot;width: 55px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
font&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
The name of the font that need to be used with LCDAT statements.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since SED-based displays do not have their own font generator, you need to define your own fonts. You can create and modify your own fonts with the FontEditor Plugin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SETFONT will set an internal used data pointer to the location in memory where you font is stored. The name you specify is the same name you use to define the font.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to include the used fonts with the $include directive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$INCLUDE &amp;quot;font8x8.font&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The order of the font files is not important. The location in your source is however important.&lt;br /&gt;
&lt;br /&gt;
The $INCLUDE statement will include binary data and this may not be accessed by the flow of your program.&lt;br /&gt;
&lt;br /&gt;
When your program flow enters into font code, unpredictable results will occur.&lt;br /&gt;
&lt;br /&gt;
So it is best to place the $INCLUDE files at the end of your program behind the END statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to include the glibSED library with&amp;amp;nbsp;:&lt;br /&gt;
&lt;br /&gt;
$LIB &amp;quot;glibsed.lbx&amp;quot;&lt;br /&gt;
&lt;br /&gt;
While original written for the SED1521, fonts are supported on a number of displays now including color displays.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;See also&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
[[CONFIG LCD|CONFIG GRAPHLCD]]&amp;amp;nbsp;,&amp;amp;nbsp;[[LCDAT]],&amp;amp;nbsp;[[GLCDCMD]],&amp;amp;nbsp;[[GLCDDATA]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Example&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;source lang=&amp;quot;bascomavr&amp;quot;&amp;gt;&lt;br /&gt;
'-----------------------------------------------------------------------------------------&lt;br /&gt;
'name : sed1520.bas&lt;br /&gt;
'copyright : (c) 1995-2005, MCS Electronics&lt;br /&gt;
'purpose : demonstrates the SED1520 based graphical display support&lt;br /&gt;
'micro : Mega48&lt;br /&gt;
'suited for demo : yes&lt;br /&gt;
'commercial addon needed : no&lt;br /&gt;
'-----------------------------------------------------------------------------------------&lt;br /&gt;
 &lt;br /&gt;
$regfile = &amp;quot;m48def.dat&amp;quot; ' specify the used micro&lt;br /&gt;
$crystal = 7372800 ' used crystal frequency&lt;br /&gt;
$baud = 115200 ' use baud rate&lt;br /&gt;
$hwstack = 32 ' default use 32 for the hardware stack&lt;br /&gt;
$swstack = 10 ' default use 10 for the SW stack&lt;br /&gt;
$framesize = 40 ' default use 40 for the frame space&lt;br /&gt;
 &lt;br /&gt;
'I used a Staver to test&lt;br /&gt;
 &lt;br /&gt;
'some routines to control the display are in the glcdSED.lib file&lt;br /&gt;
'IMPORTANT : since the SED1520 uses 2 chips, the columns are split into 2 of 60.&lt;br /&gt;
'This means that data after column 60 will not print correct. You need to locate the data on the second halve&lt;br /&gt;
'For example when you want to display a line of text that is more then 8 chars long, (8x8=64) , byte 8 will not draw correctly&lt;br /&gt;
'Frankly i find the KS0108 displays a much better choice.&lt;br /&gt;
 &lt;br /&gt;
$lib &amp;quot;glcdSED1520.lbx&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'First we define that we use a graphic LCD&lt;br /&gt;
 &lt;br /&gt;
Config Graphlcd = 120 * 64sed , Dataport = Porta , Controlport = Portd , Ce = 5 , Ce2 = 7 , Cd = 3 , Rd = 4&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
'The dataport is the portname that is connected to the data lines of the LCD&lt;br /&gt;
'The controlport is the portname which pins are used to control the lcd&lt;br /&gt;
'CE =CS Chip Enable/ Chip select&lt;br /&gt;
'CE2= Chip select / chip enable of chip 2&lt;br /&gt;
'CD=A0 Data direction&lt;br /&gt;
'RD=Read&lt;br /&gt;
 &lt;br /&gt;
'Dim variables (y not used)&lt;br /&gt;
Dim X As Byte , Y As Byte&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
'clear the screen&lt;br /&gt;
Cls&lt;br /&gt;
Wait 2&lt;br /&gt;
'specify the font we want to use&lt;br /&gt;
Setfont Font8x8&lt;br /&gt;
 &lt;br /&gt;
'You can use locate but the columns have a range from 1-132&lt;br /&gt;
 &lt;br /&gt;
'When you want to show somthing on the LCD, use the LDAT command&lt;br /&gt;
'LCDAT Y , COL, value&lt;br /&gt;
Lcdat 1 , 1 , &amp;quot;1231231&amp;quot;&lt;br /&gt;
Lcdat 3 , 80 , &amp;quot;11&amp;quot;&lt;br /&gt;
'lcdat accepts an additional param for inversing the text&lt;br /&gt;
'lcdat 1,1,&amp;quot;123&amp;quot; , 1 ' will inverse the text&lt;br /&gt;
 &lt;br /&gt;
Wait 2&lt;br /&gt;
Line(0 , 0) -(30 , 30) , 1&lt;br /&gt;
Wait 2&lt;br /&gt;
 &lt;br /&gt;
Showpic 0 , 0 , Plaatje 'show a comnpressed picture&lt;br /&gt;
End 'end program&lt;br /&gt;
 &lt;br /&gt;
'we need to include the font files&lt;br /&gt;
$include &amp;quot;font8x8.font&amp;quot;&lt;br /&gt;
'$include &amp;quot;font16x16.font&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
Plaatje:&lt;br /&gt;
'include the picture data&lt;br /&gt;
$bgf &amp;quot;smile.bgf&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;br/&amp;gt;{{Languages}}&lt;br /&gt;
&lt;br /&gt;
[[Category:BASCOM Language Reference]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>