freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] anti-aliasing question


From: Dave Calkins
Subject: Re: [ft] anti-aliasing question
Date: Tue, 09 Feb 2010 10:32:11 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1


The comment indicates the enabling this flag activates sub-pixel
rendering, yet it later says that with this option on R=G=B.
Ah, bad wording.  It means exactly the opposite.  In git, I've just
changed it to the following:

   [...]

   This macro has no impact on the FreeType API, only on its
   _implementation_.  For example, using FT_RENDER_MODE_LCD when
   calling FT_Render_Glyph still generates a bitmap that is 3 times
   wider than the original size in case this macro isn't defined;
   however, each triplet of subpixels has R=G=B.


     Werner


Thanks for the clarification.

So if I do the below:

- enable FT_CONFIG_OPTION_SUBPIXEL_RENDERING in ftoption.h
- call FT_Library_SetLcdFilter with FT_LCD_FILTER_DEFAULT
- use FT_RENDER_MODE_LCD when calling FT_Render_Glyph

Then, the result of FT_Render_Glyph will be a 24-bit (8 bits for each red,green,blue) color image. Rendering this as a 24-bit color image will take advantage of subpixel rendering and since I called FT_Library_SetLcdFilter it will already have been filtered to reduce color fringes.

Is the above correct? Or is there some additional filtering I am supposed to do other than whats provided by FT_Library_SetLcdFilter?

Also, this results in a color image so I need to figure out how to best render that in GL, but thats a GL thing not a FreeType thing.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]