TGC Codebase Backup



Font Tester [Regular Version] by 00bk

8th Apr 2005 13:09
Summary

Locate the best font for your needs!



Description

Locate the best font for your needs!
Either type in the name of your font or browse to select it; then type in the size you wish to view (optional) and voila! Perfect for finding the ideal font and size for your program.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    remstart
#################
# FONT TESTER - #
#REGULAR VERSION#
#Created by Ben #
#     Kahan     #
#################
remend

`Set the window settings for the start
cls -1
ink 0,-1
set window size 1,1
maximize window
set window title "Font Tester - Regular Version"
set text font "Arial Narrow"
set text size 16

start:
`Give the user options
cls -1
set text font "Arial Narrow"
set text size 16
print "a) Test a font only"
print "b) Test a font and size"
print "c) Exit"
print "d) About"
repeat until inkey$()="a" or inkey$()="b" or inkey$()="c" or inkey$()="d"
if inkey$()="a" then testfont()
if inkey$()="b" then testfontandsize()
if inkey$()="c" then end
if inkey$()="d" then about()

`Say what will happen if the user selects option a
function testfont()
cls -1
set text font "Arial Narrow"
set text size 16
input "Please select what font you would like to test:", selectfont$
set text font selectfont$
print "the quick brown fox jumps over the lazy dog"
print "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
set text font "Arial Narrow"
set text size 16
print "Press any key to continue."
wait key
goto start
endfunction

`Say what will happen if the user selects option b
function testfontandsize()
cls -1
set text font "Arial Narrow"
set text size 16
input "Please select what font you would like to test:", selectfont$
input "What size do you wish to test: ", fontsize$
set text font selectfont$
set text size val(fontsize$)
print "the quick brown fox jumps over the lazy dog"
print "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
set text font "Arial Narrow"
set text size 16
print "Press any key to continue."
wait key
goto start
endfunction

`Say what will happen if the user selects option d
function about()
cls -1
set text font "Arial Narrow"
set text size 16
print "Created by Ben Kahan. Also available with BlueGUI plugin."
print "Press any key to continue."
wait key
goto start
endfunction