freetype
[Top][All Lists]
Advanced

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

Re: [ft] Using different loading and render modes, plus LCD example


From: Collyer, Oliver, SI
Subject: Re: [ft] Using different loading and render modes, plus LCD example
Date: Wed, 15 Jun 2011 16:20:40 +0000

The light hinting more or less just hints in the vertical direction, so this is 
compatible with LCD rendering which deals with the horizontal (assuming your 
LCD display is a regular one and your text is horizontal). IMO it's a pretty 
good combination.

To display an LCD-rendered source bitmap on the screen you basically use each 
triplet of values in the source as the respective intensity/alpha values of the 
RGB components of your destination pixel.

i.e:

- the first (left) value in the source triplet gives how much of the R of your 
text colour to use when blending (so a value of 255 means use all of the text 
colour R and don't mix it with any of the background bitmap R, whereas a value 
of 128 would mean mix them 50-50, etc)
- the second (middle) value in the source triplet gives how much of the G of 
your text colour to use when blending
- the third (right) value in the source triplet gives how much of the B of your 
text colour to use when blending

This assumes you have already filtered your LCD bitmap first. FreeType has 
functionality for doing this, and this basically reduces a problem known as 
'colour fringing' by mixing together neighbouring pixels in the bitmap.

Here is a decent resource that describes the basics:

http://www.grc.com/ctwhat.htm

Hope this helps.

On 15 Jun 2011, at 18:58, Aekold Helbrass wrote:

> Good day All!
> 
> I've read the note to
> http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_LOAD_TARGET_XXX
> and now I have a question: what will I get in case of using LIGHT for
> loading and LCD for rendering? Is it considered bad practice, or it
> may be used to achieve some special results?
> 
> And the second question - the reason why I can't check the first one
> for myself. I am using that awesome Qt example (example4.cpp) to see
> how freetype works in general, but I can't get proper LCD modes. I see
> that image is 3 times wider and divide it, but it's still crippled
> when rendered. I suppose I should use some other color table or some
> smart pixel filtering methods that are used in openjdk or qt, but I am
> not familiar with freetype enough to figure it out myself. So, if
> there are some LCD rendering examples or guides - please give me some
> links.
> 
> Thanx!
> 
> _______________________________________________
> Freetype mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/freetype




reply via email to

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