Spyder: Ugly fonts on new installation on Ubuntu Mate 15.10 (missing anti-aliasing)

Created on 3 Mar 2016  路  13Comments  路  Source: spyder-ide/spyder

Description of your problem

The fonts are ugly

What steps will reproduce the problem?

  1. Install either Anaconda2 or Anaconda3 on a fresh Ubuntu Mate 15.10 installation
  2. run Spyder
  3. the fonts look ugly, and changing fonts in "Preferences > Editor > Display > Text and margin font style" does not help

What is the expected output? What do you see instead?

Following "Preferences > Editor > Display > Text and margin font style" and choosing "Ubuntu Mono" fonts, I expect to see the same fonts type and quality of the fonts that I see on the terminal (in which I use Ubuntu Mono fonts), but the fonts look quite different, and are really ugly (they look raw and thin). I would say that the anti-aliasing is broken. The problem is not limited to the editor: all the menus are affected, as well as the general look&feel of the windows. I think it is a problem with Qt.

Please provide any additional information below

I have three different machines running Ubuntu Mate 15.10 with Anaconda2 2.5. The problem shows up in all the three PCs. One of these three PCs has a fresh brand-new Ubuntu Mate 15.10 installation: on this machine I have also installed Anaconda3 2.5. In both Anaconda2 and Anaconda3, Spyder is affected by the problem. If I compile Spyder from source outside Anaconda, the problem does not show up, though.

I noted that in Anaconda's Spyder, PyQt4 is used (Help > About Spyder):

  • Python 2.7.11 64bits, Qt 4.8.7, PyQt4 (API v2) 4.11.4 on Linux

while in the standalone Spyder that I have built outside Anaconda, PyQt5 is used:

  • Python 2.7.10 64bits, Qt 5.4.2, PyQt5 5.4.2 on Linux

In another machine, running Ubuntu 14.04 (Unity graphical shell) the problem does not show up and the fonts look great.

Versions and main components

  • Spyder Version: 2.3.8
  • Python Version: 2.7.10 64bits
  • Operating system: Ubuntu Mate 15.10 64bit

    Dependencies

Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:

IPython >=1.0 : 4.0.3 (OK)
matplotlib >=1.0: 1.5.1 (OK)
pandas >=0.13.1 : 0.17.1 (OK)
pep8 >=0.6 : 1.7.0 (OK)
psutil >=0.3 : 3.4.2 (OK)
pyflakes >=0.5.0: 1.0.0 (OK)
pygments >=1.6 : 2.1 (OK)
pylint >=0.25 : 1.5.4 (OK)
qtconsole >=4.0 : 4.1.1 (OK)
rope >=0.9.2 : 0.9.4 (OK)
sphinx >=0.6.6 : 1.3.5 (OK)
sympy >=0.7.3 : 0.7.6.1 (OK)
zmq >=2.1.11 : 15.2.0 (OK)

Most helpful comment

A fonts configuration problem. However, there's a temporal solution I found some days ago:

  1. Go to your Anaconda installation directory (I'll assume it is ~/anaconda)
  2. cd ~/anaconda/etc
  3. mv fonts fonts.old
  4. ln -s /etc/fonts fonts
  5. Restart Spyder

So basically I'm using the fonts configuration present in the system for Anaconda. That's all that's needed :-)

All 13 comments

This seems to be a problem with Mate because you said

In another machine, running Ubuntu 14.04 (Unity graphical shell) the problem does not show up and the fonts look great.

Hallo, it's not just a Mate issue because if I install Spyder in the Mate desktop outside the Anaconda environment the problem does not show up. Only Spyder installed with conda is affected by the issue. The problem affects at least Spyder 2.3.8, 2.3.9 and 3.0.0b2 (with both python2 and python3 versions of Anaconda/Miniconda). Thank you.

I'm affected by the same problem (using Ubuntu 16.04):
The 'standalone' (or the one you can install with apt-get; currently v2.3.8) looks okay and normal. But in my case it uses pyQT4; here my "string":

  • Python 3.5.2 64bits, Qt 4.8.7, PyQt4 (API v2) 4.11.4 on Linux

Instead the one provided with anaconda (v2.3.9) has this "font problem" that @mentrelli describes, but my fonts seem bold-ish. The string is the same:

  • Python 3.5.2 64bits, Qt 4.8.7, PyQt4 (API v2) 4.11.4 on Linux

Then I updated to the most recent spyder 3.0.0, and now it looks even uglier (b/c it uses the Fusion Qt window style and not GTK+ anymore), and has this string:

  • Python 3.5.2 64bits, Qt 5.6.0, PyQt5 5.6 on Linux

So the version doesn't tell much here I guess. Dang! Today I wasted a couple of hours trying to fix it.... But I gave up. What I learned from the recent update is that the issue might not be related to the fonts only, but to the whole Qt windows style (the cursor changes slightly, etc.), so it seems that PyQt (or Qt itself?) simply cannot use the Qt window style that the "Ubuntu's 'standalone' spyder" uses (GTK+) and with this maybe also the fonts...

Eventually, the biggest hint was that the qt in anaconda doesn't have the correct libraries built into it: http://stackoverflow.com/a/19170810/3801913. So I tried to built the qt package, but I'm not a pro and it failed.
Maybe the whole issues is only related to qt-related paths and/or the style override. I'd be happy to know if something worked for you... Maybe someone has more luck :relieved:

In the end, I'm fine with installing spyder (now 3.0.0) with this _(Note: works without sudo!)_

pip3 install spyder -U --user

directly in my user profile (with all dependencies). Fine for me as well.

Note: in Ubuntu I had only pyqt4 installed (python3-pyqt4), and no python3-pyqt5. When I install python3-pyqt5, spyder 3.0.0 will require also python3-pyqt5.qtsvg and python3-pyqt5.qtwebkit. Eventually, I have this string for the 'standalone' spyder:

  • Python 3.5.2 64bits, Qt 5.5.1, PyQt5 5.5.1 on Linux

I will leave it like this now. (Btw @ccordoba12 : does Qt5 improve anything for spyder over Qt4?)

suffering from the same issue on a clean and new install of Ubuntu 16.10, spyder installed along with Anaconda. Spyder3.0.2 has the ugly fonts, whereas spyder2.3.9 looks fine. A Qt4 / Qt5 problem?
image

A fonts configuration problem. However, there's a temporal solution I found some days ago:

  1. Go to your Anaconda installation directory (I'll assume it is ~/anaconda)
  2. cd ~/anaconda/etc
  3. mv fonts fonts.old
  4. ln -s /etc/fonts fonts
  5. Restart Spyder

So basically I'm using the fonts configuration present in the system for Anaconda. That's all that's needed :-)

This fixed it. Thank you very much!

That fixed it for me as well, finally. I tried so long to solve that nasty problem... Thanks a lot!

Thanks! This works for the fonts! But it still cannot use the GTK+ QT windows style :cry:

@mherrmann3 I have the window style problem too, posted in this thread.

The problem came back with spyder 3.1.2, actually it's worse now :( The fix with linking the to the system fonts posted by ccordoba12 doesn't work anymore ...
image

The trick was not effective anymore also for me after an update, but later - I guess after upgrading Spyder to version 3.1.2 - everything started to be fine again without even need of any hack. At the moment, I am using Spyder 3.1.2 and fontconfig 2.12.1 and everything works fine.
If you have issues and you have fontconfig 2.12.1, try to downgrade to fontconfig 2.11.1 (conda install fontconfig=2.11.1) and link the fonts to the system ones...

that did the trick. Thanks!

Yep, this was solved by the great @mingwandroid in the latest fontconfig and qt 5 packages!!

Thanks for your patience ;-)

Was this page helpful?
0 / 5 - 0 ratings