1

我正在设计一个 xsl 表单,我的源 pdf 包含“钻石”符号

  1. 我需要知道如何使用 xsl 使用/创建菱形字符(是否有任何字体系列我可以配置和使用/我可以使用 Unicode 字符获取符号)。
  2. 还有如何在 xsl 表单中使用其他特殊字符。还需要知道如何创建空白 项目清单
4

2 回答 2

0

I've found that some Unicode characters can be a bit tricky to use since a lot of fonts don't have certain glyphs. You know the glyph (the diamond) is missing from the font when you see the error WARNING: Glyph "◆" (0x25c6, blackdiamond) not available in font.

Here's a small example using a fo:inline to change to a font that has the glyph. I set the fo:root font family so the the entire document defaults to SansSerif; also the fo:page-sequence is set to use monospace font Courier; then the fo:inline uses ZapfDingbats.

Maybe there's an easier way to use a bunch of fonts without defining them (fop font config?) but I'm not familiar with it.

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="SansSerif" font-size="10pt">
  <fo:layout-master-set>
      <fo:simple-page-master margin-right="0.5in" margin-left="0.5in" margin-bottom="1in" margin-top="1in" 
          page-width="8.5in" page-height="11in" master-name="main">
        <fo:region-body margin-top="1cm"/>
        <fo:region-before extent="1cm"/>
        <fo:region-after extent="1.5cm"/>
      </fo:simple-page-master>
  </fo:layout-master-set>

  <fo:page-sequence master-reference="main" font-family="Courier">
    <fo:flow flow-name="xsl-region-body">
      <fo:block>This is a &amp;#x2666; hex (&amp;#9830; decimal): 
        <fo:inline font-family="ZapfDingbats">&#9830;</fo:inline>
      </fo:block>
      <fo:block>Here is &amp;#x25C6;: 
        <fo:inline font-family="ZapfDingbats">&#x25C6;</fo:inline>
      </fo:block>
    </fo:flow>
  </fo:page-sequence>

</fo:root>
于 2013-03-08T19:53:37.293 回答
0

您可以在 XML 中使用以下字符引用来生成 ◆ 字符(Unicode U+25C6 黑菱形)。

&#x25C6;
于 2013-03-08T05:16:50.117 回答