Private Sub Form_Load()
Dim i As Long
Dim font_name As String
Dim tm As TEXTMETRIC
flxFonts.AllowUserResizing = flexResizeColumns
flxFonts.Rows = Screen.FontCount + 1
flxFonts.FixedRows = 1
flxFonts.Cols = 2
flxFonts.TextMatrix(0, 0) = "Font Name"
flxFonts.TextMatrix(0, 1) = "Pitch"
For i = 0 To Screen.FontCount - 1
' Select the font.
font_name = Screen.Fonts(i)
Font.Name = font_name
flxFonts.TextMatrix(i + 1, 0) = font_name
' Get the font's metrics.
GetTextMetrics hdc, tm
' See if it is fixed width.
If (tm.tmPitchAndFamily And FIXED_PITCH) = 0 Then
flxFonts.TextMatrix(i + 1, 1) = "Fixed"
Else
flxFonts.TextMatrix(i + 1, 1) = "Variable"
End If
Next i
SizeColumns flxFonts
End Sub
|