Jasper stops finding one font

前端 未结 6 1734
遥遥无期
遥遥无期 2020-12-09 04:56

After upgrading Jasper to the last version, it stopped finding one font: Symbol. The rest of the fonts seem to be fine. I have a bunch of ttfs in the same directory as where

相关标签:
6条回答
  • 2020-12-09 05:28

    Update for year 2015:

    Add this to (or uncomment in) /etc/apt/sources.list

    deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
    deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
    deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
    

    Then run this:

    sudo apt-get update
    sudo apt-get install msttcorefonts
    
    0 讨论(0)
  • 2020-12-09 05:39

    Well the font must be installed in the OS where the report run.

    0 讨论(0)
  • 2020-12-09 05:46

    I'm using JasperReports 6.3.1. I solved the problem by adding the following line in my .jrxml:

    <property name="net.sf.jasperreports.awt.ignore.missing.font" value="true"/>
    

    This way our report will look something different, depending on the fonts that are preinstalled in the system. In my case it does not represent a problem, and I'm not interested in adding an extra font in my project, since I need to be as light as possible.


    In case you want to use the original fonts of the report in all runtime environments, an easy solution is to add the necessary dependencies to the project.

    An example, for Maven:

    <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports-fonts</artifactId>
        <version>6.0.0</version>
    </dependency>
    

    You can also download the libraries and add them manually to the project, however it will work.


    I hope you find them useful.

    0 讨论(0)
  • 2020-12-09 05:48

    On ubuntu I needed to uninstall the fonts and reinstall them:

    sudo apt-get remove  ttf-mscorefonts-installer
    sudo apt-get install  ttf-mscorefonts-installer
    

    Then, it works ok.

    0 讨论(0)
  • 2020-12-09 05:50

    The easy steps to solve this problem would be

    1. Open jasperreports-x.x.x.jar, in my case jasperreports-3.7.2.jar.
    2. Locate default.jasperreports.properties file and open it.
    3. Find the line net.sf.jasperreports.awt.ignore.missing.font=false and change value from false to true net.sf.jasperreports.awt.ignore.missing.font=true.
    4. Update the jar.
    5. Add to classpath of your project.

    The problem is solved.

    0 讨论(0)
  • 2020-12-09 05:52

    Try adding the line

    net.sf.jasperreports.awt.ignore.missing.font=true

    to your jasperreports.properties file.

    0 讨论(0)
提交回复
热议问题