blueshake Posted November 9, 2010 Author Posted November 9, 2010 @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. Quote
blueshake Posted November 10, 2010 Author Posted November 10, 2010 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)) ) Quote
blueshake Posted April 14, 2011 Author Posted April 14, 2011 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. Quote
Lee Mac Posted April 14, 2011 Posted April 14, 2011 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 Quote
blueshake Posted April 14, 2011 Author Posted April 14, 2011 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? Quote
Lee Mac Posted April 14, 2011 Posted April 14, 2011 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. Quote
blueshake Posted April 14, 2011 Author Posted April 14, 2011 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?? Quote
Lee Mac Posted April 14, 2011 Posted April 14, 2011 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. Quote
Recommended Posts
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.