ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to draw text in custom entity with sub- and superscript?

3 REPLIES 3
Reply
Message 1 of 4
maisoui
504 Views, 3 Replies

How to draw text in custom entity with sub- and superscript?

Hi,

 

I'd like to draw text with sub- and superscript in my custom entity. In MText or Dimension, this string "161{\H0.6x;\S5^;}" will be interpreted as :

 

text_superscript.png

 

I'd like to have the same in my custom entity : geometry().text(_T("161{\H0.6x;\S5^;}"), ...) with raw parameter = Adesk::kFalse and text isn't interpreted (but tags like %%o, %%u, ... are correctly evaluated). Is it possible to use such text in custom entities?

 

I considered using unicode characters for each superscripts (¹, ², ³, ...), but the problem is for other parameters like underscore. "161{\H0.6x;\S5/;}" will be interpreted as :

 

text_superscript_underline.png

 

Any suggestions are welcomed.

--
Jonathan
3 REPLIES 3
Message 2 of 4
OysteinW
in reply to: maisoui

The easiest would be to keep an embedded AcDbMText in your custom entity. 

 

It would need to take part in the dwgInFields/dwgOutFields mechanism, and you can use mode->geometry.draw(m_text); or or m_text->worlDraw(mode);  inside your subWordDraw;

 

 

Message 3 of 4
maisoui
in reply to: OysteinW

Thank you for your suggestion. I know I could have an embedded AcDbMText, but it's a complex entity and I want to have an optimized code and drawing primitives only.

--
Jonathan
Message 4 of 4
OysteinW
in reply to: maisoui

Yes, but it's a complex task you are trying to achieve.. 😉

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost