Author Topic: Font not Found  (Read 2032 times)

0 Members and 1 Guest are viewing this topic.

One Shot

  • Guest
Font not Found
« on: April 27, 2005, 01:47:53 PM »
I need to add the create Text Style before I do a text style merge. I would like it to add this to the lisp that is associated with this thread. How would I go about doing this. I know that I need to ensure that the font style is found. But I don't know how to do that. Can someone please point me in the right direct?


Code: [Select]

Date Modified: 04/27/05
By Whom: Bcrouse

(defun C:fx1 ( / stylist txtstyle ss indx ent ent_alst str)
  (setvar "cmdecho" 0)
  (command "_.undo" "be")
  (setq stylist '("DWGTITLES" "RMNAMES"))
 
  (while (/= stylist nil)
    (setq txtstyle (car stylist))
    (setq txtstyle1 (car stylist))
    (if (= (tblsearch "STYLE" txtstyle) nil)
      (command "-style" txtstyle "Swis721 BT.shx" 0 1.20 0 "No" "No" "No")
      (command "-style" txtstyle1 "Swis721 BT.shx" 0 .7 0 "No" "No" "No")      
      (fixtxtstyle1 txtstyle)
    )
    (setq stylist (cdr stylist))
  )
  (setq ss (ssget "X" '((0 . "TEXT,MTEXT")
                (7 . "DWGTITLES"))))
                (7 . "RMNAMES"))))
  (setq indx 0)
  (if (/= ss nil)
    (while (<= indx (- (sslength ss) 1))
      (setq ent (ssname ss indx))
      (setq ent_alst (entget ent))
      (cond
        ((= (cdr (assoc 0 ent_alst)) "TEXT")
          (setq ent_alst (subst (cons 41 1.20) (assoc 41 ent_alst) ent_alst))
        )
        ((= (cdr (assoc 0 ent_alst)) "MTEXT")
          (setq str (cdr (assoc 1 ent_alst)))
          (if (/= (vl-string-position (ascii ";") str) nil)
     (progn
              (setq str (strcat "{" (substr str (+ (vl-string-position (ascii ";") str) 2))))
              (setq ent_alst (subst (cons 1 str) (assoc 1 ent_alst) ent_alst))
     )
   )
        )
      )
      (entmod ent_alst)
      (entupd ent)
      (setq indx (1+ indx))
    )
  )
  (command "_.regen")
  (command "_.undo" "end")
  (setvar "textstyle" "DWGTITLES")
  (setvar "textstyle1" "RMNAMES")  
  (setvar "cmdecho" 1)
  (princ)
)

(defun fixtxtstyle1 (txtsty / txtsty)
  (setq txtsty (entget (tblobjname "STYLE" txtsty)))
  (setq txtsty (subst (cons 41 1.20) (assoc 41 txtsty) txtsty))
  (setq txtsty (subst (cons 41 .7) (assoc 41 txtsty) txtsty))
  (setq txtsty (subst (cons 3 "swis721 BT.shx") (assoc 3 txtsty) txtsty))
  (entmod txtsty)
)


Thank you for all of your help.

Brad

pmvliet

  • Guest
Font not Found
« Reply #1 on: April 27, 2005, 03:30:19 PM »
Unless I am reading it wrong you just need to make sure your font is in one of your search paths... If you can be certain of that then you won't have a problem. If you are asking to do a check first... I would be clueless there... It would probably be similar to the findfile string that keeps popping up here are there... maybe

Pieter

One Shot

  • Guest
Font not Found
« Reply #2 on: April 27, 2005, 03:56:08 PM »
Quote from: pmvliet
Unless I am reading it wrong you just need to make sure your font is in one of your search paths... If you can be certain of that then you won't have a problem. If you are asking to do a check first... I would be clueless there... It would probably be similar to the findfile string that keeps popping up here are there... maybe

Pieter

All I need to know is how to ensure that font will be found for the lisp to read it.

Thank you,

Brad