home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Share Gallery 1
/
share_gal_1.zip
/
share_gal_1
/
GR
/
GR506.ZIP
/
ETEXT.EXE
/
ETEXT.LSP
< prev
next >
Wrap
Lisp/Scheme
|
1987-02-04
|
5KB
|
185 lines
]; ETEXT - ver 2.0 Aug 26, 1987.
; author: Terence Puls.
;
(defun getspu ()
(setq cs (- lw 65))
(setq cz 0)
(while (<= cz cs)
(setq cg (read-line fl))
(setq cz (1+ cz))
))
(defun getspl ()
(setq cs (- lw 97))
(setq cz 0)
(while (<= cz cs)
(setq cg (read-line fl))
(setq cz (1+ cz))
))
(defun ucase ()
(if (= l2 "A")
(setq fl (open "etext.gu0" "r"))
)
(if (/= nil (member l2 '("B" "D" "E" "F" "H" "I" "K" "L" "M" "N" "P" "R")))
(setq fl (open "etext.gu1" "r"))
)
(if (/= nil (member l2 '("C" "G" "O" "Q")))
(setq fl (open "etext.gu2" "r"))
)
(if (= l2 "J")
(setq fl (open "etext.gu3" "r"))
)
(if (= l2 "S")
(setq fl (open "etext.gu4" "r"))
)
(if (= l2 "T")
(setq fl (open "etext.gu5" "r"))
)
(if (= l2 "U")
(setq fl (open "etext.gu6" "r"))
)
(if (= l2 "V")
(setq fl (open "etext.gu7" "r"))
)
(if (= l2 "W")
(setq fl (open "etext.gu8" "r"))
)
(if (= l2 "X")
(setq fl (open "etext.gu9" "r"))
)
(if (= l2 "Y")
(setq fl (open "etext.gua" "r"))
)
(if (= l2 "Z")
(setq fl (open "etext.gub" "r"))
)
(getspu)
(close fl)
; insp
)
(defun ulcase ()
(if (/= nil (member l2 '("a" "c" "d" "e" "g" "o" "q")))
(setq fl (open "etext.g0" "r"))
)
(if (/= nil (member l2 '("b" "h" "i" "k" "l" "m" "n" "p" "r" "u")))
(setq fl (open "etext.g1" "r"))
)
(if (/= nil (member l2 '("f" "w")))
(setq fl (open "etext.g2" "r"))
)
(if (= l2 "j")
(setq fl (open "etext.g3" "r"))
)
(if (/= nil (member l2 '("s" "t")))
(setq fl (open "etext.g4" "r"))
)
(if (/= nil (member l2 '("v" "y")))
(setq fl (open "etext.g5" "r"))
)
(if (= l2 "x")
(setq fl (open "etext.g6" "r"))
)
(if (= l2 "z")
(setq fl (open "etext.g7" "r"))
)
(getspu)
(close fl)
;insp
)
(defun lcase ()
(if (/= nil (member l2 '("a" "c" "d" "e" "g" "o" "q")))
(setq fl (open "etext.gl0" "r"))
)
(if (/= nil (member l2 '("b" "h" "i" "k" "l" "m" "n" "p" "r" "u")))
(setq fl (open "etext.gl1" "r"))
)
(if (/= nil (member l2 '("f" "w")))
(setq fl (open "etext.gl2" "r"))
)
(if (= l2 "j")
(setq fl (open "etext.gl3" "r"))
)
(if (/= nil (member l2 '("s" "t")))
(setq fl (open "etext.gl4" "r"))
)
(if (/= nil (member l2 '("v" "y")))
(setq fl (open "etext.gl5" "r"))
)
(if (= l2 "x")
(setq fl (open "etext.gl6" "r"))
)
(if (= l2 "z")
(setq fl (open "etext.gl7" "r"))
)
(getspl)
(close fl)
)
(defun chgstl ()
(command "style" "hgoth" "hgoth" "0" "1" "0" "n" "n")
(entdel (cdr (assoc -1 kj)))
(command "text" pt sh 0 sj)
)
(defun c:etext ()
(setq pt (getpoint "\n Etext insertion point :"))
(princ "\ntext height-inches <")
(setq ib (open "etext.dft" "r"))
(setq sh (atof (read-line ib)))
(close ib)
(prin1 sh)
(prin1 '>)
(setq sy (getstring " :"))
(if (= sy "")
(setq sh sh)
(setq sh (atof sy))
)
(setq ib (open "etext.dft" "w"))
(setq ie (rtos sh 2 2))
(write-line ie ib)
(close ib)
(setq f (/ sh 24))
(setq sl (strlen (setq ss (getstring "\n text :"))))
(setq fl (open "etext.dt1" "r"))
(setq ct 0 lt nil)
(while (< ct 52) ;read in character spaces
(setq ld (read-line fl))
(setq lt (cons ld lt))
(setq ct (1+ ct))
)
(setq lt (reverse lt))
(setq ct 1 es (1- (strlen ss)))
(setq sj (substr ss 1 1))
(close fl)
(while (< ct sl) ;put in spaces routine
(setq l1 (substr ss ct 1) l2 (substr ss (1+ ct) 1))
(setq lw (ascii l1) lx (ascii l2))
(if (< lx 96)
(ucase))
(if (and (< lw 96) (> lx 96))
(ulcase))
(if (and (> lw 96) (> lx 96))
(lcase))
(setq cg (substr cg 2))
(setq cx (atof cg))
(if (< lw 96)
(setq dx (atof (substr (nth cs lt) 2)))
)
(if (> lw 96)
(setq dx (atof (substr (nth (+ 26 cs) lt) 2)))
)
(setq dr (- cx dx))
(setq dr (fix (/ dr 0.40 )))
(if (> dr 24)
(progn
(repeat (fix (/ dr 24))
(setq sj (strcat sj (chr 173))))
(setq dr (- dr (* 24 (fix (/ dr 24)))))
))
(setq sj (strcat sj (chr (+ 149 dr)) l2))
(setq ct (1+ ct))
)
(command "text" pt sh 0 sj)
(if (/= "HGOTH"
(cdr (assoc 7 (setq kj (entget (entlast))))))
(chgstl))
)