读书人

★用xsl-fo转换PDF设定了font-weigh

发布时间: 2012-03-13 11:21:10 作者: rapoo

★★★用xsl-fo转换PDF,设定了font-weight='bold',可是字体就是不变粗体★★★
用xsl-fo转换PDF,


我的userconfig.xml文件:

XML code
<configuration>  <fonts>    <font metrics-file="C:\McSyugyo\WEB-INF\msmincho.xml" kerning="yes" embed-file="C:\WINDOWS\Fonts\MSMINCHO.TTC">      <font-triplet name="MS-Mincho" style="normal" weight="normal"/>      <font-triplet name="MS-Mincho" style="normal" weight="bold"/>      <font-triplet name="MS-Mincho" style="italic" weight="normal"/>      <font-triplet name="MS-Mincho" style="italic" weight="bold"/>    </font>    <font metrics-file="C:\McSyugyo\WEB-INF\msgothic.xml" kerning="yes" embed-file="C:\WINDOWS\Fonts\MSGOTHIC.TTC">      <font-triplet name="MS-Gothic" style="normal" weight="normal"/>      <font-triplet name="MS-Gothic" style="normal" weight="bold"/>      <font-triplet name="MS-Gothic" style="italic" weight="normal"/>      <font-triplet name="MS-Gothic" style="italic" weight="bold"/>    </font>  </fonts></configuration>


fo文件的部分代码:
XML code
          <fo:table-row font-family='MS-Gothic' font-size='13pt'>            <fo:table-cell border-width='0'>               <fo:block font-weight='bold' text-align='center'>ABCDEFG</fo:block>            </fo:table-cell>          </fo:table-row>


在这里<fo:block font-weight='bold' text-align='center'>ABCDEFG</fo:block>
已经设定了font-weight='bold',可是生成的PDF的字体就是不变粗体!!
急!!
100分,不够开帖再给!!


[解决办法]
加粗可能引起文字占用页面宽度增加,如果此 region 你已经限定了宽度,是否宽度不够呢?
[解决办法]
<fo:table-row font-family='MS-Gothic' font-size='13pt'>

将 13pt 改为 12pt 看看

读书人网 >XML SOAP

热点推荐