jasperreports-5.6.1.jar包中新增字體

一:在使用iReport506生成yhjzddy.jrxml文件後,當字體與所需打印出來的PDF字體不同時,需在jasperreports-fonts.jar包中新增字體,新增方法以下:svg

1.使用壓縮工具直接打開jar包(不要解壓縮)。工具

2.在jar包中的net\sf\jasperreports\fonts包下,修改jasperreports-fonts.xml文件(新增新字體配置):字體

<?xml version="1.0" encoding="UTF-8"?>

<fontFamilies>

<fontFamily name="Pictonic" visible="false">
<normal>
<ttf>net/sf/jasperreports/fonts/pictonic/pictonic.ttf</ttf>   
<svg>net/sf/jasperreports/fonts/pictonic/pictonic.svg</svg>
<eot>net/sf/jasperreports/fonts/pictonic/pictonic.eot</eot>
<woff>net/sf/jasperreports/fonts/pictonic/pictonic.woff</woff>
</normal>
<pdfEncoding>Identity-H</pdfEncoding>
<pdfEmbedded>true</pdfEmbedded>    <!-- 生成的pdf字體與報表字體一致 -->
</fontFamily>

<fontFamily name="Microsoft YaHei UI">
<normal>net/sf/jasperreports/fonts/msyh/msyh.ttf</normal>
<pdfEncoding>Identity-H</pdfEncoding>
<pdfEmbedded>true</pdfEmbedded>
</fontFamily>

</fontFamilies>

 

3.在jasperreports-fonts.xml的同級目錄下建立字體新增字體目錄,將字體放在該文件目錄下。spa

 

 

相關文章
相關標籤/搜索