'How to read a font file's properties using C#/net6.0?

I'm building a Font Management WebApi that uploads font file (either otf, ttf or ttc) via an IFormFile. I need to inspect the file (or preferably the fileStream) at time of upload and read the normal properties of the font, such as Name, Family, Style and Version, so that I can verify conflicts against other fonts in the system.

Does anyone know how to do this?



Solution 1:[1]

This github repository should help

https://github.com/LayoutFarm/Typography/blob/master/Typography.OpenFont/OpenFontReader.cs

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Aung