Home >Java >javaTutorial >How To Fix \'java.io.IOException: Problem reading font data.\' When Load Customized TTF In Java.

How To Fix \'java.io.IOException: Problem reading font data.\' When Load Customized TTF In Java.

WBOY
WBOYOriginal
2024-07-31 18:55:42339browse

Yesterday, my colleague said the service had a problem loading the customized font -- NotoSerif-Regular.ttf on our SIT, but it worked on local, the error was as follows:

Image description

After trying several methods, although it was resolved, I still have many questions.

Our containerized service uses the base container image – amazoncorretto:19-alpine.

Below is the solution and it seems that the font-noto package must be installed first, or the problem will exist again.

How To Fix

However, I can only treat it as a workaround but not a good solution.

Because the package I installed contained the TTF file of font covered in the source code developed by our software engineer.

Although I am still looking for the answer, I hope someone encountering this issue can fix the problem quickly.

If someone has known the answer, please casually leave a comment to share your knowledge with us, big thanks!

The above is the detailed content of How To Fix \'java.io.IOException: Problem reading font data.\' When Load Customized TTF In Java.. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn