socomm
May 11th, 2005, 12:25
Coming back from the Debian world there are a few things that I just loved and now miss, for instance the msttcorefont package which provides a user with the Microsoft True Type Fonts to use with their XServer. Just a week back now and I get to thinking, why can't I just install the fonts by hand? Well in this tutorial I will go into the few steps that it takes to get this package installed and configured on a FreeBSD system.

Before we begin be sure that you have the following packages properly configured and installed on your system.

Requirements:

ttmkfdir - Provided by `$(PORTS)/x11-fonts/ttmkfdir'
rpm-build - Provided by `$(PORTS)/archivers/rpm4'
cabextract - Provided by `$(PORTS)/archivers/cabextract'
wget - Provided by `$(PORTS)/ftp/wget
chkfontpath - Must be fetched and compiled manually.

Most of above packages should build and install cleanly on most systems, RPM4 might be a hassle to get working but I'll leave that task up to you. The `chfontpath' package you'll have to download, uncompress, and compile by hand, I'll go into the process below.

I've taken the liberty of hacking up the original chkfontpath package and uploaded somewhere for your perusal. You can get it from here (http://samesoft.sourceforge.net/chkfontpath-1.7.tar.bz2), or just follow the instructions below as root:

wget http://samesoft.sourceforge.net/chkfontpath-1.7.tar.bz2
tar xjf chkfontpath-1.7.tar.bz2
cd chkfont* && make && make install
That should about have you set to build the package, next we'll need to download and configure msttcorefont's spec file. Grab the file from here (http://prdownloads.sourceforge.net/corefonts/msttcorefonts-1.3-4.spec?download).
The sections that need to be edited for your system are the ttmkfdir section, and fontdir section edit them to reflect your system setup.

With that through we're almost done next create the following directories:

mkdir -p /usr/local/src/portbld/BUILD/msttcorefonts
mkdir -p /usr/local/src/portbld/RPMS/noarch
rpm will utilize those directories for it's build process, so with said let begin the build process:

rpmbuild -bb --nodeps msttcorefonts-1.3-4.spec
This should create the msttcorefonts.rpm package, you can no install it via rpm issue the following command to install the package:

rpm -Uvh /usr/local/src/portbld/BUILD/noarch/msttcorefonts-1.3-4.noarch.rpm
With that the fonts should now be installed and autodetected by your DE/WM, if not you may have to run `xfstt --sync' and re-sync the XFont Server or restart your WM/DE for the font changes to take effect.

bumbler
May 11th, 2005, 15:55
Nice job. To avoid all the hassle, I keep a copy of the entire TrueType font directory, with fonts.dir and fonts.scale, on several different backup CDs. When doing a new install of anything, with the way the new X servers and fonts.conf work, I just copy the thing into the user's home directory as ~/.fonts. Given that fonts.conf seems always to scan for that, I've never failed to have TTFs.

optyk
May 11th, 2005, 22:07
I may be way off here, but why not just install the webfonts port?

http://www.freshports.org/x11-fonts/webfonts/

This is a collection of high quality and free to use TrueType fonts created by
Monotype and Microsoft Typography. It consists of the following families:

Times New Roman, Courier New, Georgia, Trebuchet MS, Comic Sans MS
Arial, Arial Black, Verdana, Andale Mono, Impact

socomm
May 12th, 2005, 09:48
Doh! :mad: Haha, oh well. This tutorial will also help you install all those fonts plus the tahoma font so I guess it's not a total waste.

molotov
May 12th, 2005, 14:16
Good howto, just a nitpick but couldnt fetch be used instead of wget? One less port to install...

socomm
May 12th, 2005, 16:25
The RPM's spec file utilizes wget to fetch the fonts from sourceforge, I suppose you could edit it to use fetch but since I already had wget installed I didn't see the point in that.