SFML community forums
Help => General => Topic started by: The Dab on January 05, 2018, 11:37:40 pm
-
" font.loadFromFile(filename.ttf); " returns false. The reason is because I am using working in a dynamic link library (DLL) instead of a console application. I put the font file in the project directory as well as in the process directory of the application I am injecting into. I put the exact code in a console application and it worked. I am using visual studio 2017, is there any way I can link it in project properties, or is there a function I am missing?
-
You should check what is the current working directory at the time of loading the font, it’s not necessarily the directory of your executable.
-
It is, I right click on the solution name, then "open folder in file explorer", it brings me right to the folder where my font is located.
-
https://en.m.wikipedia.org/wiki/Working_directory
-
And for reference, Visual Studio's default working directory when executing is the project directory
(the setting is <right-click on project> -> Properties -> Configuration Properties -> Debugging -> Working Directory)