New Foreword (Oct 30, 2006):
Note that since I have upgraded to Edgy I am now using mlind's edgy respository myself (see below) and I think these patches should still work on edgy (actually I know they will because they came from an edgy forum originally), so if you'd like to patch the debs yourself I think the instructions should still work. But I would just use mlind's repos.
Foreword:
The instructions below are for people who are using the compiz repositories for their font packages. They might also work for people who are not using the compiz repositories, but if you are not using compiz and want to patch the debs yourselves, you should definitely follow the instructions I made for people not using compiz that are found here:
http://ubuntuforums.org/showthread.p...14#post1402014
Edit: Compiz seems to have taken these font packages out of their repositories since I wrote this howto (several days ago), so the binaries should still work, but please follow the patching instructions in the link above and not the ones below, as you will not be able to get the latest versions of the packages to work with the patches below in the default ubuntu repositories. Thanks.
If you would like to add the compiz repositories and try the instructions below (the font packages are a little newer there, not sure what differences this would make, I use compiz on my system so I patched the compiz packages), do this:
Code:
sudo gedit /etc/apt/sources.list
And put the following lines in there:
Code:
# XGL and Compiz
deb http://www.beerorkid.com/compiz/ dapper main
deb http://xgl.compiz.info/ dapper main
deb-src http://xgl.compiz.info/ dapper main
Also, you can also use the debs that user mlind has graciously made, which are found in his repository:
Code:
deb http://www.elisanet.fi/mlind/ubuntu dapper fonts
deb-src http://www.elisanet.fi/mlind/ubuntu dapper fonts
For edgy:
Code:
deb http://www.elisanet.fi/mlind/ubuntu edgy fonts
deb-src http://www.elisanet.fi/mlind/ubuntu edgy fonts
Thanks mlind!
---
This is based on this thread:
http://www.ubuntuforums.org/showthread.php?t=178737
and also this thread:
http://www.ubuntuforums.org/showthread.php?t=180647
but unfortunately those debs do not work after the latest updates, and I did not find any other instructions on how to patch them yourselves.
If you'd just like to install these patched font packages, make a "fonts" directory in your home directory, save the attachments there, open a Terminal, and type the following commands:
Code:
cd fonts
tar xvjf fontdebs1.tar.bz2
tar xvjf fontdebs2.tar.bz2
sudo dpkg -i *.deb
sudo cp local.conf /etc/fonts
Now go to Synaptic Package Manager, search for libfreetype, libcairo, and libxft, and "lock" the package versions by selecting the package files, going to the Package menu and selecting Lock Version. If you are, at any later points in time, having problems with broken packages (which you will at some point after enough updates have been made, especially if new packages in Dapper depend on new version of these font packages that currently do not exist yet, which is why the instructions about patching them yourself are key), just unselect the Lock Version for these packages (click on the "Status" button in Synaptic Package Manager at the bottom left hand corner, click on "Pinned," and you will see all packages you have locked version there) and update and you should be great.
Now, the really fun part:
HOWTO PATCH THEM YOURSELF
1. Get these patches (these are from this thread: http://www.ubuntuforums.org/showthread.php?t=235526)
http://www.magiclinux.org/people/sun...by-default.txt
http://www.magiclinux.org/people/sun...cleartype.diff
Also, the following commands should install everything (I hope) you need to compile the packages:
Code:
sudo apt-get install build-essential devscripts fakeroot
sudo apt-get build-dep libcairo2 libxft2 libfreetype6
2. Now get the code for your packages:
Code:
mkdir fonts
cd fonts
apt-get source libcairo2 libxft2 libfreetype6
3. Change the package version so that Update Manager will not try to update the packages if you lock their versions in synaptic manager. In each package directory, type:
Enter a short descriptive phrase for the changes you have made ("Patched with David Turner's font patches" for example), close the file by pressing Ctrl-X and answering Yes so that the file is saved. Do this for all three packages.
4. Now patch the sources. Here is what you do:
For libcairo, the file you downloaded (0001-something) is actually an email, you need to edit it with gedit and get rid of the headers down to the line that reads 6b0d... Now:
Code:
cd libcairo-1.2.2 [or whatever version you got]
patch -p1 < pathtoyour0001filewiththeemailheadersremoved
Should see no errors here (if you do, perhaps the patch no longer works with some newer version that does not yet exist, or, probably, you just forgot to remove the headers or did not remove them completely, or removed too much, etc.).
For libxft, the patch is already in the right format. Do this:
Code:
cd libxft-2.1.8.2 [or whatever version you got]
patch -p1 < pathtoyourlibXft-2.1.10-etcpatchfile
Should get no errors.
Finally, for libfreetype, it is a little more complicated since there is no patch. Basically, what you do is this. In the directory created (freetype-2.2.1 for example) there will be a file called freetype-2.2.1.tar.bz2. You will extract it, edit the appropriate file, adn then re-create the tar.bz2 archive. Here is how you can do it:
Code:
cd freetype-2.2.1
tar xvjf freetype-2.2.1.tar.bz2
gedit freetype-2.2.1/src/autofit/aflatin.c
Now edit the file, find the part that reads:
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
Change that to:
if ( mode == FT_RENDER_MODE_MONO )
other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
Find the part that reads:
if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
Change that to:
if ( mode == FT_RENDER_MODE_MONO )
other_flags |= AF_LATIN_HINTS_VERT_SNAP;
Now, do:
tar cvjf freetype-2.2.1.tar.bz2 freetype-2.2.1/*
rm -rf freetype-2.2.1
Also do this to turn on the bytecode interpreter (I think this makes bold fonts better):
Code:
gedit debian/rules
Find the line that reads:
# patch -p1 -d $(freetype_u) -i $(patchdir)/030-bytecode-interpreter.diff
And take out the # at the beginning of the line so it reads:
patch -p1 -d $(freetype_u) -i $(patchdir)/030-bytecode-interpreter.diff
Great, you're done patching.
5. Make the packages:
In each package directory, just type:
Code:
dpkg-buildpackage -rfakeroot -us -uc
Wait a while, you will get some errors about missing a private key, but other than that it should succeed, and your packages will be in the fonts parent directory that you created. Enjoy!
Misha
Bookmarks