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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - 0ii0

Pages: [1]
1
Graphics / Re: Failed to load font face error
« on: January 02, 2014, 01:46:40 am »
It's not just about bad practice, but there are also issues with global construction and destruction orders, besides that, you've already sort structured your code for a class, why not simply put it inside a class? ;)

Have you placed the font in the right directory, so the application can actually find it?

Ohh thanks, that makes sense haha. I'm self-teaching so I don't always understand everything (i try though).

And yes, the font is in the right directory. in Xcode, when you drag something into the project navigator, it automatically deals with that for you. BUT i double checked anyways

2
Graphics / Re: Failed to load font face error
« on: January 02, 2014, 01:27:51 am »
Ok sorry about that. I missed that post. I got rid of a lot of the irrelevant parts of code... as for global variables. I have them now as sort of placeholders, until i can come up with better ways to deal with those specific variables. I am aware that they're bad practice


3
Graphics / Failed to create font face
« on: January 01, 2014, 11:34:17 pm »
I am getting this error... "Failed to load font "Georgia.ttf" (failed to create the font face)".

The spelling in my program is correct. And I've more than triple checked that it's in the right location. I've also tried using different fonts, to no avail. Note that in a separate program, the font georgia DOES work

I'm using Xcode if that's any help.
SFML 2.1
And I use a macbook, OS 10.7.5


.cpp
#include <SFML/Graphics.hpp>
#include <main.hpp>

//GlobalVariables (I know they're bad, I'll work on this)

sf::RenderWindow window;

sf::Event event;
sf::Keyboard keyboard;

sf::Font georgia;

//class Initialization______________________________________________
    void Initialization::programInit()
    {
        renderWindow();
        loadGeorgia();
    }

    void Initialization::renderWindow()
    {
        window.create(sf::VideoMode(width, height), "Pong", sf::Style::Default);
        window.setFramerateLimit(frameLimit);
        window.setVerticalSyncEnabled(true);
        window.clear(sf::Color::White);
       
    }

    bool Initialization::loadGeorgia()
    {
        if(!georgia.loadFromFile("Georgia.ttf"))
            return EXIT_FAILURE;
       
        return EXIT_SUCCESS;
    }

//main()______________________________________________
int main()
{
    init.programInit();
    gameFlow.beginGameFlow(); //I didn't include this class, but this is where the font is used
   
    return EXIT_SUCCESS;
}

 

.hpp
#ifndef Pong2_Header_h
#define Pong2_Header_h

class Initialization
{
public:
    static const int width  = 800;
    static const int height = 600;
    static const int frameLimit = 60;
   
    void programInit();

    void renderWindow();
    bool loadGeorgia();
   
};
Initialization init;

int main();

#endif

 

Pages: [1]