CADXChange

모든 LISP 명령

CXFONTCHK정리버전 1.0.0AutoCAD에서 테스트함

글꼴 파일이 없는 문자 스타일 목록

모든 문자 스타일을 검사해 찾을 수 없는 SHX 글꼴 파일을 가리키는 스타일을 나열합니다. 글자가 물음표로 보이는 흔한 원인입니다.

사용 방법

  1. CXFONTCHK를 입력합니다.
  2. 스타일과 없는 파일의 목록을 확인합니다.
  3. CXFONTSUB로 가지고 있는 글꼴로 바꿉니다.

알아 두세요

  • TrueType 글꼴은 여기서 검사하지 않습니다.

AutoCAD에서 불러오기

  1. 파일을 원하는 곳에 저장합니다.
  2. APPLOAD를 입력하고 파일을 선택한 뒤 '로드'를 누릅니다.
  3. 명령 이름을 입력합니다: CXFONTCHK.

시작할 때마다 쓰려면 같은 대화상자에서 '시작 그룹'에 추가하거나, 선택 사항인 로더로 폴더 전체를 한 번에 불러옵니다. 선택 사항인 로더에 대해

AutoCAD(정식 버전)에서 테스트했습니다. AutoLISP를 실행하는 다른 프로그램에서도 될 수 있지만 테스트하지 않았습니다.

코드

숨겨진 부분이 없는 일반 텍스트입니다. cxfontchk.lsp 이름의 파일에 복사하거나 내려받으세요.

;;; ============================================================================
;;; CXFONTCHK - List text styles whose font file is missing
;;; Version 1.0.0
;;; CADXChange LISP tools - https://cadxchange.net/resources/lisp/cxfontchk
;;; Tested in: AutoCAD (full version). Other programs that run AutoLISP may work but are not tested.
;;; Copyright (c) CADXChange. Free for personal and commercial use; do not resell or
;;; republish it as a collection. Terms: https://cadxchange.net/legal/lisp-terms
;;; ============================================================================

;; The text styles whose font file cannot be found by the program: ((style . file) ...).
;; Only .shx fonts are checked; TrueType fonts and shape files are skipped.
(defun cx:fontchk-run ( / r out file)
  (setq r (tblnext "STYLE" T))
  (while r
    (setq file (cx:dxf 3 r))
    (if (and (= (logand 1 (cx:dxf 70 r)) 0)
             file
             (wcmatch (strcase file) "*.SHX")
             (not (findfile file)))
      (setq out (cons (cons (cx:dxf 2 r) file) out)))
    (setq r (tblnext "STYLE")))
  (reverse out))

(defun c:CXFONTCHK ( / *error* cx:sv rows)
  (setq *error* cx:err)
  (setq rows (cx:fontchk-run))
  (if rows
    (progn
      (princ "\nText styles with a missing font file:")
      (foreach r rows (princ (strcat "\n  " (car r) "   " (cdr r))))
      (princ "\nCXFONTSUB can replace a missing font by another one."))
    (princ "\nEvery shx font file used by a text style was found."))
  (princ))


;;; ---- Shared helpers (used by the command above; identical in every CADXChange tool) ----

(defun cx:dxf (code ed)
  (cdr (assoc code ed)))

;; Close the undo step and put the system variables back.
(defun cx:end ()
  (foreach v cx:sv (setvar (car v) (cdr v)))
  (command "_.UNDO" "_End")
  (setq cx:sv nil)
  (princ))

;; Error handler: restores everything, stays quiet on Esc.
(defun cx:err (msg)
  (if (> (getvar "CMDACTIVE") 0) (command))
  (cx:end)
  (if (and msg (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")))
    (princ (strcat "\nError: " msg)))
  (princ))

(princ "\nCXFONTCHK loaded. Type CXFONTCHK to start.")
(princ)

버전 기록

버전 1.0.0 · 2026년 10월 27일

첫 번째 릴리스.

여러 도면에 한꺼번에 쓰고 싶으신가요?

TextSync는 폴더 안의 도면 전체에 이런 작업을 한 번에 처리합니다.

TextSync

다른 명령: 정리