SFML community forums

Help => Graphics => Topic started by: Pwishie on April 23, 2017, 09:58:33 am

Title: Font problem
Post by: Pwishie on April 23, 2017, 09:58:33 am
So originally in my new project I was using arial, but I switched to another font.  But for some reason it won't register the change I made.  It keeps saying "Failed to load font "arial.ttf" (failed to create the font face)" despite the fact that I changed the code, the files, etc.  I've tried moving the font files, deleting various files that visual studio generates, and I've made zero progress. 
Using VS17

#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <iostream>
#include <SFML/Graphics.hpp>
#include <string>
#include <iostream>
#include <vector>
#include <fstream>
/**
Main, has the game loop
*/

int main() {
        // Making the window
        sf::RenderWindow window(sf::VideoMode(1776, 1000), "Axis of Evil");
        window.setFramerateLimit(30);

        sf::Font fnt;
        if (!fnt.loadFromFile("cr.ttf")) {
                std::cout << "Could not load font\n";
        }

        /*
        Game loop
        */

        while (window.isOpen()) {
                // Allows the window to be closeable
                sf::Event e;
                while (window.pollEvent(e)) {
                        if (e.type == sf::Event::Closed)
                                window.close();
                }
                // Hides the console
                //HWND hWnd = GetConsoleWindow();
                //ShowWindow(hWnd, SW_HIDE);






                // Drawing to the SFML window
                window.clear();
                window.display();
        }
        return 0;
}

 
All of the code for my proj so far. 
Title: Re: Font problem
Post by: eXpl0it3r on April 23, 2017, 05:24:31 pm
Make sure it compiles successfully and that you run the new executable and not the old one. ;)
Title: Re: Font problem
Post by: Pwishie on April 24, 2017, 03:47:07 am
Make sure it compiles successfully and that you run the new executable and not the old one. ;)
Already thought of it.  I'm not that dumb