Sunday, April 08, 2007

How To Build A New Freetype

I've had several requests for my RPM for freetype2 including sub-pixel rendering for openSUSE 10.2. So here are instructions on how to build your own, including my modified SPEC file. If you're in the USA it might be illegal to download my file, so this file is only for people who live in free countries. Or at least semi-free countries, like the UK.

  1. Download freetype2 source rpm from http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/suse/src/ - it might be a newer version by the time you come to download this.
  2. Download freetype-2.3.3.tar.bz2 and freetype-doc-2.3.3.tar.bz2 from freetype.org.
  3. Download freetype2.spec if your government will let you.
  4. Install the source rpm: sudo rpm -ivh freetype2-2.3.1-7.src.rpm
  5. Put the tar.bz2 files in /usr/src/packages/SOURCES
  6. Put the spec file in /usr/src/packages/SPECS
  7. Build the rpm: rpmbuild /usr/src/packages/SPECS/freetype2.spec
  8. The built rpms will be in /usr/src/packages/RPMS/i586
Note that you will need to have any required libraries and tools installed in order to build this. It should just be the basic development tools I think.

Saturday, April 07, 2007

Sub-pixel Antialiasing in openSUSE 10.2

Finally, I have sub-pixel antialiasing in openSUSE 10.2. For some reason, it was turned off in the 10.2 release because of something being broken. I haven't been able to find out what. But yesterday I got tired of waiting for it to be fixed, so I downloaded the alpha freetype package from 10.3, only to find that it also has sub-pixel antialiasing turned off. No problem - I just installed the source package, replaced the tar files with version 2.3.3 ones, edited the spec file to enable sub-pixel rendering, disabled the freetype2-bitmap-foundry patch (because it wouldn't compile with it in there), rebuilt the rpm and installed it. Hey presto - sub-pixel rendering!

Last time I blogged about getting fonts to look better in 10.1, I had a load of comments telling me I should just turn of antialiasing because text looks better without it. Well, I like antialiasing, and especially sub-pixel antialiasing. On my 1900x1200 display it looks great. So there!

Saturday, March 10, 2007

My Subwoofer Is Woofing

I managed to get the subwoofer on my Inspiron 9400 working today. I had read in several places that I just need to add 'model=ref' to the module config file, but I'd tried that without success.

Today I discovered that openSUSE 10.2 uses version 1.0.12 rc2 of the alsa drivers, and they don't support the subwoofer. So I downloaded alsa-driver-1.0.13, configured it with ./configure --with-cards=hda-intel, ran make, and then make install-modules, rebooted my machine, and the sub was working. Oh and that model=ref line was added to /etc/modprobe.d/sound, so now the first line is options snd-hda-intel enable=1 index=0 model=ref.


There's only one slight problem - the master volume control doesn't adjust the subwoofer (shown as LFE in the mixer), and muting the sound also doesn't mute the sub. But other than that it works!

Saturday, February 24, 2007

Appreciating KDE More

Since I've been Windows XP daily for the last two and a half weeks, due to my new job, I've come to appreciate KDE all the more. I was actually expecting to adjust to using Windows pretty quickly (I haven't regularly used Windows for over five years) - after all, Microsoft throws millions of pounds at it, so it must be a good system, despite what people say. But every day when I come home and boot back into Linux, I'm amazed at how much better nearly everything is. Admittedly, there are a few things from Windows I'd like to find in Linux, but there are far more things I want take take from Linux/KDE and put in Windows. Even simple things like resizing a window - I'm so used to pressing Alt+right-click to resize that I find it quite annoying that I can't do that in Windows. (I'm quite expecting someone to tell me of an addon which does this now.) And KDE just feels more solid to use, and more streamlined, and more productive and slicker and faster, and all-round better. Yay for KDE!

I'm looking forward to version four. I've been keeping an eye on SVN and things are looking pretty cool. It's still too much of a moving target for me to contribute at the moment (I don't have much time at the moment as I have a new job, and need to be learning about work code rather than KDE code right now), but I'm quite excited about the future of KDE.

Friday, February 09, 2007

New Things

I just noticed that my feed is back on Planet KDE. So I'm crossing my fingers that Blogger won't screw everything up again.

I now have a new job, which is as a Software Architect. And it's a very cool company to work for, and I'm coding in Java, so I'm enjoying it a lot.

One of the first things I got at this job was a new laptop. It's a Dell Inspiron 9400, with 2Gb of RAM, 100Gb of hard drive space, a 1920x1200 17" display and built in Intel wireless and bluetooth. And it has an Intel graphics card too, which is great, because it means I get to use open source drivers.

The downside is that it has Windows XP installed on it, which I have to use at work. Which means I will now be becoming a big advocate of making sure KDE4 will work on Windows. I'd forgotten just how awkward so many Windows programmes are. Things I particularly miss are konversation, kopete, kmail, rsibreak, knotes, knetworkmanager, kio, alt-clicking to move windows, alt-right clicking to resize them... and the list goes on. At least I get to use IntelliJ IDEA to develop in. It might not be FOSS, but it is a fantastic piece of software and well worth paying for, if you're a professional Java developer.

When I'm not at work however, I get to run Linux. I'm not allowed to dual-boot my machine, but fortunately the laptop supports booting off USB devices, so I've connected an external USB drive to the machine and installed openSUSE on that. I had a few problems getting grub to boot properly - as grub renumbers its drives when it boots from USB, and openSUSE's installer doesn't take that into account. And then I had problems getting the 1920x1200 resolution to work, but I managed to sort that out using 915resolution. So now I have an awesome linux box to play with. (I'll post details off how I got everything working properly later).

I ran hdparm and compared my external 4200rpm drive with the internal 5200rpm one, and with the internal 7200rpm drive on my old machine. And the speeds of unbuffered reads were pretty much proportional to the speeds of the drives, while buffered reads were three times faster on the new machine than the old one. So having the drive on a USB connection seems to be having nearly no impact on performance. Which is nice. I just have to be very careful not to disconnect the drive while it's in use.

Since I have a second external drive, I'm thinking of installing another, cut down version of linux on it, specifically for developing KDE4 on. I want to have KDE3 installed in such a way that KDE4 won't see it at all - so no references to any of it in /etc. I don't want any KDE3 apps to show up in the menus of KDE4, and I don't want any clever openSUSE modifications to things - I want it to be pretty much a standard Linux installation. So I have to decide - should I use Ubuntu, Kubuntu, Fedora, Gentoo or Debian? Or something else?

Friday, January 26, 2007

Daily Surprises

One thing I do each morning is run Smart to update my system. Most of the time it's just bugfix releases, but sometimes I get the nice surprise of getting a new version of a piece software. It's especially nice when I didn't know it had been released - like yesterday when I was given KDE 3.5.6, and today I got KDevelop 3.4. And I didn't have to pay anything.

Actually, I got a free Vista DVD at work yesterday - sent automatically by Microsoft in their action pack. I tried to update my Windows 2000 VMware image just to see what Vista is like. The installer said I didn't need to enter the product key, but if I didn't I might lost information, programmes and settings, and might need to buy a new copy of Vista. And then when I clicked Next it told me I only had 5Gb of free space so it couldn't continue. Oh well, I'll stick with Windows 2000 for when I really have to use Windows. Which isn't very often.

Sunday, January 21, 2007

Simple KDE4

I thought it was about time I got to know KDE4's libs better, so I started with the simplest programme I could - a hello world programme, and then extended it to start using kdelibs. So I made it produce an MD5 checksum of "Hello, world" as well. This way I didn't have to bother learning any GUI stuff - I could just concentrate on the very basic stuff. So here's what I wrote:

CMakeLists.txt:
project( test1 )
find_package( KDE4 REQUIRED )
include_directories( ${KDE4_INCLUDES} )

set( SRC test1.cpp )
kde4_automoc( ${SRC} )
kde4_add_executable( test1 ${SRC} )
target_link_libraries( test1 ${KDE4_KDEUI_LIBS} ${KDE4_KPARTS_LIBS} )


test1.cpp
#include <KDE/KCodecs>
#include <QtCore>
#include <iostream>


int main(int argc, char *argv) {
KMD5 context( "Hello, world" );
std::cout << "Digest output: " << context.hexDigest().data() << std::endl;
}


Very simple - but now I can start experimenting with the other kdelibs classes until I understand them well. Then I will be able to understand the rest of KDE better.