As for the exact version of Cairo that I am using I don't know. I'm using Mono.Cairo in Mono 2.6.7 on Linux, and the problem shows in Mono 2.6.4 and 2.8 on Windows. But the virtual machine in which I'm running it has 800 other things, so when I test it in clean Windows VM to figure out exactly what it needs to run on that platform I will have a better idea since I haven't looked deeper yet.<div>
<br></div><div>In case anyone does need a workaround, this is Cobra code (.Net) and extends Context with a couple of methods that will strip accents and replace guillemet, which until I investigate Pango makes my app work in Windows.</div>
<div><br></div><div>Cheers.</div><div><br></div><div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: arial; font-size: small; "><div>
<font class="Apple-style-span" size="1" face="'courier new', monospace"># $Id: Extension.Mono.Cairo.Context.cobra,v 0197babc4e6f 2010/10/09 09:47:04 nevdelap $</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"># Reviewed:</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace">use Cairo</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace">use System.Globalization</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace">extend Cairo.Context</font></div>
<div>
<font class="Apple-style-span" size="1" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> def textExtentsForPlatform(s as String) as TextExtents</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> return .textExtents(_transformForPlatform(s))</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> def showTextForPlatform(s as String)</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> .showText(_transformForPlatform(s))</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> def _transformForPlatform(s as String) as String</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> """</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> On Windows guillemets and accents break</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> the context - it cannot output anything</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> subsequently. So if it is not Linux I strip</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> that stuff out since I don't know what</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> Mac OS/X would do so I'm playing it safe.</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> """</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> # <a href="http://www.mono-project.com/FAQ:_Technical">http://www.mono-project.com/FAQ:_Technical</a></font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> platform = Environment.osVersion.platform to int</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> isRunningOnLinux = platform == 4 or platform == 128</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> if not isRunningOnLinux</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> s = s.replace("«", "<<")</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> s = s.replace("»", ">>")</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> s = _stripAccents(s)</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> return s</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"><br></font></div><div>
<font class="Apple-style-span" size="1" face="'courier new', monospace"> def _stripAccents(s as String) as String</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> # <a href="http://www.codeproject.com/KB/cs/UnicodeNormalization.aspx">http://www.codeproject.com/KB/cs/UnicodeNormalization.aspx</a></font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> stringBuilder = StringBuilder()</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> for originalChar in s</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> decomposedCharacters = originalChar.toString.normalize(NormalizationForm.FormKD)</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> if decomposedCharacters.length == 1</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> stringBuilder.append(decomposedCharacters)</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> else</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> for decomposedCharacter in decomposedCharacters</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> if decomposedCharacter to int < 128 # If it is ascii</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"> stringBuilder.append(decomposedCharacter)</font></div><div><font class="Apple-style-span" size="1" face="'courier new', monospace"> return stringBuilder.toString</font></div>
<div><font class="Apple-style-span" size="1" face="'courier new', monospace"><br></font></div></span></font></div></div><div><div class="gmail_quote">On 9 October 2010 06:06, justi <span dir="ltr"><<a href="mailto:justi_10@rediffmail.com">justi_10@rediffmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Nev<br>We are woking at present on cairo with openvg backend(ARM linux).<br>If yours cairo code uses the same backend please share the code ,we can run it on windows and see the nature of problems.<br>
<br>Thanks<br>Justi.<br><br>============<br>On Sat, 09 Oct 2010 14:00:44 +0530 wrote<div><div></div><div class="h5"><br>><div><br>></div>Hi there,<div><br>></div><div>I am using Cairo in a Mono application on Linux where it works perfectly. I'm running the application on Windows (exact same code running in Mono still).<div>
<br>></div><div>My problem is that running on Windows when it either does context.TextExtents() or context.ShowText() with guillemets or characters with accents, no subsequent output is producted. It doesn't get an exception, doesn't write anything to the console, it just doesn't draw anything more on that context.</div>
<div><br>></div><div>This is only on Windows, on Linux no problem.</div><div><br>></div><div>So, I want to ask is it a known problem, if so, is there any workaround, if not is there something you can suggest to help me track down something useful to provide you for debugging? And if I made a minimal Mono application that works on Linux and shows the problem on Windows would you be able to use that?</div>
<div><br>></div><div>Thanks,</div><div><br>></div><div>Nev</div></div></div></div><font color="#888888">--<br>>cairo mailing list<br>><a href="http://prism/writemail?&mode=mail_to_individual&email=cairo@cairographics.org&output=web&els=0a23248c7fe46ba46c52f889070eaa55" target="_blank">cairo@cairographics.org</a><br>
><a href="http://www.rediffmail.com/cgi-bin/red.cgi?red=http%3A%2F%2Flists%2Ecairographics%2Eorg%2Fmailman%2Flistinfo%2Fcairo" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a><br><a href="http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?" target="_blank"><img></a></font></blockquote>
</div><br></div>