CDrummond / cantata

Qt5 Graphical MPD Client
GNU General Public License v3.0
1.04k stars 184 forks source link

Interface: missing icons #903

Closed pagiraud closed 7 years ago

pagiraud commented 7 years ago

I don't know if this bug should be reported here, to KDE or to my distribution bug tracker, so please apology if this is not the right place. screenshot_20161027_122903 As you can see in the screenshot, some icons are missing and there are empty rectangles or the letters fi or fl instead. This appeared when I upgraded plasma to the 5.8 version. I'm using Opensuse Tumbleweed 64 bits, with Cantata provided by the KDE:Extra repository

CDrummond commented 7 years ago

The missing icons are from 'font awesome' Cantata should have installed a copy of fontawesome-4.3.0.ttf into /usr/share/cantata/fonts Is it not there?

pagiraud commented 7 years ago

It is there! /usr/share/cantata/fonts/fontawesome-4.3.0.ttf is present on my system. Its content seems correct (MD5 sum: 706450d7bba6374ca02fe167d86685cb ) When I launch Cantata from command line I get this:

Icon theme "cantata" not found. Failed to compute left/right minimum bearings for "FontAwesome" Failed to compute left/right minimum bearings for "FontAwesome" Failed to compute left/right minimum bearings for "FontAwesome" Failed to compute left/right minimum bearings for "FontAwesome" Failed to compute left/right minimum bearings for "FontAwesome" Failed to compute left/right minimum bearings for "FontAwesome" Failed to compute left/right minimum bearings for "FontAwesome" Failed to compute left/right minimum bearings for "FontAwesome"

CDrummond commented 7 years ago

Well I guess the error is Qt's handing of font-awesome:

Failed to compute left/right minimum bearings for "FontAwesome"

Which version of Qt are you using?

Could you try downloading the latest (4.7) from http://fontawesome.io/ Then save this as /usr/share/cantata/fonts/fontawesome-4.3.0.ttf (Cantata looks for a specific version)

pagiraud commented 7 years ago

I'm using Qt 5.7.0. I replaced the 4.3 ttf file with the newer one, keeping the 4.3 filename as you asked: no change.

CDrummond commented 7 years ago

Didn't think it'd make any difference - but was worth a try. Are you self-compiling Cantata? If so, can you please checkout my madrigal project - https://github.com/CDrummond/madrigal This is a OpneHome client - and not MPD client. But, it also uses font-awesome icons. But it uses a slightly different font, and embeds the font in the application. I'd be interested to know if the icons work for this app. When you start it (under KDE at least) there should be a menu icon on the right-hand side. This will be a firefox style 3 bars icon. Can you please try this, and let me know if you see the icon? If so, then I can convert Cantata to use a similar method.

pagiraud commented 7 years ago

I don't compile Cantata myself, I got it from OBS. As you can see, it can't compile on Tumbleweed x86_64 (it could at the time I installed it) because it misses libreadline6. I don't know if it is related. Do you think I should open a bug in OBS?

Edit: I opened a bug.

pagiraud commented 7 years ago

My OBS bug was closed because supposed upstream. Just to test, I changed the font-awesome file for symbol.ttf from my wine directory: I copied it to /usr/share/cantata/fonts/ and renamed it fonts-awesome-4.3.ttf Now, when I launch Cantata from command line I just have

Icon theme "cantata" not found.

And I get some random icons in Cantata. So maybe it comes from Qt or the font itself…

CDrummond commented 7 years ago

Any chance you can try Madrigal? I know it means compiling an app you wont use - but might help with the font issue.

Or perhaps try copying https://github.com/CDrummond/madrigal/blob/master/icons/fontawesome-webfont.ttf to /usr/share/cantata/fonts/fontawesome-4.3.0.ttf

pagiraud commented 7 years ago

I just compiled Madrigal. I had to install a bunch of devel files to pass cmake and then had a few warnings during make but it worked. I launched Madrigal and then… well you can see by yourself. Something must have changed between Qt 5.6 and Qt 5.7 about fonts handling. screenshot_20161028_223741 Edit: It goes without saying that when I launch Madrigal from the command line I get several

Failed to compute left/right minimum bearings for "FontAwesome"

padertux commented 7 years ago

I am having the same problem here. I am using: Ubuntu 16.4 Qt 5.5.1 current master checkout (96a3155e82) fonts-font-awesome package installed

Did not try to download from http://fontawesome.io/ yet. In my case korean fonts are shown instead of icons.

CDrummond commented 7 years ago

Just updated to 16.10 - and now seeing this issue!!!!! :-(

OK, did a clean build - and it is now working. Can you please try re-building Cantata with a clean build folder - e.g. re-run CMake, make install, etc.

padertux commented 7 years ago

Did an clean build but it did not change anything. I still only see Korean characters instead of icons.

padertux commented 7 years ago

Now it works! Only did a clean build without an install. Now I see icons. Did not know that Cantata is such a beautiful app! Thanks! ;-)

CDrummond commented 7 years ago

I accepted a pull request about a year ago to allow specifying location of /usr/share files. Looks like this location compiled into the code is not updated unless you do a complete clean build. Might need to look into reverting this change - or at least making it not break things!

pagiraud commented 7 years ago

Do you think this is the same issue as mine? I mean, when I built Madrigal, it was necessarily a clean build…

CDrummond commented 7 years ago

Don't think so. My issue, and padertux's, was due to the build having an incorrect path listing to the font awesome ttf file. Madrigal embeds the ttf into the binary. So, if Madrigal is not working then its not a path issue.

pagiraud commented 7 years ago

I investigated a bit using your Madrigal project, and now I'm quite convinced this is a bug from Qt 5.7. Playing with the hexadecimal references of characters in core/monoicon.h and with fonts, I tried to change and print the "Show Lyrics" icon. First, I tried with 0xf266b from the Linux Libertine font and got what I expected: screenshot_20161101_223113 So I thought Qt 5.7 was unable to print characters from purely iconic fonts. But then I tried with 0xf56 from MarVoSym and 0xe033 from OpenSymbol… every thing worked, as you can see. screenshot_20161101_225329 screenshot_20161101_225858 But I noticed one thing : MarvoSym and OpenSymbol use at least some characters from the subset used by qfontengine to compute left and right bearings: '(', 'C', 'F', 'K', 'V', 'X', 'Y', ']', '_', 'f', 'r', '|', 127, 205, 645, 884, 922, 1070, 12386 (Qt seems to use decimal system and not hexadecimal to reference characters), where FontAwesome has none! It explains the error message I reported previously (do you have it by the way?). It was introduced in Qt 5.6, if I'm right, but a diff between qfontengine.cpp 5.6.2 and 5.7.0 shows changes around this function. They are not documented in the changelog so I didn't see them at first sight, but I think the problem lies here. What do you think about that?

CDrummond commented 7 years ago

Thanks for the investigation. Does look like a Qt issue. I might be able to hack the FontAwesome ttf file so that those characters point to mapped characters - I had some code that altered TTFs years ago, will see if I can find it.

CDrummond commented 7 years ago

Downloaded Qt5.7 from qt.io - and everything is working, all icons displayed. Sorry, but this is looking like an issue on your system.

pagiraud commented 7 years ago

Thank you for trying… I'm trying to know if other people using Tumbleweed have this problem too.

simotek commented 7 years ago

Icon theme "cantata" not found.

Have you tried installing / copying the icon theme to /usr/share/icons if Qt is meant to be looking for icon themes from standard locations thats likely where it should be looking.

CDrummond commented 7 years ago

Ignore that message - not sure why it comes up - it is not related to this issue. The missing icons are not from a theme, they're from font-awesome. This is a TTF font containing only icons. Cantata (and Madrigal) has its own icon engine for font awesome icons.

CDrummond commented 7 years ago

Has the build on opensuse been updated? Does it now build? Still have the issue? Not sure what to do about this - as it is working as expected here.

pagiraud commented 7 years ago

The build on OpenSuse has been updated… but still no luck. On the mailing list, at least one guy installed Cantata just to test and the icons displayed fine on his computer… I tried to install a fresh Opensuse in VirtualBox, but I wasn't able to start X, so I'm not able to say if I can reproduce the bug. If I had snapper installed, I could try to come back to a previous snapshot, but I formatted my root partition in ext4 instead of Btrfs especially to disable snapper. I tried many things since my last message, but nothing worked. Maybe I should really reinstall, but this is the only bug I have, and I don't have time to do that now. Maybe you should leave it open but no see this as a blocker. I would say that, if by the end of november I'm still the only user affected and don't give some news, you should consider the issue as not reproducible and close it.

CDrummond commented 7 years ago

Its now december, so closing.

pagiraud commented 7 years ago

Since this morning, icons are back, both in Cantata and Madrigal. I didn't do anything particular, but yesterday there were some updates in libqt5:

libqt5-qtbase (5.7.0 -> 5.7.1) libqt5-qtdeclarative (5.7.0 -> 5.7.1) libqt5-qtgraphicaleffects (5.7.0 -> 5.7.1) libqt5-qtimageformats (5.7.0 -> 5.7.1) libqt5-qtlocation (5.7.0 -> 5.7.1) libqt5-qtmultimedia (5.7.0 -> 5.7.1) libqt5-qtquickcontrols (5.7.0 -> 5.7.1) libqt5-qtscript (5.7.0 -> 5.7.1) libqt5-qtsensors (5.7.0 -> 5.7.1) libqt5-qtserialport (5.7.0 -> 5.7.1) libqt5-qtsvg (5.7.0 -> 5.7.1) libqt5-qttools (5.7.0 -> 5.7.1) libqt5-qtwebchannel (5.7.0 -> 5.7.1) libqt5-qtwebengine (5.7.0 -> 5.7.1) libqt5-qtwebkit (5.7.0 -> 5.7.1) libqt5-qtwebsockets (5.7.0 -> 5.7.1) libqt5-qtx11extras (5.7.0 -> 5.7.1) libqt5-qtxmlpatterns (5.7.0 -> 5.7.1)

I don't know where the problem came from, but this issue is really solved now. Thank you for this amazing software.

potuz commented 7 years ago

For what it's worth, I just installed cantata built from source on Gentoo testing branch against QT 5.7.1 and have the same issue

Failed to compute left/right minimum bearings for "FontAwesome"

Reading this thread is not clear to me how to solve this.

potuz commented 7 years ago

Just a quick addition: it seems that my system is using the wrong fontawesome perhaps, the one distributed by texmf

$ lsof -p 2072 | grep awesome
cantata 2072 user  mem       REG              259,2   173219  1449416 /usr/share/texmf-dist/fonts/type1/public/fontawesome/FontAwesome.pfb
$ 
potuz commented 7 years ago

Moved the pfb file out of the way and now cantata loads the right file. Perhaps this was the same issue experienced by pagiraud?