Chinese/unicode font question

1
geluojjj
7/31/2006 2:04 AM

Does the cadlib support unicode character and chinese font?
Please show me how to do this,Thanks

Wout
7/31/2006 11:13 AM

Hi geluojjj,

Yes it does, I have never tried the shx fonts, but for true type fonts it works.

Set DxfHeader.DrawingCodePage to CadLib.Model.DrawingCodePage.Ansi950 (Chinese traditional). The header is part of the DxfModel (DxfModel.Header). Like this you're using the chinese code page, so that's not true unicode, but should be ok (.NET strings are unicode anyway, the DrawingCodePage just specifies the way they're persisted in the DXF file).

If you need unicode characters, then look at the documentation of CadLib.Model.Entities.MText.Text: you can add a unicode character by using \Unnnn; in the string where nnnn is the unicode code. Or alternatively use \U+nnnn where + sign indicates that the number is hexadecimal.

Also you need to have Windows chinese fonts installed, which you probably
have. If not, have a look here: http://lingua.mtsu.edu/chinese-computing/faq/pc.html.

Thanks!

Wout

1