How about you doing what the rest of the world does: specify the font using CSS and suggest backups? No application should ever know which fonts are available, and there is no reliable way to do this. (You may have to print the hidden div in font and measure it to see how much dimensions are expected, but it will be very fragile.)
Just go in:
body { font-family: MyFont, Helvetica, Arial, sans-serif }
If you want to do something with a font other than displaying things in it, if possible, consider an alternative solution.
source share