<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
I can't speak for Cairo-generated SVG files, but PyQt4 doesn't have a problem displaying glyphs from SVG font files generated by FontForge, for example. Assuming that file /Users/colin/MyFonts/MagicFont.svg contains a valid <font id="MagicFont" ...> ... </font> definition then a test file such as the following should cause "Sample text here" to be displayed using glyphs from MagicFont:<br>
<br><?xml version="1.0" standalone="no"?><br><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" "<a href="http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd" target="_blank" style="color: rgb(42, 93, 176); ">http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd</a>"><br>
<svg width="400px" height="300px" version="1.1"<br> xmlns = '<a href="http://www.w3.org/2000/svg" target="_blank" style="color: rgb(42, 93, 176); ">http://www.w3.org/2000/svg</a>'<br>
xmlns:xlink="<a href="http://www.w3.org/1999/xlink" target="_blank" style="color: rgb(42, 93, 176); ">http://www.w3.org/1999/xlink</a>"><br><defs><br> <font-face font-family="MagicFont"><br>
<font-face-src><br> <font-face-uri<br> xlink:href="file:///Users/colin/MyFonts/MagicFont.svg#MagicFont"/><br> </font-face-src><br> </font-face><br></defs><br>
<br><text font-size="32" x="20" y="40" style="font-family: MagicFont;"><br> Sample text here<br></text><br><br></svg><br><br>I used the svgviewer example from the PyQt4 demo to display the sample text.<br>
<br>Hope this helps.<br>-- Colin</blockquote><div> </div><div>Thanks for the input. Cairo embeds the glyphs in the svg and uses a tag called use to place the glyph into the plot.</div><div><br></div><div>This is a sample from a cairo svg that I just generated. </div>
</div><br><div><div><?xml version="1.0" encoding="UTF-8"?></div><div><svg xmlns="<a href="http://www.w3.org/2000/svg" target="_blank" style="color: rgb(0, 0, 204); ">http://www.w3.org/2000/svg</a>" xmlns:xlink="<a href="http://www.w3.org/1999/xlink" target="_blank" style="color: rgb(0, 0, 204); ">http://www.w3.org/1999/xlink</a>" width="432pt" height="432pt" viewBox="0 0 432 432" version="1.1"></div>
<div><defs></div><div><g></div><div><symbol overflow="visible" id="glyph2-0"></div><div><path style="stroke: none;" d="M 0 -1.050781 L -5.261719 -1.050781 L -5.261719 -5.261719 L 0 -5.261719 Z M -0.132813 -1.183594 L -0.132813 -5.132813 L -5.132813 -5.132813 L -5.132813 -1.183594 Z M -0.132813 -1.183594 "/></div>
<div></symbol></div><div><symbol overflow="visible" id="glyph2-1"></div><div><path style="stroke: none;" d="M 0 -2.722656 L -1.441406 -2.722656 L -1.441406 -0.105469 L -2.121094 -0.105469 L -6.027344 -2.855469 L -6.027344 -3.460938 L -2.121094 -3.460938 L -2.121094 -4.277344 L -1.441406 -4.277344 L -1.441406 -3.460938 L 0 -3.460938 Z M -2.121094 -2.722656 L -4.839844 -2.722656 L -2.121094 -0.835938 Z M -2.121094 -2.722656 "/></div>
<div></symbol></div></div><div>...</div><div></g></div><div>...</div><div></defs></div><div><div><g id="surface0"></div><div><g clip-path="url(#clip1)" clip-rule="nonzero"></div>
<div><path style="fill: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(0%,0%,0%); stroke-opacity: 1;stroke-miterlimit: 10; " d="M 42.769531 104.457031 L 104.457031 104.457031 L 104.457031 42.769531 L 42.769531 42.769531 L 42.769531 104.457031 "/></div>
<div></g></div><div><g clip-path="url(#clip2)" clip-rule="nonzero"></div><div><g style="fill: rgb(0%,0%,0%); fill-opacity: 1;"></div><div> <use xlink:href="#glyph0-1" x="41.738281" y="76.289063"/></div>
<div> <use xlink:href="#glyph0-2" x="48.738281" y="76.289063"/></div><div> <use xlink:href="#glyph0-3" x="54.738281" y="76.289063"/></div><div> <use xlink:href="#glyph0-4" x="60.738281" y="76.289063"/></div>
<div> <use xlink:href="#glyph0-5" x="66.738281" y="76.289063"/></div><div> <use xlink:href="#glyph0-6" x="69.738281" y="76.289063"/></div><div> <use xlink:href="#glyph0-7" x="72.738281" y="76.289063"/></div>
<div> <use xlink:href="#glyph0-2" x="78.738281" y="76.289063"/></div><div> <use xlink:href="#glyph0-8" x="84.738281" y="76.289063"/></div><div> <use xlink:href="#glyph0-9" x="90.738281" y="76.289063"/></div>
<div> <use xlink:href="#glyph0-10" x="96.738281" y="76.289063"/></div><div> <use xlink:href="#glyph0-11" x="99.738281" y="76.289063"/></div><div></g></div>
<div></g></div></div><div>...</div><div><br></div><div>I don't really know a lot about svg tags and which ones are conventional or not. I'm sure that cairo makes appropriate syntax because it renders on other svg viewers that I have tried (GIMP, photoshop). I'm in kind of a bind to use cairo for svg generation. My application (Red-R) uses R for data analysis and cairo seems to be the best suited svg generating graphics package for R. </div>
<div><br></div><div>I'm not using the most up-to-date version of pyqt so that might also be the problem. </div><div><br></div><div>Anyway, my solution is providing a good workaround for the problem, I just wanted to give the code out in case someone else was having the same issue. If pyqt would like an example of a cairo svg from R that didn't render I can send one if you would like to tackle the problem.</div>
<div><br></div><div>Thanks again for the reply.</div><div><br></div><div>Kyle</div></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
</blockquote></div><br>