Global ShiftState As Integer 'is Shift key held down?
Global WhichPattern As Integer 'current pattern
Global NumCols As Integer 'number of columns for grid pattern
Global FocusFont$ 'for focus pattern
Global FocusFontSize As Single 'for focus pattern
Global TimeInterval As Integer 'convergence pattern flashing, in milliseconds
Global NumberOfGrays As Integer 'number of gray bars for ColorTracking pattern
Global ConvOrient As Integer 'orientation of convergence pattern
Global FirstConvTest As Integer 'True if this is the first convergence test pattern shown
Global OldPattern As Integer 'Holds previous pattern number
Sub CheckFont ()
'This Sub makes sure the font used in help screens and
'the focus pattern exists on the system. If it doesn't
'exist, it tries to find a sans serif font. If it can't
'find one, it chooses the first font in the system list.
Dim Found, n As Integer
Dim F$ 'holds the font name in upper-case
Found = False 'Found = True when font found on system
FocusFont$ = UCase$(FocusFont$)
' Does current Focus Font exist on the system?
For n = 0 To Screen.FontCount - 1
F$ = UCase$(Screen.Fonts(n))
If F$ = FocusFont$ Then
Found = True
FocusFont$ = Screen.Fonts(n)
Exit For
End If
Next n
'If not Found, check for common sans serif true type fonts
If Found = False Then
For n = 0 To Screen.FontCount - 1
F$ = UCase$(Screen.Fonts(n))
'the next line prevents errors when checking string
If Len(F$) < 7 Then F$ = F$ + String$(7 - Len(F$), "!")
If Left$(F$, 5) = "ARIAL" Or Left$(F$, 4) = "HELV" Or Left$(F$, 5) = "SANSS" Or Left$(F$, 5) = "OPTIM" Or Left$(F$, 5) = "GILLS" Or Left$(F$, 5) = "AVANT" Or Left$(F$, 7) = "CENTURY" Then
Found = True
FocusFont$ = Screen.Fonts(n)
Exit For
End If
Next n
End If
'If still not Found, check for ms sans serif
If Found = False Then
For n = 0 To Screen.FontCount - 1
F$ = UCase$(Screen.Fonts(n))
If Len(F$) < 7 Then F$ = F$ + String$(7 - Len(F$), "!")
If Left$(F$, 7) = "MS SANS" Then
Found = True
FocusFont$ = Screen.Fonts(n)
Exit For
End If
Next n
End If
'If no ms sans serif font either, pick the first font.