LoadFont.htm 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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>LoadFont (fontname$[,height][,bold][,italic][,underlined])</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. fontname$ - name of font to be loaded, e.g. "arial" <br />
  13. height - height of font in points (default is 12) <br />
  14. bold - True to load bold version of font, False not to (default is False) <br />
  15. italic - True to load italic version of font, False not to (default is False) <br />
  16. underlined - True to load underlined version of font, False not to (default is False)
  17. </td>
  18. </tr>
  19. </table>
  20. <h1>Description</h1>
  21. <table>
  22. <tr>
  23. <td>
  24. Loads a font and returns a font handle. <br />
  25. <br />
  26. You can then use the font handle with commands such as SetFont and FreeFont. <br />
  27. <br />
  28. Note: Blitz doesn't work with SYMBOL fonts, like Webdings and WingDings.
  29. </td>
  30. </tr>
  31. </table>
  32. <h1><a href=../2d_examples/LoadFont.bb>Example</a></h1>
  33. <table>
  34. <tr>
  35. <td>
  36. ; LoadFont/SetFont/FreeFont Example <br />
  37. ; --------------------------------- <br />
  38. <br />
  39. ; Enable Graphics mode <br />
  40. Graphics 800,600 <br />
  41. <br />
  42. ; Set global on font variables <br />
  43. Global fntArial,fntArialB,fntArialI,fntArialU <br />
  44. <br />
  45. ; Load fonts to a file handle variables <br />
  46. fntArial=LoadFont("Arial",24) <br />
  47. fntArialB=LoadFont("Arial",18,True) <br />
  48. fntArialI=LoadFont("Arial",32,False,True) <br />
  49. fntArialU=LoadFont("Arial",14,False,False,True) <br />
  50. <br />
  51. ; Set the font and print text <br />
  52. SetFont fntArial <br />
  53. Text 400,0,"This is just plain Arial 24 point",True <br />
  54. <br />
  55. SetFont fntArialB <br />
  56. Text 400,30,"This is bold Arial 18 point",True <br />
  57. <br />
  58. SetFont fntArialI <br />
  59. Text 400,60,"This is italic Arial 32 point",True <br />
  60. <br />
  61. SetFont fntArialU <br />
  62. Text 400,90,"This is underlined Arial 14 point",True <br />
  63. <br />
  64. ; Standard 'wait for ESC' from user <br />
  65. While Not KeyHit(1) <br />
  66. Wend <br />
  67. <br />
  68. ; Clear all the fonts from memory! <br />
  69. FreeFont fntArial <br />
  70. FreeFont fntArialB <br />
  71. FreeFont fntArialI <br />
  72. FreeFont fntArialU
  73. </td>
  74. </tr>
  75. </table>
  76. <br>
  77. <a target=_top href=../index.htm>Index</a><br>
  78. <br>
  79. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=LoadFont&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  80. </html>