Determine if a font is installed and available

Hi Folks,

Do any of you have experience with determining the availability of a font on the user system to recommend a solution to the below?

One of my apps needs a reasonable (read NOT Courier) mono spaced font on Linux. I’ve determined that there are 4 really good options:

  • Liberation Mono
  • Nimbus Mono L
  • Noto Mono
  • Ubuntu Mono

However, in a beta test we’ve learned that not every Linux Distro is guaranteed to have any of them specifically (so I would fall back to Courier if that was the only one available). I’d like to have a way to step through the fonts in that order and select the first that is available.

from LR :

[code]Function FontAvailable(FontName As String) As Boolean
Dim fc As Integer
fc = FontCount - 1

For i As Integer = 0 To fc
If Font(i) = FontName Then
Return True
End If
Next
Return False
End Function[/code]

Obviousness strikes again :).

Thanks @Jean-Yves Pochez