Page 1 of 2

a large amount of+~JF * *.tmp files is generated in the hard drive.

Posted: Thu May 16, 2024 8:52 am
by simon ren
Hello,
Currently, when using the printing function, a large amount of+~JF * *.tmp files is generated in the hard drive.
After searching online, we found that it was caused by the use of the Font. createFont() method internally when we called your StiFontCollection. addResourceFont() method.
Font CreateFont() has another method that does not generate a large number of tmp files
Previously, tmp files were automatically cleaned up after the program ended, but now they are not automatically cleaned up
Could you please consider whether to optimize it

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Posted: Thu May 16, 2024 10:33 am
by Max Shamanov
Hello,

Could you please send us a sample project that reproduces the issue?

Thank you.

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Posted: Mon May 20, 2024 1:58 am
by simon ren
Hello,
In a Linux environment,We call StiFontCollection.addResourceFont() method will cause this issue to stabilize.
It will write files to the/tmp folder, and when called multiple times, this folder will be full

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Posted: Mon May 20, 2024 7:30 am
by Vadim
Hello.

It seems that is bug of some Java versions, you can change Java version on your Linux environment to fix it.

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Posted: Wed May 22, 2024 7:35 am
by simon ren
The problem is that you used the Font. createFont() method, which can also be directly searched online

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Posted: Wed May 22, 2024 9:05 am
by Vadim
Hello.

This method load fonts from report resources, if you don't need this font you can remove it from report.

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Posted: Thu May 23, 2024 1:46 am
by simon ren
This method has another usage that won't generate a large number of files. Can you consider optimizing it

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Posted: Thu May 23, 2024 12:00 pm
by Vadim
Hello.

We don't create .tmp files, it created by some Java versions, please change Java version to eliminate problem

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Posted: Mon May 27, 2024 1:07 am
by simon ren
Hello,
From the figure, it can be seen that the file was generated in the method chain being called

There are two methods for createFont,
1.Font.createFont(Font.TRUETYPE_FONT, InputStream input);
2.Font.createFont(Font.TRUETYPE_FONT, new File(pathString));

The first one will cause the problem, and the second one will not. Can we change it to the second one

Re: a large amount of+~JF * *.tmp files is generated in the hard drive.

Posted: Mon May 27, 2024 6:15 am
by Vadim
Hello.

For our needs createFont with InputStream is necessary