CADXChange

All LISP commands

CXFONTCHKClean-upVersion 1.0.0Tested in AutoCAD

List text styles whose font file is missing

Checks every text style and lists the ones that point to an SHX font file that cannot be found, the usual cause of question marks in text.

How to use it

  1. Type CXFONTCHK.
  2. Read the list of styles and missing files.
  3. Use CXFONTSUB to point them to a font you have.

Good to know

  • TrueType fonts are not checked here.

Load it in AutoCAD

  1. Save the file anywhere you like.
  2. Type APPLOAD, pick the file and choose Load.
  3. Type the command name: CXFONTCHK.

To have it at every start, add it to the Startup Suite in the same dialog, or load a whole folder at once with the optional loader. About the optional loader

Tested in AutoCAD (full version). Other programs that run AutoLISP may work, but they are not tested.

The code

Plain text, nothing hidden. Copy it into a file named cxfontchk.lsp, or download it.

;;; ============================================================================
;;; 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)

Version history

Version 1.0.0 · October 27, 2026

First release.

Need this across many drawings?

TextSync does this kind of job on a whole folder of drawings in one run.

TextSync

More commands: Clean-up