| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>SetFont fonthandle</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- fontname = string containing font name
<br />
- height = font height desired
<br />
- bold = set to TRUE to load font as BOLD
<br />
- italic = set to TRUE to load font as ITALIC
<br />
- underlined set to TRUE to load font as UNDERLINED
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- This activates a TrueType font previously loaded into memory (though the LoadFont command) for future use with printing commands such as Text.
<br />
-
<br />
- Note: Blitz doesn't work with SYMBOL fonts, like Webdings and WingDings.
<br />
-
<br />
- Be sure to free the memory used by the font went you are done using the FreeFont command.
- </td>
- </tr>
- </table>
- <h1><a href=../2d_examples/SetFont.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; LoadFont/SetFont/FreeFont example
<br />
-
<br />
- ; enable graphics mode
<br />
- Graphics 800,600,16
<br />
-
<br />
- ; Set global on font variables
<br />
- Global fntArial,fntArialB,fntArialI,fntArialU
<br />
-
<br />
- ;Load fonts to a file handle variables
<br />
- fntArial=LoadFont("Arial",24,False,False,False)
<br />
- fntArialB=LoadFont("Arial",18,True,False,False)
<br />
- fntArialI=LoadFont("Arial",32,False,True,False)
<br />
- fntArialU=LoadFont("Arial",14,False,False,True)
<br />
-
<br />
- ; set the font and print text
<br />
- SetFont fntArial
<br />
- Text 400,0,"This is just plain Arial 24 point",True,False
<br />
-
<br />
- SetFont fntArialB
<br />
- Text 400,30,"This is bold Arial 18 point",True,False
<br />
-
<br />
- SetFont fntArialI
<br />
- Text 400,60,"This is italic Arial 32 point",True,False
<br />
-
<br />
- SetFont fntArialU
<br />
- Text 400,90,"This is underlined Arial 14 point",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 />
- FreeFont fntArialB
<br />
- FreeFont fntArialI
<br />
- FreeFont fntArialU
<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=SetFont&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|