I try to create a new text style when working on client's drawings.
Here is my code
(command "._-style" "Arial" "arial.ttf" "0.0" "1.0" "0.0" "No" "No")
Then I have an error message:
Command: (command "._-style" "Arial" "arial.ttf" "0.0" "1.0" "0.0" "No" "No")
._-style Enter name of text style or [?] <STANDARD>: Arial
New style.
Specify full font name or font filename (TTF or SHX) <txt>: arial.ttf
Font file doesn't exist.
Command: 0.0 Unknown command "0". Press F1 for help.
Command: 1.0 Unknown command "0". Press F1 for help.
Command: 0.0 Unknown command "0". Press F1 for help.
Command: No Unknown command "NO". Press F1 for help.
Command: No Unknown command "NO". Press F1 for help.
Command: nil
AFAIK, all "ttf" fonts are resided in "c:/windows/fonts" directory.
I then explore the font foder & found a "arial_2.ttf" instead of "arial.ttf".
The strange thing is that the following returns "c:\\windows\\fonts\\arial.ttf".
(findfile "c:\\windows\\fonts\\arial.ttf")
I then did a couple of searches by using "findfile" method again & these are found
"c:\\windows\\fonts\\arial_0.ttf"
"c:\\windows\\fonts\\arial_1.ttf"
"c:\\windows\\fonts\\arial_2.ttf"
"c:\\windows\\fonts\\arial_3.ttf"
"c:\\windows\\fonts\\arial_4.ttf"
"c:\\windows\\fonts\\arial_5.ttf"
"c:\\windows\\fonts\\arial_6.ttf"
"c:\\windows\\fonts\\arial_7.ttf"
"c:\\windows\\fonts\\arial_8.ttf"
"c:\\windows\\fonts\\arial_9.ttf"
These font files do not exist in the "c:/windows/fonts" directory in fact.
Of course, I can rename the file name of "arial_2.ttf" to the original "arial.ttf".
But now my question is in the code how to check if the "arial.ttf" exists before creating the "arial" text style?
Thanks for your help.