Print Page | Close Window

Change shx text type?

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=13336
Printed Date: 22.Apr.2026 at 03:20


Topic: Change shx text type?
Posted By: kentral
Subject: Change shx text type?
Date Posted: 11.Dec.2019 at 11:02
Hi.
I need to change several text styles with diferents shx names (romas.shx, txt.shx, etc) to an unic ttf name (arial.ttf).
Ther is any lisp to do this.
Thank you



Replies:
Posted By: John Connor
Date Posted: 11.Dec.2019 at 13:00
Individually or as a group?


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: Kent Cooper
Date Posted: 11.Dec.2019 at 22:06
This replaces the font in all Style definitions that use any .shx fonts with Arial.ttf, if that's what you want:

(defun C:SHXtoArial (/ sty stydata)
  (while (setq sty (tblnext "style" (not sty))); step through Style table
    (if (wcmatch (cdr (assoc 3 sty)) "*.shx"); Style uses an .shx font
      (progn ; then -- replace that with arial.ttf
        (setq stydata (entget (tblobjname "style" (cdr (assoc 2 sty)))))
        (entmod (subst '(3 . "arial.ttf") (assoc 3 stydata) stydata))
      )
    )
  )
  (princ)
)

It could be modified to apply to a list of specific Style names instead, or those of only selected Text/Mtext objects, or in other ways.



Print Page | Close Window