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

Author Topic: Ugly font output  (Read 8079 times)

0 Members and 1 Guest are viewing this topic.

Sade_129

  • Newbie
  • *
  • Posts: 6
    • View Profile
Ugly font output
« on: September 30, 2007, 01:19:08 am »
Hi all. I have an strange problems with fonts. I use this code:

sf::String Text("Hello", "arial.ttf", 50.f);
Text.SetColor(sf::Color(128, 128, 0));

//.....

Window.Draw(Text);

And I get this ugly output:



Is there a way to fix this?

Thanks in advance!!

Henrik.Flink

  • Newbie
  • *
  • Posts: 21
    • View Profile
Ugly font output
« Reply #1 on: September 30, 2007, 02:48:24 am »
I guess it's the default font, is it correct path to "arial.ttf"?

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Ugly font output
« Reply #2 on: September 30, 2007, 12:15:50 pm »
I'm having a similar problem, the text i draw on screen doesn't look good at all, I'm trying to use verdana.ttf (I know the path is correct).

Sade_129

  • Newbie
  • *
  • Posts: 6
    • View Profile
Ugly font output
« Reply #3 on: September 30, 2007, 02:04:16 pm »
It doesn't matter the path. SFML has a default buit in font if the path is incorrect, isn't?. The output font of the pong example when you lose o win, also has the same problem.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Ugly font output
« Reply #4 on: September 30, 2007, 03:13:15 pm »
This problem can appear when you scale the font (directly or by resizing the window). I recently fixed it (I still need to apply it to the default font, however).
Laurent Gomila - SFML developer

Sade_129

  • Newbie
  • *
  • Posts: 6
    • View Profile
Ugly font output
« Reply #5 on: September 30, 2007, 05:15:07 pm »
Thanks for the reply Laurent. I made a few tests with others fonts and works fine. I test scaling, resizing the window, and no more ugly output :D. It seems that the problem is with the default font.  

However, I have another minor problem. If I set Font.SetTop to 0, it doesn't put the font on the top of the screen, instead it puts the font at approximately Y = 10. If I want the font at the top of the screen I have to put Font.SetTop(-10). It doesn't matter if I scale the font or not. Font.SetLeft works fine.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Ugly font output
« Reply #6 on: October 01, 2007, 02:54:08 am »
I need to check the top parameter. Before, it was matching the baseline, but it is supposed to have changed to match the top of the text.

I'll check this as soon as I get my computer working.
Laurent Gomila - SFML developer

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Ugly font output
« Reply #7 on: October 03, 2007, 12:59:33 pm »
Most of the fonts that I have tried have not looked good (some characters are smooth and some are sharp), can anyone recommend a font that looks good?

Sade_129

  • Newbie
  • *
  • Posts: 6
    • View Profile
Ugly font output
« Reply #8 on: October 05, 2007, 03:16:11 am »
Look the font that comes with the pong example: cheeseburger. It works nice for me.

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Ugly font output
« Reply #9 on: October 08, 2007, 08:55:00 pm »
Quote from: "Sade_129"
Look the font that comes with the pong example: cheeseburger. It works nice for me.


Yea it looks good using a big size, but if you use 12 or 14 for example none of the fonts I have tried have looked good.

 

anything