直接上代码
gp_Pnt gPnt(100.0, 100.0, 100.0);
TCollection_ExtendedString extStr;
Resource_Unicode::ConvertGBKToUnicode(QString("AAaa 你好 OpenCascade 1234").toLocal8Bit(), extStr);
Handle(AIS_TextLabel) aPntLabel = new AIS_TextLabel();
aPntLabel->SetText(extStr);
aPntLabel->SetPosition(gPnt);
aPntLabel->SetFont("Microsoft yahei");
m_context->Display(aPntLabel, Standard_False);
参考资料
https://blog.csdn.net/qq_40247982/article/details/106765819
http://www.cppblog.com/eryar/archive/2014/08/17/208044.html