64,266
社区成员
发帖
与我相关
我的任务
分享
QFont font;
font.setFamily(QString::fromLocal8Bit("宋体"));
vtkNew<vtkTextActor> textActor;
vtkNew<vtkTextProperty> textProperty;
textProperty->SetFontFamily(VTK_FONT_FILE);
textProperty->SetFontFile(QString("E:/songti.ttf").toUtf8());
textProperty->SetColor(1, 0, 0);
textActor->SetTextProperty(textProperty);
textActor->SetInput(QString::fromLocal8Bit("我是中文123ascdj回电话傻大姐dfdsf").toUtf8());
textActor->SetDisplayPosition(50, 50);
contextView->GetRenderer()->AddActor(textActor);