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

Author Topic: Where do I get the files?  (Read 2281 times)

0 Members and 1 Guest are viewing this topic.

BeautiCode

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Where do I get the files?
« on: June 20, 2014, 09:36:06 pm »
So I was learning basic SFML from the tutorials page, since I'm new to this.
But tutorials like this one tell me to call loadFromFile("font.tff"); or whatever, but they don't tell me where to get the font file or anything. therefore, some of the code ends up being invalid. Can someone help me find the files they refer to?
Even on the sprite tutorial, they aren't elaborate.
« Last Edit: June 21, 2014, 05:51:51 am by BeautiCode »

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: Where do I get the files?
« Reply #1 on: June 20, 2014, 09:41:04 pm »
SFML doesn't provide any font, you have to use whatever font you want to.

Same goes for sprites, use any image you want to.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Where do I get the files?
« Reply #2 on: June 20, 2014, 09:46:18 pm »
The tutorials try to be generic so they will work for everyone. You may have to grab a few resources from other sources yourself.

BeautiCode

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Where do I get the files?
« Reply #3 on: June 20, 2014, 09:49:22 pm »
Is there any default font or something? Do I HAVE to download a font somewhere in order to draw text on the screen?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Where do I get the files?
« Reply #4 on: June 20, 2014, 09:54:54 pm »
Download one (Google "free font"). Or grab one from your system font directory. Fonts are really not hard to find.

And yes, you have to use a font to draw text. Like every other program that draws text does -- even notepad.
Laurent Gomila - SFML developer

BeautiCode

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Where do I get the files?
« Reply #5 on: June 20, 2014, 10:05:47 pm »
What does this mean?

Heres the code

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Where do I get the files?
« Reply #6 on: June 20, 2014, 10:29:42 pm »
That means what it says: it couldn't load the font.  90% of the time that's because the file doesn't exist or you gave it the wrong filepath.

I notice you wrote tff instead of ttf.  Maybe that's it.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Where do I get the files?
« Reply #7 on: June 20, 2014, 10:36:28 pm »
Or maybe it's the common mistake of thinking that your cwd (current working directory) is something fixed. It's not magic, but for each OS you need to know the rules - and when running through some IDE the CWD is often different.

And seriously. If you can't go grab a simple font from somewhere (even the OS you are already running). Then how the hell are you going to solve other problems??  This is trivial stuff - just go grab a font file somewhere for crying out loud.

Edit: yes I'm being a dick - sorry. I'm just fed up with trivial questions that could be solved with a little bit of research. I'll shut up now.
« Last Edit: June 20, 2014, 10:47:50 pm by Jesper Juhl »

BeautiCode

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Where do I get the files?
« Reply #8 on: June 20, 2014, 10:54:41 pm »
Ixrec's solution worked, thanks!
And alriight, I'll grab a font from somewhere else next time.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Where do I get the files?
« Reply #9 on: June 20, 2014, 11:07:05 pm »
Quote
Or maybe it's the common mistake of thinking that your cwd (current working directory) is something fixed. It's not magic, but for each OS you need to know the rules - and when running through some IDE the CWD is often different.
That's out of topic, since he's using an absolute path.
Laurent Gomila - SFML developer