80
|
Chapter 4, Related to X
#25 Use Windows and Mac Fonts
HACK
directories so that you’ll copy everything below the CoolGear and default
directories to the destination ~/.icons):
$ cp –R CoolGear ~/.icons
$ cp –R default ~/.icons
The second command overwrites whatever index.theme file you have in your
~/.icons/default directory.
Start up your favorite desktop or window manager (or exit and restart the
desktop or window manager you’re using), and you should see the cursor
theme, formerly designed for Windows, running on your Linux X server-
based desktop!
Not every CursorXP theme converts well. It’s possible for a
misbehaving cursor theme to prevent you from starting up
your window manager or desktop. If you have this problem,
switch to a virtual console by pressing Ctrl-Alt-F1. Log in with
your normal username. Edit your ~/.icons/default/index.theme
file, and change the
Inherits parameter to a theme that
works.
HACK
#25
Use Windows and Mac Fonts Hack #25
Spruce up your desktop with your favorite fonts from other operating
systems.
A major problem that has been leveled at the Linux desktop is a lack of
good-quality fonts. This is because font creation is a time-consuming and
expensive process that requires a lot of skill. Those who know how to do it
are generally not inclined to give their work away for free (a nice contrast to
the thousands of open source programmers who do give their code away).
You can purchase fonts to use with your Linux system, but it is cheaper to
use fonts you already have on another OS.
When copying fonts from one operating system to another,
bear in mind the legal implications of what you are doing.
Fonts that are included with proprietary operating systems
are sometimes under specific licensing terms that can restrict
their use. Before you copy anything, be sure to read the
licensing terms for the fonts.
Use Windows Fonts
Linux has full support for the TrueType fonts used by Windows. One
method of using the fonts is to simply copy them from Windows and install
them either in the X font directories or in .fonts in your home directory.
Use Windows and Mac Fonts #25
Chapter 4, Related to X
|
81
HACK
Although this method works, if you have Windows installed on the same
computer that runs Linux, it’s unnecessary to copy all those fonts when you
can use a more elegant solution and access them from one place.
First, you need to ensure that you can mount your Windows partition. To
do this you need to have support for the VFAT (or NTFS if you use Win-
dows 2000/XP) filesystem in your kernel. My distribution kernels include
this support, but if you compile your own kernels, you need to add support
yourself. In your kernel configuration tool, enable support by selecting File
systems
DOS/FAT/NT, File systems VFAT Support or, if you have an
NTFS filesystem, File systems
NTFS file system support (read only).
Before you can access the Windows disk, mount the partition. You can do
this manually with the following:
foo@bar:~$ mkdir /mnt/windows
foo@bar:~$ mount -t vfat /dev/hda1 /mnt/windows
Your Windows partition might be located someplace other than /dev/hda1
and you can use a different mount point than /mnt/windows. If you are
unsure which partition numbers are available, you can type this command
to see a list:
foo@bar:~$ ls -al /dev/hda*
To make mounting easier, add this mount point to the list of available
mount points in /etc/fstab. This file tells the system which disks are available
and how they are accessed. You should add one of these two lines depend-
ing on whether you have a VFAT- or NTFS-formatted Windows partition:
/dev/hda1 /mnt/windows vfat rw 0 0
/dev/hda1 /mnt/windows ntfs ro 0 0
This tells the system that /dev/hda1 is available in /mnt/windows with read
and write access and to mount it at every boot. NTFS is mounted read-only
(
ro), because writing to an NTFS partition is not supported and will cause
data corruption.
To use the fonts, you need to access the Windows font directory and run
some utilities that will make the fonts usable in X Windows. Although X sup-
ports TrueType fonts, it needs some special files to be generated that provide
information about the fonts. Windows often keeps fonts in C:\Windows\Fonts,
so you should go to /mnt/windows/windows/fonts to run the commands.
The first command is called
ttmkfdir. This command creates a special font
information file called fonts.scale that displays a list of the fonts and their
capabilities in a format the X server can understand; this acts like a refer-
ence card that says what each font can do. To create this file, simply run the
command inside the font directory:
foo@bar:~$ ttmkfdir

Get Linux Desktop Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.