SFML community forums

Help => Graphics => Topic started by: kol on October 26, 2013, 02:41:17 am

Title: Fonts best qualitity?
Post by: kol on October 26, 2013, 02:41:17 am
There is a way to leave the higher quality text, without using the GUI?
Or is there a Gui easy to use?

(http://i.imgur.com/nE3MMv2.png)
Title: Re: Fonts best qualitity?
Post by: Ixrec on October 26, 2013, 02:52:11 am
I have no idea what you're trying to ask.

Please explain what you're after and what you're getting instead and what your code is and so on and so forth.
Title: Re: Fonts best qualitity?
Post by: wintertime on October 26, 2013, 11:52:05 am
I dont understand the question either.
I see though that you are using a Sasquatch sprite ripped from Ragnarok Online and you are probably aware this is illegal?
Title: Re: Fonts best qualitity?
Post by: kol on October 26, 2013, 01:51:01 pm
When using very small font, quality is being lost, how can I have the same quality photoshop?

(http://i.imgur.com/toTGFnt.png)

I will not use the sprite from ragnarok is just for testing.
Title: Re: Fonts best qualitity?
Post by: eXpl0it3r on October 26, 2013, 02:26:08 pm
Are you scaling the text/view or are you loading the font at the said size?
Did you move the view or set the text to floating point values?
Title: Re: Fonts best qualitity?
Post by: Laurent on October 26, 2013, 07:42:03 pm
Are you using SFML 2.1?
Title: Re: Fonts best qualitity?
Post by: kol on November 10, 2013, 01:03:13 am
yes, I used the SFM 2.1. I would take this text without smoth, somehow? It may even be to the API, if you can show me examples. :)
Title: Re: Fonts best qualitity?
Post by: Laurent on November 10, 2013, 08:35:56 am
Font quality is much better in latest sources.
Title: Re: Fonts best qualitity?
Post by: kol on November 10, 2013, 07:28:44 pm
Yes, but I want to use without smoothing.
-------------------------------------------------------------------

Solved, for those who need to do the following:
Font.hpp.

Add Prototype:
Quote
void Font2(bool render);

and variable:
Quote
bool render2;

Font.cpp.
Add Prototype:

void Font::Font2(bool render)
{
   render2 = render;
}

Line: 72, Font.cpp.
Normal:
Quote
Font::Font() :
m_library  (NULL),
m_face     (NULL),
m_streamRec(NULL),
m_refCount (NULL)
{

}

For
Quote
Font::Font() :
m_library  (NULL),
m_face     (NULL),
m_streamRec(NULL),
m_refCount (NULL)
{
render2 =true;  //Add
}

Line: 408, Font.cpp.

Replace:

Quote
FT_Glyph_To_Bitmap(&glyphDesc, FT_RENDER_MODE_NORMAL, 0, 1);

For
Quote
    // Convert the glyph to a bitmap (i.e. rasterize it)
   if(render2){
      FT_Glyph_To_Bitmap(&glyphDesc, FT_RENDER_MODE_NORMAL, 0, 1);
   }else{
      FT_Glyph_To_Bitmap(&glyphDesc, FT_RENDER_MODE_MONO, 0, 1);
   }

Used:

sf::font Arial;
Arial.Font2(false);
if (!Tahoma.loadFromFile("D:/Windows/Fonts/Arial.ttf")){
 //Error
}

(http://i.imgur.com/SqcAMYQ.png)
Title: Re: Fonts best qualitity?
Post by: Laurent on November 10, 2013, 11:47:26 pm
... or use latest sources ...
Title: Re: Fonts best qualitity?
Post by: kol on November 11, 2013, 09:54:30 am
Sorry, Had not understood.