Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Chinese font names via AutoLISP

4 REPLIES 4
Reply
Message 1 of 5
martti.halminen
600 Views, 4 Replies

Chinese font names via AutoLISP

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?

 

--

4 REPLIES 4
Message 2 of 5
3wood
in reply to: martti.halminen

Try

(vl-cmdf "-STYLE" "zh-CN03_5" "宋体" 3.5 0.9 0 "No" "No")

 

Message 3 of 5
martti.halminen
in reply to: 3wood


@3wood wrote:

Try

(vl-cmdf "-STYLE" "zh-CN03_5" "宋体" 3.5 0.9 0 "No" "No")

 


Works typed from the command line, but how do I get that through the compiler to be part of a program?

Message 4 of 5
3wood
in reply to: martti.halminen

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)

Message 5 of 5
martti.halminen
in reply to: 3wood


@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 😞

 

--

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost