高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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.
|