Jump to content

Recommended Posts

Posted

@Lee

I follow your advice.but it failed to the attachment.

dig into a little.the reason is the following codes don't work for double char language.

(mapcar 'chr (vl-string->list <string>))

Drawing9.dwg

 

can you check about this?thanks.

  • Replies 27
  • Created
  • Last Reply

Top Posters In This Topic

  • blueshake

    14

  • Lee Mac

    9

  • Tiger

    2

  • Tharwat

    1

Posted

hi,Lee,

I write a routine to break string into single char.now it work for double char language.

if I want to merge the routine into your codes in this site.http://lee-mac.com/slinkytext.htmlwhat should I do?:)

 

(defun break_up_string(string / objectlist strIndex lens strWord)
 	(vl-load-com)
;(setq string "abc中国")
 	(setq strIndex 0)
 	(setq lens (strlen string))
 	(while (< strIndex lens)
  	(setq strIndex (+ 1 strIndex))
  	(setq strWord (substr string strIndex 1))
  	(if (> (ascii strWord) 128)
	  	(progn
			(setq strWord (substr string strIndex 2))
	    	(setq strIndex (+ 1 strIndex))
		)
	)
  	(setq objectlist (cons strWord objectlist))
)
(setq objectlist (reverse objectlist))
 )

  • 5 months later...
Posted

hi,Lee,I review your codes in this sitehttp://www.lee-mac.com/slinkytext.html

the variable *spacein" is not clear to me, I guess it means space between letters.and by default ,you set it to 1.1

so if I want to set the letters space value to 1 ,which valve should I set for *spacein"?thanks.

Posted

Hi Blueshake,

 

The '*spacin' variable does indeed control the character spacing along the curve. This value is multiplied by the TextSize so that larger characters are spaced further apart. To achieve a character spacing of 1, set the variable to the reciprocal of the TextSize.

 

Lee

Posted

hi,Lee

I follow the your advice,but something is just wrong.

the textsize system varible is 2.5 and I set "*spacein* to 0.4,but it is just wrong,see the picture.

did I miss something?

1745_1302788703Tchd.png

Posted

A few things to note:

 

* The code uses the TextSize System Variable which may differ from the TextSize shown in the MText Editor.

 

* The spacing calculated in the code is the distance between the insertion points of each character.

Posted

I see now,thanks.

so if I want to achieve that (a.b=1 in the picture for the curve text),what should I do??

Posted

Create individual characters with middle-center alignment, spaced as required and measure the distance between their insertion points, then set the spacing variable to this distance divided by the value of the TextSize variable.

 

Of course, this distance will only be constant for fixed-width character fonts, so you might want to take an average.

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...