" 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?