How can I use UNICODE in OCC?

Hi, all.

I'm a Korean, and I want to display a korean text in OCC view; But It seems to be not so easy;
I tested it with SampleGeometry OCC Sample, with the following modification. but the result was not successful with blah,blah, blah unrecognizable symbols.

Could anyone help me?

void ISession_Text::Compute(const Handle(PrsMgr_PresentationManager2d)& aPresentationManager,
const Handle(Graphic2d_GraphicObject)& aGrObj,
const Standard_Integer unMode)
{
Handle(Graphic2d_Text) text;

#define _UNICODE

TCollection_ExtendedString Text(_T("한글 Text Test"));
text = new Graphic2d_Text(aGrObj, Text, MyX, MyY, MyAngle,MyTypeOfText,MyScale);

#undef _UNICODE

text->SetFontIndex(MyFontIndex);

text->SetColorIndex(MyColorIndex);

text->SetSlant(MySlant);
text->SetUnderline(Standard_False);
text->SetZoomable(Standard_True);
aGrObj->Display();
Quantity_Length anXoffset,anYoffset;
text->TextSize(MyWidth, MyHeight,anXoffset,anYoffset);

}

Lugi.C's picture

Hi, Maybe you can tesselate you text into lines, and then draw them.

regards.
Lugi.C

cheng's picture

How to use UNICODE?