Add FOP font support in XMLSPY

zhaozj2021-02-16  48

Add FOP font support in XMLSPY

The use of FOP as an XMLSPY plugin is not supported by default. By default, when using XMLSPY to generate a result file, there are Chinese places (or other characters that are not supported, those who are not supported by the character set) will be replaced by "#".

You can add the font required by setting the user. There is a detailed description of the installed documentation when the FOP plug-in installation is installed. If you have an XMLSPY FOP plug-in, these documents store the address on your hard drive:

C: / program files / altova / fop / releasenotes.html.

The documentation that added font support is:

C: / Program Files / Altova / FOP / Build / Site / Fonts.html;

C: / program files / altova / fop / build / site / configuration.html;

C: / program files / altova / fop / build / site / embedding.html.

You need to install JSDK before completing this series of configurations to use the function of the Java package provided by the FOP.

Divided three steps:

First step generation font composition file [Generating a font metrics file]

The generated font composition file is an XML format. Under the Windows system, run org.apache.fop.fonts.apps.pfmReader Use the following command:

Java -cp build / fop.jar; lib / avalon-framework.jar; lib / xml-apis.jar; lib / xerceptimpl.jar; lib / xalan.jar org.apache.fop.fonts.apps.pfmreader PFM-file XML-File

Two examples:

Two examples have a subtle difference, please note :)

[1] An example of generating a Song font file:

[2] Example of generating a black body file

Simhei.ttf and sIMSun.ttc files can be found under C: / Windows / Fonts. See the FOP documentation for more information. http://xml.apache.org/fop

Step 2 Registration Font to FOP [Modify Profile UserConfig.xml]

Modify UserConfig.xml Insert the appropriate node in the Configuration / Fonts node.

The value of the Name property is to select the value of font-family in the FO document. Press the above profile, you can set the font-family = "simhei" setting character as a black body.

The third step allows XMLSPY to automatically read UserConfig.xml

Now we have already configured the support of the FOP's Song and the black body. If you run the FOP through the command line, these two fonts can already be generated correctly. However, when generating a PDF file through the XMLSPY menu: "No font" !! The reason is that XMLSPY does not automatically read UserConfig.xml by default. Now we have to solve this problem. Let XMLSPY read UserConfig.xml.

Open the FOP root directory FOP file [C: / Program files / altova / fop / fop.bat], pay attention to the last line:

Java -cp% localclasspath% org.apache.fop.apps.fop% 1% 2% 3% 4% 5% 6% 7% 8

The FOP command has an optional parameter-C cfg.xml, so it only needs to be changed to:

Java -cp% localclasspath% org.apache.fop.apps.fop -c config / userConfig.xml% 1% 2% 3% 4% 5% 6% 7% 8 good, finally finished: D: D: D Find a message with a Chinese font.

STAN

Mailto: xiaoleilong@mail.biti.edu.cn

May 23, 2003

转载请注明原文地址:https://www.9cbs.com/read-25776.html

New Post(0)