home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
576-600
/
apd600
/
ldos_demo
/
examples
/
font_proc.amos
/
font_proc.amosSourceCode
Wrap
AMOS Source Code
|
1994-02-02
|
1KB
|
55 lines
' Use Lword to simplify font-searching. Use can this procedure in your
' own programs.
Screen Open 1,640,256,8,Hires : Paper 6 : Cls
Do
Input "Font:";N$
Input "Size:";A
Cls 6 : Home
If N$=""
End
End If
_SETFONT[N$,A]
If Param
Print "Font set!"
Else
Print "Font not available"
End If
Text 10,150,"The quick brown fox jumps over the lazy dog"
Loop
Procedure _SETFONT[NAME$,SIZE]
' You may call this procedure either with or without '.font'
' included in the fontname. If the font first isn't found in
' RAM (or ROM as AMOS sees it) it (tries to) load it from disk
' and do another scan. If the font still isn't available Param
' will be FALSE. The loading from disk is done by Ldisk font so
' the user hardly notices any delay.
' IF the font is found, Param will be true and the font set to the
' current using Set Font.
'
NAME$=Upper$(NAME$)
If Right$(NAME$,5)<>".FONT"
NAME$=NAME$+".FONT"
End If
TIMES=1
_TRY_AGAIN:
Get Rom Fonts : A=1
While Font$(A)<>""
F$=Upper$( Extension_10_0520(1,Font$(A)))
S=Val( Extension_10_0520(2,Font$(A)))
If F$=NAME$ and SIZE=S
FOUND=True
Exit 1
End If
Inc A
Wend
If FOUND
Set Font A
Goto UT
End If
If TIMES<>2
L= Extension_10_0326(NAME$,SIZE)
Inc TIMES
Goto _TRY_AGAIN
End If
UT:
End Proc[FOUND]