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

Author Topic: Fonts best qualitity?  (Read 3341 times)

0 Members and 1 Guest are viewing this topic.

kol

  • Newbie
  • *
  • Posts: 31
    • View Profile
Fonts best qualitity?
« 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?


Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Fonts best qualitity?
« Reply #1 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.

wintertime

  • Sr. Member
  • ****
  • Posts: 255
    • View Profile
Re: Fonts best qualitity?
« Reply #2 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?

kol

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Fonts best qualitity?
« Reply #3 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?



I will not use the sprite from ragnarok is just for testing.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Fonts best qualitity?
« Reply #4 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?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Fonts best qualitity?
« Reply #5 on: October 26, 2013, 07:42:03 pm »
Are you using SFML 2.1?
Laurent Gomila - SFML developer

kol

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Fonts best qualitity?
« Reply #6 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. :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Fonts best qualitity?
« Reply #7 on: November 10, 2013, 08:35:56 am »
Font quality is much better in latest sources.
Laurent Gomila - SFML developer

kol

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Fonts best qualitity?
« Reply #8 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
}

« Last Edit: November 10, 2013, 08:34:32 pm by kol »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Fonts best qualitity?
« Reply #9 on: November 10, 2013, 11:47:26 pm »
... or use latest sources ...
Laurent Gomila - SFML developer

kol

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: Fonts best qualitity?
« Reply #10 on: November 11, 2013, 09:54:30 am »
Sorry, Had not understood.