For who face issues please find below solution: There is dependency called Jasper font extensions, if you check this dependency you will found file 'jasperreports_extension.properties', this file have fonts as property file this file have two items, first the type of factory fonts(which you don't need to change it), also paths for custom(config) fonts as XML file(lets called it as customFontConfig. if you check xml file you will found path ttf file Jasper load file 'jasperreports_extension.properties' from src/main/resources, and load all fonts inside it(customFontConfig file). but the need to config, to do it we need to use Jasper Studio, first you add the font in Properties, after that you export the font, when you export it you will get jar file, this jar will be almost Jasper Extension Fonts, so what you need to use this with your project
excuse me you just replace the font, but who to add it I try to extract the jar file and add my font manually to jasper-fonts jar same they are work with other fonts and replace this jar with new jar in .m2 folder Maven but still not see my font, even I add it in jasper-fonts jar please any help
@@moumie3246 I have custom font, I add it this font as jar after create it in Jasper Studio. All export files (like Excel) are work with this custom font, but PDF not work
@@moumie3246 I try these following: 1. create the font in Jasper Studio, and export this font as jar file using Jasper Studio, and import this jar in my Java project. 2. I try PDF encoding by set it for every text field in my report using Jasper Studio 3. extract the extension font Jasper library Java and add my custom font in it and edit the xml file for extension font Jasper library and link my ttf with xml all these I try it but all reach same result, which export report as PDF using Java will not see my font
For who face issues please find below solution:
There is dependency called Jasper font extensions, if you check this dependency you will found file 'jasperreports_extension.properties', this file have fonts as property file
this file have two items, first the type of factory fonts(which you don't need to change it), also paths for custom(config) fonts as XML file(lets called it as customFontConfig.
if you check xml file you will found path ttf file
Jasper load file 'jasperreports_extension.properties' from src/main/resources, and load all fonts inside it(customFontConfig file).
but the need to config, to do it we need to use Jasper Studio, first you add the font in Properties, after that you export the font, when you export it you will get jar file, this jar will be almost Jasper Extension Fonts, so what you need to use this with your project
how to add custom fonts with different language here?
It helps me with a taks, thank u man!
Unfortunaly i did not understant, where are you getting font.xml, jar file, will be better if you will share your code in git
excuse me you just replace the font, but who to add it
I try to extract the jar file and add my font manually to jasper-fonts jar same they are work with other fonts and replace this jar with new jar in .m2 folder Maven but still not see my font, even I add it in jasper-fonts jar
please any help
@Ahmed Kahled, sorry for the late reply but I could not get your point but hope by now it has been solved.
@@moumie3246 thanks for reply
sir please I need your help
@@moumie3246 I have custom font, I add it this font as jar after create it in Jasper Studio.
All export files (like Excel) are work with this custom font, but PDF not work
@@moumie3246 I try these following:
1. create the font in Jasper Studio, and export this font as jar file using Jasper Studio, and import this jar in my Java project.
2. I try PDF encoding by set it for every text field in my report using Jasper Studio
3. extract the extension font Jasper library Java and add my custom font in it and edit the xml file for extension font Jasper library and link my ttf with xml
all these I try it but all reach same result, which export report as PDF using Java will not see my font
@@moumie3246 please any help
After i added these librariesand convert into jar file.its not open.jar file open only without library.how to fix it
Hello
can I get link to your project file to downoald it ?
thanks for explain
excuse me is there link source code for your project?
and very thanks
Yes sure, I can sent it to you by email