0

I've inherited a project that uses Jaspersoft Studio 6.2.2 (a tool I know nothing about). Reports are failing because they've been deployed to a Unix server that doesn't have the "Arial" font installed. I'm trying to replace it with "Lucida Sans", a font that I know is available

I've replaced the term "Arial" with "Lucida Console" in the two *.jrxml files I have and them recompiled to *.jasper but the report is totally ignoring the new font.

<style name="Heritage" mode="Opaque" forecolor="#E5F1FA" backcolor="#18BC9C" radius="3" hTextAlign="Center" vTextAlign="Middle" fontName="Lucida Sans" fontSize="12" isBold="true">
    <conditionalStyle>
        <conditionExpression><![CDATA[!$P{project}.isHeritage()]]></conditionExpression>
        <style mode="Opaque" forecolor="#FFFFFF" backcolor="#D62C1A"/>
    </conditionalStyle>
</style>

net.sf.jasperreports.engine.util.JRFontNotFoundException: Font "Arial" is not available to the JVM.

Is there a quick way to switch the font?

I understand there're better solutions (use font extenions or just install Arial on server) but I need a quick fix.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
  • Did you check this: [Font is not available to the JVM with Jasper Reports](https://stackoverflow.com/q/3811908/876298)? – Alex K Jul 16 '19 at 21:10

1 Answers1

1

add exported font file into the project's classpath.

try with following steps,

  1. select Window > Preferences
  2. in the preferences dialog, select Jaspersoft Studio > Fonts
  3. select Add for add the new font. in this step, set the font name and browse the relevant font files (.ttf files), then you can see, new font under the "Font List"
  4. select the desired font from "Font List" and Export to .jar file. in this step. give the name for exported font (.jar) file
  5. finally exported font file (.jar) add to the project's classpath
Lakshan
  • 1,404
  • 3
  • 10
  • 23
  • That dialogue seems to be broken in 6.2.2 (it throws an error in two different PCs) and we can't upgrade because we need to support some outdated toolchain but it seems to be the only solution. Whatever, since the quick and dirty workaround I was in need for doesn't seem to exist, I've linked my question with the existing one that has all the know-how. – Álvaro González Jul 24 '19 at 08:07