<div dir="ltr">Hi Roberto,<div><br></div><div>We've recently fixed a number of bugs in the text rendering code in the development branch. I'm adding your test case to our regression tests to check if we still see this with the new rendering backend.</div>
<div><br></div><div style>Which version of VTK are you seeing this in?</div><div style><br></div><div style>Dave</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 7, 2013 at 9:37 AM, Roberto Garrido <span dir="ltr"><<a href="mailto:rgarrido@emedica.es" target="_blank">rgarrido@emedica.es</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="ES" link="blue" vlink="purple"><div><p class="MsoNormal">Hi,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span lang="EN-US">We have added a vtkCaptionActor2D to our scene, but the text appears chopped, and we don’t know why…<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">A simple and compilable example that shows the output text chopped is sent attached. Also, an screenshot at the bottom.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Could anyone try to reproduce the error?<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks in advance.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">My best,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">Robert.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">#include</span><span lang="EN-US" style="font-family:Consolas"> <span style="color:#a31515"><vtkPolyDataMapper.h></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">#include</span><span lang="EN-US" style="font-family:Consolas"> <span style="color:#a31515"><vtkActor.h></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">#include</span><span lang="EN-US" style="font-family:Consolas"> <span style="color:#a31515"><vtkRenderWindow.h></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">#include</span><span lang="EN-US" style="font-family:Consolas"> <span style="color:#a31515"><vtkRenderer.h></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">#include</span><span lang="EN-US" style="font-family:Consolas"> <span style="color:#a31515"><vtkRenderWindowInteractor.h></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">#include</span><span lang="EN-US" style="font-family:Consolas"> <span style="color:#a31515"><vtkPolyData.h></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">#include</span><span lang="EN-US" style="font-family:Consolas"> <span style="color:#a31515"><vtkSmartPointer.h></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">#include</span><span lang="EN-US" style="font-family:Consolas"> <span style="color:#a31515"><vtkSphereSource.h></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">#include</span><span lang="EN-US" style="font-family:Consolas"> <span style="color:#a31515"><vtkCaptionWidget.h></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">#include</span><span lang="EN-US" style="font-family:Consolas"> <span style="color:#a31515"><vtkCaptionRepresentation.h></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Consolas;color:blue">#include</span><span style="font-family:Consolas"> <span style="color:#a31515"><vtkCaptionActor2D.h></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">#include</span><span lang="EN-US" style="font-family:Consolas"> <span style="color:#a31515"><vtkTextActor.h></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">#include</span><span lang="EN-US" style="font-family:Consolas"> <span style="color:#a31515"><vtkTextProperty.h></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">#include</span><span lang="EN-US" style="font-family:Consolas"> <span style="color:#a31515"><sstream></span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas;color:blue">int</span><span lang="EN-US" style="font-family:Consolas"> main(<span style="color:blue">int</span>, <span style="color:blue">char</span> *[])<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas">{<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> <u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> <span style="color:green">// A renderer and render window</span><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-family:Consolas"> vtkSmartPointer<vtkRenderer> renderer = <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> vtkSmartPointer<vtkRenderer>::New();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> vtkSmartPointer<vtkRenderWindow> renderWindow = <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-family:Consolas"> vtkSmartPointer<vtkRenderWindow>::New();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> renderWindow->AddRenderer(renderer);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> <span style="color:green">// An interactor</span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-family:Consolas"> vtkSmartPointer<vtkRenderWindowInteractor>::New();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> renderWindowInteractor->SetRenderWindow(renderWindow);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> <span style="color:green">// Draw text with diameter measure</span><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> std::stringstream stream;<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> <span style="color:blue">int</span> id = 2;<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> stream << <span style="color:#a31515">"("</span> << id << <span style="color:#a31515">") "</span> << std::fixed << std::setprecision(2) << 2.2666;<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> vtkSmartPointer<vtkCaptionActor2D> sectionTextActor = vtkCaptionActor2D::New();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> sectionTextActor->SetAttachmentPoint( 0, 0, 0 );<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-family:Consolas"> sectionTextActor->SetCaption( stream.str().c_str() );<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> sectionTextActor->BorderOff();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> sectionTextActor->LeaderOff();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> sectionTextActor->SetPadding(0);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> sectionTextActor->GetCaptionTextProperty()->SetJustificationToLeft();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-family:Consolas"> sectionTextActor->GetCaptionTextProperty()->ShadowOff();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> sectionTextActor->GetCaptionTextProperty()->ItalicOff(); <u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> sectionTextActor->GetCaptionTextProperty()->SetFontFamilyToCourier();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-family:Consolas"> sectionTextActor->GetCaptionTextProperty()->SetFontSize( 24 );<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> sectionTextActor->GetTextActor()->SetTextScaleModeToNone();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> renderer->AddActor2D( sectionTextActor );<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> renderer->SetBackground(1,0,0);<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> <u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> renderWindow->Render();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> <u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> <span style="color:green">// Begin mouse interaction</span><u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span lang="EN-US" style="font-family:Consolas"> renderWindowInteractor->Start();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> <u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-family:Consolas"> </span><span style="font-family:Consolas;color:blue">return</span><span style="font-family:Consolas"> EXIT_SUCCESS;<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-family:Consolas">}<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><img width="308" height="334" src="cid:image001.png@01CE0549.1B186C60"><span lang="EN-US"><u></u><u></u></span></p></div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>