Hi. I am creating PDF documents using fop, those documents include embedded fonts and SVG images, which use same embedded fonts.
PDF I get does not use selected fonts in SVGs. What do I do wrong ? Attached files are: example.fo : Example file with SVG text example.pdf : PDF built from example.fo with embedded font userconf.xml : fop configuration file (needed for embedding font) To run: 1. Create font map (I used comic.ttf font) # fop-ttfreader fontname.ttf fontname.xml 2. Edit userconf.xml, change font name if you can not locate comic.ttf 3. Run fop: # fop -c userconf.xml -fo example.fo -pdf example.pdf -- Regards, Lev T.
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg"> <fo:layout-master-set> <fo:simple-page-master master-name="one"> <fo:region-body margin-top="25pt" margin-bottom="25pt" margin-left="50pt" margin-right="50pt" /> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="one"> <fo:flow flow-name="xsl-region-body"> <fo:block font-family="Comic"> FO comic text <fo:instream-foreign-object> <svg:svg width="100" height="60"> <svg:g style="fill:red; stroke:#000000"> <svg:text x="10" y="10">Default font text</svg:text> <svg:text x="10" y="20" font-family="Comic">Supposed to be Comic font text</svg:text> </svg:g> </svg:svg> </fo:instream-foreign-object> </fo:block> </fo:flow> </fo:page-sequence> </fo:root>
example.pdf
Description: Adobe PDF document
<configuration>
<fonts>
<font metrics-file="comic.xml" embed-file="comic.ttf" kerning="yes">
<font-triplet name="Comic" style="normal" weight="normal"/>
</font>
</fonts>
</configuration>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
