[vtkusers] vtkTextActor render utf8 characters not working
Frank Sea
fromseattle at gmail.com
Tue Nov 21 22:31:23 EST 2017
Hi All,
I built the test code at the following location:
https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/FreeType/Testing/Cxx/TestMathTextFreeTypeTextRenderer.cxx#L184
which tests displaying utf8 chars like following:
// UTF-8 freetype handling:
vtkNew<vtkTextActor> actor15;
actor15->GetTextProperty()->SetFontFamily(VTK_FONT_FILE);
actor15->GetTextProperty()->SetFontFile(uncodeFontFile.c_str());
actor15->GetTextProperty()->SetJustificationToCentered();
actor15->GetTextProperty()->SetVerticalJustificationToCentered();
actor15->GetTextProperty()->SetFontSize(18);
actor15->GetTextProperty()->SetColor(0.0, 1.0, 0.7);
actor15->SetInput("UTF-8 FreeType:
\xce\xa8\xd2\x94\xd2\x96\xd1\x84\xd2\xbe");
actor15->SetPosition(10, 110);
I provided font file from
https://github.com/aosp-mirror/platform_frameworks_base/blob/master/data/fonts/DroidSansFallbackFull.ttf
But the text is not rendered. It's blank for that one. Anyone know the
reason? I am on Windows 10.
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
More information about the vtkusers
mailing list