Friday, November 21, 2008

Spotify, Guitar Pro, Wine = Messed up fonts

Some context, I got an invite to Spotify from a friend. They say that Spotify works under Wine in Linux so I decided to try it out.

The program works very well, it's very snappy and well thought out. I really like the service, it makes it easy to find new music and to share it with other people (who also needs to have Spotify or something similar of course).

There was only one issue. Spotify allows you to play their Radio, which is pretty much a shuffle over the genre you have specified and the years you have specified.

However, In wine I got bad fonts for all the buttons on that page, instead of Roman letters, I got musical notation. I thought that this was a bug I could live with until I tried it at another Linux installation which did not have this bug. So, how can this happen?








Well, it is a font-issue in Wine. Wine creates a small filesystem that looks like a Windows-filesystem with a few necessary catalogs. Like for example windows/Fonts. Your programs are then installed into this mini-filesystem into for example the "Program Files" directory.

Now for the bug I encountered. Or, I don't think that it is an actual bug per se, just an unwanted effect.

Wine typically stores its fonts in /usr/share/wine/fonts or in /usr/share/fonts/wine.
Now, if you install your own fonts, they go into the directory windows/Fonts in your mini-filesystem. This is also where all your Windows-programs will store its fonts as they think they are running on Windows.

The issue comes from the ordering of locations to search for fonts. Wine first checks the windows/Fonts directory and if it can't find the font there, then it will go to its own fonts.
So if any of your Windows-programs have installed fonts there (in my case, it was Guitar Pro which had installed a musical notation font) Then that will be searched first.

I got the issue, I believe, because the font requested by Spotify wasn't in my windows/fonts directory, and then it wasn't found among Wines core-fonts, so it defaulted to take the first font it could find - which was the Guitar Pro font.

The fix?

$ cp /usr/share/wine/fonts/tahoma.ttf ~/.wine/drive_c/windows/Fonts/a.ttf

1 comment:

CaCHoRRo said...

Same problem and same fix. Thanks a lot!!