高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】how to export text to autoacd correctly
how to export text to autoacd correctly
how to export text to autoacd correctly
now i am exporting some texts to autocad, but the result is wrong. if the length of a line is longer than mtext's refrectwid value( set by pmtext->setwidth(refrectwid)), autocad will break the texts in the same line into different lines, then in autocad, the text maybe will be out of the text box. so we need compute the refrectwid correctly. our text font is the windows font type, e.g. arail, but autocad uses its own fonts. how can we translate the windows fonts to autocad fonts, e.g. how to translate the height and width of windows font to autocad's? if we know the relationship between the fons of windows and the the fonts in autocad, maybe we can compute the refrectwid correctly.
autocad can't recognise line breaks that are caused by the text box or the carriage return, it is right? if it is right, what can we do to set autocad to recognise the carriage return?
hope for your help!
autocad uses windows ttf fonts but it treats font height in a special manner. font height in autocad is the height of "a" character.
inside mtext cr/lf symbols are treated as spaces. line an paragraph breaks are represented by special control sequences. they are described in dbmtext.h see functions like linebreak(), paragraphbreak(), nonbreakablespace() etc.
sergey slezkin
|