[vtkusers] Displaying the degree symbol "\u00B0" invtkCornerAnnotation

John Platt jcplatt at dsl.pipex.com
Tue Oct 21 17:05:44 EDT 2014


Hi,

In VTK 5.10, I have only had success with vtkUnicodeString text arguments 
...

    std::ostringstream ostr;
    ostr << ang;
    vtkUnicodeString label(vtkUnicodeString::from_utf8( 
ostr.str().c_str() ));
    vtkUnicodeString deg( 1, 0xb0 );
    label += deg;

Not much help with vtkCornerAnnotation::SetText().

John.

----- Original Message ----- 
From: Alok
To: vtkusers at vtk.org
Sent: Tuesday, October 21, 2014 5:46 PM
Subject: Re: [vtkusers] Displaying the degree symbol "\u00B0" 
invtkCornerAnnotation


I accidently hit post too quick earlier:


Here's the completed and corrected post:

Hey,

This is a silly question.
I have been trying for a while to display a degree symbol in 
vtkCornerAnnotation.

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 of 
type vtkCornerAnnotation.

This displays something like 50° rather than 50°
When I display the string on a terminal it works as expected.

Am I missing something here?



On Tue, Oct 21, 2014 at 11:32 AM, junior <alok.theanomaly at gmail.com> wrote:

Hey,

This is a silly question.
I have been trying for a while to display a degree symbol in
vtkCornerAnnotation.

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 of
type vtkCornerAnnotation.

This displays something like 50A&circ&deg




--
View this message in context: 
http://vtk.1045678.n5.nabble.com/Displaying-the-degree-symbol-u00B0-in-vtkCornerAnnotation-tp5729197.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: 
http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers




-- 

I live a simple life...  in 0s and 1s !



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: 
http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers 




More information about the vtkusers mailing list