I am trying to set up a text style for Chinese text using the SimSun font via AutoLISP.
Using an European Windows 7, english-language AcadM 2012, no problem:
(vl-cmdf "-STYLE" "zh-CN03_5" "SimSun" 3.5 0.9 0 "No" "No")
But, when trying to run the program in China, the same font isn't named SimSun, it is
"宋体"
[whatever this web software shows about that. Two kanji characters.]
Trying
(vl-cmdf "-STYLE" "zh-CN03_5" "\U+5B8B\U+4F53" 3.5 0.9 0 "No" "No")
doesn't work.
- Trying to paste the characters directly to VLIDE just produces ASCII 183 for both characters.
- Pasting the text in another editor to the program and saving it in UTF-8 or UTF-16 produces files that the AutoLISP compiler won't accept.
So, any ideas on how this should be done?
--
I don't have Chinese version to test.
But you can try the combination of followings:
1. Set your Windows "Language for non-Unicode programs" to "Chinese (Simplified)"
2. Edit the program in Notepad and save the file as an Unicode file.
3. Edit the program in Vlisp editor after Step 1
4. Edit the program in AutoCAD Chinese version under Windows Chinese version
5. Edit the program in AutoCAD English version under Windows Chinese version (I've never tested this one, just a guess)
@3wood wrote:I don't have Chinese version to test.
But you can try the combination of followings:
1. Set your Windows "Language for non-Unicode programs" to "Chinese (Simplified)"
2. Edit the program in Notepad and save the file as an Unicode file.
3. Edit the program in Vlisp editor after Step 1
4. Edit the program in AutoCAD Chinese version under Windows Chinese version
5. Edit the program in AutoCAD English version under Windows Chinese version (I've never tested this one, just a guess)
Thank you for the ideas, but not much success:
1. This is part of a Lisp program containing about 28000 strings, most of those in european languages. This would clobber all those, as well as a few other programs we are running. This crashes our program
2. The compiler doesn't like that:
.
; error: bad character read (octal): 0
; Make aborted, fatal errors found.
- the same also with UTF-8 and UTF-16.
3. see 1.
4. Our Chinese factory is running english-language AutoCAD
5. This is rather painful, as I don't read chinese, and we have no Chinese machines here. I'll probably have to try this over a remote connection next 😞
--