Thursday, June 25, 2009

How to add Windows TrueType fonts easily in Linux desktop system

How do you use Windows True Type fonts in Linux or how do you install Windows TrueType fonts in Linux?

Fonts are very important. When you migrate from Windows XP to Linux you may miss Truetype font. TrueType is a font standard developed by Apple Computer. By 1991 Microsoft had built TrueType into the Windows 3.1 operating system. The FreeType project provides TrueType under Linux. So let us see how to backup your Windows TrueType fonts and install them in Linux.

It is quite easy to add Windows True Type fonts in Linux. First make sure you copy Windows fonts on USB pen (usually located in C:\Windows\Fonts directory) or just mount windows NTFS/FAT partition. You can copy selected or all fonts from C:\Windows\Fonts directory.
Linux Gnome desktop

=> Open your default file manger or double click Computer icon on Gnome desktop
=> Type url:
fonts://
Alternatively, select Open Location? from file menu and type
fonts://
=> Once window open, just drag and drop fonts into this new windows from USB pen or mounted partition. Don't forget to restart application or just logout and login again.

Display Microsoft fonts like in Windows in CentOS/Fedora

Staying in front of your computer for hours and hours with the default fonts can be a challenge on Linux/Unix. I, for one, can’t work properly without the Windows fonts comfort :)

Having the windows fonts working on Unix systems is fairly easy, but on Red Hat-based operating systems such as CentOS or Fedora, can be a real nightmare. The most critical aspect of having the Microsoft fonts to display properly on CentOS in compiling freetype with bytecode interpreter enabled. Let’s go through this procedure.

This tutorial assumes you have the 3 most popular community repositories enabled (Karanbir Singh, Dag Wieers and Dries).
((http://www.osresources.com/11_6_en.html))

1. Create the system source tree:

$ su
# mkdir -p /usr/src/redhat/SPECS


2. Download the latest version of the Freetype source code from a CentOS repository – For instance: freetype-2.*.el5.src.rpm – To your desktop (has to have a .src.rpm extension) and install the source:

# rpm -Uvh ./Desktop/freetype-2.1.9-1.0.rf.src.rpm

3. Open the spec (make) file in a text editor:

# gedit /usr/src/redhat/SPECS/freetype.spec

And enable the bytecode interpreter changing this line:

%define without_bytecode_interpreter 1

To:

%define without_bytecode_interpreter 0

(And not the opposite!)
Save.

4. Install some essential compilation tools and a few upgrades:

# yum install gcc-c++ rpm-build xorg-x11-deprecated-libs-devel xorg-x11-devel automake autoconf libtool zlib-devel libX11-devel


5. Build Freetype:


# cd /usr/src/redhat/SPECS
# rpmbuild -ba freetype.spec


6. Now you should have your RPMs:

# cd /usr/src/redhat/RPMS/i386 && ls
freetype-2.1.9-1.2.rf.i386.rpm freetype-devel-2.1.9-1.2.rf.i386.rpm
freetype-demos-2.1.9-1.2.rf.i386.rpm freetype-utils-2.1.9-1.2.rf.i386.rpm
#


7. Install the new version of Freetype:

# rpm -Uvh --force *

8. Download the Microsoft fonts and extract them:

# mkdir /usr/share/fonts/TTF
# tar xvjpf msfonts.tbz -C /usr/share/fonts/TTF/


Download the fontconfig files and extract them into your fontconfig directory:

# tar xvjpf fontconfig.tbz -C /etc/fonts/

9. Make sure the fonts directory is listed in the fontconfig configuration file:

# gedit /etc/fonts/fonts.conf

ie:

/usr/share/fonts/TTF
Save.

10. Log out from Gnome/KDE and relog in. Now here’s how your fonts should look like:

Wednesday, June 24, 2009

Virtual IP addresses

You can add several virtual IP addresses to a physical network interface. A good starting point is to copy the interface definition file of the device you want to add a virtual IP address to.

cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0


You may have to modify ifcfg-eth0 to match your physical interface name.

Now you can edit the new file ifcfg-eth0:0 and specify the network settings of the virtual interface.

To make the changes take effect please restart the network services using:

service network restart