问题描述
拜托,我在使用 api fop 1.0 (XSL-FO) 以 PDF 格式生成的报告中显示阿拉伯语时出现问题.
我配置了一个 userConfig.xml 以使用 Arial.ttf 字体.除了字符单独显示外,一切正常.
例如: ت ق و ل 而不是 تقول
我加空格只是为了给你解释.
Please, I have a problem displaying the Arabic language in my reports generated in PDF format using the api fop 1.0 (XSL-FO).
I configured a userConfig.xml for using Arial.ttf font. everything works fine except that characters are displayed separately.
example: ت ق و ل instead of تقول
I put spaces only to explain to you.
<fo:block-container font-size="12pt" writing-mode="rl-tb" xml:lang="ar" font-family="Arial" xmlns:fo="http://www.w3.org/1999/XSL/Format" >
<fo:block>
تقول
</fo:block>
</fo:block-container>
我尝试使用该标签,但其内容未出现在生成的文档中.
I tried to use the tag but its contents do not appear in the generated doc.
<fo:block text-align="center">
<fo:inline direction="rtl" language="ar" unicode-bidi="embed">
تقول
</fo:inline>
</fo:block>
userConfig.xml
userConfig.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Arial Unicode only -->
<fop version="1.0">
<renderers>
<renderer mime="application/pdf">
<fonts>
<!-- register a particular font -->
<font kerning="yes"
embed-url="file:///C:\windows\arial.ttf"
encoding-mode="single-byte">
<font-triplet name="Arial" style="normal" weight="normal"/>
</font>
</fonts>
</renderer>
</renderers>
</fop>
- 我的xsl的负责人
谢谢.
推荐答案
在 FOP 中可能会禁用对阿拉伯语和其他复杂脚本的支持,请参阅 FOP 复杂脚本.
Support for Arabic and other complex scripts may be disabled in FOP, see FOP complex scripts.
如果启用,设置 lang="ar" 就足够了.
If they are enabled, setting lang="ar" should be enough.
complex-scripts-disabled 应该是 'false'
complex-scripts-disabled should be 'false'
这篇关于XSL-FO:显示阿拉伯字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!