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

Author Topic: Text drawing problem, characters missing  (Read 1578 times)

0 Members and 1 Guest are viewing this topic.

aegir

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • Email
Text drawing problem, characters missing
« 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!

Jabberwocky

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Text drawing problem, characters missing
« Reply #1 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.

aegir

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • Email
Re: Text drawing problem, characters missing
« Reply #2 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.