Hello All,
For some reason I can't get this routine to create a text style with the Arial.ttf font file. The routine creates the text style ok, but it's "Font Name" is "Arabic Transparent". I don't know why but I believe it may have something to do with the fonts installed on my system. Code and screen shot attached.
I know this is not the best way of doing this, just piecing together bits of code to accomplish the task.
Update: So I am using AC2012(vanilla) and having the problem. I tested the same routine on an AC2008 install and Map 2012. Neither of them created the problem. So, must be something with my install of AC2012.
;;;
;;; Mtext Creation Routine
;;; Original Code by Lee Mac
;;;
(defun c:mtx ( / e h p s )
(setvar "CMDECHO" 1)
(command ".undo" "end")
(command ".undo" "m")
(setvar "CECOLOR" "bylayer")
(setvar "CELTYPE" "bylayer")
(setvar "CELWEIGHT" -1)
(setvar "SNAPMODE" 0)
;;;
(MAKEMTSTYLE)
(MAKETLAYER)
(GETSPACE)
(graphscr)
(setq s "NEW-ARIAL"
h (* DIMSC 0.093750)
)
(if (setq p (getpoint "\nPoint for MText: "))
(progn
(setq e
(entmakex
(list
'(0 . "MTEXT")
'(100 . "AcDbEntity")
'(100 . "AcDbMText")
'(1 . "")
(cons 10 (trans p 1 0))
(cons 40 h)
(cons 07 (if (tblsearch "STYLE" s) s "Standard"))
)
)
)
(command "_.mtedit" e)
)
)
;;;
(command ".undo" "end")
(princ)
)
;;;
(defun MAKEMTSTYLE (/)
(setvar "CMDECHO" 1)
(if (not (tblsearch "style" "NEW-ARIAL"))
(command ".-style" "NEW-ARIAL" "ARIAL.ttf" 0.00000000 1.00000000 0.00000000 "N" "N")
(progn
(princ "\nText Style \"NEW-ARIAL\" Already Exists... Text Style Un-Changed... ")
(setvar "TEXTSTYLE" "NEW-ARIAL")
)
)
)
;;;
(defun GETSPACE (/)
(if (and (equal (getvar "TILEMODE") 0)
(equal (getvar "CVPORT") 1)
)
(setq CSPACE 1);paper space
(setq CSPACE 0);model space.
)
(if (= CSPACE 1)
(setq DIMSC 1.0)
(setq DIMSC(getvar "DIMSCALE"))
)
)
;;;
(defun MAKETLAYER (/)
(setq DISL "G-ANNO-TEXT")
(command ".-layer" "thaw" DISL "on" DISL "unlock" DISL "make" DISL "color" "4" DISL "lt" "continuous" DISL "")
(setvar "clayer" DISL)
)