Jaspersoft Studio itself does not support Chinese characters, so if there are Chinese characters in the report, it will become a small square:

There are two solutions:

1 Use Unicode codes

  1. Find a Chinese character to Unicode site and convert the Chinese character you want to enter into Unicode:

  1. Use components that support expressions

Do not use “static text” because it does not transform the content. Replace it with a “text field” component and copy the unicode for the character:

3. Reformat your font

Click the top toolbar, select the corresponding Chinese font, and set the font size:

Unfortunately, the font here is only up to 26.

4. Run the tests

Isn’t it nice to see beautiful Chinese characters

2 Install Chinese fonts

Although using Unicode can solve the problem of Chinese character display, but still feel cumbersome conversion, is there a better solution? Of course there is

  1. Download Chinese font

The example font here (TTF format) is Microsoft Yahei, of course you can use any font

  1. The installation

window -> preference

Open font Manager:

Click Add on the right to Add the font. Just enter the font name and select the font path:

After setting, click Next -> Next -> Finish and you are ready

The Settings after Next, one for HTML fonts and one for localized characters, are rarely used

  1. test

Let’s use the new static Text component and try typing Chinese characters:

[image.png- b6605A-1579421553848-0]

The static text component is now supported

Note: You must use a new static Text component. Simply modifying an existing static Text component in the template will not take effect. Obviously Jaspersoft Studio will not apply a new font library to an old component.

  1. Font fine-tuning

Click on the Static Text component and you can find the font Settings in the middle of the top.