LIST FONT TYPE

LIST FONT TYPE

Anonymous
Not applicable
7,507 Views
7 Replies
Message 1 of 8

LIST FONT TYPE

Anonymous
Not applicable
Dear good day, someone knows how to list all types of letters supported in autocad both .ttf and .shx. example: something like that: ( "C:\\windows\\font" "arial.ttf" "calibri.ttf" ....) ( "C:\\program files\ autodesk\autocad 2017\\fonts "romans.shx " "romand.shx"....)) Thank you very much.
0 Likes
7,508 Views
7 Replies
Replies (7)
Message 2 of 8

m_badran
Advocate
Advocate

Hi,you can use lee-mac 's code and changed as below.

(LM:directoryfiles "c:/windows/fonts" "*.ttf" nil);for ttf files
(LM:directoryfiles "C:/program files/autodesk/autocad 2014/fonts" "*.shx" nil);for shx files

Change red color as your version.

HTH.

 

0 Likes
Message 3 of 8

Anonymous
Not applicable

Hi. The problem I have is that I need to know the name of a special font that uses AutoCAD, with the command STYLE I establish the font "Courier New" "Bold", and I would like to know what font name it uses, when I use The TBLSEARCH function to see the font name, does not show it, the value 3 is empty.

 

(tblsearch "STYLE" "Standard")

((0 . "STYLE") (2 . "Standard") (70 . 0) (40 . 0.0) (41 . 1.0) (50 . 0.0) (71 . 0) (42 . 0.2) (3 . "") (4 . ""))

 

In short, I need to know which font name AutoCAD uses in the combobox.

 

Example:

Arial - Regular -> arial.ttf

Calibri - Italic -> calibrii.ttf

.......

 

Thanks.

0 Likes
Message 4 of 8

marko_ribar
Advisor
Advisor

Command: (setq e (tblobjname "STYLE" "Standard"))
<Entity name: 7ff7ea403910>

 

Command: (entget e '("*"))
((-1 . <Entity name: 7ff7ea403910>) (0 . "STYLE") (330 . <Entity name: 7ff7ea403830>) (5 . "11") (100 . "AcDbSymbolTableRecord") (100 . "AcDbTextStyleTableRecord") (2 . "Standard") (70 . 0) (40 . 0.0) (41 . 1.0) (50 . 0.0) (71 . 0) (42 . 0.2) (3 . "ARIAL.TTF") (4 . "") (-3 ("ACAD" (1000 . "Arial") (1071 . 34))))

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 5 of 8

m_badran
Advocate
Advocate

I think this helpful for you.

 

0 Likes
Message 6 of 8

Anonymous
Not applicable

The solution is perfect when you want to know the font of a font style, and if I wanted to get the list of fonts according to the styles shown in the combobox marked in red like image.

 

The list would be something like this:

 

The texts marked in red are an example of how the font styles would be listed.

 

(("arial.ttf -> regular" "ariali.ttf -> cursiva" ....)("romans.shx" "bigfont.shx -> check use big font"......))

 

This is possible?

0 Likes
Message 7 of 8

Ranjit_Singh
Advisor
Advisor

maybe something like this

 

(defun c:somefunc ( / a b c)
(acad_strlsort (while (setq a (tblnext "style" (null a)))
    (setq b (entget (tblobjname "style" (cdr (assoc 2 a)))))
    (setq c (cons (setq b (strcat (cdr (assoc 3 b)) " -> " (cdr (assoc 2 b)))) c))))
)
0 Likes
Message 8 of 8

Anonymous
Not applicable

That solution lists only the font styles created, but my question is if you can list all font styles according to the attached image in red color (combobox).

0 Likes