what’s fop:
http://xmlgraphics.apache.org/fop/
1. using TTF reader to generate metric xml file and let fop using it
cd to fop's main directory,
java -cp "build/*;lib/*" org.apache.fop.fonts.apps.TTFReader -ttcname "MS Gothic" c:\Windows\Fonts\msgothic.ttc msgothic.xml
java -cp "build/*;lib/*" org.apache.fop.fonts.apps.TTFReader c:\Windows\Fonts\msgothic.ttc test.xml --> list all font in ttc collection file
add below line to fop’s config file’s fonts section:
<font embed-url="file:///c:Windows/Fonts/msgothic.ttc" sub-font="MS Gothic">
<font-triplet name="MSGothic" style="normal" weight="normal"/>
</font>
start fop with -c configfile.xml argument
2. add to fop’s config file’s font section
start fop with -c configfile.xml argument.
but you fo file need specify font for chinese character, fop will displya ##
for your chinise character if not set font;
if you set the wrong font, it will display a warning message to console to
tell you some character not found with instead with default #.
For example MS Gothic font not has 贾,so it will display as #
if you enable auto-detect, fop will create a font cache file(fop-fonts.cache)
for speed up next time