SFML community forums

Help => Graphics => Topic started by: aegir on April 15, 2015, 07:30:44 pm

Title: Text drawing problem, characters missing
Post by: aegir on April 15, 2015, 07:30:44 pm
I just started with sfml so i might be doing something stupid.
I'm reading from txt file and and want to print that to screen. But i get this:
(click to show/hide)
instead of this:
(click to show/hide)
its formatted correctly in terminal and i have no idea how to debug.
here is code:
(click to show/hide)
So how to fix that? :P
Thanks!
Title: Re: Text drawing problem, characters missing
Post by: Jabberwocky on April 15, 2015, 07:40:59 pm
Very cool old-school rogue-like you've got going on there.  They came in many flavors, but back in the day I played some versions called Moria and Angband.

The problem is simple.  It's your font.  You need a fixed width font, also sometimes called a monospace font.  Google either of those terms and you will find some to your liking.

Then replace "arial.ttf" "somefixedwidthfont.ttf" and you're good to go.
Title: Re: Text drawing problem, characters missing
Post by: aegir on April 15, 2015, 07:57:49 pm
Thank you so very much it works like a charm!
I have simple rogulike kinda complete as a console application so i wanted to port it to some sort of gui, sfml looked simplest.