satishmhiremath Posted September 29, 2016 Share Posted September 29, 2016 Hi Team,As I tried using unicode with properties as UTF-8, Font Name DejaVu Sans, pdfEmbedded=true, pdf encoding=cp1256(Arabic) , installing Dejavu Sans.ttf fileas below for displaying Arabic text in Jasper tool as text field expression($F{state.locale}.equalsIgnoreCase("AR") || $F{state.locale}.equalsIgnoreCase("ar-EG")) ? "\u0627\u0633\u0645 \u0627\u0644\u0645\u0646\u062A\u062C" :"Product Name"But the result in pdf is not displaying in arabic.It displays the same Hadcoded Unicode \u0627\u0633\u0645 \u0627\u0644\u0645\u0646\u062A\u062Cor?????????Kindly do the needfull to display Arabic text fonts ASAP. Regards,Satish M Hiremath Link to comment Share on other sites More sharing options...
hozawa Posted September 29, 2016 Share Posted September 29, 2016 The main problem is you're using iReport. Switch to Jaspersoft Studio.http://community.jaspersoft.com/wiki/custom-font-font-extension Link to comment Share on other sites More sharing options...
satishmhiremath Posted October 4, 2016 Author Share Posted October 4, 2016 As tried the suggestions given below, but they are not working in Jasper Studio and the pdf output has same issue Link to comment Share on other sites More sharing options...
satishmhiremath Posted October 6, 2016 Author Share Posted October 6, 2016 After all workarounds, i am able to fix this issue in Jasper ireport as followsIn Text Properties of jrxml:Font Name : ArialPdf Font Name : ../arial.ttfPdf Embedded : truePdf Encoding : Identity-H-------------------------------------------------------In your Project META-INF folderCreate and Add reports folder containing arial.ttf files and font.xmlOutside META-INF folder, add jasper-extensions.properties fileSo finally, jasper-extensions.properties --- Uses --- fonts.xml --- Uses --- true type font files jasper-extensions.properties file --> fonts.xml ---> arial.ttf The syntactical contents ofFont.xml:<?xml version="1.0" encoding="UTF-8"?> <fontFamilies><fontFamily name="Arial"> <normal><![CDATA[META-INF/reports/fonts/arial.ttf]]></normal> <bold><![CDATA[META-INF/reports/fonts/arialbd.ttf]]></bold> <italic><![CDATA[META-INF/reports/fonts/ariali.ttf]]></italic> <boldItalic><![CDATA[META-INF/reports/fonts/arialbi.ttf]]></boldItalic> <pdfEmbedded><![CDATA[true]]></pdfEmbedded> </fontFamily></fontFamilies>jasper-extensions.properties :net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactorynet.sf.jasperreports.extension.simple.font.families.myfamily=META-INF/fonts.xml Regards,Satish M Hiremath Link to comment Share on other sites More sharing options...
harshavardhan247 Posted September 22, 2023 Share Posted September 22, 2023 In your Project META-INF folderCreate and Add reports folder containing arial.ttf files and font.xmlOutside META-INF folder, add jasper-extensions.properties fileSo finally, jasper-extensions.properties --- Uses --- fonts.xml --- Uses --- true type font files jasper-extensions.properties file --> fonts.xml ---> arial.ttf The syntactical contents ofFont.xml:<?xml version="1.0" encoding="UTF-8"?> <fontFamilies><fontFamily name="Arial"> <normal><![CDATA[META-INF/reports/fonts/arial.ttf]]></normal> <bold><![CDATA[META-INF/reports/fonts/arialbd.ttf]]></bold> <italic><![CDATA[META-INF/reports/fonts/ariali.ttf]]></italic> <boldItalic><![CDATA[META-INF/reports/fonts/arialbi.ttf]]></boldItalic> <pdfEmbedded><![CDATA[true]]></pdfEmbedded> </fontFamily></fontFamilies>jasper-extensions.properties :net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactorynet.sf.jasperreports.extension.simple.font.families.myfamily=META-INF/fonts.xmlI didn't get this Link to comment Share on other sites More sharing options...
harshavardhan247 Posted September 22, 2023 Share Posted September 22, 2023 <textElement><font fontName="Arial" isBold="true" isItalic="true" pdfFontName="Home/Music/arial-cufonfonts" pdfEncoding="Identity-H" isPdfEmbedded="true"/></textElement> correct me where I am doing wrong Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now