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 - king.randow

Pages: [1]
1
General / Re: Load Font
« on: March 28, 2024, 12:33:58 pm »
aaahhhh thank you for this. This is working now!

For others that might come across this. Here is what I needed to change:

Go to your project properties -> Linker -> Input -> Additional Dependencies:

For debug configuration:
sfml-graphics-d.lib
sfml-window-d.lib
sfml-system-d.lib
sfml-audio-d.lib
sfml-main-d.lib

For release configuration:
sfml-graphics.lib
sfml-window.lib
sfml-system.lib
sfml-audio.lib
sfml-main.lib

2
General / Re: Load Font
« on: March 27, 2024, 10:33:26 pm »
Came for the exact same reason. Everything works of SFML 2.6.1 64 bit version, aside from the font.

Running
sf::Font font;
if (!font.loadFromFile("times.ttf"))
    std::cout << "Could not load font." << std::endl;
return EXIT_SUCCESS;

Returns this message when running
Failed to load font "░╣
8times.ttf      ╤ó╨÷╨rµ╣e └o╟ -ÉG√" (failed to create the font face)
Could not load font.

C:\...\Primer\x64\Debug\Primer.exe (process 30992) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.

The times.ttf is the one copied from the C:\Windows\Fonts folder into the Debug folder where the exe file is. I also tried coping in every other folder of the Primer Project as well as running C:\\Windows\\Fonts\\times.ttf. All without luck.

This is my whole code:
#include <SFML/Graphics.hpp>
#include <iostream>


using namespace std;

int main()
{
    sf::Font font;
    if (!font.loadFromFile("times.ttf"))
        std::cout << "Could not load font." << std::endl;
    return EXIT_SUCCESS;


    return 0;
}

Pages: [1]
anything