MantisBT - VTK
View Issue Details
0009618VTK(No Category)public2009-09-29 11:422016-08-12 09:55
Pof 
Marcus D. Hanwell 
normaltextalways
closedmoved 
 
 
0009618: Differences in display of vtkTextActors between vtk5.0.4 and vtk5.4.2 (shadow and accentuated characters)
Two problems when rendering vtkTextActor:
- the shadow property looks 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.

Below is the sample code that produce.
Joined a zip file with output images for 5.4.2 and 5.0.4.
//
// 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;
}
No tags attached.
zip text_vtk504_ 542.zip (46,080) 2009-09-29 11:42
https://www.vtk.org/Bug/file/7498/text_vtk504_%20542.zip
patch shadowRenderProblem.patch (2,718) 2010-05-28 04:16
https://www.vtk.org/Bug/file/8150/shadowRenderProblem.patch
zip vtk5.6_ results.zip (134,047) 2010-05-31 14:01
https://www.vtk.org/Bug/file/8155/vtk5.6_%20results.zip
Issue History
2009-09-29 11:42PofNew Issue
2009-09-29 11:42PofFile Added: text_vtk504_ 542.zip
2009-09-29 11:49Bill LorensenNote Added: 0017825
2009-09-29 11:49Bill LorensenStatusbacklog => @20@
2009-09-29 14:15PofNote Added: 0017831
2010-05-28 04:16Roger BramonFile Added: shadowRenderProblem.patch
2010-05-28 04:16Roger BramonNote Added: 0020851
2010-05-30 13:57jdNote Added: 0020867
2010-05-30 14:57Roger BramonNote Added: 0020868
2010-05-31 01:49jdNote Added: 0020869
2010-05-31 14:01Roger BramonFile Added: vtk5.6_ results.zip
2010-05-31 14:02Roger BramonNote Added: 0020878
2010-09-08 14:52jdNote Added: 0022140
2010-09-08 17:18jdNote Added: 0022142
2010-12-05 16:02Marcus D. HanwellAssigned To => Marcus D. Hanwell
2010-12-05 16:02Marcus D. HanwellStatus@20@ => tabled
2010-12-05 16:04Marcus D. HanwellNote Added: 0023721
2010-12-05 16:04Marcus D. HanwellStatustabled => @80@
2010-12-05 16:04Marcus D. HanwellResolutionopen => fixed
2010-12-05 16:11Marcus D. HanwellNote Added: 0023722
2010-12-05 16:11Marcus D. HanwellStatus@80@ => @20@
2010-12-05 16:11Marcus D. HanwellResolutionfixed => reopened
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0037104
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionreopened => moved

Notes
(0017825)
Bill Lorensen   
2009-09-29 11:49   
I verified part of the reporter's problem. The code for generating shadowed characters is flawed, producing improper shadowed characters. Also, ShadowOffset is not copied in TextProperty::ShallowCopy(). Hence, non-defualt ShadowOffset's cannot be specified.

I have a fix for the above bugs and will submit the fix after further testing.

I cannot reproduce the reporters problem with accents. It is LANG locale specific I believe.
(0017831)
Pof   
2009-09-29 14:15   
About the problem with accentuated characters, it might quite obviously be a LANG locale specific.
However, the only thing I can say is that it works perfectly on vtk5.0.4 (actually it was broken from 5.2) on the same computer and same developement environement...
(0020851)
Roger Bramon   
2010-05-28 04:16   
I also have this problem after update from vtk5.0.4 to vtk5.6. I uploaded a patch which solves the shadow problem. I'm working with the current release of vtk5.6: http://vtk.org/gitweb?p=VTK.git;a=shortlog;h=refs/heads/release. [^] The last change was committed on 21 May 2010 12:59:24.

I wonder if you can test it and let me know what do you think about it.
(0020867)
jd   
2010-05-30 13:57   
Roger,
I've actually tested with vtk release 5.6.0, and I arrive at the following conclusions :
- Good point, the problem related to shadowing characters is solved.
- However, I still have the problem with accentuated characters that do not appear at all.
(0020868)
Roger Bramon   
2010-05-30 14:57   
Thanks for your feedback. You're right, this patch just try to solve the rendering problem with shadows. The problem with accentuated characters is another type of problem. It seems that there aren't defined glyphs for them.
(0020869)
jd   
2010-05-31 01:49   
hum... I may not have put it very clearly, what I meant is that I successfully tested the official vtk5.6.0 against the shadowing problem (I don't think I tested the patch you submitted, unless your patch is in the official 5.6.0).

Regarding the accentuated characters, if I understand it may have nothing to do with a Lang Locale specific, so maybe this would deserve another bug report.
I might first send a message to vtkuser to see if some other people face the same problem.
(0020878)
Roger Bramon   
2010-05-31 14:02   
I'm developing on Mac OS X with OpenGL and the result of my test is the same as the result attached by Pof.

I attached a zip with the results of my tests with and without applying the patch and I would like to compare them with your results.
(0022140)
jd   
2010-09-08 14:52   
Roger,
I applied your patch on the vtk5.6.0 release, and it perfectly solves the shadow issue. This is great.
Still the accentuated character problem is not solved, but this is another issue.
(0022142)
jd   
2010-09-08 17:18   
1) the UTF patch solves the accentuated character bug:
http://vtk.org/gitweb?p=VTK.git;a=commit;h=331a44656276882766248c1f8e338434b40226ef [^]

2) Roger Bramon's patch solves the shadow problem.

To conclude, the bug is closed from my side
(0023721)
Marcus D. Hanwell   
2010-12-05 16:04   
It looks like the relevant patches have now been merged to solve this issue. Please let me know if this is not the case, I am working on improving Unicode support in our text rendering but there is still more work to be done before we support everything. Most accented characters should be displayed now that we use an unsigned char, but Unicode requires a font with the extended character set and the new code in vtkFreeTypeTools.
(0023722)
Marcus D. Hanwell   
2010-12-05 16:11   
Sorry, the drop shadow patch has not been applied. I was referring to the other issue. Reopening. I will try to make some time to examine this before the VTK 5.8 release deadline, and have assigned the issue.
(0037104)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.