Hi all,
I've embedded fop 1.1 in my java program following this guide:
http://xmlgraphics.apache.org/fop/1.1/embedding.html
Everything is working and I don't have compile/runtime errors but afp files
don't use the fonts configured, the same font is always displayed.
If I use the binary distribution of fop (fop.bat) the afp files generated are
correct, so the .fo file, .xconf and also fonts are valid.
PDFs are perfect, the issue is just with AFP.
here's an exctract from my .fo:
<fo:block font-family="GalaxiePolarisCondensed-Light-T1001250"
font-style="normal" font-size="6"
font-weight="normal">GalaxiePolarisCondensed-Light 6</fo:block>
here's an exctract from my .xconf:
<renderer mime="application/x-afp">
<images mode="b+w" bits-per-pixel="8"/>
<renderer-resolution>240</renderer-resolution>
<line-width-correction>2.5</line-width-correction>
<fonts>
<font>
<afp-font name="GalaxiePolarisCondensed-Light-T1001250" type="raster"
codepage="T1001250" encoding="Cp1250"
base-uri="../../data/fonts-encoded/GalaxiePolarisCondensed-Light-T1001250/"
embed-url="../../data/fonts-encoded/GalaxiePolarisCondensed-Light-T1001250/">
<afp-raster-font size="6" characterset="C0FT0006"/>
</afp-font>
<font-triplet name="GalaxiePolarisCondensed-Light-T1001250" style="normal"
weight="normal"/>
<font-triplet name="any" style="normal" weight="normal"/>
</font>
</fonts>
</renderer>
The steps to create the afp are always the same:
config_builder = new DefaultConfigurationBuilder();
config = config_builder.buildFromFile(new File(my_conf_file));
fop_factory = FopFactory.newInstance();
fop_factory.setUserConfig(config);
bw = new BufferedOutputStream(new FileOutputStream(new File(out_afp_file)));
fop = fop_factory.newFop("application/x-afp", bw);
transformer_factory = TransformerFactory.newInstance();
transformer = transformer_factory.newTransformer();
fo_file = new StreamSource(new InputStreamReader(new
FileInputStream(in_fo_file), "UTF-8"));
res_file = new SAXResult(fop.getDefaultHandler());
transformer.transform(fo_file, res_file);
I can't figure out what's wrong; can you point me in the right direction?
Thank you very much,
F.