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

control codes
control codes
hi all,
according to the autocad documention, the three control codes are supposed to be 0x00b0, 0x00b1, and 0x2205.
however with my following code, i have to translate 100,101,and 102 accordingly to get them to work correctly, so what am i doing wrong again?
cheers
jason
odgitextstyle style;
gifromdbtextstyle(textptr->textstyle(), style);
oddbtextiteratorptr txtitr = oddbtextiterator::createobject(textptr->textstring().c_str(), strlen(textptr->textstring().c_str()), false, id, &style);
cexstring *pstring = new cexstring();
do {
oduint16 curchar = 0x0000;
curchar = txtitr->nextchar();
if( curchar == 0x0100) {
curchar = 0x00b0;
}
if( curchar == 0x0101) {
curchar = 0x00b1;
}
if( curchar == 0x0102) {
curchar = 0x2205;
}
.....................
hi cheers,
special symbols (degree,diameter and plus_minus) have difference codes in difference fonts. so textiterator return code corresponding font.
for example: degree symbol code - kfontgdt = 126, kfont10a = 248, kfont10 = 127, ktruetype | kunifont10 = 0xb0 or default = 256;
string can content these symbols in difference coding. for example: dwg and dxf files can content both "\u+00b0" and '掳' (code 0xb0) symbols. both values are correct. strings like "%%d" and "%%d" are correct too for this symbol.
--
best regards,
sergey z.
hello
what does it mean
kfont10, kfont11 etc.?
i have a strage thing. sometimes when i read a string with shx-font, i get unicode symbols (f.e. code is 1034 in dec), but in shx-font file a max number is 220. in odamfc everything draw correctly (see attachment, for example). how do you do this trick?
best regards,
andrey
attached files (13.4 kb, 1 views)

quote:
originally posted by limarov@kompas.kolomna.ru
hello
what does it mean
kfont10, kfont11 etc.?
hello,
it is types of shx fonts. kunifont10 means unicode font.
your font eskd.shx has kfont10 type (no unicode). your dwg file has version r21 (unicode). so you need conversion unicode to codepage for access symbols in font.
best regards,
sergey z.
sergey, thank you for quick answer.
could you explain quote from help:
"font libraries
dwgdirect contains platform neutral code to read and process shx font files. "
how do you find out that string (odstring) is unicode?
i have two files (see attachment. there are also a unicode shx-font). in one case dwgdirect return a unicode string (text_eskd.dwg), in other case a two byte string (but code are from ansi range)(text_eskd+eskdw.dwg). i don't undestand when i could get nonunicode?
attached files (25.1 kb, 2 views)

hello,
start dwgdirect version 2.0 all strings (odstring) are stored as unicode. it doesn't depend on font.
best regards,
sergey z.
last edited by sergey z.; 9th december 2008 at 08:57 amfff">.
it is mean when dwgdirect are opening nonunicode dwg-file, it convert strings (include shx - not only ttf) from ansi to unicode? does it use codepage to do that?
when dwgdirect treat shx-string, it don't use local codepage or dwgcodepage, do it? (see quote from font handling "dwgdirect contains platform neutral code to read and process shx font files".)
but when dwgdirect draw unicode string by nonunicode shx-font, dwgdirect converts strings to dwgcodepage. is it right? (i saw it - odamfc and autocad draw this correctly)
this question is important for me. i treat shx font in my application.
andrey
quote:
originally posted by limarov@kompas.kolomna.ru
it is mean when dwgdirect are opening nonunicode dwg-file, it convert strings (include shx - not only ttf)
from ansi to unicode? does it use codepage to do that?
when dwgdirect treat shx-string, it don't use local codepage or dwgcodepage, do it?
(see quote from font handling "dwgdirect contains platform neutral code to read and process shx font files".)
this question is important for me. i treat shx font in my application.
yes! dwgdirect convert all strings to unicode used dwg codepage. in case it is undefined it used
system codepage. here font doesn't mean. there is exeption with big font. it defines codepage odcharmapper сlass for accurate conversion asian mtext with font switch.
quote:
originally posted by limarov@kompas.kolomna.ru
but when dwgdirect draw unicode string by nonunicode shx-font,
dwgdirect converts strings to dwgcodepage. is it right? (i saw it - odamfc and autocad draw this correctly)
yes! it is so.
best regards,
sergey z.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】control codes and special characters yang686526 DirectDWG 0 2009-05-04 06:07 PM
【转帖】asme美国机械工程师标准目录2 huangyhg American standards 5 2009-04-26 02:38 PM
Unicode、UCS、UTF、BMP、BOM huangyhg vc编程 2 2007-01-22 05:43 PM


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


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