Add fop font support to xmlspy

Source: Internet
Author: User

InSupport for adding fop fonts to xmlspy

 

As XmlspyBy default, the plug-in does not support Chinese fonts. By defaultXmlspyWhen a result file is generated, where there are Chinese characters (or other fonts that are not supported or are not supported by the character set), it will be replaced.

You can set the font required for adding users.The installation documents attached to the FOP plug-in are described in detail. If you have installedXmlspyFOP plug-in, these documents are stored on your hard disk address:

C: \ Program Files \ altova \ fop \ releasenotes.html.

Documents supported by adding fonts are:

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 installJsdk,To useFOPProvidedJavaPackage features.

 

Perform the following three steps:

 

Step 1Generate a font diagram file[Generating a font metrics file]

The generated font diagram file isXML format.WindowsIn the system, runOrg. Apache. fop. fonts. Apps. pfmreaderRun the following command:

Java -CP build \ fop. jar; Lib \ avalon-framework.jar; Lib \ xml-apis.jar; Lib \ xercesimpl. jar; Lib \ xalan. jar Org. apache. FOP. fonts. apps. pfmreader PFM-file XML-File

 

Here are two examples:

There are minor differences between the two examples. Please note that:)

[1] example of generating a font file:


[2] example of generating a simhei font file

Simhei. TTFAndSimsun. TTCFiles can be found in C:/Windows/fonts. For more information, see the FOP document. Http://xml.apache.org/fop

 

Step 2Register the font to fop [modify the configuration fileUserconfig. xml]

 

ModifyUserconfig. xmlInConfiguration/FontsInsert the corresponding node under the node.

Name attributeThe value isInFoSelect the font-family value in the document. According to the above configuration file, you can set font-family = "simhei" to set the characters to the simhei.

Step 3LetXmlspyAutomatically read userconfig.XML

 

Now we have configured FOP And Font support. If you run FOP You can generate these two fonts correctly. However Xmlspy Menu Generation PDF When the file is still reported: "No font found" !! The reason is that, by default Xmlspy Not read automatically Userconfig. xml . Now we have to solve this problem. Let Xmlspy Automatic read Userconfig. xml .

Open FOP Under the root directory FOP File [C:/ProgramFiles/altova \ fop/fop. bat] , Pay attention to the last line:

Java-CP % localclasspath %Org. Apache. fop. Apps. fop% 1% 2% 3% 4% 5% 6% 8

FOPThe command has an optional parameter. -CCfg. xml So you only need to change the last line :

Java-CP % localclasspath %Org. Apache. fop. Apps. fop-CConfig/userconfig. xml% 1% 2% 3% 4% 5% 6% 8

 

All right, all done. Find a Chinese font *.Fo Test the file.

Stan

Mailto: xiaoleilong@mail.biti.edu.cn

2003Year5Month23Day

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.