几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-05-05, 11:04 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】fontchange

fontchange
fontchange
the function fontchange() of oddbmtext may be it return the wrong char.
it is return "\f" but i think it must return "\f"
you can try to export funcion:
....
oddbmtextptr ptext;
cstring st1="\\farial|b0|i0|c0|p34;hello ok";
cstring st2="\\farial|b0|i0|c0|p34;hello bad";
ptext->setcontents(st1);
ptext->setcontents(st2);
export
...
"hello ok" is with right font, "hello bad" don't.
the font switch is case insensitive in acad and it is processed so by dwgdirect. the objectarx method fontchange() of mtext class returns ''\f" value.
may be problem is in export. that is export...?
--
best regards,
sergey zaitcev
export
for export i write...
oddbmtextptr ptext;
ptext=oddbmtext::createobject();
ptext->setlocation(odgepoint3d(0,0,0));
ptext->settextheight(2.0);
ptext->setcontents("{\\farial|b0|i0|c0|p34;hello}");
ptext->setattachment(oddbmtext::kbottomleft);
ptext->setlayer(..., false);
pblock->appendoddbentity(ptext);
it seem export right.
quote:
originally posted by rareba
"hello ok" is with right font, "hello bad" don't.
export seems ok. i am not able to reproduce wrong situation. i have both text right in acad and odamfcapp (dwg and dxf).
could you send me or post your result wrong file? possibly it will help to resolve problem.
--
best regards,
sergey zaitcev
i think it is not a big problem
you can try to change
ptext->setcontents("{\\farial|b0|i0|c0|p34;hello}");
with
ptext->setcontents("{\\farial|b0|i0|c0|p34;hello}");
i open with autocad 14.
in attachments the two files
attached files (11.8 kb, 14 views)
(11.8 kb, 11 views)

quote:
originally posted by rareba
i open with autocad 14.
really autocad 14 requires "\\f" switch (and autocad 2002 too). but here is piece from object arx 2002 documentation :
"acdbmtext::fontchange function
static const char * const fontchange();
this static member function returns the string "\f". this function can be used in place of the string constant "\f" in order to make your code more understandable. when used in the string that's returned from acdbmtext::contents() (or that will be passed into acdbmtext::setcontents()), the "\f" indicates a font change."
--
best regards,
sergey zaitcev
thanks a lot
i am trying to export a striked out text. would the following string strike out the text in dxf ?
ptext->setcontents{\farial|strike1|b0|i1|c0|p0;strike out}");
thanks in advance.
kedar
quote:
originally posted by kedark
i am trying to export a striked out text. would the following string strike out the text in dxf ?
ptext->setcontents{\farial|strike1|b0|i1|c0|p0;strike out}");
the word strike1fff"> has no sence in this place. you will have mtext in dxf with content as you set.
best regards,
sergey z.
hi!
i am also facing similar problem.
i am working on exporting to autocad format.
when i use \f while exporting, in autocad it is showing ttf font.
i used times new roman with \f, autocad is showing as ttf in mtext properties.
but when i use times new roman with \f autocad is showing as shx(some other icon not ttf) font in mtext properties.
previously i used fontchange() function which returned \f. so i was getting unexpected behavior. actually i want to export italic and bold attributes of text.
i was unable to do this with fontchange() function. i think for shx fonts italic and bold properties are not supported.
is \f and \f are different or am i missing anything?
then why fontchange() returns \f?
thanks
ashwin
hi!
i am attaching the files.
please look into these files.
is there anything i am missing.
those two files differed by only \f and \f(fontchange)
thanks
ashwin
attached files (14.5 kb, 3 views)
(14.5 kb, 2 views)

last edited by ashwin kumar; 8th november 2006 at 11:03 pmfff">. reason: forgot to attach files
hi ashwin!
unfortunately acad supports "\f" and "\f" switches differently. acad interpretes string after switch "\f" as type face name and after "\f" as file name. in first case acad ignores properties bold, italic and pitch&family.
for example mtext is created by acad:
{\fverdana|b0|i0|c0|p34;one \fscriptc|c204;two}
quote:
originally posted by ashwin kumar
i think for shx fonts italic and bold properties are not supported.
you are right but for simulate italic you may use other switch "\qangle;" - "changes obliquing angle".
best regards,
sergey z.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭



所有的时间均为北京时间。 现在的时间是 06:44 PM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多