Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: I'm getting an error with the Font class, but not after debugging  (Read 1248 times)

0 Members and 1 Guest are viewing this topic.

Wicketd

  • Newbie
  • *
  • Posts: 2
    • View Profile
I've decided to check SFML out and am really pleased so far. However, I'm having a slight issue with the Font class that I just can't seem to solve. Whenever I directly debug in Visual Studio, I'm getting the error 'Failed to load font "arial.ttf" (failed to create the font face)'. However, after much tinkering, I accidentally opened the output executable directly from my debug folder and it worked like a charm:



Am I missing something obvious here? I've tried to follow the tutorial to the letter. The TTF file is in my working directory and everything appears to be set up properly (to me). Here is my code. While a minor nuisance at first, it's getting increasingly more annoying, so I would appreciate some help.

Thanks in advance.
« Last Edit: January 12, 2014, 10:28:04 pm by Wicketd »

G.

  • Hero Member
  • *****
  • Posts: 1592
    • View Profile
Re: I'm getting an error with the Font class, but not after debugging
« Reply #1 on: January 12, 2014, 10:31:16 pm »
When you run your program from Visual Studio, the working directory isn't your release or debug folder, but your solution directory. Try moving your .ttf where your .cpp are.

Wicketd

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: I'm getting an error with the Font class, but not after debugging
« Reply #2 on: January 12, 2014, 10:36:34 pm »
When you run your program from Visual Studio, the working directory isn't your release or debug folder, but your solution directory. Try moving your .ttf where your .cpp are.
Of course, how stupid of me. Tinkering too long causes my brain to come up with all kinds of implausible theories. Thanks a lot for the quick response.