freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] freetype tutorial & gdk/gtk


From: Sven Neumann
Subject: Re: [Freetype] freetype tutorial & gdk/gtk
Date: 29 Aug 2002 15:35:07 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Hi
Michael Pfeiffer <address@hidden> writes:

> >Any idea how to change the colours of the bitmap (fg/bg) ? Currently I
> >get white letters on a black background. I've tried a few Gdk functions
> >with not much joy.
> 
> I have no knowledge in GDK programming. In general you have the
> following possibilities (at least):
> 
> 1. RGBA-Bitmap
> a) initialize the bitmap with the textColor
> b) set the alpha channel of the bitmap to the glyph gray values
> c) draw the bitmap with alpha blending
> 
> 2. RGB-Bitmap
> a) 
> for each glyphPixel in glyph
>   for each color channel do
>     destPixel.channel = (bg.channel * (255-glyphPixel) + textColor.channel * 
> glyphPixel) / 255
> 
> b) draw the RGB-Bitmap
> 
> destPixel is the corrseponding pixel to the glyphPixel in the RGB-bitmap
> 
> 3. Blending with current background
> same as RGB-Bitmap, but RGB-Bitmap is initialized with the current background 
> image that
> the glyph overlaps.
> 
> - Michael
> 
> 
> 
> 
> _______________________________________________
> Freetype mailing list
> address@hidden
> http://www.freetype.org/mailman/listinfo/freetype


reply via email to

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