Dev Tips#56 Font is not available to the JVM in Jasper report

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

ความคิดเห็น • 22

  • @AhmedKhaled-he9mf
    @AhmedKhaled-he9mf 2 ปีที่แล้ว +1

    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

  • @hkkabir2024
    @hkkabir2024 2 หลายเดือนก่อน +1

    how to add custom fonts with different language here?

  • @gusdev-r
    @gusdev-r 5 หลายเดือนก่อน

    It helps me with a taks, thank u man!

  • @chyngyzsheraliev1447
    @chyngyzsheraliev1447 4 หลายเดือนก่อน

    Unfortunaly i did not understant, where are you getting font.xml, jar file, will be better if you will share your code in git

  • @AhmedKhaled-he9mf
    @AhmedKhaled-he9mf 3 ปีที่แล้ว +2

    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
      @moumie3246  3 ปีที่แล้ว

      @Ahmed Kahled, sorry for the late reply but I could not get your point but hope by now it has been solved.

    • @AhmedKhaled-he9mf
      @AhmedKhaled-he9mf 3 ปีที่แล้ว

      @@moumie3246 thanks for reply
      sir please I need your help

    • @AhmedKhaled-he9mf
      @AhmedKhaled-he9mf 3 ปีที่แล้ว

      @@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

    • @AhmedKhaled-he9mf
      @AhmedKhaled-he9mf 3 ปีที่แล้ว

      @@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

    • @AhmedKhaled-he9mf
      @AhmedKhaled-he9mf 3 ปีที่แล้ว

      @@moumie3246 please any help

  • @dhananjayat1373
    @dhananjayat1373 3 ปีที่แล้ว

    After i added these librariesand convert into jar file.its not open.jar file open only without library.how to fix it

  • @youcefbouguerni449
    @youcefbouguerni449 3 ปีที่แล้ว

    Hello
    can I get link to your project file to downoald it ?

  • @AhmedKhaled-he9mf
    @AhmedKhaled-he9mf 3 ปีที่แล้ว +1

    thanks for explain
    excuse me is there link source code for your project?
    and very thanks

    • @moumie3246
      @moumie3246  3 ปีที่แล้ว

      Yes sure, I can sent it to you by email