Apache fop 如何更改输出PDF中嵌入的MathML的字体样式?

Apache fop 如何更改输出PDF中嵌入的MathML的字体样式?,apache-fop,mathml,Apache Fop,Mathml,我是ApacheFop新手,我需要在FOP的PDF输出中将默认字体样式更改为times字体 我的fop.xconf: <fop version="1.0"> <renderers> <renderer mime="application/pdf"> <fonts> <font embed-url="file:///C:/Windows/Fonts/Tim

我是ApacheFop新手,我需要在FOP的PDF输出中将默认字体样式更改为times字体

我的fop.xconf

    <fop version="1.0"> 
    <renderers>
       <renderer mime="application/pdf">
            <fonts>

                <font embed-url="file:///C:/Windows/Fonts/Times New Roman/times.ttf" name="Times New Roman">
                    <font-triplet name="Times New Roman" style="roman" weight="normal"/>
                </font>

                <font embed-url="file:///C:/Windows/Fonts/Times New Roman/timesbd.ttf" name="Times New Roman">
                    <font-triplet name="Times New Roman" style="normal" weight="bold"/>
                </font>

                <font embed-url="file:///C:/Windows/Fonts/Times New Roman/timesi.ttf" name="Times New Roman">
                    <font-triplet name="Times New Roman" style="italic" weight="normal"/>
                </font>

                <font embed-url="file:///C:/Windows/Fonts/Times New Roman/timesbi.ttf" name="Times New Roman">
                    <font-triplet name="Times New Roman" style="italic" weight="bold"/>
                </font>

            </fonts>
       </renderer>
    </renderers>
    </fop>

要测试的我的FO文件:

<?xml version="1.0" encoding="iso-8859-1"?>

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns="http://www.w3.org/1998/Math/MathML">
    <fo:layout-master-set>
        <fo:simple-page-master master-name="my-page">
            <fo:region-body margin="1in"/>
        </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="my-page">
        <fo:flow flow-name="xsl-region-body">
            <fo:wrapper>
            <fo:block font-family="Times New Roman">
                <fo:instream-foreign-object>
                    <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline">
                        <msub>
                            <mi>σ</mi>
                            <mrow>
                                <mi>z</mi>
                            </mrow>
                        </msub>
                        <mo>=</mo>
                        <munder>
                            <mrow>
                                <munder>
                                    <mrow>
                                        <mi mathvariant="normal">l</mi>
                                        <mi mathvariant="normal">i</mi>
                                        <mi mathvariant="normal">m</mi>
                                    </mrow>
                                    <mrow/>
                                </munder>
                            </mrow>
                            <mrow>
                                <mo>Δ</mo>
                                <mi>A</mi>
                                <mo rspace="0.25pt" lspace="0.25pt">→</mo>
                                <mn>0</mn>
                            </mrow>
                        </munder>
                        <mspace width="0.33em"/>
                        <mfrac>
                            <mrow>
                                <mo>Δ</mo>
                                <msub>
                                    <mi>F</mi>
                                    <mrow>
                                        <mi>z</mi>
                                    </mrow>
                                </msub>
                            </mrow>
                            <mrow>
                                <mo>Δ</mo>
                                <mi>A</mi>
                            </mrow>
                        </mfrac>
                    </math>
                </fo:instream-foreign-object>
            </fo:block>
            </fo:wrapper>
        </fo:flow>
    </fo:page-sequence>
</fo:root>

σ
Z
=
L
我
M
Δ
A.
→
0
Δ
F
Z
Δ
A.
这些是我的文件,我用泰晤士报的新罗马字体把PDF打印出来,但是在output.PDF中字体不变

请提出实现这一目标的任何方法


我在命令行中运行的代码是:
fop-fo test.fo-c fop.xconf-pdf 1233.pdf

我建议添加一个mathml标记,所有字体引用都是用mathml完成的,您使用的是jeuclid插件吗?是的,我使用的是jeuclid!对不起,我对fop/jeuclid和字体处理没有具体的了解,只是尝试通过编辑问题来添加mathml标记,以吸引更多了解的人。也就是说,我会尝试将字体三元组中的“Times New Roman”替换为“Times New Roman”,您也可以将它们作为新的三元组添加到
输出中不显示时间?请参阅,它声明“MathML指定的内联将从周围获取以下属性。fo上下文…使用的字体名称。”因此,在
fo:block
中放置一个
font-family=“Times New Roman”
,围绕您的mathmlHi-Stefan和Ifurini,谢谢您的建议,我已经按照您所说的尝试过了,但没有成功,请检查命令行日志:2017年4月12日10:16:56 AM org.apache.fop.events.LoggingEventListener进程事件警告:未找到字体“Times New Roman,normal,400”。以“任何,正常,400”取代。2017年4月12日上午10:16:57 org.apache.fop.events.LoggingEventListener进程事件信息:呈现页面#1。