[vtkusers] vtkTextActor render utf8 characters not working

Allie Vacanti allison.vacanti at kitware.com
Mon Nov 27 09:10:32 EST 2017


Are you sure the font file includes the glyphs in that UTF8 string? That's
the only thing I can think of that would prevent that string from rendering.

On Tue, Nov 21, 2017 at 10:31 PM, Frank Sea <fromseattle at gmail.com> wrote:

> 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
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20171127/23dbb142/attachment.html>


More information about the vtkusers mailing list