Applied docspak188.
This commit is contained in:
@@ -1,23 +1,58 @@
|
||||
<html><head><title>Command: FontWidth() </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'> FontWidth() </span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Returns the width of the widest character 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 width, in pixels, of the currently selected font (using <a href='SetFont.htm'>SetFont</a> - previously loaded with <a href='LoadFont.htm'>LoadFont</a>). This command returns the width of the WIDEST character of the font.</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>
|
||||
<html>
|
||||
<head>
|
||||
<title>Blitz3D Docs</title>
|
||||
<link rel=stylesheet href=../css/commands.css type=text/css>
|
||||
</head>
|
||||
<body>
|
||||
<h1>FontWidth()</h1>
|
||||
<h1>Parameters</h1>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
None.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h1>Description</h1>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
This returns the width, in pixels, of the currently selected font (using SetFont - previously loaded with LoadFont). This command returns the width of the WIDEST character of the font.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h1><a href=../2d_examples/FontWidth.bb>Example</a></h1>
|
||||
<table>
|
||||
<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
|
||||
; enable graphics mode<br>
|
||||
Graphics 800,600,16<br>
|
||||
<br />
|
||||
Text 400,30,"The height of the font is:"+ FontHeight(),True,False
|
||||
; 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>
|
||||
<br />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user