Determining TTF Font File Name
If I have a .NET Font object, is there a way to programmatically det开发者_JS百科ermine which ttf file in the C:\Windows\Fonts directory it was created with?
This helpful article suggests that by looking at registry key
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Fonts
You'll get a list of fontname, filename pairs. Open said registry key, iterate through the names until you find a match, then the value contains the filename (without a path).
精彩评论