Forum archiveIssue archiveOther usage issues

Archived discussion

2D Text

Other usage issuesMon, 02/03/2003 - 15:062 replies

Browse this forum
QuestionAuthor

Hi,
I am new to Opencascade and want to know a way to draw 2D TEXT in Opencascade.I have tried following, but the program either crashes or displays nothing.

a)Graphic2d_TransientManager::DrawText(...)

b)Graphic2d_Text(aGraphicObject,aText,10.0,10.0,0.0,Aspect_TOT_SOLID,1.0);aGraphicObject->Display();

c)Handle(Graphic2d_Text) text;
text = new Graphic2d_Text(aGrObj, "kaka", 10.0, 10.0, 0.0,Aspect_TOT_SOLID,1.0);
text->SetFontIndex(10);
Graphic2d_Text textObj(aGrObj,aText,10.0,10.0,0.0,Aspect_TOT_SOLID,1.0);
aGrObj->Display();

Awaiting prompt reply.
Thanks

Discussion

2 archived replies

Posts are displayed in their archived order.

01Commenter-1

Hi !

If I remeber correct, you need to set an environment variable that point to the font directory, I belive there is an entry in the FAQ about the environment variables to set, that could be the problem.

Commenter-1

02Commenter-2

Hi Amod,
There is a sample that do just that, you should look at it.
Commenter-2.