;; | --------------------------------------------------------------------------- ;; | TX_SetStyleParams ;; | --------------------------------------------------------------------------- ;; | Function : Set a current text style and height ;; | Arguments: 'Sty' - Text Style Name to set ;; | If 'nil' is passed, the current text style is ;; | used. ;; | 'Hgt' - Height to set ;; | 'AutoLoad' - If AutoLoad is true, attempt to load the font if ;; | SHX is available. ;; | Returns : None ;; | Action : Sets the specifed style as current ;; | and optionally set the height also ;; | Updated : January 3, 2002 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | --------------------------------------------------------------------------- (defun TX_SetStyleParams ( Sty Hgt AutoLoad / ttfFn tbl CmdN fa ) (cond ((= #OperatingEnv "AutoCAD") (if (not Sty) (setq Sty (getvar "TEXTSTYLE")) ) (setq tbl (tblsearch "STYLE" Sty)) (if (and (not tbl) AutoLoad) (progn (if (findfile (strcat Sty ".shx")) (progn (setq tbl T) (TX_LoadStyle Sty Sty) ) (progn (setq ttfFn (strcat (dos_specialdir 20) Sty ".ttf")) (if (findfile ttfFn) (progn (setq tbl T) (TX_LoadStyle Sty Sty) )) )) )) (if tbl (progn (setq fa (getvar "FONTALT")) (setvar "FONTALT" "") (command "._Style" Sty "" Hgt) (setq CmdN "STYLE") (while (= CmdN "STYLE") (setq CmdN (getvar "CMDNAMES")) (if (= CmdN "STYLE") (command "") ) ) (setvar "FONTALT" fa) ) (princ (strcat "\nError: Text Style '" Sty "' is not defined.")) ) ) ) )