Can't change to a especific font in command line

Can't change to a especific font in command line

NexusEngenharia
Participant Participant
1,005 Views
10 Replies
Message 1 of 11

Can't change to a especific font in command line

NexusEngenharia
Participant
Participant

I am trying to make a script to change all font styles that come in a drawing to a especific font (bahnschrift), but it seems to be inacessible through the -style command, i can change it trough the style window, but it wouldn't work in a script, and it seems i can change to any other font, but when i try with bahnshrift it just says "font not available" anyone knows which might be the problem?

0 Likes
1,006 Views
10 Replies
Replies (10)
Message 2 of 11

Kent1Cooper
Consultant
Consultant

You may be able to use >this< or something else in the same thread.

 

If you can't use AutoLisp [if you have Acad LT], post what you have as a Script so far.  It certainly should be possible to do this in a Script.

Kent Cooper, AIA
0 Likes
Message 3 of 11

NexusEngenharia
Participant
Participant

i'm trying to use script due to the fact that need to do it for a large amount of drawings, so i can use windows batch script, and also some of the computers in the workplace use AutoCAD LT

 

the script so far is simple, or at least it's suposed to be simple

it's:

 

-style
standard
arial

 

 

 

with all the enters needed to work properly, and it works properly, but only with some fonts, i've noticed that Arial and Harrington works, but bahnschrift and vivaldi are some of the ones that doesn't work, and in my case, i needed to change it to bahnschrift

 

0 Likes
Message 4 of 11

Kent1Cooper
Consultant
Consultant

@NexusEngenharia wrote:

.... it works properly, but only with some fonts, i've noticed that Arial and Harrington works, but bahnschrift and vivaldi are some of the ones that doesn't work, and in my case, i needed to change it to bahnschrift


I don't have BAHNSCHRIFT, but I have VIVALDI, so I experimented.  Notice:

 

Command: -STYLE
Enter name of text style or [?] <Standard>: {Enter to accept default}
Existing style. Full font name = Vivaldi Italic
Specify font name or font filename (for SHX) <Vivaldi>: VIVALDI {typed in}
Font not available.

 

Command: -STYLE
Enter name of text style or [?] <Standard>:
Existing style. Full font name = Vivaldi Italic
Specify font name or font filename (for SHX) <Vivaldi>: {Enter to accept default}
Specify height of text or [Annotative] <0'-0">: OK

 

Command: -STYLE
Enter name of text style or [?] <Standard>: test
New style.
Specify font name or font filename (for SHX) <txt>: VIVALDI ITALIC {typed in full}
Specify height of text or [Annotative] <0'-0">: OK

 

So it seems you need to use the Full spelling of the font name, which apparently is not always be the way it is shown to you.  If you create a STYLE with the dialog box, and assign the font through the font list there, and set it current, then call up a -STYLE command and accept the current Style name, it should give you the "Full font name" to put into your Script.

Kent Cooper, AIA
0 Likes
Message 5 of 11

NexusEngenharia
Participant
Participant

it really works with vivaldi this way, but still especifically with bahnschrift, wich is weird

it gives me this

 

Command: -STYLE
Enter name of text style or [?] <Standard>:
Existing style. Full font name = Bahnschrift Light
Specify font name or font filename (for SHX) <txt>: Bahnschrift Light
Font file doesn't exist.

 

i also noticed that between the "<>" where in other fonts it shows the font name, like vivaldi or arial, in the case of this font it only says "txt" dont know if it's related

 

i'm thinking propably there is some problem with the font file, but it happens in all computers in my workplace

0 Likes
Message 6 of 11

Kent1Cooper
Consultant
Consultant

@NexusEngenharia wrote:

....

i'm thinking propably there is some problem with the font file, but it happens in all computers in my workplace


Are you able to use it in other software, such as in a word processor?

Kent Cooper, AIA
0 Likes
Message 7 of 11

NexusEngenharia
Participant
Participant

yes

0 Likes
Message 8 of 11

Kent1Cooper
Consultant
Consultant

And in the STYLE dialog box in AutoCAD, can you assign it to a Style?  I'm guessing maybe it's really an OpenType font rather than a TrueType font -- see, for example, >this<.

Kent Cooper, AIA
0 Likes
Message 9 of 11

NexusEngenharia
Participant
Participant

yes, i can normally assign it to a style in the dialog box, and in the windows fonts folder the file says bahnschrift.ttf, so i'm guessing it's a true type font

0 Likes
Message 10 of 11

Kent1Cooper
Consultant
Consultant

@NexusEngenharia wrote:

... in the windows fonts folder the file says bahnschrift.ttf, so i'm guessing it's a true type font


See the first sentence >here<, which suggests that a .ttf filetype ending could be on what's really an OpenType font.  But it also says AutoCAD should be able to work with those -- maybe that has changed since.  I don't know enough about the difference, or how to tell [or even whether that's possible], but maybe someone more knowledgeable will jump in.

Kent Cooper, AIA
0 Likes
Message 11 of 11

NexusEngenharia
Participant
Participant

thanks for the help man

0 Likes