jwong
2011-Oct-20 01:13 UTC
[Wine] Locating .tff or .fon file for fonts in C:\Windows\Font
Normally each font has entry in the registry under HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts whereby the registry Name is the font name and the registry Data value is the filename of the font (for example courier.ttf). In my app I use the facename from the LOGFONT structure and the above registry entries to determine the associated ttf file. When I add a font to the C:\Windows\font, the font correctly appears as an available font in the font dialog, but the entry is not listed in HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts. My question is how do I determine the font file (*.ttf or *.fon) for the fonts in C:\Windows\Font?
SpawnHappyJake
2011-Oct-20 04:00 UTC
[Wine] Re: Locating .tff or .fon file for fonts in C:WindowsFont
Could you have your app read the font files in %SYSTEMROOT%\Fonts directly to determine their names and whether they are *.ttf format or *.fon format as well as using registry values (that may or may not be there)? That way you get all the font files in the %SYSTEMROOT%\Fonts folder as well as any fonts in an obscure folder referenced by the registry. Perhaps even register any font file in %SYSTEMROOT%\Fonts not already registered in the registry. There was (maybe still is) a bug in WineTricks that does not register font files that it installs. So you definitely want a method not dependent on the registry (you've seen what things dependent on the registry do, right?). Maybe even let the user pick whether they want the program to scan the %SYSTEMROOT%\Fonts folder to find fonts (one optional paramether), register font files found in the %SYSTEMROOT%\Fonts folder not already registered (another optional parameter), use the registry to find fonts (another optional parameter), and maybe even delete registry values that reference non-existant font files (another optional parameter). And so that the user can have any one of those parameters on or off (as opposed to only getting to pick one parameter). I don't know your intentions, but those could be command line options and/or check box options, etc. Perhaps the ttx dev team could give you a hand parsing font files directly? Or at least view their source code? Cheers, Jake
vitamin
2011-Oct-20 14:02 UTC
[Wine] Re: Locating .tff or .fon file for fonts in C:WindowsFont
jwong wrote:> When I add a font to the C:\Windows\font, the font correctly appears as an available font in the font dialog, but the entry is not listed in HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts. My question is how do I determine the font file (*.ttf or *.fon) for the fonts in C:\Windows\Font?Wine regenerates that registry tree only once on startup. Exit Wine and restart it.