-style says swiss.ttf is not found, but it works through style dialog: acad 2015

-style says swiss.ttf is not found, but it works through style dialog: acad 2015

JamesMaeding
Advisor Advisor
1,674 Views
9 Replies
Message 1 of 10

-style says swiss.ttf is not found, but it works through style dialog: acad 2015

JamesMaeding
Advisor
Advisor

Our company is starting to use windows 10, and one machine out of like 20 new ones is acting funny with -style.

We have a lisp that makes a few styles using -style command, and it works generally.

On one though, it rejects swiss.ttf even though (findfile "swiss.ttf") gives the correct path so acad is finding it.

I reset the profile and imported the company standard profile, no luck.

I reinstalled the .ttf fonts under admin login, no luck.

 

I can make the style no problem with style dialog, the font shows normally by the actual windows name, same as other machines.

Note that swiss.ttf shows as "Swis 721 BT" in style dialog, there is no confusion on that here.

 

I need to understand a bit about how -style recognizes truetype fonts as I have run out of tricks to unscrew acad's head.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

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

john.vellek
Alumni
Alumni

Hi @JamesMaeding,

 

Is it possible to attach some of the lisp code that works for some fonts but not this one? I would like to test on my Win7 and Win10 to compare.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 3 of 10

JamesMaeding
Advisor
Advisor

John, it will not matter as I have already troubleshot by comparing machines.

Its like this though:

(command "-style" "Swiss" "swiss.ttf" 0.1 "1" "0" "n" "n")

 

You will not be able to replicate the issue most likely, which is why I stated I needed to understand how -style looks for ttf.

It will be specific to the -style command, as you cannot type some font name in the dialog version, it gives a list.

See what I mean?

This is not an easy question I am asking, it will need some deep knowledge possibly from developers.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 4 of 10

JamesMaeding
Advisor
Advisor

btw, this type of error will cause us to rebuild a machine if we can't figure it out in a few days.

We have many tools that glitch out if the -style command fails as you cannot gracefully handle the issue.

As I stated, findfile gives proper return so that test does not help.

I'd have to revert to using try catch with .net butr these are lisps involved and I must solve the problem or rebuild the machine anyway.

Simply catching the error is not good enough.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 5 of 10

john.vellek
Alumni
Alumni

Hi @JamesMaeding,

 

I ran that code on both Win7 and Win10 in AutoCAD 2017 and it created the style without reporting an error. Is your setup doing something different?


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 6 of 10

JamesMaeding
Advisor
Advisor

yah, it says font file not found.

That is bogus though as (findfile "swiss.ttf") gives correct path.

Also, the fact that regular style dialog box has it correct tells me -style is somehow pickier, but how?


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 7 of 10

john.vellek
Alumni
Alumni

Hi @JamesMaeding,

 

Wow - very strange since it worked fine on my Windows 10

 

Does it work if you activate God mode on your computer? I have seen some strange permissions things occasionally with Windows 10. 


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 8 of 10

JamesMaeding
Advisor
Advisor

God mode?

I am God's admin already 🙂

Does not matter though, this person is heathen so will have to run under same settings as other users.

Obviously there is some difference between this machine and the others, but the right way to troubleshoot this is understand how it works.

The problem is if you don't, it may happen again even after a rebuild.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 9 of 10

JamesMaeding
Advisor
Advisor
Accepted solution

So I found the answer, you must provide the font title, not the ttf name for windows 10.

So this failed on windows 10 (but works on windows 7):

(command "-style" "SwissB" "swissb.ttf" txtht "1" "0" "n" "n")

 

and this works for both 7 and 10:

(command "-style" "SwissB" "swiss 721 bold bt" txtht "1" "0" "n" "n")

 

at first I thought the font title would be the name shown by windows in the ttf list of regular style dialog, but its not.

What you must do is go to the folder with the ttf in explorer, and right click and do properties.

Go to details tab, to get title:

font.jpg

 

guess I get to mark my own post as answered, I will be an 11 yet!


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 10 of 10

john.uhden
Mentor
Mentor

Boy are you optimistic.  Even Bo Derek was only a 10.

John F. Uhden

0 Likes