几何尺寸与公差论坛------致力于产品几何量公差标准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-06, 06:28 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】new textstyles in odvectorizee

new textstyles in odvectorizeex
new textstyles in odvectorizeex
hi,
the function exgssimpledevice::textproc(...) offers for each vectorized text a textstyle (odgitextstyle). is this textstyle somehow linked to the textstyles defined in oddbtextstyletable?
and a second question to this: i understand that if a mtext is vectorized, i get one or more texts, each with its own textstyle. is there a way to find out if a textstyle has been used before, e.g. the same id?
torsten
odgitextstyle may have no corresponding oddbtextstyletablerecord. for example then mtext is vetorized font and other properties can be switched inside mtext string.
sergey slezkin
hi sergey,
thanks for you answer.
torsten
quote:
originally posted by torsten
and a second question to this: i understand that if a mtext is vectorized, i get one or more texts, each with its own textstyle. is there a way to find out if a textstyle has been used before, e.g. the same id?
mtext has method explodefragments(...). its fragments you get in exgssimpledevice::textproc(...). oddbmtextfragment structure has the field "changestyle". this field will be one of:
0 - no change
1 - change to original (text style mtext)
2 - change to other
--
best regards,
sergey zaitcev
about case "2 - change to other"
i noticed that library may cast shx-fonts to true-type fonts, doesn't it?
(see attachment - romans.shx -> romans.ttf)
have you got some rules to do that?
how can i use this font-casting algorithm to get true-type font from shx font?
hello,
i want to make the question more exact.
wich algorithm do explodefragments use to cast font form shx to ttf?
in my example explodefragments convert romans.shx to romans.ttf.
i'm using getpreferablefont("romans.shx", ...), but i haven't got the same result.
i want use the same algorithm to get truetype font.
bye
in addition to previous post.
another example
look at the file 7.dwg (see in attachment)
there are two mtext entitis.
all character have the same font - romans.shx, but mtext entities have different style and dif. font in style.
when i read this file, this entities look differ (see 7.jpg). because i can't get font from style, but explodefragment can do it :-) ! how do you do it?
symbolic code to try
odstring ttffont;
odstring filename;
odttfdescriptor ttfdescr;
odstring strtypeface = dd_t("romans");
ttfdescr.settypeface( strtypeface );
pexhostappservs->ttffilenamebydescriptor( ttfdescr, filename );
ttffont = pexhostappservs->getpreferablefont( strtypeface, kfonttypetruetype );
best regards,
and
mtext string can contain control sequences switching font, color, height etc.
your second mtext entity contents is:
{fromans|c204;123}
so it is rendered with romans irrespectively of font set in style.
sergey slezkin
hi, sergey
yes, it is.
i choose fromans.shx font for some symbols
and explodefragment return romans truetype font (.ttf)
i understand how explodefragment do casting from romans.shx font to true type romans font.
so i can't get romans(true type) from style when i read another mtext entity (style has romans.shx font).
sorry, maby i can't explain satisfactorily.
i think if issue is not related to casting between shx anf ttf fonts.
romans.shx is specified in style and romans ttf is specified in mtext contents. the text below will be rendered with verdana:
{fverdana|c204;123}
even if romans.shx is specified in style.
one more sample:
{fverdana|c204;this text has verdana font}this text uses font from style{farial|c204;and this text has arial font}
sergey slezkin
sergey, thank you for your attention. i think, i look folly.
i think i understand that.
i find out another feature of library.
to get font i use the algorithm:
// get text style from text of mtext entity
odgitextstyle gitextstyle;
::gifromdbtextstyle( mtext.textstyle(), gitextstyle );
// then
if ( gitextstyle.isttffont() )
{
...
gitextstyle.font( typeface, bold, italic, charset, pitchandfamily );
// attention! the "typeface" field will be not empty only for truetype fonts (times new roman etc.).
// but? on the outside, library can cast shx fonts to truetype font (romans.shx -> romans_.ttf).
// and in this case, the "typeface" field will be empty (shx font haven't got typeface)!
// gitextstyle.ttfdecriptor().filename() - it is font name! :-)
// am i right?
}
else
{
// txtstyle.isshxfont()
...
}
it is only small part of algorithm
i have got v.2.4.1 dwgdirect.
best regards
your code is related only to text style font.
mtext references only one text style. text style has only one font.
but the contents of mtext can be rendered with many different fonts. because special control sequences may swith the font.
sergey slezkin
it is only small part of code.
of course, for mtext i treat fonts in explodefragments(..).
are you agree with comments in the code?
a few posts above i wrote:
quote:
i think if issue is not related to casting between shx anf ttf fonts.
romans.shx is specified in style and romans ttf is specified in mtext contents.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】makefile for odvectorizee yang686526 DirectDWG 0 2009-05-06 05:25 PM


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


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