Help Wizard

Step 1

NEXT STEP

[BUG] Incorrect font encoding

[BUG] Incorrect font encoding

Hi all,

 

I am still unable to understand the correct procedure to file bug reports, since you don't have any documentation on that (on the side note, I am also a premium user).

 

Anyway, when I try to change the folder that Spotify uses to download the song into, white boxes are displayed instead of characters. See the attached screenshot:

 

spotify bug.png

 

Best,

Raffaele

 

Reply
3 Replies

There is unfortunately no correct procedure to file bug reports. I think that creating new threads like this in the desktop linux forum for linux client specific ones is pretty good.

 

Thanks for the report, this is a new bug as far as I know. Looks like the file dialog can't find the proper font.

 

What happens when you create a new playlist, click on the image to choose a new image and a file dialog pops up? Does it look different?

 

Also, what shows up when you type this in a terminal?

 

zenity --version
zenity --file-selection --directory

zenity --version

 3.24.0

zenity --file-selection --directory

 On the terminal it shows

 

Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

 

and then it opens a file dialog box, which is displayed correctly

 

"What happens when you create a new playlist, click on the image to choose a new image and a file dialog pops up? Does it look different?"

 

In that case it's working, although the dialog is kinda odd

 

P.S. the dialog to choose the directory location of the cache it's working now (see attached screenshot). I don't know what might have triggered it.

 

Screenshot from 2018-02-01 11-39-59.png
Screenshot from 2018-02-01 11-41-15.png

For anyone in the future who comes across this bug, I had the same issue for the current version (1.1.55.498), it's related to font permissions. To solve, correct font permissions:

 

For older distros:

 

 

 

sudo find ~/.fonts -type f -exec sudo chmod 644 {} \;

 

 

 

For 20.04+:

 

 

 

sudo find /usr/share/fonts -type f -exec sudo chmod 644 {} \;

 

 

 

Then refresh the font cache:

 

 

 

sudo fc-cache -r -v

 

 

EDIT: 06/2022 This bug still occurs in rev 60 (1.1.84.716.gc5f8b819), especially if you manually copied installed fonts in /usr/share/fonts/ - its folders may now belong to $USER instead of root. It seems like a limitation in Snap rather than Spotify. If the above solution doesn't work:

 

sudo snap stop spotify
# Clear all font caches
sudo rm -rf ~/snap/spotify/common/.cache/fontconfig/
sudo rm -rf /var/cache/fontconfig/*
sudo rm -rf ~/.cache/fontconfig/*
# Reset permissions
sudo chown -R root:root /usr/share/fonts
find /usr/share/fonts -type d -exec sudo chmod 755 {} \;
find /usr/share/fonts -type f -exec sudo chmod 644 {} \;
fc-cache -rv
# Just to be safe:
reboot
# Only use `connect <...>:mount-observe` on trusted snaps!
sudo snap connect spotify:mount-observe
snap run spotify
# Check the bug is resolved (eg click on edit playlist cover)
sudo snap disconnect spotify:mount-observe

 

 

If that doesn't work, based on this post I recommend to stop all running snap services (view these using `snap services`, then `sudo snap stop <SERVICE>`. Then uninstall Spotify, reset ALL font permissions and ownership, and reinstall fontconfig. This may break other snaps!

 

If you are running Ubuntu 20.04 (not earlier versions), you can run this bash script at your own risk:

 

#!/bin/bash
# This may break other snaps!
# Remove spotify, clear font caches
sudo snap remove --purge spotify
sudo rm -rf ~/snap/spotify/common/.cache/fontconfig/
sudo rm -rf /var/cache/fontconfig/*
sudo rm -rf ~/.cache/fontconfig/*
# Transfer ownership to root, reset default folder/file permissions
sudo chown -R root:root /usr/share/fonts
font_dirs=("/usr/share/fonts" "/usr/local/share/fonts" "${HOME}/.local/share/fonts" "${HOME}/.fonts")
for dir in "${font_dirs[@]}"; do
    if [ -d "$dir" ]; then
        find "$dir" -type f -exec sudo chmod 644 {} \;
        find "$dir" -type d -exec sudo chmod 755 {} \;
        sudo chmod 755 "$dir"
    fi
done
# WARNING! This will backup then reinstall fontconfig
sudo cp /etc/fonts /etc/fonts.bak
sudo apt-get install --reinstall fontconfig-config
fc-cache -rv
# All of your fonts will now look broken
sudo rsync -auv /etc/fonts.bak/fonts.conf /etc/fonts/fonts.conf
# The folder will be missing:
sudo rsync -auv /etc/fonts.bak/conf.avail /etc/fonts/conf.avail
sudo chmod -R root:root /etc/fonts/
sudo chmod 755 /etc/fonts
sudo chmod 644 /etc/fonts/fonts.conf
find /etc/fonts/ -type d -exec sudo chmod 755 {} \;
find /etc/fonts/conf.avail -type f -exec sudo chmod 644 {} \;
find /etc/fonts/conf.d -type f -exec sudo chmod 444 {} \;
fc-cache -rv
sudo apt-get install --fix-broken
fc-cache -rv

 

 

Then check /etc/fonts/fonts.conf exists. Check /etc/fonts/conf.avail/ and /etc/fonts/conf.d/ both contain files. If not, just replace the changes/missing files with fonts.bak, re-verify ownership/permissions, and refresh the font cache. Reboot ONLY when you're confident everything is correct. If in any doubt restore the backup.

 

Finally, reinstall Spotify and run the second solution above (connect spotify:mount-observe etc). Don't restore any saved snapshots! If other snaps are now misbehaving, clear their caches or reinstall them. If there are further problems, connecting and disconnecting spotify:mount-observe should be sufficient.

Suggested posts