Tuesday, 7 August 2012

Centos 6/RHEL install TrueType Fonts

You can add extra fonts in Centos 6/RHEL quite easily and I've made available a 60mb pack of them for this purpose.

Fonts.zip

Download it to your home directory and unzip them.

$ unzip Fonts.zip

They are mainly truetype so make a directory called truetype

$ sudo mkdir /usr/share/fonts/truetype

Copy them over

$ sudo cp /home/<user_name>/Fonts/* /usr/share/fonts/truetype

Then add them to the cache

$ fc-cache /usr/share/fonts/truetype

To view the new fonts run a program such as Gimp, Libreoffice, Beaver, Gedit and many others

You can repeat the process if you have fonts from elsewhere.

If you have Java installed you can download and run Opcion (get the .jar file)

$ java -jar Opcion_v1.1.1.jar

And that gives you a list of all the fonts.

To make them available in Java/Eclipse 

$ sudo vi /home/<user>/.bashrc

See vi or vim commands

JAVA_FONTS=/usr/share/fonts/truetype
export JAVA_FONTS


Save and source the file

$ source /home/anton/.bashrc

Now the fonts are available to Java.



Eclipse with new fonts (SteppesTT selected)







6 comments:

  1. opening the Fonts.zip file gives me "unexpected end of archive".

    ReplyDelete
  2. Keep trying, it will work. I am unfortunately waiting for hospital treatment on a bad hearing condition at present so posting is sporadic.

    ReplyDelete
  3. Hey paul, thanks for the tip. I incorporated this into my video conversion script since I do a lot of bulk video edits that require fonts that are typically attached in the video. So this helped me add some additional functionality to dump the fonts and then import them to the cache so that they don't give me a font-not-found error on centos.

    ReplyDelete
  4. thankyou for providing a downloading link for Fonts.zip but it only works with a windows computer, it won't work with a wget command in a linux console. Is there any chance you could provide a more linux-friendly download link?

    ReplyDelete