[vtkusers] Displaying the degree symbol "\u00B0" in vtkCornerAnnotation
alok.theanomaly at gmail.com
Wed Oct 22 14:40:34 EDT 2014
That worked! Worked like a charm
I cannot wrap my head around why I didnt try that myself
On Wed, Oct 22, 2014 at 11:36 AM, David Lonie <david.lonie at kitware.com>
> Hi Alok,
> As for the differences between vtkCornerAnnotation and vtkTextActor,
> vtkCornerAnnotation uses the vtkTextMapper under the covers, which hasn't
> seen as much attention lately as the other classes.
> I don't have time at the moment to track down why the "\u00b0" literal is
> getting garbled, but I did notice that using "\xb0" instead seems to be
> work fine. It seems to be something screwy in the utf8 --> utf16 conversion
> before rendering...
> Try using "\xb0" instead and let me know if that works for you.
> Hope this helps,
> On Tue, Oct 21, 2014 at 5:04 PM, Alok <alok.theanomaly at gmail.com> wrote:
>> I cloned the git repo some time time back and built from source
>> The vtkTextActor/vtkTextWidget seem to be working fine with unicode but I
>> see some other problems which make them unusable for me.
>> Any recommendations on how to check the difference between
>> vtkCornerAnnotation and the vtkTextActor will be great. Seems like an easy
>> On Tue, Oct 21, 2014 at 4:49 PM, Sean McBride <sean at rogue-research.com>
>>> On Tue, 21 Oct 2014 12:46:15 -0400, Alok said:
>>> >I have been trying for a while to display a degree symbol in
>>> >The way I am trying to do it is like this:
>>> >std;:string angle = computeAngle()+"\u00B0";
>>> >cornerAnnotation->SetText(3,angle.c_str()); //where cornerAnnotation if
>>> >type vtkCornerAnnotation.
>>> >This displays something like 50Â° rather than 50°
>>> >When I display the string on a terminal it works as expected.
>>> In the past, VTK hasn't had very good Unicode support. I'm not sure
>>> where it stands today actually. What version of VTK are you using? You'll
>>> have the best results with the newest version I expect.
>>> Sean McBride, B. Eng sean at rogue-research.com
>>> Rogue Research www.rogue-research.com
>>> Mac Software Developer Montréal, Québec, Canada
>> I live a simple life... in 0s and 1s !
>> Powered by www.kitware.com
>> Visit other Kitware open-source projects at
>> Please keep messages on-topic and check the VTK FAQ at:
>> Follow this link to subscribe/unsubscribe:
I live a simple life... in 0s and 1s !
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers