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

applying shx textstyle
applying shx textstyle
hi,
i am using the code of odwriteex to add a textstyle to database. when i use a ttf everything is ok, when i use shx fonts the audit report gives a problem when it is assigned to a text.
code:
// name must be set before a table object is added to a table. the
// isshapefile flag must also be set (if true) before adding the object
// to the database.
pstyle->setname(atextstyle.name);
pstyle->setisshapefile(atextstyle.isshapefile);
// add the object to the table.
pstyles->add(pstyle);
// set the remaining properties.
pstyle->settextsize(atextstyle.height);
pstyle->setpriorsize(atextstyle.priorsize);
pstyle->setxscale(atextstyle.widthfactor);
pstyle->setobliquingangle(atextstyle.obliquingangle);
pstyle->setfilename(atextstyle.fontfile);
if (atextstyle.usebigfontfile)
pstyle->setbigfontfilename(atextstyle.bigfontfile);
odstring odfontface(atextstyle.font.typeface);
if (!odfontface.isempty())
pstyle->setfont(odfontface, atextstyle.font.bold, atextstyle.font.italic, atextstyle.font.charset, atextstyle.font.pitchandfamily);attached files
the problem is that in the file you attached the text style style1 is a shape style.
isshapefile determines not if the style is ttf or shx.
for text styles (both shx and ttf) isshapefile() should be false.
shapefile is true for shape (not text) styles. they are unnamed. they contain definitions not for text characters but for a special symbols used for example in linetypes.
if a style is used for texts it should not be "shapefile"
sergey slezkin
thank you. i didn't understand the shape file parameter.
i apply these effects to the textstyle:
pstyle->setisupsidedown(atextstyle.isupsidedown);
pstyle->setisbackwards(atextstyle.isbackwards);
pstyle->setisvertical(atextstyle.isvertical);
and all work fine except the setisvertical. (i am using 2.7 beta)
could you be more detailed what is wrong?
sergey slezkin
nothing is wrong. i didn't realize that for ttf fonts and some shx fonts it is not possible to set vertical. sorry about that.
although this brings another question, how do i identify which fonts can be set to vertical?
found it in the documentation: odfont::supportsverticalmode()
however it seems to return true for all shx... even when acad says it doesn't support vertical. then when i vectorize, it appears horizontal.
last edited by billyaraujo@gmail.com; 18th december 2008 at 10:43 amfff">.
quote:
originally posted by billyaraujo@gmail.com
found it in the documentation: odfont::supportsverticalmode()
however it seems to return true for all shx... even when acad says it doesn't support vertical. then when i vectorize, it appears horizontal.
hello
supportsverticalmode() for shx font returns value of mode flag ( one bit is indicated support vertical mode).
could you give us example font for which dwgdirect returns incorrect this value ?
best regards,
sergey z.

the error occurred because i was defining both setfilename and setfont:
code:
odgitextstyle textstyle;
textstyle.setfilename(odstring((*afont).filename));

textstyle.setfont(odstring((*afont).typeface), (*afont).bold, (*afont).italic, (*afont).charset, (*afont).pitchandfamily);
hello
you needn't use both methods. use setfilename() for shx font and setfont() for ttf.
best regards,
sergey z.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】a strange shx font name yang686526 DirectDWG 0 2009-05-04 03:17 PM
【转帖】求助:将字体文件.shx反编译成.shp文件(已应助) yang686526 数据库ObjectDBX 0 2009-04-28 03:07 PM
求助:将字体文件.shx反编译成.shp文件(已应助) yang686526 ObjectARX(AutoLISP) 0 2009-04-27 10:23 AM
【转帖】关于textstyle 的 xscale yang686526 ObjectARX(VB.NET/C#) 0 2009-04-20 07:54 PM
【转帖】关于shx文件格式 yang686526 ObjectARX(C++) 0 2009-04-16 08:12 PM


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


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