[vtkusers] Differences in display of vtkTextActors between vtk5.0.4 and vtk5.4.2 (shadow and accentuated characters) ??

pof jd379252 at gmail.com
Wed Sep 23 16:35:54 EDT 2009


Hi vkt'ers

actually I've already submitted almost the same post on 2009/01/11 (see 
http://www.vtk.org/pipermail/vtkusers/2009-January/098973.html), same 
problem but now
with vtk5.4.2 (was vtk5.2.1 in the previous post).
I was hoping that this problem would have disappeared in the latest 
release, unfortunately this is not the case.

Here is a small description again:

I'am trying to upgrade from vtk5.0.4 to vtk5.4.2 .
I end up with two problems when rendering vtkTextActor.
Basically :
- the shadow property looks rather strange in 5.4.2 (and 5.2.1) compared 
to 5.0.4
- accuentuated characters (é, è...) are no longer displayed in 5.4.2 
(and 5.2.1)

Note : all vtk version were compiled with VC++2005 under WinVista, with 
the same options.

I can hardly believe that I am the only one that is having this problem, 
although I admit this occurs only with non standard characters 
(accentuated).

So my question again:
- any idea where this behaviour change comes from?
- any hint to solve it?

Thanks in advance

-------------------

Below a small test that reproduce the problem.

//
// test for vtkTextActor
//
#include "vtkActor.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkCamera.h"
#include "vtkTextProperty.h"
#include "vtkTextActor.h"

int main()
{
    // Create an example text actor.
    vtkTextActor *textActor = vtkTextActor::New();
    textActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport(); 

    textActor->SetPosition(0.50,0.50);
    textActor->SetInput("vtk5.0.4\n\nCharacters without 
accents\n\nCaractères accentués");
    textActor->GetTextProperty()->SetFontSize(40);
    textActor->GetTextProperty()->SetFontFamilyToArial();
    textActor->GetTextProperty()->SetJustificationToCentered();
    textActor->GetTextProperty()->BoldOn();
    textActor->GetTextProperty()->ItalicOn();
    textActor->GetTextProperty()->ShadowOn();
    textActor->GetTextProperty()->SetColor(1, 0, 0);

    // Create the graphics structure.
    vtkRenderer *ren = vtkRenderer::New();
    vtkRenderWindow *renWin = vtkRenderWindow::New();

    renWin->AddRenderer(ren);
    renWin->SetSize(600, 600);

    vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
    iren->SetRenderWindow(renWin);

    // Add the actor to the renderer, set the background and size
    ren->AddActor(textActor);
    ren->SetBackground(0.1, 0.2, 0.4);
    ren->ResetCamera();
    ren->GetActiveCamera()->Zoom(1.0);
    renWin->Render();

    // This starts the event loop and as a side effect causes an initial 
render.
    iren->Start();

    // Exiting from here, we have to delete all the created instances
    textActor->Delete();
    ren->Delete();
    renWin->Delete();
    iren->Delete();

    return 0;
}




More information about the vtkusers mailing list