Simple Macro to change Text Style not finding file

Simple Macro to change Text Style not finding file

rponsell
Participant Participant
1,141 Views
9 Replies
Message 1 of 10

Simple Macro to change Text Style not finding file

rponsell
Participant
Participant
^C^C-Style;Standard;C:/Users/User/AppData/Local/Microsoft/Windows/Fonts/Helvetica.ttf

 

The above code should change my Standard Text Style to the Helvetica font. I have verified that the font file is indeed in that location, but when I run this code I get the error: "Font file doesn't exist".

 

I know that it does, and I can manually select it as my font when I just use the "Style" command normally.

 

Why isn't my macro working?

 

Thanks

0 Likes
Accepted solutions (1)
1,142 Views
9 Replies
Replies (9)
Message 2 of 10

Kent1Cooper
Consultant
Consultant

See >this recent similar topic<.  Could it be that the full actual font file name is not the same as what displays in the <Default> in the prompt, but something longer in the line above that, as in the example in the link?

Kent Cooper, AIA
Message 3 of 10

rponsell
Participant
Participant

I found that elsewhere the font name was "Helvetica Regular" and I see different error messages depending on what I use. But still no success.

 

Command: -STYLE
Enter name of text style or [?] <Standard>:
Existing style.
Specify font name or font filename (for SHX) <txt>: Helvetica Regular
Font not available.
Command: -STYLE
Enter name of text style or [?] <Standard>:
Existing style.
Specify font name or font filename (for SHX) <txt>: Helvetica
Font file doesn't exist.
0 Likes
Message 4 of 10

pendean
Community Legend
Community Legend
Also... why do you need to fully path the font location if I may ask? Seems odd, your stock Windows fonts are pre-pathed in stock AutoCAD installations.
Message 5 of 10

rponsell
Participant
Participant

I just tried that when it didn't work without the path.

0 Likes
Message 6 of 10

pendean
Community Legend
Community Legend
Sure you got the correct font names? try different ones as a test, this is a snippet of one of my scripts, has been working just fine for 20+ years now

STYLE
WINGDINGS
WINGDINGS
0
1
0
N
N
STYLE
LABEL
ARIAL.TTF
A
Y
N
5
1
0
N
N
0 Likes
Message 7 of 10

pendean
Community Legend
Community Legend
Do yourself a huge favor: go to the Windows fonts folder, find the font you want to use, select it, right-click and choose PROPERTIES: actual file name and extension will be in that pop-up.
Message 8 of 10

rponsell
Participant
Participant

That's exactly what I did the first time.

Screenshot 2021-08-11 140544.png

0 Likes
Message 9 of 10

pendean
Community Legend
Community Legend
Accepted solution
Do you have file extensions hidden in Windows File Manager? Turn it on, when I do it the above includes he full file name and extension.

>>>...That's exactly what I did the first time....<<<
Try ARIAL.TTF (not just ARIAL) and TIMES.TTF (not just TIMES) in another commandline test, no pathing, since none of us have your unique font file: does it fail too? Works fine here. If it does not for you, there is something else going on at your workstation.
Message 10 of 10

rponsell
Participant
Participant
That was it! I needed to use Helvetica.ttf, but not the full file path. Thank you so much for your time.
0 Likes