problem with vtkFreeTypeTools and Calibri
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
On a windows 7 system, I ran into a strange issue while trying to render the label for the y-axis of a vtkPlotPoints with Calibri, 18, bold. If the label text contains "AT", vtkFreeTypeTools::RenderCharacter will make an out of bounds acces in the image (vtkFreeTypeTools.cxx line 1477) when trying to render the T. Even stranger: displaying only T does not cause an issue.
The crashing rendering call is performed at vtkOpenGLContextDevice2D.cxx, line 834. The following code reproduces the crash:
vtkNew<vtkTextRendererStringToImage> ren;
vtkNew<vtkTextProperty> prop;
prop->SetFontFile("c:\\Windows\\Fonts\\Calibri.ttf");
prop->SetFontFamily(VTK_FONT_FILE);
prop->SetFontSize(18);
prop->SetBold(true);
prop->SetOrientation(90);
vtkNew<vtkImageData> image; // not initialized exactly as in vtkOpenGLContextDevice2D.cxx
int textDims[2];
ren->RenderString(prop.GetPointer(), vtkUnicodeString::from_utf8("AT"), image.GetPointer(), textDims);