2

I have an app whitch use a report made with JasperReport, but when I try generated the report this throw a net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Nimbus Mono L' is not available to the JVM. See the Javadoc for more details. I have embebed the fonts in the report, and it's work in the server development but not work in the server producction.

I try install de font in my server producction (Ubuntu) but the commands fc-list and fc-cache not work, throws -bash: fc-list: command not found

My server producction is only command line, info of my server:

uname -a:

Linux crtfacntyp1 3.2.0-33-generic #52-Ubuntu SMP Thu Oct 18 16:29:15 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/*-release:

DISTRIB_ID=Ubuntu

DISTRIB_RELEASE=12.04

DISTRIB_CODENAME=precise

DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS"

NAME="Ubuntu" VERSION="12.04.1 LTS, Precise Pangolin"

ID=ubuntu

ID_LIKE=debian

PRETTY_NAME="Ubuntu precise (12.04.1 LTS)"

VERSION_ID="12.04"

any idea? please help me :(

victorpacheco3107
  • 822
  • 3
  • 10
  • 32
  • you need to add the font under java fonts directory – codeMan Nov 15 '13 at 14:31
  • 1
    check out this SO question : http://stackoverflow.com/questions/3811908/jvm-fonts-and-jasperreports – codeMan Nov 15 '13 at 14:32
  • I have the file ttf, where I put it? – victorpacheco3107 Nov 15 '13 at 14:33
  • I have already sudo apt-get install ttf-mscorefonts-installer but it no contains the font nimbus mono – victorpacheco3107 Nov 15 '13 at 14:35
  • have u added the fonts directory to classpath? – codeMan Nov 15 '13 at 14:37
  • if the installation does not contain you font and if u have a ttf file, add the path of the file to CLASSPATH – codeMan Nov 15 '13 at 14:37
  • My web project have the project dependecy, this dependency have the report. Inside the jar of the dependency exist the ttf file, and the report reference the ttf file by the relative path. how I added to the classpath? – victorpacheco3107 Nov 15 '13 at 14:52
  • And I don't understand why work in develop but not in producction :( – victorpacheco3107 Nov 15 '13 at 14:53
  • 1
    I can resolved my problem!! In iReport, add de ttf file: Tools -> Options -> Fonts -> Install Fonts, after select de file ttf. After de install the font in the iReport, in same windown select the font installed and select the option "Export as extension", this generate a jar file. I added this file jar to the classpath of my app and this work!!!! – victorpacheco3107 Nov 15 '13 at 16:40

1 Answers1

0

create a new directory under "/usr/share/fonts". For example, I created directory:

mkdir /usr/share/fonts/GlobalFonts

to store a collection of fonts used in your project. To make sure that the fonts is accessible to the world, do

chmod 775 -R /usr/share/fonts/GlobalFonts

Then all needs to be done is run fc-cache command on that directory,

e.g

cd /usr/share/fonts
fc-cache GlobalFonts 
codeMan
  • 5,730
  • 3
  • 27
  • 51
  • I try install de font in my server producction (Ubuntu) but the commands fc-list and fc-cache not work, throws -bash: fc-list: command not found – victorpacheco3107 Nov 20 '13 at 16:57