Hi Everyone,
I have spent some time trying to improve the font packages in Winetricks and I've run into a few issues with Wine that I hope someone can clarify. I agreed with Austin here https://github.com/Winetricks/winetricks/issues/896 that it would be best to get a wider audience on Wine Devel.
First of all, there is some logic somewhere in Wine which automagically populates `HKCU\Software\Wine\Fonts\Cache` when font files are copied into `.wine/drive_c/windows/Fonts/`. The magic seems to be based on inotify, but I don't understand well enough how it works.
However, there seems to be a race issue between apps like regedit and notepad and the above mechanism. For example, if I have the corefonts installers cached under `.cache/winetricks/` and I run `winetricks corefonts` and I start notepad immediately after, I notice that the new fonts are not available. Worse, most times (not sure yet how to reproduce it all the time) if I run regedit just after, the new fonts never get added to `HKCU\Software\Wine\Fonts\Cache`, which seems to be the place from where Wine lists fonts through EnumFontFamiliesEx (try running this code https://github.com/kamwoods/FontAnalysis/blob/d894c082221912e72653ae76804a72... just after installing corefonts). This happens on wine-3.0-rc2 and older.
Is this the expected behaviour?
I'm also wondering why Wine doesn't also write the required entries under `HKLM\Software\Microsoft\Windows[\ NT]?\CurrentVersion\Fonts` when it populates `HKCU\Software\Wine\Fonts\Cache`. Is this a bug? Is there a different way of registering fonts that Winetricks should use? I'd be more than happy to remove this manual registry insertion code from Winetricks...
And, I also noticed that a fresh wine install on Ubuntu 16 will auto-populate both `HKLM\Software\Microsoft\Windows[\ NT]?\CurrentVersion\Fonts` keys with the following fonts: Courier -> coure.fon MS Sans Serif -> sserife.fon MS Serif -> serife.fon Small Fonts -> smalle.fon
If I look in `HKCU\Software\Wine\Fonts\Cache`, I see that they are located in `/opt/wine-devel/bin/../share/wine/fonts/`, so shouldn't the above entries also point to the same location? And maybe not all apps will like the `..` in the font path...
And, since we're here, I noticed that Winetricks registers font replacements under `HKCU\Software\Wine\Fonts\Replacements`, but doesn't add any entries to `HKLM\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes`. Does Wine completely ignore this key?
Thank you, Mihai