Skip to main content
GameDev.net gamedev.net
🔒 Locked

FreeType2 : disable anti-aliasing effect

Started by Pet123 May 2, 2007 at 12:16 AM 2 replies 13.2k views
Original Post
Pet123
Pet123
Hi, there In freetype2 tutorials, it draws true type font anti-aliased by default no matter how big the font size is. sometimes at certain size font looks better without anti-aliasing effect (for example, the text you're reading -- which is verdana). i tweaked some flags and with no luck. would anybody here has experience please tell me how to disable anti-aliasing effect? thank you. BTW, in freetype.org faqs, it says the differences between freetype1 and freetype2 are :
Quote:
What are the differences between FreeType 1.x and FreeType 2? The biggest differences are as follows. FreeType 1 only supports the TrueType format, while FreeType 2 supports a lot more. The FreeType 2 API is simpler as well as more powerful than the FreeType 1 API. FreeType 1 includes an extension to support OpenType text layout processing. This support hasn't become part of FreeType 2; a much improved version is now part of the Pango library.
According to the faq, freetype1 looks already good enough for game developing (at least enough for me), questions about the comparison that not answered or asked is : 1. which one is faster (with and without anti-aliasing)? the faq confirmed that freetype2 is more powerful, but being more powerful does not mean its way faster. 2. which one uses less meomory? I know SDL and FTGL chose freetype2, anyway any quick answers to above two questions would be appreciated~~ pet 20070502
Niksan2
Niksan2
I guess it depends on how you're rendering, I use freetype2 with the following.
FT_LOAD_MONOCHROME essentially removes the AA.

if(monochrome){	FT_Load_Char( g_Face, character, FT_LOAD_RENDER|FT_LOAD_MONOCHROME );}else{	FT_Load_Char( g_Face, character, FT_LOAD_RENDER );}

Pet123
Pet123
i have tried the loading flag FT_LOAD_RENDER|FT_LOAD_MONOCHROME, to be frank, the rendered text (ANSI) looks bad, and i searched the internet trying to find some proof that freetype2 can draw text the way you are now reading and only to find that people using freetype2 seems only want to draw anti-aliased text.

why i turn to freetype2 is because microsft does not provide enough freedom for user to decide when to use AA and when not to -- especially when you handle CJK characters. on the contrary, as far as i know, freetype2 has enough freedom for user to decide when to use AA font or not and yes its AA font looks pretty, but the problem is its non-AA text looks bad actually ugly.

what to do now? use both HFONT and Freetype2 in my project?! sigh, please somebody tell me : can freetype2 draw text exactly the way you are now looking? thank you.
Anon Mike
Anon Mike
Quote:
Original post by Pet123
microsft does not provide enough freedom for user to decide when to use AA and when not to


eh? How is specifying one of the following flags in your CreateFont call:

NONANTIALIASED_QUALITY (never anti-alias)
ANTIALIASED_QUALITY (always greyscale anti-alias)
CLEARTYPE_QUALITY (cleartype anti-alias)
DEFAULT_QUALITY (do whatever the user wants)

not enough freedom? Seems like pretty much all choices are there.
-Mike

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.