View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009618VTK(No Category)public2009-09-29 11:422016-08-12 09:55
ReporterPof 
Assigned ToMarcus D. Hanwell 
PrioritynormalSeveritytextReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0009618: Differences in display of vtkTextActors between vtk5.0.4 and vtk5.4.2 (shadow and accentuated characters)
DescriptionTwo 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.
Additional Information//
// 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;
}
TagsNo tags attached.
Project
Type
Attached Fileszip file icon text_vtk504_ 542.zip [^] (46,080 bytes) 2009-09-29 11:42
patch file icon shadowRenderProblem.patch [^] (2,718 bytes) 2010-05-28 04:16 [Show Content]
zip file icon vtk5.6_ results.zip [^] (134,047 bytes) 2010-05-31 14:01

 Relationships

  Notes
(0017825)
Bill Lorensen (developer)
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 (reporter)
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 (reporter)
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 (reporter)
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 (reporter)
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 (reporter)
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 (reporter)
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 (reporter)
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 (reporter)
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 (developer)
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 (developer)
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 (administrator)
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.

 Issue History
Date Modified Username Field Change
2009-09-29 11:42 Pof New Issue
2009-09-29 11:42 Pof File Added: text_vtk504_ 542.zip
2009-09-29 11:49 Bill Lorensen Note Added: 0017825
2009-09-29 11:49 Bill Lorensen Status backlog => @20@
2009-09-29 14:15 Pof Note Added: 0017831
2010-05-28 04:16 Roger Bramon File Added: shadowRenderProblem.patch
2010-05-28 04:16 Roger Bramon Note Added: 0020851
2010-05-30 13:57 jd Note Added: 0020867
2010-05-30 14:57 Roger Bramon Note Added: 0020868
2010-05-31 01:49 jd Note Added: 0020869
2010-05-31 14:01 Roger Bramon File Added: vtk5.6_ results.zip
2010-05-31 14:02 Roger Bramon Note Added: 0020878
2010-09-08 14:52 jd Note Added: 0022140
2010-09-08 17:18 jd Note Added: 0022142
2010-12-05 16:02 Marcus D. Hanwell Assigned To => Marcus D. Hanwell
2010-12-05 16:02 Marcus D. Hanwell Status @20@ => tabled
2010-12-05 16:04 Marcus D. Hanwell Note Added: 0023721
2010-12-05 16:04 Marcus D. Hanwell Status tabled => @80@
2010-12-05 16:04 Marcus D. Hanwell Resolution open => fixed
2010-12-05 16:11 Marcus D. Hanwell Note Added: 0023722
2010-12-05 16:11 Marcus D. Hanwell Status @80@ => @20@
2010-12-05 16:11 Marcus D. Hanwell Resolution fixed => reopened
2011-06-16 13:11 Zack Galbreath Category => (No Category)
2016-08-12 09:55 Kitware Robot Note Added: 0037104
2016-08-12 09:55 Kitware Robot Status expired => closed
2016-08-12 09:55 Kitware Robot Resolution reopened => moved


Copyright © 2000 - 2018 MantisBT Team