我正在设计一个 xsl 表单,我的源 pdf 包含“钻石”符号
- 我需要知道如何使用 xsl 使用/创建菱形字符(是否有任何字体系列我可以配置和使用/我可以使用 Unicode 字符获取符号)。
- 还有如何在 xsl 表单中使用其他特殊字符。还需要知道如何创建空白
我正在设计一个 xsl 表单,我的源 pdf 包含“钻石”符号
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 &#x2666; hex (&#9830; decimal):
<fo:inline font-family="ZapfDingbats">♦</fo:inline>
</fo:block>
<fo:block>Here is &#x25C6;:
<fo:inline font-family="ZapfDingbats">◆</fo:inline>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>