Tuesday, May 22, 2007

Ubuntu: How to install Liberation fonts

On May 9, 2007 Red Hat released free fonts under the name Liberation. There are three sets: Sans (a substitute for Arial, Albany, Helvetica, Nimbus Sans L, and Bitstream Vera Sans), Serif (a substitute for Times New Roman, Thorndale, Nimbus Roman, and Bitstream Vera Serif) and Mono (a substitute for Courier New, Cumberland, Courier, Nimbus Mono L, and Bitstream Vera Sans Mono).

Download liberation-fonts-ttf-2.tar.gz and extract.
$ tar xvzf liberation-fonts-ttf-2.tar.gz --wildcards *.ttf

Create folder for the fonts and move font files to that folder (I'm creating folder /usr/share/fonts/truetype/liberation).
$ sudo mkdir /usr/share/fonts/truetype/liberation
$ sudo mv *.ttf /usr/share/fonts/truetype/liberation

Create file liberation.hints in directory /etc/defoma/hints with the following content:
category truetype
begin /usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf
Family = Sans
FontName = Sans-Regular
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Vietnamese Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR
GeneralFamily = SansSerif
Weight = Medium
Width = Variable
Shape = NoSerif Upright
Foundry = Monotype
Priority = 20
end
begin /usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf
Family = Sans
FontName = Sans-Bold
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Vietnamese Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR
GeneralFamily = SansSerif
Weight = Bold
Width = Variable
Shape = NoSerif Upright
Foundry = Monotype
Priority = 20
end
begin /usr/share/fonts/truetype/liberation/LiberationSans-BoldItalic.ttf
Family = Sans
FontName = Sans-BoldItalic
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Vietnamese Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR
GeneralFamily = SansSerif
Weight = Bold
Width = Variable
Shape = NoSerif Italic
Foundry = Monotype
Priority = 20
end
begin /usr/share/fonts/truetype/liberation/LiberationSans-Italic.ttf
Family = Sans
FontName = Sans-Italic
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Vietnamese Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR
GeneralFamily = SansSerif
Weight = Medium
Width = Variable
Shape = NoSerif Italic
Foundry = Monotype
Priority = 20
end
begin /usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf
Family = Mono
FontName = Mono-Regular
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Vietnamese Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR
GeneralFamily = Typewriter
Weight = Semilight
Width = Fixed
Shape = Serif Upright
Foundry = Monotype
Priority = 20
end
begin /usr/share/fonts/truetype/liberation/LiberationMono-Bold.ttf
Family = Mono
FontName = Mono-Bold
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Vietnamese Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR
GeneralFamily = Typewriter
Weight = Demibold
Width = Fixed
Shape = Serif Upright
Foundry = Monotype
Priority = 20
end
begin /usr/share/fonts/truetype/liberation/LiberationMono-BoldItalic.ttf
Family = Mono
FontName = Mono-BoldItalic
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR
GeneralFamily = Typewriter
Weight = Demibold
Width = Fixed
Shape = Serif Italic
Foundry = Monotype
Priority = 20
end
begin /usr/share/fonts/truetype/liberation/LiberationMono-Italic.ttf
Family = Mono
FontName = Mono-Italic
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Vietnamese Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR
GeneralFamily = Typewriter
Weight = Semilight
Width = Fixed
Shape = Italic Serif
Foundry = Monotype
Priority = 20
end
begin /usr/share/fonts/truetype/liberation/LiberationSerif-Regular.ttf
Family = Serif
FontName = Serif-Regular
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Vietnamese Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR
GeneralFamily = Roman
Weight = Medium
Width = Variable
Shape = Serif Upright
Foundry = Monotype
Priority = 20
end
begin /usr/share/fonts/truetype/liberation/LiberationSerif-Bold.ttf
Family = Serif
FontName = Serif-Bold
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Vietnamese Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR
GeneralFamily = Roman
Weight = Bold
Width = Variable
Shape = Serif Upright
Foundry = Monotype
Priority = 20
end
begin /usr/share/fonts/truetype/liberation/LiberationSerif-BoldItalic.ttf
Family = Serif
FontName = Serif-BoldItalic
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Vietnamese Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR
GeneralFamily = Roman
Weight = Bold
Width = Variable
Shape = Serif Italic
Foundry = Monotype
Priority = 20
end
begin /usr/share/fonts/truetype/liberation/LiberationSerif-Italic.ttf
Family = Serif
FontName = Serif-Italic
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Vietnamese Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-9e ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP437 CP850 CP1251 CP1255 VISCII1.1-1 TCVN-5712 TATAR-CYR
GeneralFamily = Roman
Weight = Medium
Width = Variable
Shape = Serif Italic
Foundry = Monotype
Priority = 20
end
Content is taken and modified from the /etc/defoma/hints/msttcorefonts.hints file.

Then register fonts with defoma:
$ sudo defoma-font -v reregister-all /etc/defoma/hints/liberation.hints

Log out and log in or reboot :)

Also check http://uwstopia.nl/blog/2007/05/free-your-fonts to see how you can fool applications into showing Liberation whenever they ask for one of the non-free Microsoft fonts.

3 Comments:

At 19 June, 2007 11:25, Blogger tolikzilla said...

One more method:
add lines to /etc/apt/sources.list
# Automatix Repositories
deb http://www.getautomatix.com/apt feisty main
In terminal:
wget http://www.getautomatix.com/keys/automatix2.key
gpg --import automatix2.key
gpg --export --armor E23C5FC3 | sudo apt-key add -
sudo aptitude update
sudo aptitude install ttf-liberation

 
At 31 July, 2008 00:47, Anonymous Anonymous said...

automatix is evil

 
At 24 August, 2022 13:19, Anonymous Rodent Control Chattanooga said...

Thank you for sharing.

 

Post a Comment

<< Home