Tuesday, August 12, 2014

Installing MS fonts into Centos for converting DOCX files to PDF using DOCX4J


a)  Install MS TT Fonts using information here:


b)  If you need font mapping you can setup a font.properties file. I copied the one on my Mac, from
 /Library/Java/Home/lib/fontconfig.properties.src
to
 /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64/lib/font.properties
.. on my Centos development box .



Notes:
After installing the MS fonts, it must add a file to the JDK lib as (the path will vary based on whatever JVM you are using):
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64/lib/msttcorefonts-2.5-1.spec

The reason for renaming fontconfig.properties.src to font.properties, is found here:
http://docs.oracle.com/javase/8/docs/technotes/guides/intl/fontconfig.html

Remember to restart any Java app that's running and needs to find the newly installed fonts.

No comments:

Post a Comment