FreeFont.htm 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>FreeFont fonthandle</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. fonthandle = A handle to a previously loaded font.
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. This removes a TrueType font previously loaded into memory (though the LoadFont command). <br />
  21. <br />
  22. Note: Blitz doesn't work with SYMBOL fonts, like Webdings and WingDings.
  23. </td>
  24. </tr>
  25. </table>
  26. <h1><a href=../2d_examples/FreeFont.bb>Example</a></h1>
  27. <table>
  28. <tr>
  29. <td>
  30. ; LoadFont/SetFont/FreeFont example <br />
  31. <br />
  32. ; enable graphics mode <br />
  33. Graphics 800,600,16 <br />
  34. <br />
  35. ; Set global on font variables <br />
  36. Global fntArial,fntArialB,fntArialI,fntArialU <br />
  37. <br />
  38. ;Load fonts to a file handle variables <br />
  39. fntArial=LoadFont("Arial",24,False,False,False) <br />
  40. fntArialB=LoadFont("Arial",18,True,False,False) <br />
  41. fntArialI=LoadFont("Arial",32,False,True,False) <br />
  42. fntArialU=LoadFont("Arial",14,False,False,True) <br />
  43. <br />
  44. ; set the font and print text <br />
  45. SetFont fntArial <br />
  46. Text 400,0,"This is just plain Arial 24 point",True,False <br />
  47. <br />
  48. SetFont fntArialB <br />
  49. Text 400,30,"This is bold Arial 18 point",True,False <br />
  50. <br />
  51. SetFont fntArialI <br />
  52. Text 400,60,"This is italic Arial 32 point",True,False <br />
  53. <br />
  54. SetFont fntArialU <br />
  55. Text 400,90,"This is underlined Arial 14 point",True,False <br />
  56. <br />
  57. ; Standard 'wait for ESC' from user <br />
  58. While Not KeyHit(1) <br />
  59. Wend <br />
  60. <br />
  61. ; Clear all the fonts from memory! <br />
  62. FreeFont fntArial <br />
  63. FreeFont fntArialB <br />
  64. FreeFont fntArialI <br />
  65. FreeFont fntArialU
  66. </td>
  67. </tr>
  68. </table>
  69. <br>
  70. <a target=_top href=../index.htm>Index</a><br>
  71. <br>
  72. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=FreeFont&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  73. </html>