[vtkusers] Show Chinese Character on qvtkwidget

Simon ESNEAULT simon.esneault at gmail.com
Mon Apr 27 06:03:49 EDT 2015


Hi,

In order to display some Chinese character in vtk 6.1 or later, I think you
need to load an external True type font, with those two lines

m_textActor->GetTextProperty()->SetFontFamily( VTK_FONT_FILE );
m_textActor->GetTextProperty()->SetFontFile( "C:/Path_to_font/DejaVu.ttf" );

Hope this help
Simon

2015-04-27 11:31 GMT+02:00 lee <lihouxing at yeah.net>:

> Hi, I am right now been bothered by the showing of Chinese Character on
> qvtkwidget.The following is my codes:
> *       QString temp;
>         temp="this is a test哦哦";
>         QMessageBox::information(this,"test",temp);
>         std::string str = temp.toStdString();
>         const char* ch = str.c_str();
>         m_textActor->SetInput(ch);
>         m_render->AddActor2D(m_textActor);
>         m_renWin->Render();*
> the result shows the English words correctly, but the last two Chinese word
> in a form which I don't understand.
> So I am wondering anyone who has solved this problem can share the methods.
> Thanks a lot.
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Show-Chinese-Character-on-qvtkwidget-tp5731627.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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
>



-- 
------------------------------------------------------------------
Simon Esneault
Rennes, France
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150427/87ad9b6c/attachment.html>


More information about the vtkusers mailing list