Tag Archive for 'user interface'

Qt and Fontconfig

After upgrading to Lucid Lynx I found that all Qt based applications would not have anti-aliased fonts anymore. For example Skype would look awful with these pixelated fonts. Unfortunately Google didn’t help me out, so I started a little research of my own into this issue. I was previously able to tweak font settings using ~/.fonts.conf so I thought to start there.

To make a very long story a whole lot shorter; assigning pixelsize turns off font hinting for Qt apps. I wasn’t able to figure out why, but I did find a solution for my particular setup, resulting in the following ~/.fonts.conf:




  
    Arial
    12
    13
  

You really have to look carefully to notice the difference with the original: it’s the qual="all" attribute in both test nodes. That did the trick for me.

Ubuntu, setuptools and --install-layout=deb

I wanted to start out with some wxPython GUI testing and was trying to get dogtail installed on my Ubuntu 10.04 system. The current dogtail version that you can install with Synaptic is 0.6.1, while I want to try out 0.7.0. So I grabbed the source from dogtail’s website, unpacked it into /usr/local/src and ran:

$ cd /usr/local/src/dogtail-0.7.0
$ sudo setup.py install

However, when I tried to run sniff for example, it can’t find it’s image files, because it’s looking explicitly in /usr/share instead of /usr/local/share. Ok, so let’s try again:

$ sudo setup.py install --prefix=/usr

This time, sniff start complaining that there’s no module named dogtail.config. A bit of Googling tells me that Ubuntu doesn’t have /usr/lib/pythonx.y/site-packages in its path by default. Only site-packages inside /usr/local/lib/pythonx.y and dist-packages in /usr/lib/pythonx.y are added to Python’s path by default. This is to clearly separate the place for packages that are included in the Ubuntu distribution (dist-packages) and those you install yourself (site-packages).

Now there’s a special argument for distutils if you want to install a “distribution” package manually, namely --install-layout=deb. Passing this argument will put the package using /usr as prefix and using dist-packages instead of site-packages, as if you were installing a deb package. So:

$ sudo setup.py install --install-layout=deb

That did the trick for me. Now back to what I was originally wanting to figure out: wxPython GUI scripting and testing with dogtail.

Help, NUMLOCK is Broken!

I can’t remember after which update (of Gnome/Ubuntu) this happened, but each time when I fire up the Gnome Calculator and start hitting the numbers on my keyboard’s keypad, nothing appears in the calculator’s display! Aha, of course, NUMLOCK turned off. So I hit the NUMLOCK key and start banging on the keypad again. Still no numbers appear, but… What the heck, the mouse is moving?

After consulting the all-knowing Google, I found the cause of this rather interesting behavior. Open System -> Preferences -> Keyboard. Then go to the Mouse Keys tab. Now here’s the million dollar question. Why would somebody _ever_ want to move its mouse pointer with the keypad? Maybe because you broke your mouse slamming it on your desk because you we’re so irritated that you couldn’t use your keypad? I don’t know. I’ve never had the urge to control my mouse pointer using the keyboard. Maybe they’d called it keypad-pointer if it was meant to be controlled by the keypad.

Well, they didn’t, so press Shift+NUMLOCK. This will uncheck the “Pointer can be controlled using the keypad” checkbox. Why was this box checked in the first place? Maybe its the default. Or maybe I once accidentally held down the shift key when I pressed NUMLOCK.

That must be it.