Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

liberation seems to not register fonts properly in the registry #896

Closed
mihaitodor opened this issue Dec 15, 2017 · 5 comments
Closed

liberation seems to not register fonts properly in the registry #896

mihaitodor opened this issue Dec 15, 2017 · 5 comments
Assignees

Comments

@mihaitodor
Copy link
Contributor

Looking more into #886, I noticed that the liberation verb stomps over the fonts that Wine registers automatically on Ubuntu (see Ubuntu_original.png) and registers its fonts with the wrong name (see Ubuntu_with_liberation_installed.png).

Wine seems to be able to automagically re-cache "Liberation Sans Narrow" under HKCU\Software\Wine\Fonts\Cache after this code copies liberationsansnarrow-regular.ttf to C:\windows\Fonts, but, for some reason, it deletes it from HKLM\Software\Microsoft\Windows\CurrentVersion\Fonts and from HKLM\Software\Microsoft\Windows NT\CurrentVersion\Fonts, which doesn't make much sense. Could this be a bug in Wine?

The above makes me wonder what is the actual point of writing these font registry entries manually from Winetricks. Maybe we should let Wine do it as described in the last comment here? Do you have any insight into this? I recall seeing a more detailed discussion on this topic somewhere, but I can't seem to find it any more.

ubuntu_original

ubuntu_with_liberation_installed

@austin987
Copy link
Contributor

I don't see fonts automatically registering from C:\windows\fonts. I suspect that only works for stuff in /usr/share/fonts (or whatever fontconfig reports, I suspect).

I think the proper fix would be to write a full windows path to the registry. I'm looking at it.

@mihaitodor
Copy link
Contributor Author

mihaitodor commented Dec 19, 2017

@austin987 I spent more time digging into this and I can confirm there is some logic somewhere which automagically populates HKCU\Software\Wine\Fonts\Cache but not HKLM\Software\Microsoft\Windows[\ NT]?\CurrentVersion\Fonts when copying font files into .wine/drive_c/windows/Fonts/. The magic seems to be based on inotify, but I don't understand well enough how it works (this seems to be the Wine code that manages inotify subscriptions).

Now, 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.exe 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 after copying some font files in .wine/drive_c/windows/Fonts/, 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).

The main issue here is that something needs to wait for whatever background process to finish writing to HKCU\Software\Wine\Fonts\Cache before granting access to the registry. I have created #900, which seems to solve this.

Another problem would be to understand why Wine only populates HKCU\Software\Wine\Fonts\Cache automatically when a font file is manually added to .wine/drive_c/windows/Fonts/. Why not also add it to HKLM\Software\Microsoft\Windows[\ NT]?\CurrentVersion\Fonts?

I can try posting this investigation on wine-devel as well to see if somebody can clarify what should be the expected behaviour. WDYT?

@austin987
Copy link
Contributor

I was thinking of the same fix, so sgtm.

Re: wine/wine-devel, yes, I think that's a good idea. Huw/AJ are the most likely to know, or maybe Nikolay.

@mihaitodor
Copy link
Contributor Author

@mihaitodor
Copy link
Contributor Author

mihaitodor commented Dec 20, 2017

Fixed by #901 and #900.

More info provided by Huw on wine-devel: https://www.winehq.org/pipermail/wine-devel/2017-December/120684.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants