jasonwryan.com

Miscellaneous ephemera…

Install .otf Fonts in OpenOffice

OpenOffice won’t recognize TrueType fonts with the extension .otf, so you need to convert them to .ttf in order to use them in that suite.

1
sudo apt-get install fontforge

If all the .otf files are in the same folder, then you are good to go.

First, you need the conversion script, which I found in this post:

otf2ttf.sh
1
2
3
4
5
6
7
#!/usr/local/bin/fontforge
# Quick and dirty hack: converts a font to truetype (.ttf)
Print("Opening "+$1);
Open($1);
Print("Saving "+$1:r+".ttf");
Generate($1:r+".ttf");
Quit(0);

Save it as otf2ttf.sh into the folder with the .otf files.

Then run:

1
for i in *.otf; do fontforge -script otf2ttf.sh $i; done

Move all the converted fonts to your your shared directory:

1
sudo mv *ttf /usr/share/fonts/truetype/myfonts/

And then change the permissions and reload the cache:

1
2
3
sudo chmod go+rx /usr/share/fonts/truetype/myfonts/
sudo chmod go+rx /usr/share/fonts/truetype/myfonts/*.ttf
sudo fc-cache -f -v

And the fonts will now appear in OpenOffice. Easy.

Comments