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.