Showing results for 
Search instead for 
Did you mean: 

3D Create Text VI won't find font file in EXE

Hello all,

               I have a problem regarding 3D text in a 3D picture control. I need to put some text in arial true type font in a 3D picture which I'm attempting to do using the 'Create Text' VI in the 3D picture geometries palette. I've wired an absolute path constant to c:\windows\fonts\arial.ttf which works fine in the debug environment but when built into an exe, the create text VI retuns an error suggesting it can't find the font file (and then defaults to courier).


I've tried using a relative path to the windows folder so that when included in the exe the VI should be able to find the font file but I still can't get it to work. Does anyone have any ideas why this should be?


Thanks in advance 

0 Kudos
Message 1 of 8

The path to a VI located in an executable is different than the path of a VI located in the development environment.


path\myapp.exe\ in executable

path\ in development environment.


If you are using a path relative your VI, you need to strip off one more level in the executable then you do in the development environment.

0 Kudos
Message 2 of 8

Thanks for the reply but I'm still not sure how that applies.


For example, I created an application that would read a text file which is always located at c:\mytextfile. This works fine regardless of if the application is built or not (all I do is wire the absolute path constant c:\mytextfile to the open spreadsheet VI).


Why is this any different to wiring the absolute path c:\windows\fonts\arial.ttf to the Create Text VI?


I've got a feeling I'm being stupid but I can't grasp it!



0 Kudos
Message 3 of 8

Without seeing your application, I can't say for sure.


But when you said "relative path" and "exe", those are red flags that usually signal an issue with the path to something relative to the VI being different in an exe vs. the development environment.  If you are using absolute paths (i.e. not relative to the VI) then you shouldn't have a problem because of this.

0 Kudos
Message 4 of 8

I meet the same problem of the font path finding in exe. Have you already found the solution?



0 Kudos
Message 5 of 8

I meet the same problem of the font path finding in exe. Have you already found the solution?



0 Kudos
Message 6 of 8

Need to use the application.kind property and invoke a case so that if you are in the dev environment, use your c:\windows path but if you are in the exe environment, use your other path.  I got stung by this when using the "Current VIs path" function in my code recently because it causes the same problem.

0 Kudos
Message 7 of 8

id- that's kind of random.  you do realize the last post on this thread was 22 months ago right?

"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 8