24 lines
1.7 KiB
HTML
24 lines
1.7 KiB
HTML
<html><head><title>Command: FontHeight() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'> FontHeight() </span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the height of the currently selected font.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This returns the height, in pixels, of the currently selected font (using <a href='SetFont.htm'>SetFont</a> - previously loaded with <a href='LoadFont.htm'>LoadFont</a>).</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; FontWidth()/FontHeight example<br>
|
|
<br>
|
|
; enable graphics mode<br>
|
|
Graphics 800,600,16<br>
|
|
<br>
|
|
; Set global on font variable<br>
|
|
Global fntArial<br>
|
|
<br>
|
|
;Load fonts to a file handle variables<br>
|
|
fntArial=LoadFont("Arial",13,False,False,False)<br>
|
|
<br>
|
|
; set the font and print sizes<br>
|
|
SetFont fntArial<br>
|
|
Text 400,0,"The font width of the widest character is:"+ FontWidth(),True,False<br>
|
|
Text 400,30,"The height of the font is:"+ FontHeight(),True,False<br>
|
|
<br>
|
|
; Standard 'wait for ESC' from user<br>
|
|
While Not KeyHit(1)<br>
|
|
Wend<br>
|
|
<br>
|
|
; Clear all the fonts from memory!<br>
|
|
FreeFont fntArial<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
|
|
</html>
|