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

Author Topic: Font problem  (Read 1684 times)

0 Members and 1 Guest are viewing this topic.

Pwishie

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Font problem
« 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. 

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11016
    • View Profile
    • development blog
    • Email
Re: Font problem
« Reply #1 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. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Pwishie

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Font problem
« Reply #2 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