<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 13 Sep 2010, at 19:24, Kyle Covington wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="font-family: verdana, geneva, helvetica, arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Recently I found that svg files generated by Cairo do not plot properly in pyqt.  The error comes from the use of glyphs which seem not to be shown in pyqt (this might be wrong but I couldn't find any way of getting glyphs to render). <br>
<br>...<br><br>I just wanted people to have these so they wouldn't have to search high and low like I did to find a way to render glyphs in pyqt. <br>
<br>...</span></blockquote><br></div><div>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  <font class="Apple-style-span" face="'Courier New'">/Users/colin/MyFonts/MagicFont.svg</font>  contains a valid <font class="Apple-style-span" face="'Courier New'"><font id="MagicFont" ...> ... </font></font> definition then a test file such as the following should cause "Sample text here" to be displayed using glyphs from MagicFont:</div><div><br></div><div><div><font class="Apple-style-span" face="'Courier New'"><?xml version="1.0" standalone="no"?></font></div><div><font class="Apple-style-span" face="'Courier New'"><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" "<a href="http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd</a>"></font></div><div><font class="Apple-style-span" face="'Courier New'"><svg width="400px" height="300px" version="1.1"</font></div><div><font class="Apple-style-span" face="'Courier New'">     xmlns = 'http://www.w3.org/2000/svg'</font></div><div><font class="Apple-style-span" face="'Courier New'">     xmlns:xlink="<a href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</a>"></font></div><div><font class="Apple-style-span" face="'Courier New'"><defs></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="white-space: pre;">    </span><font-face font-family="MagicFont"></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="white-space: pre;">        </span><font-face-src></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="white-space: pre;">            </span><font-face-uri</font></div><div><font class="Apple-style-span" face="'Courier New'">                xlink:href="file:///Users/colin/MyFonts/MagicFont.svg#MagicFont"/></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="white-space: pre;">        </span></font-face-src></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="white-space: pre;">    </span></font-face></font></div><div><font class="Apple-style-span" face="'Courier New'"></defs></font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'"><text font-size="32" x="20" y="40" style="font-family: MagicFont;"></font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="'Courier New'">    </font></span><font class="Apple-style-span" face="'Courier New'">Sample text here</font></div><div><font class="Apple-style-span" face="'Courier New'"></text></font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'"></svg></font></div></div><div><br></div>I used the svgviewer example from the PyQt4 demo to display the sample text.<div><br><div>Hope this helps.</div><div>-- Colin</div></div></body></html>