| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <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
<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>
- <br>
- <a target=_top href=../index.htm>Index</a><br>
- <br>
- Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=FontWidth&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|