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

Author Topic: SFML Text is incomplete when shown on window  (Read 6015 times)

0 Members and 1 Guest are viewing this topic.

yingche

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: SFML Text is incomplete when shown on window
« Reply #15 on: February 15, 2016, 11:27:17 am »
In my opinion, the reason may due to a conversion between float type and int type. The fractional part lost, so the letters display incompletely. I think the error is not due to freetype library, but SFML itself.

ramaskrik

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: SFML Text is incomplete when shown on window
« Reply #16 on: February 15, 2016, 01:17:02 pm »
You could upload the font you're using, so I can test it on my computer.

yingche

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: SFML Text is incomplete when shown on window
« Reply #17 on: February 15, 2016, 03:22:13 pm »
http://pan.baidu.com/s/1nurR3pZ
I just casually select a font file from the folder "c:\windows\fonts". You can try other files, and most of them have this problem.
Thank you so much for helping me :D
« Last Edit: February 15, 2016, 03:38:09 pm by yingche »

ramaskrik

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: SFML Text is incomplete when shown on window
« Reply #18 on: February 15, 2016, 06:55:44 pm »
Seems just fine here.

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: SFML Text is incomplete when shown on window
« Reply #19 on: February 16, 2016, 01:33:21 am »
What exactly was the error you were having with the text? You said the text was "incomplete". Your screenshot shows all of the text in both cases.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

yingche

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: SFML Text is incomplete when shown on window
« Reply #20 on: February 16, 2016, 01:57:27 am »
After all,the fractional part is less than one pixel. So if the font size is large, it looks nice. You can try smaller font size.

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: SFML Text is incomplete when shown on window
« Reply #21 on: February 16, 2016, 02:57:06 am »
Are you referring to the fact that some of the text looks slightly "straight" on edges on one version and not on the other?

This is a perception thing.

Pixel-wise, it's exactly perfect.
I've inverted the image you gave us so that the black on white text is now white on black and vice versa, and the same effect appears on the one on white (the one that looked fine before).
I'll upload the image. It has your screenshot at the top, and the inverted version at the bottom.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

yingche

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: SFML Text is incomplete when shown on window
« Reply #22 on: February 16, 2016, 06:14:09 am »
I'm sorry that what I said before was wrong. Both white backgroung and black background have this problem. And if the font size is set to 16,18,ect, the phenomenon is very clear.

 

anything