Problem loading font
« on: 04 January 2014, 20:35:13 »
Hi everyone,

I'm trying to follow the starter tutorial and load the globalFont but the application crashes everytime.
This is my code:

Code: [Select]
sf::Font font;
font.loadFromFile("TGUI/fonts/DejaVuSans.ttf");
m_MainWindow.globalFont = font;

I included everything all right I think because without using the font everything works that I'm trying to do. (Creating a textbox works and creating a background picture as well).

This is the error I'm getting:

Code: [Select]
Unhandled exception at 0x000007FEE870364F (sfml-graphics-2.dll) in SFMLclient.exe: 0xC0000005: Access violation reading location 0x0000000000000019.
I have no idea what to do. Can anyone help me please?

Thanks in advance

Re: Problem loading font
« Reply #1 on: 04 January 2014, 20:42:02 »
Never mind. I fixed it already.

I forgot that SFML is prebuilt in Release and I built TGUI in Debug.
I changed it so that I built TGUI in Release mode as well and now everything is working as it should.

Re: Problem loading font
« Reply #2 on: 10 October 2015, 05:39:35 »
I'm having this exact same problem, but I don't understand the solution. Can anybody explain to me what he did?

This line here:

gui.setFont("TGUI/fonts/DejaVuSans.ttf");

Gives me an unhandled exception. I'm using the latest SFML and the latest TGUI, win7, VS2015.

EDIT: Nevermind, I updated the Visual Studio and forgot to change the TGUI version. Downloaded the proper files and it's working now. Sorry about that.
« Last Edit: 10 October 2015, 05:46:04 by desocupado »