Jump to content

Recommended Posts

Posted

Hello everyone,
Please let me know how to correctly use mtext with text formatting (tracking - spacing between characters).

 

(setq a (list 0 0))

(setq b (list 10 10))

(setq c 1000)

(command "_.mtext" a b c "")

OK

 

(setq a (list 0 0))

(setq b (list 10 10))

(setq c {\T0.8; 1000})

(command "_.mtext" a b c "")
NOK

Posted

A couple of thing you might consider.

 

If C is your text then it is probably better to define that as a string if it is being used as a string, put in all in "..... ", for example (setq C "1000")

 

Put your second 'C' in " " to get: (setq c "{\T0.8; 1000}") You might do this already in other parts of your code

 

Last thing to look at is Special characters, the backslash is a marker for a special character in a string (for example, \n is the new line combination. In your c, it is looking to insert a special character, \T. You'll want to fix the \. This is done with a double \\, the first \ to say special character next and the second \ is the character to insert.

 

Hope that makes sense - basic thing, inside " .... " you need to use a double \\ to make that work

 

So you will want to use:

(setq c "{\\T0.8; 1000}")

 

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...