VTK 7.x How to show non ASCII text on TextActor -
environment:
- ubuntu 14.04 64 bit
- vtk 7.1
vtk 7.x remove ftgl. https://gitlab.kitware.com/vtk/vtk/merge_requests/660
how show non ascii text now?
try code, show nothing:
vtksmartpointer<vtktextactor> textactor = vtksmartpointer<vtktextactor>::new(); textactor->setinput("\u5728\u7ebf\u5de5\u5177"); // or textactor->setinput("中文");
any appreciated!
thanks vtk developers.
vtk supports non ascii text.
have specify font file on vtktextproperty -- default fonts in vtk support ascii.
the following example use droid
font display chinese characters.
vtksmartpointer<vtktextactor> textactor = vtksmartpointer<vtktextactor>::new(); textactor->gettextproperty()->setfontfamily(vtk_font_file); textactor->gettextproperty()->setfontfile("/usr/share/fonts/truetype/droid/droidsansfallbackfull.ttf"); textactor->setinput("utf-8 freetype 中文: \xe4\xb8\xad\xe6\x96\x87");
Comments
Post a Comment